summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-24 11:30:15 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-30 12:56:19 +0000
commit6036726eb981b6c4b42047513b9d3f4ac865daac (patch)
tree673593e70678e7789766d1f732eb51f613a2703b /chromium/chrome/browser
parent466052c4e7c052268fd931888cd58961da94c586 (diff)
downloadqtwebengine-chromium-6036726eb981b6c4b42047513b9d3f4ac865daac.tar.gz
BASELINE: Update Chromium to 70.0.3538.78
Change-Id: Ie634710bf039e26c1957f4ae45e101bd4c434ae7 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/chrome/browser')
-rw-r--r--chromium/chrome/browser/BUILD.gn294
-rw-r--r--chromium/chrome/browser/accessibility/DEPS7
-rw-r--r--chromium/chrome/browser/accessibility/OWNERS4
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_extension_api.cc306
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_extension_api.h102
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc25
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_permission_context.cc17
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_permission_context.h23
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_ui.cc419
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_ui.h45
-rw-r--r--chromium/chrome/browser/accessibility/animation_policy_prefs.cc17
-rw-r--r--chromium/chrome/browser/accessibility/animation_policy_prefs.h18
-rw-r--r--chromium/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc30
-rw-r--r--chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc81
-rw-r--r--chromium/chrome/browser/accessibility/invert_bubble_prefs.cc12
-rw-r--r--chromium/chrome/browser/accessibility/invert_bubble_prefs.h14
-rw-r--r--chromium/chrome/browser/android/download/manifest.json6
-rw-r--r--chromium/chrome/browser/android/metrics/BUILD.gn2
-rw-r--r--chromium/chrome/browser/android/vr/BUILD.gn81
-rw-r--r--chromium/chrome/browser/apps/BUILD.gn21
-rw-r--r--chromium/chrome/browser/apps/app_shim/BUILD.gn11
-rw-r--r--chromium/chrome/browser/apps/foundation/app_service/BUILD.gn1
-rw-r--r--chromium/chrome/browser/apps/platform_apps/BUILD.gn5
-rw-r--r--chromium/chrome/browser/browser_resources.grd19
-rw-r--r--chromium/chrome/browser/chrome_content_browser_manifest_overlay.json30
-rw-r--r--chromium/chrome/browser/chrome_notification_types.h8
-rw-r--r--chromium/chrome/browser/chromeos/BUILD.gn174
-rw-r--r--chromium/chrome/browser/chromeos/android_sms/BUILD.gn78
-rw-r--r--chromium/chrome/browser/chromeos/device_sync/BUILD.gn14
-rw-r--r--chromium/chrome/browser/chromeos/multidevice_setup/BUILD.gn14
-rw-r--r--chromium/chrome/browser/chromeos/power/ml/BUILD.gn19
-rw-r--r--chromium/chrome/browser/chromeos/power/ml/smart_dim/BUILD.gn29
-rw-r--r--chromium/chrome/browser/devtools/BUILD.gn2
-rw-r--r--chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.cc51
-rw-r--r--chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.h15
-rw-r--r--chromium/chrome/browser/devtools/chrome_devtools_session.cc30
-rw-r--r--chromium/chrome/browser/devtools/chrome_devtools_session.h14
-rw-r--r--chromium/chrome/browser/devtools/device/android_device_manager.cc9
-rw-r--r--chromium/chrome/browser/devtools/device/devtools_device_discovery.cc28
-rw-r--r--chromium/chrome/browser/devtools/device/port_forwarding_controller.cc4
-rw-r--r--chromium/chrome/browser/devtools/devtools_auto_opener.cc17
-rw-r--r--chromium/chrome/browser/devtools/devtools_auto_opener.h8
-rw-r--r--chromium/chrome/browser/devtools/devtools_browser_context_manager.cc127
-rw-r--r--chromium/chrome/browser/devtools/devtools_browser_context_manager.h44
-rw-r--r--chromium/chrome/browser/devtools/devtools_eye_dropper.cc93
-rw-r--r--chromium/chrome/browser/devtools/devtools_eye_dropper.h14
-rw-r--r--chromium/chrome/browser/devtools/devtools_file_helper.cc5
-rw-r--r--chromium/chrome/browser/devtools/devtools_file_system_indexer.cc8
-rw-r--r--chromium/chrome/browser/devtools/devtools_file_watcher.cc6
-rw-r--r--chromium/chrome/browser/devtools/devtools_sanity_browsertest.cc88
-rw-r--r--chromium/chrome/browser/devtools/devtools_ui_bindings.cc46
-rw-r--r--chromium/chrome/browser/devtools/global_confirm_info_bar.cc14
-rw-r--r--chromium/chrome/browser/devtools/global_confirm_info_bar.h8
-rw-r--r--chromium/chrome/browser/devtools/inspector_protocol_config.json3
-rw-r--r--chromium/chrome/browser/devtools/protocol/target_handler.cc160
-rw-r--r--chromium/chrome/browser/devtools/protocol/target_handler.h7
-rw-r--r--chromium/chrome/browser/extensions/BUILD.gn28
-rw-r--r--chromium/chrome/browser/extensions/api/BUILD.gn8
-rw-r--r--chromium/chrome/browser/extensions/api/DEPS5
-rw-r--r--chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc55
-rw-r--r--chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.h19
-rw-r--r--chromium/chrome/browser/extensions/api/autofill_private/autofill_util.cc10
-rw-r--r--chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.cc8
-rw-r--r--chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.h5
-rw-r--r--chromium/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/autotest_private/DEPS3
-rw-r--r--chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.cc44
-rw-r--r--chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.h23
-rw-r--r--chromium/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc3
-rw-r--r--chromium/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/braille_display_private/braille_controller.h2
-rw-r--r--chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc22
-rw-r--r--chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h4
-rw-r--r--chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.h2
-rw-r--r--chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc39
-rw-r--r--chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.h12
-rw-r--r--chromium/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc142
-rw-r--r--chromium/chrome/browser/extensions/api/certificate_provider/certificate_provider_api.cc6
-rw-r--r--chromium/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc5
-rw-r--r--chromium/chrome/browser/extensions/api/commands/command_service.h2
-rw-r--r--chromium/chrome/browser/extensions/api/content_settings/content_settings_api.cc33
-rw-r--r--chromium/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc50
-rw-r--r--chromium/chrome/browser/extensions/api/content_settings/content_settings_service.cc1
-rw-r--r--chromium/chrome/browser/extensions/api/content_settings/content_settings_service.h1
-rw-r--r--chromium/chrome/browser/extensions/api/content_settings/content_settings_store.h2
-rw-r--r--chromium/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc20
-rw-r--r--chromium/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc9
-rw-r--r--chromium/chrome/browser/extensions/api/debugger/debugger_api.cc9
-rw-r--r--chromium/chrome/browser/extensions/api/declarative/declarative_apitest.cc13
-rw-r--r--chromium/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc16
-rw-r--r--chromium/chrome/browser/extensions/api/declarative_content/set_icon_apitest.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc114
-rw-r--r--chromium/chrome/browser/extensions/api/declarative_net_request/ruleset_matcher_unittest.cc16
-rw-r--r--chromium/chrome/browser/extensions/api/desktop_capture/OWNERS4
-rw-r--r--chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc119
-rw-r--r--chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc116
-rw-r--r--chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h20
-rw-r--r--chromium/chrome/browser/extensions/api/developer_private/DEPS4
-rw-r--r--chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc111
-rw-r--r--chromium/chrome/browser/extensions/api/developer_private/developer_private_api.h18
-rw-r--r--chromium/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc252
-rw-r--r--chromium/chrome/browser/extensions/api/developer_private/extension_info_generator.cc35
-rw-r--r--chromium/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc49
-rw-r--r--chromium/chrome/browser/extensions/api/downloads/downloads_api.cc7
-rw-r--r--chromium/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc13
-rw-r--r--chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc3
-rw-r--r--chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.h8
-rw-r--r--chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc70
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_hardware_platform/OWNERS1
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.cc38
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h37
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api_unittest.cc84
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc18
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc11
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc3
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc122
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper_unittest.cc78
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.cc40
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.h25
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator_unittest.cc72
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc3
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc8
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.cc29
-rw-r--r--chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.h32
-rw-r--r--chromium/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc100
-rw-r--r--chromium/chrome/browser/extensions/api/extension_action/extension_action_api.cc21
-rw-r--r--chromium/chrome/browser/extensions/api/extension_action/extension_action_api.h5
-rw-r--r--chromium/chrome/browser/extensions/api/extension_action/extension_action_apitest.cc38
-rw-r--r--chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.cc32
-rw-r--r--chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h55
-rw-r--r--chromium/chrome/browser/extensions/api/file_system/DEPS6
-rw-r--r--chromium/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc9
-rw-r--r--chromium/chrome/browser/extensions/api/identity/identity_apitest.cc49
-rw-r--r--chromium/chrome/browser/extensions/api/identity/identity_constants.cc1
-rw-r--r--chromium/chrome/browser/extensions/api/identity/identity_constants.h1
-rw-r--r--chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc28
-rw-r--r--chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h6
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/operation.cc16
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/operation.h11
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc7
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/operation_manager.cc10
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_chromeos.cc5
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/test_utils.cc10
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/test_utils.h2
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/unzip_helper.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc66
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.h39
-rw-r--r--chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc31
-rw-r--r--chromium/chrome/browser/extensions/api/input_ime/input_ime_api.cc5
-rw-r--r--chromium/chrome/browser/extensions/api/input_ime/input_ime_api.h4
-rw-r--r--chromium/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc6
-rw-r--r--chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc86
-rw-r--r--chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h26
-rw-r--r--chromium/chrome/browser/extensions/api/management/management_browsertest.cc151
-rw-r--r--chromium/chrome/browser/extensions/api/mdns/mdns_api.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/mdns/mdns_apitest.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/messaging/DEPS8
-rw-r--r--chromium/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc65
-rw-r--r--chromium/chrome/browser/extensions/api/messaging/native_message_process_host.cc11
-rw-r--r--chromium/chrome/browser/extensions/api/messaging/native_process_launcher.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/music_manager_private/device_id.h2
-rw-r--r--chromium/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/music_manager_private/device_id_mac.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/music_manager_private/device_id_win.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/networking_private/DEPS2
-rw-r--r--chromium/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc15
-rw-r--r--chromium/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_browsertest.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/notifications/notifications_api.cc10
-rw-r--r--chromium/chrome/browser/extensions/api/notifications/notifications_apitest.cc1
-rw-r--r--chromium/chrome/browser/extensions/api/page_capture/page_capture_api.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc18
-rw-r--r--chromium/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.cc30
-rw-r--r--chromium/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc10
-rw-r--r--chromium/chrome/browser/extensions/api/preference/preference_api.cc29
-rw-r--r--chromium/chrome/browser/extensions/api/preference/preference_apitest.cc16
-rw-r--r--chromium/chrome/browser/extensions/api/processes/processes_api.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/proxy/proxy_api.cc6
-rw-r--r--chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc37
-rw-r--r--chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.h5
-rw-r--r--chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc63
-rw-r--r--chromium/chrome/browser/extensions/api/proxy/proxy_apitest.cc28
-rw-r--r--chromium/chrome/browser/extensions/api/sessions/sessions_apitest.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/settings_private/generated_pref.h2
-rw-r--r--chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc26
-rw-r--r--chromium/chrome/browser/extensions/api/socket/combined_socket_unittest.cc145
-rw-r--r--chromium/chrome/browser/extensions/api/socket/mock_tcp_client_socket.h82
-rw-r--r--chromium/chrome/browser/extensions/api/socket/socket_apitest.cc30
-rw-r--r--chromium/chrome/browser/extensions/api/socket/tcp_socket_unittest.cc859
-rw-r--r--chromium/chrome/browser/extensions/api/socket/tls_socket_unittest.cc750
-rw-r--r--chromium/chrome/browser/extensions/api/sync_file_system/DEPS5
-rw-r--r--chromium/chrome/browser/extensions/api/sync_file_system/OWNERS1
-rw-r--r--chromium/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc4
-rw-r--r--chromium/chrome/browser/extensions/api/system_private/system_private_api.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc422
-rw-r--r--chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.h236
-rw-r--r--chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.cc114
-rw-r--r--chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.h75
-rw-r--r--chromium/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc94
-rw-r--r--chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc92
-rw-r--r--chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h38
-rw-r--r--chromium/chrome/browser/extensions/api/tabs/tabs_api.cc6
-rw-r--r--chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc404
-rw-r--r--chromium/chrome/browser/extensions/api/tabs/tabs_event_router.h61
-rw-r--r--chromium/chrome/browser/extensions/api/terminal/terminal_private_api.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc53
-rw-r--r--chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.h8
-rw-r--r--chromium/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc33
-rw-r--r--chromium/chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.cc15
-rw-r--r--chromium/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc245
-rw-r--r--chromium/chrome/browser/extensions/api/web_request/web_request_apitest.cc405
-rw-r--r--chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc2
-rw-r--r--chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc300
-rw-r--r--chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_browsertest.cc6
-rw-r--r--chromium/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc76
-rw-r--r--chromium/chrome/browser/media/media_engagement_score_details.mojom7
-rw-r--r--chromium/chrome/browser/media/router/BUILD.gn8
-rw-r--r--chromium/chrome/browser/media/router/discovery/BUILD.gn1
-rw-r--r--chromium/chrome/browser/media/webrtc/desktop_streams_registry.cc91
-rw-r--r--chromium/chrome/browser/media/webrtc/desktop_streams_registry.h65
-rw-r--r--chromium/chrome/browser/printing/cloud_print/DEPS5
-rw-r--r--chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc80
-rw-r--r--chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h15
-rw-r--r--chromium/chrome/browser/printing/cloud_print/gcd_api_flow.cc6
-rw-r--r--chromium/chrome/browser/printing/cloud_print/gcd_api_flow.h12
-rw-r--r--chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc81
-rw-r--r--chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.h26
-rw-r--r--chromium/chrome/browser/printing/cloud_print/gcd_api_flow_unittest.cc95
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http.h12
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.cc5
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h8
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc29
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h17
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http_impl.cc148
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http_impl.h86
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_http_unittest.cc761
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.cc23
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.h7
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister_unittest.cc68
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_notifications.cc20
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_notifications.h2
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc74
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.cc266
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.h114
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_url_fetcher.cc353
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_url_fetcher_unittest.cc299
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_url_loader.cc365
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_url_loader.h (renamed from chromium/chrome/browser/printing/cloud_print/privet_url_fetcher.h)74
-rw-r--r--chromium/chrome/browser/printing/cloud_print/privet_url_loader_unittest.cc298
-rw-r--r--chromium/chrome/browser/printing/pdf_nup_converter_client.cc92
-rw-r--r--chromium/chrome/browser/printing/pdf_nup_converter_client.h69
-rw-r--r--chromium/chrome/browser/printing/pdf_to_emf_converter.cc2
-rw-r--r--chromium/chrome/browser/printing/print_dialog_cloud.cc2
-rw-r--r--chromium/chrome/browser/printing/print_dialog_cloud_win.cc4
-rw-r--r--chromium/chrome/browser/printing/print_job.cc23
-rw-r--r--chromium/chrome/browser/printing/print_job.h9
-rw-r--r--chromium/chrome/browser/printing/print_preview_data_service.cc20
-rw-r--r--chromium/chrome/browser/printing/print_preview_dialog_controller.cc2
-rw-r--r--chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc2
-rw-r--r--chromium/chrome/browser/printing/print_preview_message_handler.cc35
-rw-r--r--chromium/chrome/browser/printing/print_preview_message_handler.h16
-rw-r--r--chromium/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc29
-rw-r--r--chromium/chrome/browser/printing/print_view_manager.cc16
-rw-r--r--chromium/chrome/browser/printing/print_view_manager_base.cc44
-rw-r--r--chromium/chrome/browser/printing/print_view_manager_base.h9
-rw-r--r--chromium/chrome/browser/printing/print_view_manager_basic.cc2
-rw-r--r--chromium/chrome/browser/printing/print_view_manager_common.cc11
-rw-r--r--chromium/chrome/browser/printing/print_view_manager_common.h7
-rw-r--r--chromium/chrome/browser/printing/printer_manager_dialog_linux.cc2
-rw-r--r--chromium/chrome/browser/printing/printer_manager_dialog_win.cc2
-rw-r--r--chromium/chrome/browser/printing/printing_message_filter.cc2
-rw-r--r--chromium/chrome/browser/profiling_host/BUILD.gn1
-rw-r--r--chromium/chrome/browser/push_messaging/BUILD.gn (renamed from chromium/chrome/browser/budget_service/BUILD.gn)0
-rw-r--r--chromium/chrome/browser/renderer_host/pepper/device_id_fetcher.cc4
-rw-r--r--chromium/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom12
-rw-r--r--chromium/chrome/browser/resources/BUILD.gn2
-rw-r--r--chromium/chrome/browser/resources/about_sys/about_sys.css12
-rw-r--r--chromium/chrome/browser/resources/accessibility/OWNERS4
-rw-r--r--chromium/chrome/browser/resources/accessibility/accessibility.css78
-rw-r--r--chromium/chrome/browser/resources/accessibility/accessibility.html152
-rw-r--r--chromium/chrome/browser/resources/accessibility/accessibility.js318
-rw-r--r--chromium/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css22
-rw-r--r--chromium/chrome/browser/resources/certificate_viewer.css6
-rw-r--r--chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn107
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json18
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/algebra.json58
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/elementary.json211
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/hyperbolic.json109
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/trigonometry.json110
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-capital.json242
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-mathfonts.json1502
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-scripts.json122
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-small.json252
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-symbols.json357
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/hebrew_letters.json42
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-double-accent.json572
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-normal.json522
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-phonetic.json2152
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-single-accent.json1912
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-mathfonts.json5502
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-rest.json2402
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-double-accent.json572
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-normal.json522
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-single-accent.json1842
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_angles.json194
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_arrows.json2677
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_characters.json350
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_delimiters.json1514
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_digits.json2575
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_geometry.json2523
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_harpoons.json458
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_non_characters.json224
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_symbols.json6988
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_whitespace.json354
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/other_stars.json471
-rw-r--r--chromium/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd42
-rw-r--r--chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn49
-rw-r--r--chromium/chrome/browser/resources/chromeos/multidevice_setup/multidevice_setup_resources.grd24
-rw-r--r--chromium/chrome/browser/resources/chromeos/network_ui/BUILD.gn2
-rw-r--r--chromium/chrome/browser/resources/chromeos/select_to_speak/BUILD.gn34
-rw-r--r--chromium/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd37
-rw-r--r--chromium/chrome/browser/resources/chromeos/switch_access/BUILD.gn31
-rw-r--r--chromium/chrome/browser/resources/component_extension_resources.grd2
-rw-r--r--chromium/chrome/browser/resources/components.css22
-rw-r--r--chromium/chrome/browser/resources/conflicts/about_conflicts.html8
-rw-r--r--chromium/chrome/browser/resources/device_log_ui/device_log_ui.css6
-rw-r--r--chromium/chrome/browser/resources/discards/discards.css2
-rw-r--r--chromium/chrome/browser/resources/discards/discards.js113
-rw-r--r--chromium/chrome/browser/resources/feedback/css/feedback.css24
-rw-r--r--chromium/chrome/browser/resources/feedback/js/feedback.js18
-rw-r--r--chromium/chrome/browser/resources/hangout_services/manifest.json3
-rw-r--r--chromium/chrome/browser/resources/hangout_services/thunk.js7
-rw-r--r--chromium/chrome/browser/resources/inline_login/inline_login.html6
-rw-r--r--chromium/chrome/browser/resources/inline_login/inline_login.js4
-rw-r--r--chromium/chrome/browser/resources/inspect/inspect.css4
-rw-r--r--chromium/chrome/browser/resources/interventions_internals/OWNERS2
-rw-r--r--chromium/chrome/browser/resources/local_discovery/local_discovery.css12
-rw-r--r--chromium/chrome/browser/resources/local_ntp/OWNERS3
-rw-r--r--chromium/chrome/browser/resources/local_ntp/custom_backgrounds.css91
-rw-r--r--chromium/chrome/browser/resources/local_ntp/custom_backgrounds.js382
-rw-r--r--chromium/chrome/browser/resources/local_ntp/custom_links_edit.css6
-rw-r--r--chromium/chrome/browser/resources/local_ntp/custom_links_edit.html6
-rw-r--r--chromium/chrome/browser/resources/local_ntp/custom_links_edit.js81
-rw-r--r--chromium/chrome/browser/resources/local_ntp/local_ntp.css116
-rw-r--r--chromium/chrome/browser/resources/local_ntp/local_ntp.html75
-rw-r--r--chromium/chrome/browser/resources/local_ntp/local_ntp.js271
-rw-r--r--chromium/chrome/browser/resources/local_ntp/most_visited_single.css6
-rw-r--r--chromium/chrome/browser/resources/local_ntp/most_visited_single.js29
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/app.html2
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/command_manager.html2
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/dnd_chip.html4
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/dnd_manager.js4
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/folder_node.html10
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/item.html8
-rw-r--r--chromium/chrome/browser/resources/md_bookmarks/list.html6
-rw-r--r--chromium/chrome/browser/resources/md_downloads/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/md_downloads/item.html19
-rw-r--r--chromium/chrome/browser/resources/md_downloads/manager.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/BUILD.gn20
-rw-r--r--chromium/chrome/browser/resources/md_extensions/code_section.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/detail_view.html59
-rw-r--r--chromium/chrome/browser/resources/md_extensions/detail_view.js35
-rw-r--r--chromium/chrome/browser/resources/md_extensions/error_page.html20
-rw-r--r--chromium/chrome/browser/resources/md_extensions/extensions_resources.grd12
-rw-r--r--chromium/chrome/browser/resources/md_extensions/extensions_resources_vulcanized.grd1
-rw-r--r--chromium/chrome/browser/resources/md_extensions/install_warnings_dialog.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/item.html18
-rw-r--r--chromium/chrome/browser/resources/md_extensions/item.js14
-rw-r--r--chromium/chrome/browser/resources/md_extensions/item_list.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/keyboard_shortcuts.html8
-rw-r--r--chromium/chrome/browser/resources/md_extensions/kiosk_dialog.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/load_error.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/manager.js1
-rw-r--r--chromium/chrome/browser/resources/md_extensions/options_dialog.html6
-rw-r--r--chromium/chrome/browser/resources/md_extensions/pack_dialog.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.html115
-rw-r--r--chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.js234
-rw-r--r--chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.html37
-rw-r--r--chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.js222
-rw-r--r--chromium/chrome/browser/resources/md_extensions/service.js26
-rw-r--r--chromium/chrome/browser/resources/md_extensions/sidebar.html8
-rw-r--r--chromium/chrome/browser/resources/md_extensions/toggle_row.html2
-rw-r--r--chromium/chrome/browser/resources/md_extensions/toolbar.html10
-rw-r--r--chromium/chrome/browser/resources/md_history/BUILD.gn4
-rw-r--r--chromium/chrome/browser/resources/md_history/history.html2
-rw-r--r--chromium/chrome/browser/resources/md_history/history_item.html16
-rw-r--r--chromium/chrome/browser/resources/md_history/history_list.js15
-rw-r--r--chromium/chrome/browser/resources/md_history/history_toolbar.html4
-rw-r--r--chromium/chrome/browser/resources/md_history/shared_style.html2
-rw-r--r--chromium/chrome/browser/resources/md_history/side_bar.html10
-rw-r--r--chromium/chrome/browser/resources/md_history/synced_device_card.html4
-rw-r--r--chromium/chrome/browser/resources/md_user_manager/control_bar.html8
-rw-r--r--chromium/chrome/browser/resources/md_user_manager/create_profile.html4
-rw-r--r--chromium/chrome/browser/resources/md_user_manager/user_manager.html2
-rw-r--r--chromium/chrome/browser/resources/md_user_manager/user_manager_tutorial.html2
-rw-r--r--chromium/chrome/browser/resources/media/media_engagement.html14
-rw-r--r--chromium/chrome/browser/resources/media/media_engagement.js28
-rw-r--r--chromium/chrome/browser/resources/media/webrtc_logs.css10
-rw-r--r--chromium/chrome/browser/resources/media/webrtc_logs.html12
-rw-r--r--chromium/chrome/browser/resources/media/webrtc_logs.js215
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.css8
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css56
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html42
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js12
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css16
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.html4
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js7
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/route_controls/route_controls.css4
-rw-r--r--chromium/chrome/browser/resources/media_router/elements/route_details/route_details.css4
-rw-r--r--chromium/chrome/browser/resources/media_router/extension/src/init.js12
-rw-r--r--chromium/chrome/browser/resources/media_router/extension/src/init_test.js9
-rw-r--r--chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager.js66
-rw-r--r--chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_callbacks.js15
-rw-r--r--chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_test.js61
-rw-r--r--chromium/chrome/browser/resources/media_router/extension/src/mojo_externs.js4
-rw-r--r--chromium/chrome/browser/resources/media_router/icons/media_router_icons.html5
-rw-r--r--chromium/chrome/browser/resources/media_router/media_router.css5
-rw-r--r--chromium/chrome/browser/resources/ntp4/apps_page.js31
-rw-r--r--chromium/chrome/browser/resources/ntp4/incognito_tab.css10
-rw-r--r--chromium/chrome/browser/resources/ntp4/nav_dot.css12
-rw-r--r--chromium/chrome/browser/resources/ntp4/new_tab.css18
-rw-r--r--chromium/chrome/browser/resources/ntp4/page_list_view.js3
-rw-r--r--chromium/chrome/browser/resources/optimize_webui.gni9
-rwxr-xr-xchromium/chrome/browser/resources/optimize_webui.py24
-rwxr-xr-xchromium/chrome/browser/resources/optimize_webui_test.py11
-rw-r--r--chromium/chrome/browser/resources/pdf/elements/viewer-bookmark/viewer-bookmark.js2
-rw-r--r--chromium/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.html14
-rw-r--r--chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.html4
-rw-r--r--chromium/chrome/browser/resources/pdf/elements/viewer-toolbar-dropdown/viewer-toolbar-dropdown.html4
-rw-r--r--chromium/chrome/browser/resources/pdf/index.html2
-rw-r--r--chromium/chrome/browser/resources/pdf/pdf_scripting_api.js2
-rw-r--r--chromium/chrome/browser/resources/pdf/pdf_viewer.js (renamed from chromium/chrome/browser/resources/pdf/pdf.js)7
-rw-r--r--chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json6
-rw-r--r--chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json6
-rw-r--r--chromium/chrome/browser/resources/plugin_metadata/plugins_win.json6
-rw-r--r--chromium/chrome/browser/resources/policy.css8
-rw-r--r--chromium/chrome/browser/resources/policy.html2
-rw-r--r--chromium/chrome/browser/resources/policy_android.css16
-rw-r--r--chromium/chrome/browser/resources/policy_common.css10
-rw-r--r--chromium/chrome/browser/resources/print_preview/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/print_preview/common/search_box.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/data/destination.js60
-rw-r--r--chromium/chrome/browser/resources/print_preview/data/local_parsers.js3
-rw-r--r--chromium/chrome/browser/resources/print_preview/native_layer.js4
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/BUILD.gn3
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.js8
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/advanced_settings_item.html4
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/app.html6
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/app.js7
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/button_css.html4
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/checkbox_radio_css.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/color_settings.html7
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/color_settings.js22
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/destination_dialog.html77
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/destination_dialog.js44
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/destination_list.html40
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/destination_list.js123
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/destination_list_item.html10
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/destination_list_item.js18
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/destination_settings.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/header.html6
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/header.js11
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/layout_settings.html3
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/layout_settings.js8
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/margin_control_container.html1
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/margin_control_container.js75
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/margins_settings.html3
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/margins_settings.js8
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/model.js98
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/more_settings.html56
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/more_settings.js17
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/number_settings_section.html4
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/other_options_settings.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/other_options_settings.js17
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.js6
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/pages_settings.html5
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/pages_settings.js49
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/preview_area.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/preview_area.js62
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/print_preview_search_box.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/print_preview_shared_css.html38
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/search_dialog_css.html12
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/select_behavior.js49
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/select_css.html4
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/settings_behavior.js6
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/settings_section.html15
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/settings_section.js9
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/settings_select.html4
-rw-r--r--chromium/chrome/browser/resources/print_preview/new/settings_select.js16
-rw-r--r--chromium/chrome/browser/resources/print_preview/print_preview.css16
-rw-r--r--chromium/chrome/browser/resources/print_preview/print_preview.js3
-rw-r--r--chromium/chrome/browser/resources/print_preview/print_preview_resources.grd4
-rw-r--r--chromium/chrome/browser/resources/print_preview/print_preview_resources_vulcanized.grd1
-rw-r--r--chromium/chrome/browser/resources/print_preview/search/destination_list.css14
-rw-r--r--chromium/chrome/browser/resources/print_preview/search/destination_list_item.css16
-rw-r--r--chromium/chrome/browser/resources/print_preview/search/destination_search.css12
-rw-r--r--chromium/chrome/browser/resources/print_preview/search/destination_search.js3
-rw-r--r--chromium/chrome/browser/resources/print_preview/search/provisional_destination_resolver.js2
-rw-r--r--chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.css2
-rw-r--r--chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.css4
-rw-r--r--chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.html3
-rw-r--r--chromium/chrome/browser/resources/print_preview/settings/destination_settings.css4
-rw-r--r--chromium/chrome/browser/resources/print_preview/settings/page_settings.css2
-rw-r--r--chromium/chrome/browser/resources/print_preview/settings/page_settings.html2
-rw-r--r--chromium/chrome/browser/resources/print_preview/settings/settings_box.css2
-rw-r--r--chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.html3
-rw-r--r--chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.js65
-rw-r--r--chromium/chrome/browser/resources/set_as_default_browser.css4
-rw-r--r--chromium/chrome/browser/resources/settings/BUILD.gn6
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html17
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js25
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.html22
-rw-r--r--chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.js9
-rw-r--r--chromium/chrome/browser/resources/settings/about_page/about_page.html4
-rw-r--r--chromium/chrome/browser/resources/settings/about_page/about_page.js16
-rw-r--r--chromium/chrome/browser/resources/settings/about_page/detailed_build_info.html2
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html6
-rw-r--r--chromium/chrome/browser/resources/settings/appearance_page/home_url_input.js2
-rw-r--r--chromium/chrome/browser/resources/settings/basic_page/basic_page.html26
-rw-r--r--chromium/chrome/browser/resources/settings/basic_page/basic_page.js2
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html68
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js26
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js2
-rw-r--r--chromium/chrome/browser/resources/settings/change_password_page/change_password_page.html2
-rw-r--r--chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html37
-rw-r--r--chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js72
-rw-r--r--chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html54
-rw-r--r--chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js124
-rw-r--r--chromium/chrome/browser/resources/settings/controls/BUILD.gn11
-rw-r--r--chromium/chrome/browser/resources/settings/controls/controlled_button.html8
-rw-r--r--chromium/chrome/browser/resources/settings/controls/controlled_radio_button.html2
-rw-r--r--chromium/chrome/browser/resources/settings/controls/extension_controlled_indicator.html6
-rw-r--r--chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html (renamed from chromium/chrome/browser/resources/settings/people_page/password_prompt_dialog.html)4
-rw-r--r--chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.js (renamed from chromium/chrome/browser/resources/settings/people_page/password_prompt_dialog.js)103
-rw-r--r--chromium/chrome/browser/resources/settings/controls/settings_checkbox.html2
-rw-r--r--chromium/chrome/browser/resources/settings/controls/settings_slider.html8
-rw-r--r--chromium/chrome/browser/resources/settings/controls/settings_toggle_button.html4
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html2
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/device_page.html4
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/device_page.js13
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/display.html76
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/display.js31
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/display_size_slider.html19
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/display_size_slider.js28
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/keyboard.html37
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/keyboard.js26
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/pointers.html6
-rw-r--r--chromium/chrome/browser/resources/settings/device_page/storage.html6
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/BUILD.gn3
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.html22
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.js40
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/downloads_browser_proxy.js14
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/downloads_page.html7
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/downloads_page.js40
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/smb_browser_proxy.js1
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.html13
-rw-r--r--chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.js29
-rw-r--r--chromium/chrome/browser/resources/settings/find_shortcut_behavior.html2
-rw-r--r--chromium/chrome/browser/resources/settings/find_shortcut_behavior.js111
-rw-r--r--chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.html8
-rw-r--r--chromium/chrome/browser/resources/settings/icons.html5
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/BUILD.gn11
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html35
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js84
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html2
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_page.html15
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_page.js74
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_shared_css.html6
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html12
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js33
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.html1
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.js94
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html4
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html16
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js23
-rw-r--r--chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.html6
-rw-r--r--chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.js19
-rw-r--r--chromium/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html3
-rw-r--r--chromium/chrome/browser/resources/settings/languages_page/languages.js90
-rw-r--r--chromium/chrome/browser/resources/settings/languages_page/languages_page.html8
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/BUILD.gn41
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_browser_proxy.js54
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_constants.js80
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html4
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js181
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.html49
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js37
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.html17
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.js76
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.html80
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.js238
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.html10
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.js35
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.html118
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.js89
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.html34
-rw-r--r--chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js163
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/BUILD.gn16
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html11
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.js20
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html138
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js234
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html4
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html2
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_list_item.js7
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html13
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js11
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_export_dialog.html2
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html4
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js41
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html13
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.html154
-rw-r--r--chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.js421
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/BUILD.gn38
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/account_manager.html20
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/account_manager.js36
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js14
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/change_picture.html8
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/fingerprint_list.html3
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js11
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.html23
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js171
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/lock_screen.html75
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/lock_screen.js38
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.html16
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.js119
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/people_page.html99
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/people_page.js143
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html59
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js140
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/setup_pin_dialog.js2
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/signout_dialog.html78
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/signout_dialog.js120
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/sync_account_control.html8
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/sync_account_control.js55
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js22
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/sync_page.html111
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/sync_page.js49
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/user_list.html2
-rw-r--r--chromium/chrome/browser/resources/settings/people_page/users_page.html2
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/BUILD.gn11
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html20
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js45
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.html58
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.js44
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html103
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js141
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html16
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js14
-rw-r--r--chromium/chrome/browser/resources/settings/printing_page/cups_printer_shared_css.html2
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn2
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/personalization_options.html4
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html67
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js115
-rw-r--r--chromium/chrome/browser/resources/settings/privacy_page/privacy_page_browser_proxy.js8
-rw-r--r--chromium/chrome/browser/resources/settings/route.js3
-rw-r--r--chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html2
-rw-r--r--chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html2
-rw-r--r--chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry_css.html2
-rw-r--r--chromium/chrome/browser/resources/settings/search_engines_page/search_engines_list.html4
-rw-r--r--chromium/chrome/browser/resources/settings/search_page/search_page.html8
-rw-r--r--chromium/chrome/browser/resources/settings/search_page/search_page.js2
-rw-r--r--chromium/chrome/browser/resources/settings/search_settings.js16
-rw-r--r--chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html12
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.html1
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.js32
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_section.html4
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html7
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js36
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_subpage_search.html25
-rw-r--r--chromium/chrome/browser/resources/settings/settings_resources.grd79
-rw-r--r--chromium/chrome/browser/resources/settings/settings_resources_vulcanized.grd2
-rw-r--r--chromium/chrome/browser/resources/settings/settings_shared_css.html26
-rw-r--r--chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js31
-rw-r--r--chromium/chrome/browser/resources/settings/settings_vars_css.html4
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/BUILD.gn17
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/all_sites.html19
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/all_sites.js252
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js33
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/protocol_handlers.html2
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_data.html2
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_data.js26
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_details.html7
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_details.js8
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_details_permission.html11
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js58
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_entry.html34
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_entry.js133
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_list.html73
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_list.js139
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_list_entry.html80
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_list_entry.js145
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js39
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/usb_devices.html2
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/zoom_levels.html50
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings/zoom_levels.js20
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings_page/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html3
-rw-r--r--chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js7
-rw-r--r--chromium/chrome/browser/resources/signin/dice_sync_confirmation/BUILD.gn1
-rw-r--r--chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html15
-rw-r--r--chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.js16
-rw-r--r--chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_browser_proxy.js10
-rw-r--r--chromium/chrome/browser/resources/signin/signin_email_confirmation/signin_email_confirmation.html8
-rw-r--r--chromium/chrome/browser/resources/signin/signin_error/signin_error.html8
-rw-r--r--chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.css8
-rw-r--r--chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.html4
-rw-r--r--chromium/chrome/browser/resources/sync_file_system_internals/OWNERS1
-rw-r--r--chromium/chrome/browser/resources/sync_file_system_internals/main.css2
-rw-r--r--chromium/chrome/browser/resources/task_scheduler_internals/OWNERS2
-rw-r--r--chromium/chrome/browser/resources/uber_shared.css24
-rw-r--r--chromium/chrome/browser/resources/webapks/about_webapks.css6
-rw-r--r--chromium/chrome/browser/resources/welcome/welcome_win10.html4
-rw-r--r--chromium/chrome/browser/safe_browsing/BUILD.gn42
-rw-r--r--chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc24
-rw-r--r--chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.h2
-rw-r--r--chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc12
-rw-r--r--chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h2
-rw-r--r--chromium/chrome/browser/ui/BUILD.gn347
-rw-r--r--chromium/chrome/browser/ui/libgtkui/BUILD.gn251
-rw-r--r--chromium/chrome/browser/ui/webui/DEPS12
-rw-r--r--chromium/chrome/browser/ui/webui/about_ui.cc12
-rw-r--r--chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/browsing_history_handler.cc3
-rw-r--r--chromium/chrome/browser/ui/webui/browsing_history_handler_unittest.cc27
-rw-r--r--chromium/chrome/browser/ui/webui/certificates_handler.cc167
-rw-r--r--chromium/chrome/browser/ui/webui/certificates_handler.h9
-rw-r--r--chromium/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc8
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/DEPS5
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.cc251
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.h12
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h30
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc34
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.cc225
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h85
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.cc48
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.h39
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.cc8
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.h3
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.cc32
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.h10
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.cc9
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.h3
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.cc13
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.h3
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc17
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc198
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/emulator/DEPS7
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc76
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h9
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/first_run/first_run_handler.cc3
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/image_source.cc4
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.cc21
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc64
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h3
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.cc363
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h110
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc82
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc12
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h1
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_manager.cc9
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.cc104
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.h58
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager_observer.h25
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.cc77
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.h32
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.cc63
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.h32
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.cc63
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.h32
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_welcome.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc38
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc17
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc5
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/error_screen_handler.cc7
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.cc179
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h71
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc30
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h4
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.cc3
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/l10n_util.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc63
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h48
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc114
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.h53
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.h2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc12
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc308
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.h31
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc11
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h4
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc13
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h1
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/signin_userlist_unittest.cc7
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc49
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h13
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc160
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h24
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc144
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h14
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.cc79
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h6
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.cc69
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.h35
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/power_ui.cc36
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/set_time_ui.cc3
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/sys_internals/sys_internals_message_handler.h2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.cc4
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h4
-rw-r--r--chromium/chrome/browser/ui/webui/components_ui.cc14
-rw-r--r--chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.cc233
-rw-r--r--chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.h6
-rw-r--r--chromium/chrome/browser/ui/webui/discards/discards.mojom4
-rw-r--r--chromium/chrome/browser/ui/webui/discards/discards_ui.cc24
-rw-r--r--chromium/chrome/browser/ui/webui/eoc_internals/eoc_internals_page_handler.cc9
-rw-r--r--chromium/chrome/browser/ui/webui/extensions/extensions_internals_browsertest.cc53
-rw-r--r--chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.cc156
-rw-r--r--chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.h38
-rw-r--r--chromium/chrome/browser/ui/webui/extensions/extensions_ui.cc37
-rw-r--r--chromium/chrome/browser/ui/webui/help/version_updater_basic.cc11
-rw-r--r--chromium/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc10
-rw-r--r--chromium/chrome/browser/ui/webui/help/version_updater_win.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/inspect_ui.cc15
-rw-r--r--chromium/chrome/browser/ui/webui/interstitials/interstitial_ui.cc10
-rw-r--r--chromium/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc16
-rw-r--r--chromium/chrome/browser/ui/webui/interventions_internals/OWNERS2
-rw-r--r--chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.cc13
-rw-r--r--chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.h15
-rw-r--r--chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler_unittest.cc39
-rw-r--r--chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.cc7
-rw-r--r--chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.h6
-rw-r--r--chromium/chrome/browser/ui/webui/invalidations_message_handler.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc190
-rw-r--r--chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc36
-rw-r--r--chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h12
-rw-r--r--chromium/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc12
-rw-r--r--chromium/chrome/browser/ui/webui/md_downloads/md_downloads_ui.cc18
-rw-r--r--chromium/chrome/browser/ui/webui/md_history_ui.cc16
-rw-r--r--chromium/chrome/browser/ui/webui/media/media_engagement_ui.cc53
-rw-r--r--chromium/chrome/browser/ui/webui/media/webrtc_logs_ui.cc324
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl.cc3
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl_unittest.cc8
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui.cc11
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui.h7
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.cc71
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.h61
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.cc64
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h51
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory_unittest.cc103
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc26
-rw-r--r--chromium/chrome/browser/ui/webui/media_router/media_router_web_ui_test.cc4
-rw-r--r--chromium/chrome/browser/ui/webui/memory_internals_ui.cc19
-rw-r--r--chromium/chrome/browser/ui/webui/nacl_ui.cc4
-rw-r--r--chromium/chrome/browser/ui/webui/net_internals/DEPS2
-rw-r--r--chromium/chrome/browser/ui/webui/net_internals/net_internals_ui.cc22
-rw-r--r--chromium/chrome/browser/ui/webui/ntp/app_launcher_handler.cc19
-rw-r--r--chromium/chrome/browser/ui/webui/ntp/new_tab_ui.cc4
-rw-r--r--chromium/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/policy_indicator_localized_strings_provider.cc11
-rw-r--r--chromium/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc4
-rw-r--r--chromium/chrome/browser/ui/webui/policy_tool_ui_handler.cc8
-rw-r--r--chromium/chrome/browser/ui/webui/policy_ui_handler.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.cc34
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.h1
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc16
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc12
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/policy_settings.cc18
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/policy_settings.h28
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.cc189
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.h21
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc53
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.cc58
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.h29
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc40
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc5
-rw-r--r--chromium/chrome/browser/ui/webui/print_preview/sticky_settings.cc16
-rw-r--r--chromium/chrome/browser/ui/webui/profile_helper.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/profile_helper_browsertest.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/quota_internals/OWNERS1
-rw-r--r--chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.cc65
-rw-r--r--chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.h9
-rw-r--r--chromium/chrome/browser/ui/webui/sandbox_internals_ui.cc9
-rw-r--r--chromium/chrome/browser/ui/webui/settings/about_handler.cc14
-rw-r--r--chromium/chrome/browser/ui/webui/settings/about_handler.h2
-rw-r--r--chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc5
-rw-r--r--chromium/chrome/browser/ui/webui/settings/change_password_handler.cc11
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc25
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h2
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.cc62
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h6
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc17
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h3
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc47
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc117
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc33
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h8
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/google_assistant_handler.cc15
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc9
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.cc192
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.h57
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc330
-rw-r--r--chromium/chrome/browser/ui/webui/settings/chromeos/smb_handler.cc21
-rw-r--r--chromium/chrome/browser/ui/webui/settings/downloads_handler.cc26
-rw-r--r--chromium/chrome/browser/ui/webui/settings/downloads_handler.h7
-rw-r--r--chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc210
-rw-r--r--chromium/chrome/browser/ui/webui/settings/md_settings_ui.cc54
-rw-r--r--chromium/chrome/browser/ui/webui/settings/people_handler.cc169
-rw-r--r--chromium/chrome/browser/ui/webui/settings/people_handler.h19
-rw-r--r--chromium/chrome/browser/ui/webui/settings/people_handler_unittest.cc406
-rw-r--r--chromium/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc31
-rw-r--r--chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h7
-rw-r--r--chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc85
-rw-r--r--chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.h7
-rw-r--r--chromium/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc1
-rw-r--r--chromium/chrome/browser/ui/webui/settings/site_settings_handler.cc198
-rw-r--r--chromium/chrome/browser/ui/webui/settings/site_settings_handler.h35
-rw-r--r--chromium/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc185
-rw-r--r--chromium/chrome/browser/ui/webui/settings/tts_handler.cc26
-rw-r--r--chromium/chrome/browser/ui/webui/settings/tts_handler.h11
-rw-r--r--chromium/chrome/browser/ui/webui/settings_utils_linux.cc8
-rw-r--r--chromium/chrome/browser/ui/webui/settings_utils_win.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc9
-rw-r--r--chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc20
-rw-r--r--chromium/chrome/browser/ui/webui/signin/inline_login_handler.cc49
-rw-r--r--chromium/chrome/browser/ui/webui/signin/inline_login_handler.h20
-rw-r--r--chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.cc16
-rw-r--r--chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.h10
-rw-r--r--chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc57
-rw-r--r--chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.h10
-rw-r--r--chromium/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc12
-rw-r--r--chromium/chrome/browser/ui/webui/signin/login_ui_service.cc13
-rw-r--r--chromium/chrome/browser/ui/webui/signin/login_ui_service.h2
-rw-r--r--chromium/chrome/browser/ui/webui/signin/login_ui_test_utils.cc7
-rw-r--r--chromium/chrome/browser/ui/webui/signin/md_user_manager_ui.cc3
-rw-r--r--chromium/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc3
-rw-r--r--chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc56
-rw-r--r--chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.h5
-rw-r--r--chromium/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc9
-rw-r--r--chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc15
-rw-r--r--chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.h2
-rw-r--r--chromium/chrome/browser/ui/webui/sync_file_system_internals/DEPS3
-rw-r--r--chromium/chrome/browser/ui/webui/sync_file_system_internals/OWNERS1
-rw-r--r--chromium/chrome/browser/ui/webui/sync_internals_browsertest.js34
-rw-r--r--chromium/chrome/browser/ui/webui/sync_internals_message_handler.cc36
-rw-r--r--chromium/chrome/browser/ui/webui/sync_internals_message_handler.h5
-rw-r--r--chromium/chrome/browser/ui/webui/task_scheduler_internals/OWNERS2
-rw-r--r--chromium/chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/theme_handler.cc5
-rw-r--r--chromium/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc23
-rw-r--r--chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.cc100
-rw-r--r--chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.h20
-rw-r--r--chromium/chrome/browser/ui/webui/version_handler.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/version_handler_chromeos.cc8
-rw-r--r--chromium/chrome/browser/ui/webui/version_ui.cc15
-rw-r--r--chromium/chrome/browser/ui/webui/welcome_ui.cc61
-rw-r--r--chromium/chrome/browser/ui/webui/welcome_win10_handler.cc8
-rw-r--r--chromium/chrome/browser/vr/BUILD.gn270
-rw-r--r--chromium/chrome/browser/vr/testapp/BUILD.gn4
-rw-r--r--chromium/chrome/browser/web_applications/BUILD.gn59
-rw-r--r--chromium/chrome/browser/web_applications/bookmark_apps/BUILD.gn23
-rw-r--r--chromium/chrome/browser/web_applications/components/BUILD.gn71
-rw-r--r--chromium/chrome/browser/web_applications/extensions/BUILD.gn75
987 files changed, 25930 insertions, 50158 deletions
diff --git a/chromium/chrome/browser/BUILD.gn b/chromium/chrome/browser/BUILD.gn
index b5d398fd088..ccc2e812de7 100644
--- a/chromium/chrome/browser/BUILD.gn
+++ b/chromium/chrome/browser/BUILD.gn
@@ -48,6 +48,7 @@ if (is_win) {
"netapi32.lib",
"ndfapi.lib", # Used by browser/net/net_error_diagnostics_dialog_win.h
"pdh.lib", # Used by browser/private_working_set_snapshot.h
+ "wbemuuid.lib", # Used by browser/metrics/antivirus_metrics_provider_win.cc
]
ldflags = [
"/DELAYLOAD:ndfapi.dll",
@@ -82,6 +83,8 @@ jumbo_split_static_library("browser") {
"about_flags.h",
"accessibility/accessibility_permission_context.cc",
"accessibility/accessibility_permission_context.h",
+ "accessibility/accessibility_ui.cc",
+ "accessibility/accessibility_ui.h",
"after_startup_task_utils.cc",
"after_startup_task_utils.h",
"app_controller_mac.h",
@@ -226,14 +229,6 @@ jumbo_split_static_library("browser") {
"browsing_data/navigation_entry_remover.h",
"browsing_data/site_data_size_collector.cc",
"browsing_data/site_data_size_collector.h",
- "budget_service/budget_database.cc",
- "budget_service/budget_database.h",
- "budget_service/budget_manager.cc",
- "budget_service/budget_manager.h",
- "budget_service/budget_manager_factory.cc",
- "budget_service/budget_manager_factory.h",
- "budget_service/budget_service_impl.cc",
- "budget_service/budget_service_impl.h",
"cache_stats_recorder.cc",
"cache_stats_recorder.h",
"chooser_controller/chooser_controller.cc",
@@ -260,6 +255,8 @@ jumbo_split_static_library("browser") {
"chrome_content_browser_client_parts.h",
"chrome_device_client.cc",
"chrome_device_client.h",
+ "chrome_feature_list_creator.cc",
+ "chrome_feature_list_creator.h",
"chrome_notification_types.h",
"chrome_quota_permission_context.cc",
"chrome_quota_permission_context.h",
@@ -471,6 +468,8 @@ jumbo_split_static_library("browser") {
"lifetime/browser_shutdown.h",
"media/webrtc/audio_debug_recordings_handler.cc",
"media/webrtc/audio_debug_recordings_handler.h",
+ "media/webrtc/webrtc_event_log_history.cc",
+ "media/webrtc/webrtc_event_log_history.h",
"media/webrtc/webrtc_event_log_manager.cc",
"media/webrtc/webrtc_event_log_manager.h",
"media/webrtc/webrtc_event_log_manager_common.cc",
@@ -588,12 +587,6 @@ jumbo_split_static_library("browser") {
"infobars/infobar_responder.h",
"infobars/infobar_service.cc",
"infobars/infobar_service.h",
- "install_verification/win/install_verification.cc",
- "install_verification/win/install_verification.h",
- "install_verification/win/loaded_module_verification.cc",
- "install_verification/win/loaded_module_verification.h",
- "install_verification/win/module_ids.cc",
- "install_verification/win/module_ids.h",
"install_verification/win/module_info.h",
"install_verification/win/module_list.cc",
"install_verification/win/module_list.h",
@@ -619,6 +612,8 @@ jumbo_split_static_library("browser") {
"interstitials/enterprise_util.h",
"intranet_redirect_detector.cc",
"intranet_redirect_detector.h",
+ "invalidation/deprecated_profile_invalidation_provider_factory.cc",
+ "invalidation/deprecated_profile_invalidation_provider_factory.h",
"invalidation/profile_invalidation_provider_factory.cc",
"invalidation/profile_invalidation_provider_factory.h",
"io_thread.cc",
@@ -697,8 +692,8 @@ jumbo_split_static_library("browser") {
"media/webrtc/desktop_media_list_base.h",
"media/webrtc/desktop_media_picker.cc",
"media/webrtc/desktop_media_picker.h",
- "media/webrtc/desktop_streams_registry.cc",
- "media/webrtc/desktop_streams_registry.h",
+ "media/webrtc/desktop_media_picker_factory.cc",
+ "media/webrtc/desktop_media_picker_factory.h",
"media/webrtc/media_capture_devices_dispatcher.cc",
"media/webrtc/media_capture_devices_dispatcher.h",
"media/webrtc/media_stream_capture_indicator.cc",
@@ -713,6 +708,10 @@ jumbo_split_static_library("browser") {
"media/webrtc/native_desktop_media_list.h",
"media/webrtc/permission_bubble_media_access_handler.cc",
"media/webrtc/permission_bubble_media_access_handler.h",
+ "media/webrtc/webrtc_event_log_manager_keyed_service.cc",
+ "media/webrtc/webrtc_event_log_manager_keyed_service.h",
+ "media/webrtc/webrtc_event_log_manager_keyed_service_factory.cc",
+ "media/webrtc/webrtc_event_log_manager_keyed_service_factory.h",
"media/webrtc/window_icon_util.h",
"media/webrtc/window_icon_util_chromeos.cc",
"media/webrtc/window_icon_util_mac.mm",
@@ -748,6 +747,8 @@ jumbo_split_static_library("browser") {
"metrics/https_engagement_metrics_provider.h",
"metrics/jumplist_metrics_win.cc",
"metrics/jumplist_metrics_win.h",
+ "metrics/live_tab_count_metrics.cc",
+ "metrics/live_tab_count_metrics.h",
"metrics/metrics_memory_details.cc",
"metrics/metrics_memory_details.h",
"metrics/metrics_reporting_state.cc",
@@ -758,6 +759,8 @@ jumbo_split_static_library("browser") {
"metrics/oom/out_of_memory_reporter.h",
"metrics/perf/perf_provider_chromeos.cc",
"metrics/perf/perf_provider_chromeos.h",
+ "metrics/power_metrics_provider_mac.h",
+ "metrics/power_metrics_provider_mac.mm",
"metrics/process_memory_metrics_emitter.cc",
"metrics/process_memory_metrics_emitter.h",
"metrics/renderer_uptime_tracker.cc",
@@ -796,8 +799,6 @@ jumbo_split_static_library("browser") {
"net/chrome_report_sender.h",
"net/chrome_url_request_context_getter.cc",
"net/chrome_url_request_context_getter.h",
- "net/default_network_context_params.cc",
- "net/default_network_context_params.h",
"net/dns_probe_runner.cc",
"net/dns_probe_runner.h",
"net/dns_probe_service.cc",
@@ -838,8 +839,6 @@ jumbo_split_static_library("browser") {
"net/referrer.h",
"net/reporting_permissions_checker.cc",
"net/reporting_permissions_checker.h",
- "net/safe_search_util.cc",
- "net/safe_search_util.h",
"net/service_providers_win.cc",
"net/service_providers_win.h",
"net/spdyproxy/data_reduction_proxy_chrome_io_data.cc",
@@ -890,6 +889,8 @@ jumbo_split_static_library("browser") {
"notifications/persistent_notification_handler.h",
"notifications/platform_notification_service_impl.cc",
"notifications/platform_notification_service_impl.h",
+ "notifications/popups_only_ui_controller.cc",
+ "notifications/popups_only_ui_controller.h",
"notifications/system_notification_helper.cc",
"notifications/system_notification_helper.h",
"ntp_snippets/bookmark_last_visit_updater.cc",
@@ -946,6 +947,8 @@ jumbo_split_static_library("browser") {
"page_load_metrics/observers/https_engagement_metrics/https_engagement_service.h",
"page_load_metrics/observers/https_engagement_metrics/https_engagement_service_factory.cc",
"page_load_metrics/observers/https_engagement_metrics/https_engagement_service_factory.h",
+ "page_load_metrics/observers/live_tab_count_page_load_metrics_observer.cc",
+ "page_load_metrics/observers/live_tab_count_page_load_metrics_observer.h",
"page_load_metrics/observers/loading_predictor_page_load_metrics_observer.cc",
"page_load_metrics/observers/loading_predictor_page_load_metrics_observer.h",
"page_load_metrics/observers/local_network_requests_page_load_metrics_observer.cc",
@@ -1011,8 +1014,6 @@ jumbo_split_static_library("browser") {
"password_manager/password_store_factory.h",
"password_manager/password_store_mac.cc",
"password_manager/password_store_mac.h",
- "password_manager/password_store_win.cc",
- "password_manager/password_store_win.h",
"password_manager/reauth_purpose.h",
"payments/payment_handler_permission_context.cc",
"payments/payment_handler_permission_context.h",
@@ -1064,6 +1065,8 @@ jumbo_split_static_library("browser") {
"policy/browser_dm_token_storage_mac.mm",
"policy/browser_dm_token_storage_win.cc",
"policy/browser_dm_token_storage_win.h",
+ "policy/browsing_history_policy_handler.cc",
+ "policy/browsing_history_policy_handler.h",
"policy/chrome_browser_policy_connector.cc",
"policy/chrome_browser_policy_connector.h",
"policy/cloud/cloud_policy_invalidator.cc",
@@ -1133,6 +1136,8 @@ jumbo_split_static_library("browser") {
"predictors/predictor_database_factory.h",
"predictors/predictor_table_base.cc",
"predictors/predictor_table_base.h",
+ "predictors/resolve_host_client_impl.cc",
+ "predictors/resolve_host_client_impl.h",
"predictors/resource_prefetch_common.cc",
"predictors/resource_prefetch_common.h",
"predictors/resource_prefetch_predictor.cc",
@@ -1197,12 +1202,17 @@ jumbo_split_static_library("browser") {
"prerender/prerender_util.h",
"previews/previews_infobar_delegate.cc",
"previews/previews_infobar_delegate.h",
- "previews/previews_infobar_tab_helper.cc",
- "previews/previews_infobar_tab_helper.h",
+ "previews/previews_lite_page_decider.cc",
+ "previews/previews_lite_page_decider.h",
+ "previews/previews_lite_page_navigation_throttle.cc",
+ "previews/previews_lite_page_navigation_throttle.h",
+ "previews/previews_lite_page_navigation_throttle_manager.h",
"previews/previews_service.cc",
"previews/previews_service.h",
"previews/previews_service_factory.cc",
"previews/previews_service_factory.h",
+ "previews/previews_ui_tab_helper.cc",
+ "previews/previews_ui_tab_helper.h",
"previews/resource_loading_hints/resource_loading_hints_web_contents_observer.cc",
"previews/resource_loading_hints/resource_loading_hints_web_contents_observer.h",
"process_resource_usage.cc",
@@ -1217,6 +1227,10 @@ jumbo_split_static_library("browser") {
"profiles/chrome_browser_main_extra_parts_profiles.h",
"profiles/chrome_version_service.cc",
"profiles/chrome_version_service.h",
+ "profiles/force_safe_search_policy_handler.cc",
+ "profiles/force_safe_search_policy_handler.h",
+ "profiles/force_youtube_safety_mode_policy_handler.cc",
+ "profiles/force_youtube_safety_mode_policy_handler.h",
"profiles/gaia_info_update_service.cc",
"profiles/gaia_info_update_service.h",
"profiles/gaia_info_update_service_factory.cc",
@@ -1265,9 +1279,15 @@ jumbo_split_static_library("browser") {
"profiles/profile_shortcut_manager_win.h",
"profiles/profiles_state.cc",
"profiles/profiles_state.h",
+ "profiles/renderer_updater.cc",
+ "profiles/renderer_updater.h",
+ "profiles/renderer_updater_factory.cc",
+ "profiles/renderer_updater_factory.h",
"profiles/sql_init_error_message_ids.cc",
"profiles/sql_init_error_message_ids.h",
"profiles/storage_partition_descriptor.h",
+ "push_messaging/budget_database.cc",
+ "push_messaging/budget_database.h",
"push_messaging/push_messaging_app_identifier.cc",
"push_messaging/push_messaging_app_identifier.h",
"push_messaging/push_messaging_constants.cc",
@@ -1294,6 +1314,8 @@ jumbo_split_static_library("browser") {
"resource_coordinator/browser_child_process_watcher.h",
"resource_coordinator/chrome_browser_main_extra_parts_resource_coordinator.cc",
"resource_coordinator/chrome_browser_main_extra_parts_resource_coordinator.h",
+ "resource_coordinator/exponential_moving_average.cc",
+ "resource_coordinator/exponential_moving_average.h",
"resource_coordinator/page_signal_receiver.cc",
"resource_coordinator/page_signal_receiver.h",
"resource_coordinator/performance_measurement_manager.cc",
@@ -1374,14 +1396,25 @@ jumbo_split_static_library("browser") {
"signin/account_reconcilor_factory.h",
"signin/account_tracker_service_factory.cc",
"signin/account_tracker_service_factory.h",
+ "signin/chrome_device_id_helper.cc",
+ "signin/chrome_device_id_helper.h",
"signin/chrome_signin_client.cc",
"signin/chrome_signin_client.h",
"signin/chrome_signin_client_factory.cc",
"signin/chrome_signin_client_factory.h",
"signin/chrome_signin_helper.cc",
"signin/chrome_signin_helper.h",
+ "signin/chrome_signin_proxying_url_loader_factory.cc",
+ "signin/chrome_signin_proxying_url_loader_factory.h",
+ "signin/chrome_signin_proxying_url_loader_factory_manager.cc",
+ "signin/chrome_signin_proxying_url_loader_factory_manager.h",
+ "signin/chrome_signin_url_loader_throttle.cc",
+ "signin/chrome_signin_url_loader_throttle.h",
"signin/gaia_cookie_manager_service_factory.cc",
"signin/gaia_cookie_manager_service_factory.h",
+ "signin/header_modification_delegate.h",
+ "signin/header_modification_delegate_impl.cc",
+ "signin/header_modification_delegate_impl.h",
"signin/identity_manager_factory.cc",
"signin/identity_manager_factory.h",
"signin/investigator_dependency_provider.cc",
@@ -1400,14 +1433,8 @@ jumbo_split_static_library("browser") {
"signin/signin_status_metrics_provider_chromeos.h",
"signin/signin_tracker_factory.cc",
"signin/signin_tracker_factory.h",
- "signin/signin_updater.cc",
- "signin/signin_updater.h",
- "signin/signin_updater_factory.cc",
- "signin/signin_updater_factory.h",
"signin/signin_util.cc",
"signin/signin_util.h",
- "signin/unified_consent_helper.cc",
- "signin/unified_consent_helper.h",
"site_details.cc",
"site_details.h",
"speech/chrome_speech_recognition_manager_delegate.cc",
@@ -1455,6 +1482,8 @@ jumbo_split_static_library("browser") {
"ssl/insecure_sensitive_input_driver_factory.h",
"ssl/mitm_software_blocking_page.cc",
"ssl/mitm_software_blocking_page.h",
+ "ssl/secure_origin_policy_handler.cc",
+ "ssl/secure_origin_policy_handler.h",
"ssl/security_state_tab_helper.cc",
"ssl/security_state_tab_helper.h",
"ssl/ssl_blocking_page.cc",
@@ -1575,12 +1604,12 @@ jumbo_split_static_library("browser") {
"usb/usb_chooser_controller.h",
"usb/usb_tab_helper.cc",
"usb/usb_tab_helper.h",
- "usb/web_usb_chooser_service.cc",
- "usb/web_usb_chooser_service.h",
+ "usb/web_usb_chooser.cc",
+ "usb/web_usb_chooser.h",
"usb/web_usb_histograms.cc",
"usb/web_usb_histograms.h",
- "usb/web_usb_permission_provider.cc",
- "usb/web_usb_permission_provider.h",
+ "usb/web_usb_service_impl.cc",
+ "usb/web_usb_service_impl.h",
"vr/ui_suppressed_element.h",
"vr/vr_tab_helper.cc",
"vr/vr_tab_helper.h",
@@ -1590,6 +1619,7 @@ jumbo_split_static_library("browser") {
"webauthn/authenticator_request_dialog_model.h",
"webauthn/authenticator_request_scheduler.cc",
"webauthn/authenticator_request_scheduler.h",
+ "webauthn/authenticator_transport.h",
"webauthn/chrome_authenticator_request_delegate.cc",
"webauthn/chrome_authenticator_request_delegate.h",
"webauthn/transport_list_model.cc",
@@ -1632,7 +1662,7 @@ jumbo_split_static_library("browser") {
"//build/config/compiler:wexit_time_destructors",
"//build/config:precompiled_headers",
]
- defines = []
+ defines = [ "ZLIB_CONST" ]
libs = []
ldflags = []
@@ -1664,7 +1694,6 @@ jumbo_split_static_library("browser") {
"//chrome:strings",
"//chrome/app/resources:platform_locale_settings",
"//chrome/app/theme:theme_resources",
- "//chrome/browser/budget_service:budget_proto",
"//chrome/browser/devtools",
"//chrome/browser/media:media_engagement_preload_proto",
"//chrome/browser/media:mojo_bindings",
@@ -1673,6 +1702,7 @@ jumbo_split_static_library("browser") {
"//chrome/browser/metrics/variations:chrome_ui_string_overrider_factory",
"//chrome/browser/net:probe_message_proto",
"//chrome/browser/profiling_host",
+ "//chrome/browser/push_messaging:budget_proto",
"//chrome/browser/resource_coordinator:mojo_bindings",
"//chrome/browser/safe_browsing",
"//chrome/browser/ssl:proto",
@@ -1700,7 +1730,8 @@ jumbo_split_static_library("browser") {
"//components/consent_auditor",
"//components/content_settings/core/browser",
"//components/content_settings/core/common",
- "//components/contextual_search:browser",
+ "//components/contextual_search/content:browser",
+ "//components/contextual_search/core:browser",
"//components/cookie_config",
"//components/crx_file",
"//components/data_reduction_proxy/content/browser",
@@ -1722,7 +1753,6 @@ jumbo_split_static_library("browser") {
"//components/filename_generation",
"//components/flags_ui",
"//components/gcm_driver",
- "//components/google/core/browser",
"//components/handoff",
"//components/history/content/browser",
"//components/history/core/browser",
@@ -1732,14 +1762,18 @@ jumbo_split_static_library("browser") {
"//components/keyed_service/content",
"//components/language/content/browser",
"//components/language/core/browser",
- "//components/metrics:call_stacks",
+ "//components/live_tab_count_metrics",
+ "//components/metrics:call_stack_profile_collector",
"//components/metrics:component_metrics",
"//components/metrics:gpu",
"//components/metrics:net",
"//components/metrics:ui",
"//components/metrics_services_manager",
"//components/mirroring/browser:browser",
- "//components/mirroring/service:interface",
+ "//components/mirroring/mojom:constants",
+ "//components/mirroring/mojom:host",
+ "//components/mirroring/mojom:service",
+ "//components/mirroring/service:mirroring_service",
"//components/navigation_interception",
"//components/navigation_metrics",
"//components/net_log",
@@ -1805,7 +1839,6 @@ jumbo_split_static_library("browser") {
"//components/translate/core/browser",
"//components/translate/core/common",
"//components/ukm:observers",
- "//components/ukm/content/debug_page",
"//components/undo",
"//components/unified_consent",
"//components/update_client",
@@ -1833,7 +1866,6 @@ jumbo_split_static_library("browser") {
"//content/public/common:buildflags",
"//content/public/common:feature_h264_with_openh264_ffmpeg",
"//content/public/common:service_names",
- "//courgette:courgette_lib",
"//crypto",
"//crypto:platform",
"//device/base",
@@ -1939,6 +1971,8 @@ jumbo_split_static_library("browser") {
"android/android_theme_resources.h",
"android/app_hooks.cc",
"android/app_hooks.h",
+ "android/autofill_assistant/assistant_ui_controller_android.cc",
+ "android/autofill_assistant/assistant_ui_controller_android.h",
"android/background_sync_launcher_android.cc",
"android/background_sync_launcher_android.h",
"android/background_tab_manager.cc",
@@ -2026,6 +2060,8 @@ jumbo_split_static_library("browser") {
"android/contextualsearch/contextual_search_field_trial.h",
"android/contextualsearch/contextual_search_manager.cc",
"android/contextualsearch/contextual_search_manager.h",
+ "android/contextualsearch/contextual_search_preference_helper.cc",
+ "android/contextualsearch/contextual_search_preference_helper.h",
"android/contextualsearch/contextual_search_ranker_logger_impl.cc",
"android/contextualsearch/contextual_search_ranker_logger_impl.h",
"android/contextualsearch/contextual_search_tab_helper.cc",
@@ -2039,6 +2075,8 @@ jumbo_split_static_library("browser") {
"android/contextualsearch/unhandled_tap_web_contents_observer.cc",
"android/contextualsearch/unhandled_tap_web_contents_observer.h",
"android/cookies/cookies_fetcher_util.cc",
+ "android/crash/crash_keys_android.cc",
+ "android/crash/crash_keys_android.h",
"android/crash/pure_java_exception_handler.cc",
"android/crash/pure_java_exception_handler.h",
"android/customtabs/detached_resource_request.cc",
@@ -2056,6 +2094,8 @@ jumbo_split_static_library("browser") {
"android/document/document_web_contents_delegate.h",
"android/dom_distiller/distiller_ui_handle_android.cc",
"android/dom_distiller/distiller_ui_handle_android.h",
+ "android/download/available_offline_content_provider.cc",
+ "android/download/available_offline_content_provider.h",
"android/download/chrome_duplicate_download_infobar_delegate.cc",
"android/download/chrome_duplicate_download_infobar_delegate.h",
"android/download/dangerous_download_infobar_delegate.cc",
@@ -2089,6 +2129,17 @@ jumbo_split_static_library("browser") {
"android/explore_sites/catalog.h",
"android/explore_sites/explore_sites_bridge.cc",
"android/explore_sites/explore_sites_bridge.h",
+ "android/explore_sites/explore_sites_feature.cc",
+ "android/explore_sites/explore_sites_feature.h",
+ "android/explore_sites/explore_sites_schema.cc",
+ "android/explore_sites/explore_sites_schema.h",
+ "android/explore_sites/explore_sites_service.h",
+ "android/explore_sites/explore_sites_service_factory.cc",
+ "android/explore_sites/explore_sites_service_factory.h",
+ "android/explore_sites/explore_sites_service_impl.cc",
+ "android/explore_sites/explore_sites_service_impl.h",
+ "android/explore_sites/explore_sites_store.cc",
+ "android/explore_sites/explore_sites_store.h",
"android/explore_sites/ntp_json_fetcher.cc",
"android/explore_sites/ntp_json_fetcher.h",
"android/explore_sites/url_util.cc",
@@ -2181,6 +2232,8 @@ jumbo_split_static_library("browser") {
"android/omnibox/autocomplete_controller_android.h",
"android/omnibox/omnibox_prerender.cc",
"android/omnibox/omnibox_prerender.h",
+ "android/omnibox/query_in_omnibox_android.cc",
+ "android/omnibox/query_in_omnibox_android.h",
"android/oom_intervention/near_oom_monitor.cc",
"android/oom_intervention/near_oom_monitor.h",
"android/oom_intervention/oom_intervention_config.cc",
@@ -2255,6 +2308,7 @@ jumbo_split_static_library("browser") {
"android/signin/signin_manager_android.h",
"android/signin/signin_promo_util_android.cc",
"android/signin/signin_promo_util_android.h",
+ "android/signin/unified_consent_service_bridge.cc",
"android/subresource_filter/test_subresource_filter_publisher.cc",
"android/tab_android.cc",
"android/tab_android.h",
@@ -2272,8 +2326,8 @@ jumbo_split_static_library("browser") {
"android/trusted_cdn.cc",
"android/trusted_cdn.h",
"android/url_utilities.cc",
- "android/usb/web_usb_chooser_service_android.cc",
- "android/usb/web_usb_chooser_service_android.h",
+ "android/usb/web_usb_chooser_android.cc",
+ "android/usb/web_usb_chooser_android.h",
"android/warmup_manager.cc",
"android/web_contents_factory.cc",
"android/webapk/chrome_webapk_host.cc",
@@ -2341,8 +2395,8 @@ jumbo_split_static_library("browser") {
"media/android/cdm/media_drm_license_manager.h",
"media/android/cdm/media_drm_storage_factory.cc",
"media/android/cdm/media_drm_storage_factory.h",
- "media/android/remote/media_controller_bridge.cc",
- "media/android/remote/media_controller_bridge.h",
+ "media/android/remote/flinging_controller_bridge.cc",
+ "media/android/remote/flinging_controller_bridge.h",
"media/android/remote/record_cast_action.cc",
"media/android/remote/remote_media_player_bridge.cc",
"media/android/remote/remote_media_player_bridge.h",
@@ -2406,6 +2460,8 @@ jumbo_split_static_library("browser") {
"policy/cloud/user_policy_signin_service_mobile.h",
"prerender/external_prerender_handler_android.cc",
"prerender/external_prerender_handler_android.h",
+ "previews/android/previews_android_bridge.cc",
+ "previews/android/previews_android_bridge.h",
"profiles/profile_android.cc",
"profiles/profile_android.h",
"search/contextual_search_policy_handler_android.cc",
@@ -2433,10 +2489,12 @@ jumbo_split_static_library("browser") {
"//chrome/browser/android/webapk:proto",
"//chrome/services/media_gallery_util:manifest", # TODO(xingliu): Tries to remove this.
"//chrome/services/media_gallery_util/public/cpp",
+ "//components/autofill_assistant/browser",
"//components/cdm/browser",
"//components/embedder_support/android:web_contents_delegate",
"//components/feed:buildflags",
"//components/feed:feature_list",
+ "//components/language/android:language_bridge",
"//components/payments/content/android",
"//components/resources:components_resources",
"//components/toolbar",
@@ -2575,6 +2633,16 @@ jumbo_split_static_library("browser") {
"lifetime/browser_close_manager.h",
"lifetime/termination_notification.cc",
"lifetime/termination_notification.h",
+ "media/capture_access_handler_base.cc",
+ "media/capture_access_handler_base.h",
+ "media/unified_autoplay_config.cc",
+ "media/unified_autoplay_config.h",
+ "media/webrtc/desktop_capture_devices_util.cc",
+ "media/webrtc/desktop_capture_devices_util.h",
+ "media/webrtc/desktop_media_picker_factory_impl.cc",
+ "media/webrtc/desktop_media_picker_factory_impl.h",
+ "media/webrtc/display_media_access_handler.cc",
+ "media/webrtc/display_media_access_handler.h",
"media/webrtc/tab_desktop_media_list.cc",
"media/webrtc/tab_desktop_media_list.h",
"media_galleries/chromeos/mtp_device_delegate_impl_chromeos.cc",
@@ -2747,6 +2815,8 @@ jumbo_split_static_library("browser") {
"resource_coordinator/local_site_characteristics_data_store.h",
"resource_coordinator/local_site_characteristics_data_store_factory.cc",
"resource_coordinator/local_site_characteristics_data_store_factory.h",
+ "resource_coordinator/local_site_characteristics_data_store_inspector.cc",
+ "resource_coordinator/local_site_characteristics_data_store_inspector.h",
"resource_coordinator/local_site_characteristics_data_writer.cc",
"resource_coordinator/local_site_characteristics_data_writer.h",
"resource_coordinator/local_site_characteristics_database.h",
@@ -2925,11 +2995,11 @@ jumbo_split_static_library("browser") {
"themes/theme_service_mac.mm",
"themes/theme_syncable_service.cc",
"themes/theme_syncable_service.h",
- "upgrade_detector.cc",
- "upgrade_detector.h",
- "upgrade_observer.h",
- "usb/web_usb_chooser_service_desktop.cc",
- "usb/web_usb_chooser_service_desktop.h",
+ "upgrade_detector/upgrade_detector.cc",
+ "upgrade_detector/upgrade_detector.h",
+ "upgrade_detector/upgrade_observer.h",
+ "usb/web_usb_chooser_desktop.cc",
+ "usb/web_usb_chooser_desktop.h",
"usb/web_usb_detector.cc",
"usb/web_usb_detector.h",
]
@@ -2951,6 +3021,7 @@ jumbo_split_static_library("browser") {
"//components/vector_icons",
"//components/web_modal",
"//components/zoom",
+ "//courgette:courgette_lib",
]
if (is_posix || is_fuchsia) {
@@ -3023,24 +3094,28 @@ jumbo_split_static_library("browser") {
"task_manager/providers/arc/arc_process_task.h",
"task_manager/providers/arc/arc_process_task_provider.cc",
"task_manager/providers/arc/arc_process_task_provider.h",
+ "upgrade_detector/upgrade_detector_chromeos.cc",
+ "upgrade_detector/upgrade_detector_chromeos.h",
]
deps += [
"//ash",
"//ash/components/quick_launch/public/mojom:constants",
"//ash/public/cpp",
"//chrome/browser/chromeos",
+ "//chrome/browser/chromeos/android_sms:android_sms",
"//chromeos/services/device_sync",
"//chromeos/services/device_sync/public/mojom",
+ "//chromeos/services/ime/public/mojom",
"//chromeos/services/multidevice_setup",
"//chromeos/services/multidevice_setup/public/mojom",
"//chromeos/services/secure_channel",
"//chromeos/services/secure_channel/public/mojom",
"//components/services/font:lib",
"//components/services/font/public/interfaces",
- "//services/ui/public/cpp/input_devices",
- "//services/ui/public/cpp/input_devices:input_device_controller",
- "//services/ui/public/interfaces",
- "//services/ui/ws2:lib",
+ "//services/ws:lib",
+ "//services/ws/public/cpp/input_devices",
+ "//services/ws/public/cpp/input_devices:input_device_controller",
+ "//services/ws/public/mojom",
"//ui/ozone",
]
allow_circular_includes_from += [ "//chrome/browser/chromeos" ]
@@ -3054,6 +3129,8 @@ jumbo_split_static_library("browser") {
} else { # Non-ChromeOS.
sources += [
"fullscreen.h",
+ "policy/browser_signin_policy_handler.cc",
+ "policy/browser_signin_policy_handler.h",
"policy/cloud/user_cloud_policy_manager_factory.cc",
"policy/cloud/user_cloud_policy_manager_factory.h",
"policy/cloud/user_policy_signin_service_base.cc",
@@ -3067,6 +3144,10 @@ jumbo_split_static_library("browser") {
if (is_win) {
sources += [
+ "browser_switcher/browser_switcher_prefs.cc",
+ "browser_switcher/browser_switcher_prefs.h",
+ "browser_switcher/browser_switcher_sitelist.cc",
+ "browser_switcher/browser_switcher_sitelist.h",
"downgrade/user_data_downgrade.cc",
"downgrade/user_data_downgrade.h",
"first_run/upgrade_util.cc",
@@ -3096,6 +3177,7 @@ jumbo_split_static_library("browser") {
"//components/browser_watcher:stability_client",
"//components/chrome_cleaner/public/constants",
"//components/chrome_cleaner/public/interfaces",
+ "//components/download/quarantine",
"//third_party/crashpad/crashpad/client:client",
"//third_party/iaccessible2",
"//third_party/isimpledom",
@@ -3171,6 +3253,8 @@ jumbo_split_static_library("browser") {
}
if (is_mac) {
+ allow_circular_includes_from += [ "//chrome/browser/apps/app_shim" ]
+ sources += [ "download/drag_download_item_mac.mm" ]
deps += [
"//chrome/app_shim",
"//chrome/browser/apps/app_shim",
@@ -3307,9 +3391,8 @@ jumbo_split_static_library("browser") {
"net/disk_cache_dir_policy_handler.h",
"notifications/fullscreen_notification_blocker.cc",
"notifications/fullscreen_notification_blocker.h",
- "notifications/message_center_notification_manager.cc",
- "notifications/message_center_notification_manager.h",
- "notifications/notification_ui_manager_desktop.cc",
+ "notifications/notification_ui_manager_impl.cc",
+ "notifications/notification_ui_manager_impl.h",
"notifications/screen_lock_notification_blocker.cc",
"notifications/screen_lock_notification_blocker.h",
"platform_util.cc",
@@ -3344,8 +3427,8 @@ jumbo_split_static_library("browser") {
"signin/signin_global_error.h",
"signin/signin_global_error_factory.cc",
"signin/signin_global_error_factory.h",
- "upgrade_detector_impl.cc",
- "upgrade_detector_impl.h",
+ "upgrade_detector/upgrade_detector_impl.cc",
+ "upgrade_detector/upgrade_detector_impl.h",
]
} else {
sources += [
@@ -3411,8 +3494,7 @@ jumbo_split_static_library("browser") {
if (use_aura) {
# Cross-platform Aura files.
sources += [
- # This file is called _views but has Aura calls in it.
- "download/drag_download_item_views.cc",
+ "download/drag_download_item_aura.cc",
"lifetime/application_lifetime_aura.cc",
"platform_util_aura.cc",
]
@@ -3495,6 +3577,12 @@ jumbo_split_static_library("browser") {
"//printing",
]
+ if (is_chromeos) {
+ sources += [
+ "policy/printing_restrictions_policy_handler.cc",
+ "policy/printing_restrictions_policy_handler.h",
+ ]
+ }
if (is_win) {
sources += [
"printing/pdf_to_emf_converter.cc",
@@ -3509,6 +3597,8 @@ jumbo_split_static_library("browser") {
sources += [
"printing/background_printing_manager.cc",
"printing/background_printing_manager.h",
+ "printing/pdf_nup_converter_client.cc",
+ "printing/pdf_nup_converter_client.h",
"printing/print_dialog_cloud.cc",
"printing/print_dialog_cloud.h",
"printing/print_dialog_cloud_win.cc",
@@ -3632,12 +3722,12 @@ jumbo_split_static_library("browser") {
"guest_view/web_view/chrome_web_view_permission_helper_delegate.h",
"guest_view/web_view/context_menu_content_type_web_view.cc",
"guest_view/web_view/context_menu_content_type_web_view.h",
- "media/capture_access_handler_base.cc",
- "media/capture_access_handler_base.h",
"media/cast_transport_host_filter.cc",
"media/cast_transport_host_filter.h",
"media/extension_media_access_handler.cc",
"media/extension_media_access_handler.h",
+ "media/offscreen_tab.cc",
+ "media/offscreen_tab.h",
"media/webrtc/desktop_capture_access_handler.cc",
"media/webrtc/desktop_capture_access_handler.h",
"media/webrtc/tab_capture_access_handler.cc",
@@ -3784,11 +3874,18 @@ jumbo_split_static_library("browser") {
allow_circular_includes_from += [
"//chrome/browser/apps/platform_apps",
"//chrome/browser/extensions",
+ "//chrome/browser/web_applications",
+ "//chrome/browser/web_applications/bookmark_apps",
+ "//chrome/browser/web_applications/components",
+ "//chrome/browser/web_applications/extensions",
]
deps += [
"//apps",
"//chrome/browser/sync_file_system/drive_backend:sync_file_system_drive_proto",
"//chrome/browser/web_applications",
+ "//chrome/browser/web_applications/bookmark_apps",
+ "//chrome/browser/web_applications/components",
+ "//chrome/browser/web_applications/extensions",
"//chrome/common/extensions/api",
"//chrome/common/extensions/api:extensions_features",
"//components/drive",
@@ -3937,6 +4034,8 @@ jumbo_split_static_library("browser") {
"offline_pages/android/downloads/offline_page_download_bridge.h",
"offline_pages/android/downloads/offline_page_infobar_delegate.cc",
"offline_pages/android/downloads/offline_page_infobar_delegate.h",
+ "offline_pages/android/downloads/offline_page_share_helper.cc",
+ "offline_pages/android/downloads/offline_page_share_helper.h",
"offline_pages/android/load_termination_listener_impl.cc",
"offline_pages/android/load_termination_listener_impl.h",
"offline_pages/android/offline_page_bridge.cc",
@@ -3949,6 +4048,7 @@ jumbo_split_static_library("browser") {
"offline_pages/android/prefetch_background_task_android.cc",
"offline_pages/android/prefetch_background_task_android.h",
"offline_pages/android/prefetch_background_task_scheduler_android.cc",
+ "offline_pages/android/prefetch_configuration_impl_android.cc",
"offline_pages/android/prefetched_pages_notifier_android.cc",
"offline_pages/android/request_coordinator_factory.cc",
]
@@ -4066,7 +4166,16 @@ jumbo_split_static_library("browser") {
}
if (enable_rlz) {
- deps += [ ":rlz" ]
+ sources += [
+ "rlz/chrome_rlz_tracker_delegate.cc",
+ "rlz/chrome_rlz_tracker_delegate.h",
+ ]
+
+ public_deps += [
+ "//components/google/core/browser",
+ "//components/rlz",
+ "//rlz:rlz_lib",
+ ]
}
if (enable_service_discovery) {
@@ -4115,8 +4224,8 @@ jumbo_split_static_library("browser") {
"printing/cloud_print/privet_notifications.h",
"printing/cloud_print/privet_notifications_factory.cc",
"printing/cloud_print/privet_notifications_factory.h",
- "printing/cloud_print/privet_url_fetcher.cc",
- "printing/cloud_print/privet_url_fetcher.h",
+ "printing/cloud_print/privet_url_loader.cc",
+ "printing/cloud_print/privet_url_loader.h",
]
}
@@ -4176,10 +4285,17 @@ jumbo_split_static_library("browser") {
}
}
- if (enable_simple_browser_service) {
+ if (enable_simple_browser_service_out_of_process) {
deps += [ "//services/content/simple_browser/public/mojom" ]
}
+ if (enable_simple_browser_service_in_process) {
+ deps += [
+ "//services/content/simple_browser",
+ "//services/content/simple_browser/public/mojom",
+ ]
+ }
+
if (enable_supervised_users) {
sources += [
"content_settings/content_settings_supervised_provider.cc",
@@ -4271,6 +4387,10 @@ jumbo_split_static_library("browser") {
deps += [ "//chrome/browser/vr:vr_common" ]
}
+ if (enable_isolated_xr_service) {
+ deps += [ "//device/vr/public/mojom" ]
+ }
+
if (enable_wayland_server) {
deps += [
"//components/exo",
@@ -4329,16 +4449,20 @@ jumbo_split_static_library("browser") {
if (enable_feed_in_chrome) {
sources += [
+ "android/feed/feed_content_bridge.cc",
+ "android/feed/feed_content_bridge.h",
"android/feed/feed_host_service_factory.cc",
"android/feed/feed_host_service_factory.h",
"android/feed/feed_image_loader_bridge.cc",
"android/feed/feed_image_loader_bridge.h",
+ "android/feed/feed_journal_bridge.cc",
+ "android/feed/feed_journal_bridge.h",
"android/feed/feed_network_bridge.cc",
"android/feed/feed_network_bridge.h",
"android/feed/feed_scheduler_bridge.cc",
"android/feed/feed_scheduler_bridge.h",
]
- deps += [ "//components/feed/core:feed_core" ]
+ deps += [ "//components/feed/content:feed_content" ]
}
}
@@ -4378,6 +4502,7 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/autofill/PersonalDataManager.java",
"../android/java/src/org/chromium/chrome/browser/autofill/PhoneNumberUtil.java",
"../android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/PasswordAccessoryBridge.java",
+ "../android/java/src/org/chromium/chrome/browser/autofill_assistant/AssistantUiController.java",
"../android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java",
"../android/java/src/org/chromium/chrome/browser/banners/AppBannerUiDelegateAndroid.java",
"../android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java",
@@ -4407,10 +4532,12 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsBridge.java",
"../android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchContext.java",
"../android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java",
+ "../android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchPreferenceHelper.java",
"../android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRankerLoggerImpl.java",
"../android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java",
"../android/java/src/org/chromium/chrome/browser/contextualsearch/CtrSuppression.java",
"../android/java/src/org/chromium/chrome/browser/cookies/CookiesFetcher.java",
+ "../android/java/src/org/chromium/chrome/browser/crash/CrashKeys.java",
"../android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadService.java",
"../android/java/src/org/chromium/chrome/browser/crash/PureJavaExceptionHandler.java",
"../android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java",
@@ -4426,6 +4553,7 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/download/DownloadLocationDialogBridge.java",
"../android/java/src/org/chromium/chrome/browser/download/DownloadManagerService.java",
"../android/java/src/org/chromium/chrome/browser/download/DownloadMediaParserBridge.java",
+ "../android/java/src/org/chromium/chrome/browser/download/DownloadUtils.java",
"../android/java/src/org/chromium/chrome/browser/download/items/OfflineContentAggregatorFactory.java",
"../android/java/src/org/chromium/chrome/browser/download/service/DownloadBackgroundTask.java",
"../android/java/src/org/chromium/chrome/browser/download/service/DownloadTaskScheduler.java",
@@ -4459,6 +4587,7 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/infobar/InstantAppsInfoBar.java",
"../android/java/src/org/chromium/chrome/browser/infobar/InstantAppsInfoBarDelegate.java",
"../android/java/src/org/chromium/chrome/browser/infobar/NearOomInfoBar.java",
+ "../android/java/src/org/chromium/chrome/browser/infobar/NearOomReductionInfoBar.java",
"../android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java",
"../android/java/src/org/chromium/chrome/browser/infobar/PermissionUpdateInfoBarDelegate.java",
"../android/java/src/org/chromium/chrome/browser/infobar/PreviewsInfoBar.java",
@@ -4479,7 +4608,7 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerBridge.java",
"../android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouter.java",
"../android/java/src/org/chromium/chrome/browser/media/router/ChromeMediaRouterDialogController.java",
- "../android/java/src/org/chromium/chrome/browser/media/router/MediaControllerBridge.java",
+ "../android/java/src/org/chromium/chrome/browser/media/router/FlingingControllerBridge.java",
"../android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java",
"../android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java",
"../android/java/src/org/chromium/chrome/browser/metrics/UmaSessionStats.java",
@@ -4490,6 +4619,7 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/notifications/ActionInfo.java",
"../android/java/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridge.java",
"../android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java",
+ "../android/java/src/org/chromium/chrome/browser/notifications/NotificationSystemStatusUtil.java",
"../android/java/src/org/chromium/chrome/browser/ntp/ContentSuggestionsNotifier.java",
"../android/java/src/org/chromium/chrome/browser/ntp/ForeignSessionHelper.java",
"../android/java/src/org/chromium/chrome/browser/ntp/LogoBridge.java",
@@ -4508,12 +4638,14 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/OfflineNotificationBackgroundTask.java",
"../android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTask.java",
"../android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchBackgroundTaskScheduler.java",
+ "../android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchConfiguration.java",
"../android/java/src/org/chromium/chrome/browser/offlinepages/prefetch/PrefetchedPagesNotifier.java",
"../android/java/src/org/chromium/chrome/browser/omnibox/AnswersImage.java",
"../android/java/src/org/chromium/chrome/browser/omnibox/AutocompleteController.java",
"../android/java/src/org/chromium/chrome/browser/omnibox/OmniboxPrerender.java",
"../android/java/src/org/chromium/chrome/browser/omnibox/OmniboxUrlEmphasizer.java",
"../android/java/src/org/chromium/chrome/browser/omnibox/OmniboxViewUtil.java",
+ "../android/java/src/org/chromium/chrome/browser/omnibox/QueryInOmnibox.java",
"../android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java",
"../android/java/src/org/chromium/chrome/browser/page_info/CertificateChainHelper.java",
"../android/java/src/org/chromium/chrome/browser/page_info/CertificateViewer.java",
@@ -4544,6 +4676,7 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/preferences/privacy/BrowsingDataCounterBridge.java",
"../android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java",
"../android/java/src/org/chromium/chrome/browser/prerender/ExternalPrerenderHandler.java",
+ "../android/java/src/org/chromium/chrome/browser/previews/PreviewsAndroidBridge.java",
"../android/java/src/org/chromium/chrome/browser/profiles/Profile.java",
"../android/java/src/org/chromium/chrome/browser/profiles/ProfileDownloader.java",
"../android/java/src/org/chromium/chrome/browser/profiles/ProfileManagerUtils.java",
@@ -4561,6 +4694,7 @@ if (is_android) {
"../android/java/src/org/chromium/chrome/browser/signin/SigninInvestigator.java",
"../android/java/src/org/chromium/chrome/browser/signin/SigninManager.java",
"../android/java/src/org/chromium/chrome/browser/signin/SigninPromoUtil.java",
+ "../android/java/src/org/chromium/chrome/browser/signin/UnifiedConsentServiceBridge.java",
"../android/java/src/org/chromium/chrome/browser/snackbar/smartlockautosignin/AutoSigninSnackbarController.java",
"../android/java/src/org/chromium/chrome/browser/ssl/CaptivePortalHelper.java",
"../android/java/src/org/chromium/chrome/browser/ssl/SecurityStateModel.java",
@@ -4596,7 +4730,9 @@ if (is_android) {
if (enable_feed_in_chrome) {
sources += [
+ "../android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedContentBridge.java",
"../android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedImageLoaderBridge.java",
+ "../android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedJournalBridge.java",
"../android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNetworkBridge.java",
"../android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedSchedulerBridge.java",
]
@@ -4805,6 +4941,8 @@ static_library("test_support") {
"history/history_test_utils.h",
"media/webrtc/fake_desktop_media_list.cc",
"media/webrtc/fake_desktop_media_list.h",
+ "media/webrtc/fake_desktop_media_picker_factory.cc",
+ "media/webrtc/fake_desktop_media_picker_factory.h",
"net/dns_probe_test_util.cc",
"net/dns_probe_test_util.h",
"net/url_request_mock_util.cc",
@@ -5114,19 +5252,3 @@ static_library("test_support_ui") {
]
}
}
-
-if (enable_rlz_support) {
- static_library("rlz") {
- sources = [
- "rlz/chrome_rlz_tracker_delegate.cc",
- "rlz/chrome_rlz_tracker_delegate.h",
- ]
- public_deps = [
- "//components/google/core/browser",
- "//components/omnibox/browser",
- "//components/rlz",
- "//components/search_engines",
- "//rlz:rlz_lib",
- ]
- }
-}
diff --git a/chromium/chrome/browser/accessibility/DEPS b/chromium/chrome/browser/accessibility/DEPS
new file mode 100644
index 00000000000..cdc33833563
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/DEPS
@@ -0,0 +1,7 @@
+specific_include_rules = {
+ "accessibility_extension_api\.cc": [
+ # TODO(mash): Replace with mojo API. http://crbug.com/594887
+ "+ash/accessibility/accessibility_focus_ring_controller.h",
+ "+ash/shell.h",
+ ],
+}
diff --git a/chromium/chrome/browser/accessibility/OWNERS b/chromium/chrome/browser/accessibility/OWNERS
new file mode 100644
index 00000000000..2c85844e32c
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/OWNERS
@@ -0,0 +1,4 @@
+file://ui/accessibility/OWNERS
+
+# TEAM: chromium-accessibility@chromium.org
+# COMPONENT: UI>Accessibility
diff --git a/chromium/chrome/browser/accessibility/accessibility_extension_api.cc b/chromium/chrome/browser/accessibility/accessibility_extension_api.cc
new file mode 100644
index 00000000000..2ffd012d95a
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/accessibility_extension_api.cc
@@ -0,0 +1,306 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/accessibility/accessibility_extension_api.h"
+
+#include <stddef.h>
+#include <memory>
+#include <set>
+#include <vector>
+
+#include "base/json/json_writer.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/values.h"
+#include "build/build_config.h"
+#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
+#include "chrome/browser/extensions/chrome_extension_function_details.h"
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_tab_util.h"
+#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/extensions/api/accessibility_private.h"
+#include "chrome/common/extensions/extension_constants.h"
+#include "components/infobars/core/confirm_infobar_delegate.h"
+#include "components/infobars/core/infobar.h"
+#include "content/public/browser/browser_accessibility_state.h"
+#include "content/public/common/service_manager_connection.h"
+#include "extensions/browser/event_router.h"
+#include "extensions/browser/extension_system.h"
+#include "extensions/browser/lazy_background_task_queue.h"
+#include "extensions/common/error_utils.h"
+#include "extensions/common/image_util.h"
+#include "extensions/common/manifest_handlers/background_info.h"
+#include "services/service_manager/public/cpp/connector.h"
+#include "ui/events/keycodes/keyboard_codes.h"
+
+#if defined(OS_CHROMEOS)
+#include "ash/public/interfaces/accessibility_focus_ring_controller.mojom.h"
+#include "ash/public/interfaces/constants.mojom.h"
+#include "ash/public/interfaces/event_rewriter_controller.mojom.h"
+#include "ash/shell.h"
+#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
+#include "chrome/browser/chromeos/arc/accessibility/arc_accessibility_helper_bridge.h"
+#include "ui/aura/window_tree_host.h"
+#include "ui/base/ui_base_features.h"
+#include "ui/events/event_sink.h"
+#endif
+
+namespace accessibility_private = extensions::api::accessibility_private;
+
+namespace {
+
+const char kErrorNotSupported[] = "This API is not supported on this platform.";
+
+} // namespace
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateSetNativeAccessibilityEnabledFunction::Run() {
+ bool enabled = false;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled));
+ if (enabled) {
+ content::BrowserAccessibilityState::GetInstance()->
+ EnableAccessibility();
+ } else {
+ content::BrowserAccessibilityState::GetInstance()->
+ DisableAccessibility();
+ }
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateSetFocusRingFunction::Run() {
+#if defined(OS_CHROMEOS)
+
+ std::unique_ptr<extensions::api::accessibility_private::SetFocusRing::Params>
+ params(
+ extensions::api::accessibility_private::SetFocusRing::Params::Create(
+ *args_));
+ EXTENSION_FUNCTION_VALIDATE(params);
+
+ std::vector<gfx::Rect> rects;
+ for (const extensions::api::accessibility_private::ScreenRect& rect :
+ params->rects) {
+ rects.push_back(gfx::Rect(rect.left, rect.top, rect.width, rect.height));
+ }
+
+ auto* accessibility_manager = chromeos::AccessibilityManager::Get();
+ if (params->color) {
+ SkColor color;
+ if (!extensions::image_util::ParseHexColorString(*(params->color), &color))
+ return RespondNow(Error("Could not parse hex color"));
+ accessibility_manager->SetFocusRingColor(color, extension_id());
+ } else {
+ accessibility_manager->ResetFocusRingColor(extension_id());
+ }
+
+ // Move the visible focus ring to cover all of these rects.
+ accessibility_manager->SetFocusRing(
+ rects, ash::mojom::FocusRingBehavior::PERSIST_FOCUS_RING, extension_id());
+
+ // Also update the touch exploration controller so that synthesized
+ // touch events are anchored within the focused object.
+ if (!rects.empty()) {
+ chromeos::AccessibilityManager* manager =
+ chromeos::AccessibilityManager::Get();
+ manager->SetTouchAccessibilityAnchorPoint(rects[0].CenterPoint());
+ }
+
+ return RespondNow(NoArguments());
+#endif // defined(OS_CHROMEOS)
+
+ return RespondNow(Error(kErrorNotSupported));
+}
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateSetHighlightsFunction::Run() {
+#if defined(OS_CHROMEOS)
+ std::unique_ptr<extensions::api::accessibility_private::SetHighlights::Params>
+ params(
+ extensions::api::accessibility_private::SetHighlights::Params::Create(
+ *args_));
+ EXTENSION_FUNCTION_VALIDATE(params);
+
+ std::vector<gfx::Rect> rects;
+ for (const extensions::api::accessibility_private::ScreenRect& rect :
+ params->rects) {
+ rects.push_back(gfx::Rect(rect.left, rect.top, rect.width, rect.height));
+ }
+
+ SkColor color;
+ if (!extensions::image_util::ParseHexColorString(params->color, &color))
+ return RespondNow(Error("Could not parse hex color"));
+
+ // Set the highlights to cover all of these rects.
+ chromeos::AccessibilityManager::Get()->SetHighlights(rects, color);
+
+ return RespondNow(NoArguments());
+#endif // defined(OS_CHROMEOS)
+
+ return RespondNow(Error(kErrorNotSupported));
+}
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateSetKeyboardListenerFunction::Run() {
+ ChromeExtensionFunctionDetails details(this);
+ CHECK(extension());
+
+#if defined(OS_CHROMEOS)
+ bool enabled;
+ bool capture;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled));
+ EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &capture));
+
+ chromeos::AccessibilityManager* manager =
+ chromeos::AccessibilityManager::Get();
+
+ const std::string current_id = manager->keyboard_listener_extension_id();
+ if (!current_id.empty() && extension()->id() != current_id)
+ return RespondNow(Error("Existing keyboard listener registered."));
+
+ manager->SetKeyboardListenerExtensionId(
+ enabled ? extension()->id() : std::string(), details.GetProfile());
+
+ ash::mojom::EventRewriterControllerPtr event_rewriter_controller_ptr;
+ content::ServiceManagerConnection* connection =
+ content::ServiceManagerConnection::GetForProcess();
+ connection->GetConnector()->BindInterface(ash::mojom::kServiceName,
+ &event_rewriter_controller_ptr);
+ event_rewriter_controller_ptr->CaptureAllKeysForSpokenFeedback(enabled &&
+ capture);
+ return RespondNow(NoArguments());
+#endif // defined OS_CHROMEOS
+
+ return RespondNow(Error(kErrorNotSupported));
+}
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateDarkenScreenFunction::Run() {
+#if defined(OS_CHROMEOS)
+ bool darken = false;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &darken));
+ chromeos::AccessibilityManager::Get()->SetDarkenScreen(darken);
+ return RespondNow(NoArguments());
+#else
+ return RespondNow(Error(kErrorNotSupported));
+#endif
+}
+
+#if defined(OS_CHROMEOS)
+ExtensionFunction::ResponseAction
+AccessibilityPrivateSetSwitchAccessKeysFunction::Run() {
+ std::unique_ptr<accessibility_private::SetSwitchAccessKeys::Params> params =
+ accessibility_private::SetSwitchAccessKeys::Params::Create(*args_);
+ EXTENSION_FUNCTION_VALIDATE(params);
+
+ // For now, only accept key code if it represents an alphanumeric character.
+ std::set<int> key_codes;
+ for (auto key_code : params->key_codes) {
+ EXTENSION_FUNCTION_VALIDATE(key_code >= ui::VKEY_0 &&
+ key_code <= ui::VKEY_Z);
+ key_codes.insert(key_code);
+ }
+
+ chromeos::AccessibilityManager* manager =
+ chromeos::AccessibilityManager::Get();
+
+ // AccessibilityManager can be null during system shut down, but no need to
+ // return error in this case, so just check that manager is not null.
+ if (manager)
+ manager->SetSwitchAccessKeys(key_codes);
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateSetNativeChromeVoxArcSupportForCurrentAppFunction::Run() {
+ std::unique_ptr<
+ accessibility_private::SetNativeChromeVoxArcSupportForCurrentApp::Params>
+ params = accessibility_private::
+ SetNativeChromeVoxArcSupportForCurrentApp::Params::Create(*args_);
+ EXTENSION_FUNCTION_VALIDATE(params);
+
+ ChromeExtensionFunctionDetails details(this);
+ arc::ArcAccessibilityHelperBridge* bridge =
+ arc::ArcAccessibilityHelperBridge::GetForBrowserContext(
+ details.GetProfile());
+ if (bridge) {
+ bool enabled;
+ EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled));
+ bridge->SetNativeChromeVoxArcSupport(enabled);
+ }
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateSendSyntheticKeyEventFunction::Run() {
+ // TODO(crbug.com/876043): Mash support.
+ if (features::IsUsingWindowService()) {
+ NOTIMPLEMENTED();
+ return RespondNow(NoArguments());
+ }
+
+ std::unique_ptr<accessibility_private::SendSyntheticKeyEvent::Params> params =
+ accessibility_private::SendSyntheticKeyEvent::Params::Create(*args_);
+ EXTENSION_FUNCTION_VALIDATE(params);
+ accessibility_private::SyntheticKeyboardEvent* key_data = &params->key_event;
+
+ int modifiers = 0;
+ if (key_data->modifiers.get()) {
+ if (key_data->modifiers->ctrl && *key_data->modifiers->ctrl)
+ modifiers |= ui::EF_CONTROL_DOWN;
+ if (key_data->modifiers->alt && *key_data->modifiers->alt)
+ modifiers |= ui::EF_ALT_DOWN;
+ if (key_data->modifiers->search && *key_data->modifiers->search)
+ modifiers |= ui::EF_COMMAND_DOWN;
+ if (key_data->modifiers->shift && *key_data->modifiers->shift)
+ modifiers |= ui::EF_SHIFT_DOWN;
+ }
+
+ ui::KeyEvent synthetic_key_event(
+ key_data->type ==
+ accessibility_private::SYNTHETIC_KEYBOARD_EVENT_TYPE_KEYUP
+ ? ui::ET_KEY_RELEASED
+ : ui::ET_KEY_PRESSED,
+ static_cast<ui::KeyboardCode>(key_data->key_code),
+ static_cast<ui::DomCode>(0), modifiers);
+
+ // Only keyboard events, so dispatching to primary window suffices.
+ ui::EventSink* sink =
+ ash::Shell::GetPrimaryRootWindow()->GetHost()->event_sink();
+ if (sink->OnEventFromSource(&synthetic_key_event).dispatcher_destroyed)
+ return RespondNow(Error("Unable to dispatch key "));
+
+ return RespondNow(NoArguments());
+}
+
+ExtensionFunction::ResponseAction
+AccessibilityPrivateOnSelectToSpeakStateChangedFunction::Run() {
+ std::unique_ptr<accessibility_private::OnSelectToSpeakStateChanged::Params>
+ params =
+ accessibility_private::OnSelectToSpeakStateChanged::Params::Create(
+ *args_);
+ EXTENSION_FUNCTION_VALIDATE(params);
+ accessibility_private::SelectToSpeakState params_state = params->state;
+ ash::mojom::SelectToSpeakState state;
+ switch (params_state) {
+ case accessibility_private::SelectToSpeakState::
+ SELECT_TO_SPEAK_STATE_SELECTING:
+ state = ash::mojom::SelectToSpeakState::kSelectToSpeakStateSelecting;
+ break;
+ case accessibility_private::SelectToSpeakState::
+ SELECT_TO_SPEAK_STATE_SPEAKING:
+ state = ash::mojom::SelectToSpeakState::kSelectToSpeakStateSpeaking;
+ break;
+ case accessibility_private::SelectToSpeakState::
+ SELECT_TO_SPEAK_STATE_INACTIVE:
+ case accessibility_private::SelectToSpeakState::SELECT_TO_SPEAK_STATE_NONE:
+ state = ash::mojom::SelectToSpeakState::kSelectToSpeakStateInactive;
+ }
+
+ auto* accessibility_manager = chromeos::AccessibilityManager::Get();
+ accessibility_manager->OnSelectToSpeakStateChanged(state);
+
+ return RespondNow(NoArguments());
+}
+
+#endif // defined (OS_CHROMEOS)
diff --git a/chromium/chrome/browser/accessibility/accessibility_extension_api.h b/chromium/chrome/browser/accessibility/accessibility_extension_api.h
new file mode 100644
index 00000000000..6726455d258
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/accessibility_extension_api.h
@@ -0,0 +1,102 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_
+#define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_
+
+#include <string>
+
+#include "base/compiler_specific.h"
+#include "base/memory/singleton.h"
+#include "base/values.h"
+#include "extensions/browser/extension_function.h"
+#include "ui/accessibility/ax_enums.mojom.h"
+
+// API function that enables or disables web content accessibility support.
+class AccessibilityPrivateSetNativeAccessibilityEnabledFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateSetNativeAccessibilityEnabledFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION(
+ "accessibilityPrivate.setNativeAccessibilityEnabled",
+ ACCESSIBILITY_PRIVATE_SETNATIVEACCESSIBILITYENABLED)
+};
+
+// API function that sets the location of the accessibility focus ring.
+class AccessibilityPrivateSetFocusRingFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateSetFocusRingFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.setFocusRing",
+ ACCESSIBILITY_PRIVATE_SETFOCUSRING)
+};
+
+// API function that sets the location of the accessibility highlights.
+class AccessibilityPrivateSetHighlightsFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateSetHighlightsFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.setHighlights",
+ ACCESSIBILITY_PRIVATE_SETHIGHLIGHTS)
+};
+
+// API function that sets keyboard capture mode.
+class AccessibilityPrivateSetKeyboardListenerFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateSetKeyboardListenerFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.setKeyboardListener",
+ ACCESSIBILITY_PRIVATE_SETKEYBOARDLISTENER)
+};
+
+// API function that darkens or undarkens the screen.
+class AccessibilityPrivateDarkenScreenFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateDarkenScreenFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.darkenScreen",
+ ACCESSIBILITY_PRIVATE_DARKENSCREEN)
+};
+
+// API function that sets the keys to be captured by Switch Access.
+#if defined(OS_CHROMEOS)
+class AccessibilityPrivateSetSwitchAccessKeysFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateSetSwitchAccessKeysFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.setSwitchAccessKeys",
+ ACCESSIBILITY_PRIVATE_SETSWITCHACCESSKEYS)
+};
+
+// API function that sets native ChromeVox ARC support.
+class AccessibilityPrivateSetNativeChromeVoxArcSupportForCurrentAppFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateSetNativeChromeVoxArcSupportForCurrentAppFunction()
+ override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION(
+ "accessibilityPrivate.setNativeChromeVoxArcSupportForCurrentApp",
+ ACCESSIBILITY_PRIVATE_SETNATIVECHROMEVOXARCSUPPORTFORCURRENTAPP)
+};
+
+// API function that injects key events.
+class AccessibilityPrivateSendSyntheticKeyEventFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateSendSyntheticKeyEventFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.sendSyntheticKeyEvent",
+ ACCESSIBILITY_PRIVATE_SENDSYNTHETICKEYEVENT)
+};
+
+// API function that is called when the Select-to-Speak extension state changes.
+class AccessibilityPrivateOnSelectToSpeakStateChangedFunction
+ : public UIThreadExtensionFunction {
+ ~AccessibilityPrivateOnSelectToSpeakStateChangedFunction() override {}
+ ResponseAction Run() override;
+ DECLARE_EXTENSION_FUNCTION("accessibilityPrivate.onSelectToSpeakStateChanged",
+ ACCESSIBILITY_PRIVATE_ONSELECTTOSPEAKSTATECHANGED)
+};
+#endif // defined (OS_CHROMEOS)
+
+#endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_
diff --git a/chromium/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc b/chromium/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc
new file mode 100644
index 00000000000..35233a3acad
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/accessibility_extension_api_browsertest.cc
@@ -0,0 +1,25 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "ui/base/ui_base_features.h"
+
+namespace extensions {
+
+using AccessibilityPrivateApiTest = ExtensionApiTest;
+
+#if defined(OS_CHROMEOS)
+IN_PROC_BROWSER_TEST_F(AccessibilityPrivateApiTest, SendSyntheticKeyEvent) {
+ // TODO(crbug.com/876043): Mash support.
+ if (features::IsUsingWindowService())
+ return;
+
+ ASSERT_TRUE(RunExtensionSubtest("accessibility_private/",
+ "send_synthetic_key_event.html"))
+ << message_;
+}
+#endif // defined (OS_CHROMEOS)
+
+} // namespace extensions
diff --git a/chromium/chrome/browser/accessibility/accessibility_permission_context.cc b/chromium/chrome/browser/accessibility/accessibility_permission_context.cc
new file mode 100644
index 00000000000..11b51939804
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/accessibility_permission_context.cc
@@ -0,0 +1,17 @@
+// 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.
+
+#include "chrome/browser/accessibility/accessibility_permission_context.h"
+
+AccessibilityPermissionContext::AccessibilityPermissionContext(Profile* profile)
+ : PermissionContextBase(
+ profile,
+ CONTENT_SETTINGS_TYPE_ACCESSIBILITY_EVENTS,
+ blink::mojom::FeaturePolicyFeature::kAccessibilityEvents) {}
+
+AccessibilityPermissionContext::~AccessibilityPermissionContext() = default;
+
+bool AccessibilityPermissionContext::IsRestrictedToSecureOrigins() const {
+ return false;
+}
diff --git a/chromium/chrome/browser/accessibility/accessibility_permission_context.h b/chromium/chrome/browser/accessibility/accessibility_permission_context.h
new file mode 100644
index 00000000000..c22e5bd6a57
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/accessibility_permission_context.h
@@ -0,0 +1,23 @@
+// 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 CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_PERMISSION_CONTEXT_H_
+#define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_PERMISSION_CONTEXT_H_
+
+#include "base/macros.h"
+#include "chrome/browser/permissions/permission_context_base.h"
+
+class AccessibilityPermissionContext : public PermissionContextBase {
+ public:
+ explicit AccessibilityPermissionContext(Profile* profile);
+ ~AccessibilityPermissionContext() override;
+
+ private:
+ // PermissionContextBase:
+ bool IsRestrictedToSecureOrigins() const override;
+
+ DISALLOW_COPY_AND_ASSIGN(AccessibilityPermissionContext);
+};
+
+#endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_PERMISSION_CONTEXT_H_
diff --git a/chromium/chrome/browser/accessibility/accessibility_ui.cc b/chromium/chrome/browser/accessibility/accessibility_ui.cc
new file mode 100644
index 00000000000..4b5b4b94106
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/accessibility_ui.cc
@@ -0,0 +1,419 @@
+// 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.
+
+#include "chrome/browser/accessibility/accessibility_ui.h"
+
+#include <memory>
+#include <utility>
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/command_line.h"
+#include "base/json/json_writer.h"
+#include "base/strings/string_number_conversions.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/values.h"
+#include "build/build_config.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/browser_window.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/common/webui_url_constants.h"
+#include "chrome/grit/browser_resources.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+#include "components/prefs/pref_service.h"
+#include "content/public/browser/browser_accessibility_state.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/favicon_status.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host.h"
+#include "content/public/browser/render_widget_host_iterator.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "net/base/escape.h"
+#include "ui/accessibility/platform/ax_platform_node.h"
+#include "ui/accessibility/platform/ax_platform_node_delegate.h"
+#include "ui/base/webui/web_ui_util.h"
+
+static const char kTargetsDataFile[] = "targets-data.json";
+
+static const char kProcessIdField[] = "processId";
+static const char kRouteIdField[] = "routeId";
+static const char kUrlField[] = "url";
+static const char kNameField[] = "name";
+static const char kFaviconUrlField[] = "favicon_url";
+static const char kPidField[] = "pid";
+static const char kAccessibilityModeField[] = "a11y_mode";
+
+// Global flags
+static const char kInternal[] = "internal";
+static const char kNative[] = "native";
+static const char kWeb[] = "web";
+static const char kText[] = "text";
+static const char kScreenReader[] = "screenreader";
+static const char kHTML[] = "html";
+
+// Possible global flag values
+static const char kOff[] = "off";
+static const char kOn[] = "on";
+static const char kDisabled[] = "disabled";
+
+namespace {
+
+std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
+ const GURL& url,
+ const std::string& name,
+ const GURL& favicon_url,
+ int process_id,
+ int route_id,
+ ui::AXMode accessibility_mode,
+ base::ProcessHandle handle = base::kNullProcessHandle) {
+ std::unique_ptr<base::DictionaryValue> target_data(
+ new base::DictionaryValue());
+ target_data->SetInteger(kProcessIdField, process_id);
+ target_data->SetInteger(kRouteIdField, route_id);
+ target_data->SetString(kUrlField, url.spec());
+ target_data->SetString(kNameField, net::EscapeForHTML(name));
+ target_data->SetInteger(kPidField, base::GetProcId(handle));
+ target_data->SetString(kFaviconUrlField, favicon_url.spec());
+ target_data->SetInteger(kAccessibilityModeField, accessibility_mode.mode());
+ return target_data;
+}
+
+std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
+ content::RenderViewHost* rvh) {
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderViewHost(rvh);
+ ui::AXMode accessibility_mode;
+
+ std::string title;
+ GURL url;
+ GURL favicon_url;
+ if (web_contents) {
+ // TODO(nasko): Fix the following code to use a consistent set of data
+ // across the URL, title, and favicon.
+ url = web_contents->GetURL();
+ title = base::UTF16ToUTF8(web_contents->GetTitle());
+ content::NavigationController& controller = web_contents->GetController();
+ content::NavigationEntry* entry = controller.GetVisibleEntry();
+ if (entry != nullptr && entry->GetURL().is_valid()) {
+ gfx::Image favicon_image = entry->GetFavicon().image;
+ if (!favicon_image.IsEmpty()) {
+ const SkBitmap* favicon_bitmap = favicon_image.ToSkBitmap();
+ favicon_url = GURL(webui::GetBitmapDataUrl(*favicon_bitmap));
+ }
+ }
+ accessibility_mode = web_contents->GetAccessibilityMode();
+ }
+
+ return BuildTargetDescriptor(url, title, favicon_url,
+ rvh->GetProcess()->GetID(), rvh->GetRoutingID(),
+ accessibility_mode);
+}
+
+bool HandleAccessibilityRequestCallback(
+ content::BrowserContext* current_context,
+ const std::string& path,
+ const content::WebUIDataSource::GotDataCallback& callback) {
+ if (path != kTargetsDataFile)
+ return false;
+ std::unique_ptr<base::ListValue> rvh_list(new base::ListValue());
+
+ std::unique_ptr<content::RenderWidgetHostIterator> widgets(
+ content::RenderWidgetHost::GetRenderWidgetHosts());
+
+ while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
+ // Ignore processes that don't have a connection, such as crashed tabs.
+ if (!widget->GetProcess()->IsInitializedAndNotDead())
+ continue;
+ content::RenderViewHost* rvh = content::RenderViewHost::From(widget);
+ if (!rvh)
+ continue;
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderViewHost(rvh);
+ content::WebContentsDelegate* delegate = web_contents->GetDelegate();
+ if (!delegate)
+ continue;
+ // Ignore views that are never visible, like background pages.
+ if (delegate->IsNeverVisible(web_contents))
+ continue;
+ content::BrowserContext* context = rvh->GetProcess()->GetBrowserContext();
+ if (context != current_context)
+ continue;
+
+ rvh_list->Append(BuildTargetDescriptor(rvh));
+ }
+
+ base::DictionaryValue data;
+ data.Set("list", std::move(rvh_list));
+ ui::AXMode mode =
+ content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
+ bool disabled = !content::BrowserAccessibilityState::GetInstance()
+ ->IsRendererAccessibilityEnabled();
+ bool native = mode.has_mode(ui::AXMode::kNativeAPIs);
+ bool web = mode.has_mode(ui::AXMode::kWebContents);
+ bool text = mode.has_mode(ui::AXMode::kInlineTextBoxes);
+ bool screenreader = mode.has_mode(ui::AXMode::kScreenReader);
+ bool html = mode.has_mode(ui::AXMode::kHTML);
+
+ // The "native" and "web" flags are disabled if
+ // --disable-renderer-accessibility is set.
+ data.SetString(kNative, disabled ? kDisabled : (native ? kOn : kOff));
+ data.SetString(kWeb, disabled ? kDisabled : (web ? kOn : kOff));
+
+ // The "text", "screenreader", and "html" flags are only meaningful if
+ // "web" is enabled.
+ data.SetString(kText, web ? (text ? kOn : kOff) : kDisabled);
+ data.SetString(kScreenReader, web ? (screenreader ? kOn : kOff) : kDisabled);
+ data.SetString(kHTML, web ? (html ? kOn : kOff) : kDisabled);
+
+ PrefService* pref = Profile::FromBrowserContext(current_context)->GetPrefs();
+ bool show_internal = pref->GetBoolean(prefs::kShowInternalAccessibilityTree);
+ data.SetString(kInternal, show_internal ? kOn : kOff);
+
+ std::string json_string;
+ base::JSONWriter::Write(data, &json_string);
+
+ callback.Run(base::RefCountedString::TakeString(&json_string));
+ return true;
+}
+
+std::string RecursiveDumpAXPlatformNodeAsString(ui::AXPlatformNode* node,
+ int indent) {
+ if (!node)
+ return "";
+ std::string str(2 * indent, '+');
+ str += node->GetDelegate()->GetData().ToString() + "\n";
+ for (int i = 0; i < node->GetDelegate()->GetChildCount(); i++) {
+ gfx::NativeViewAccessible child = node->GetDelegate()->ChildAtIndex(i);
+ ui::AXPlatformNode* child_node =
+ ui::AXPlatformNode::FromNativeViewAccessible(child);
+ str += RecursiveDumpAXPlatformNodeAsString(child_node, indent + 1);
+ }
+ return str;
+}
+
+} // namespace
+
+AccessibilityUI::AccessibilityUI(content::WebUI* web_ui)
+ : WebUIController(web_ui) {
+ // Set up the chrome://accessibility source.
+ content::WebUIDataSource* html_source =
+ content::WebUIDataSource::Create(chrome::kChromeUIAccessibilityHost);
+
+ // Add required resources.
+ html_source->SetJsonPath("strings.js");
+ html_source->AddResourcePath("accessibility.css", IDR_ACCESSIBILITY_CSS);
+ html_source->AddResourcePath("accessibility.js", IDR_ACCESSIBILITY_JS);
+ html_source->SetDefaultResource(IDR_ACCESSIBILITY_HTML);
+ html_source->SetRequestFilter(
+ base::Bind(&HandleAccessibilityRequestCallback,
+ web_ui->GetWebContents()->GetBrowserContext()));
+
+ html_source->UseGzip({kTargetsDataFile});
+
+ content::BrowserContext* browser_context =
+ web_ui->GetWebContents()->GetBrowserContext();
+ content::WebUIDataSource::Add(browser_context, html_source);
+
+ web_ui->AddMessageHandler(std::make_unique<AccessibilityUIMessageHandler>());
+}
+
+AccessibilityUI::~AccessibilityUI() {}
+
+AccessibilityUIMessageHandler::AccessibilityUIMessageHandler() {}
+
+AccessibilityUIMessageHandler::~AccessibilityUIMessageHandler() {}
+
+void AccessibilityUIMessageHandler::RegisterMessages() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ web_ui()->RegisterMessageCallback(
+ "toggleAccessibility",
+ base::BindRepeating(&AccessibilityUIMessageHandler::ToggleAccessibility,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setGlobalFlag",
+ base::BindRepeating(&AccessibilityUIMessageHandler::SetGlobalFlag,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "requestWebContentsTree",
+ base::BindRepeating(
+ &AccessibilityUIMessageHandler::RequestWebContentsTree,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "requestNativeUITree",
+ base::BindRepeating(&AccessibilityUIMessageHandler::RequestNativeUITree,
+ base::Unretained(this)));
+}
+
+void AccessibilityUIMessageHandler::ToggleAccessibility(
+ const base::ListValue* args) {
+ std::string process_id_str;
+ std::string route_id_str;
+ int process_id;
+ int route_id;
+ int mode;
+ CHECK_EQ(3U, args->GetSize());
+ CHECK(args->GetString(0, &process_id_str));
+ CHECK(args->GetString(1, &route_id_str));
+ // TODO(695247): We should pass each ax flag seperately
+ CHECK(args->GetInteger(2, &mode));
+ CHECK(base::StringToInt(process_id_str, &process_id));
+ CHECK(base::StringToInt(route_id_str, &route_id));
+
+ AllowJavascript();
+ content::RenderViewHost* rvh =
+ content::RenderViewHost::FromID(process_id, route_id);
+ if (!rvh)
+ return;
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderViewHost(rvh);
+ ui::AXMode current_mode = web_contents->GetAccessibilityMode();
+
+ if (mode & ui::AXMode::kNativeAPIs)
+ current_mode.set_mode(ui::AXMode::kNativeAPIs, true);
+
+ if (mode & ui::AXMode::kWebContents)
+ current_mode.set_mode(ui::AXMode::kWebContents, true);
+
+ if (mode & ui::AXMode::kInlineTextBoxes)
+ current_mode.set_mode(ui::AXMode::kInlineTextBoxes, true);
+
+ if (mode & ui::AXMode::kScreenReader)
+ current_mode.set_mode(ui::AXMode::kScreenReader, true);
+
+ if (mode & ui::AXMode::kHTML)
+ current_mode.set_mode(ui::AXMode::kHTML, true);
+
+ web_contents->SetAccessibilityMode(current_mode);
+}
+
+void AccessibilityUIMessageHandler::SetGlobalFlag(const base::ListValue* args) {
+ std::string flag_name_str;
+ bool enabled;
+ CHECK_EQ(2U, args->GetSize());
+ CHECK(args->GetString(0, &flag_name_str));
+ CHECK(args->GetBoolean(1, &enabled));
+
+ AllowJavascript();
+ if (flag_name_str == kInternal) {
+ PrefService* pref = Profile::FromWebUI(web_ui())->GetPrefs();
+ pref->SetBoolean(prefs::kShowInternalAccessibilityTree, enabled);
+ return;
+ }
+
+ ui::AXMode new_mode;
+ if (flag_name_str == kNative) {
+ new_mode = ui::AXMode::kNativeAPIs;
+ } else if (flag_name_str == kWeb) {
+ new_mode = ui::AXMode::kWebContents;
+ } else if (flag_name_str == kText) {
+ new_mode = ui::AXMode::kInlineTextBoxes;
+ } else if (flag_name_str == kScreenReader) {
+ new_mode = ui::AXMode::kScreenReader;
+ } else if (flag_name_str == kHTML) {
+ new_mode = ui::AXMode::kHTML;
+ } else {
+ NOTREACHED();
+ return;
+ }
+
+ // It doesn't make sense to enable one of the flags that depends on
+ // web contents without enabling web contents accessibility too.
+ if (enabled && (new_mode.has_mode(ui::AXMode::kInlineTextBoxes) ||
+ new_mode.has_mode(ui::AXMode::kScreenReader) ||
+ new_mode.has_mode(ui::AXMode::kHTML))) {
+ new_mode.set_mode(ui::AXMode::kWebContents, true);
+ }
+
+ // Similarly if you disable web accessibility we should remove all
+ // flags that depend on it.
+ if (!enabled && new_mode.has_mode(ui::AXMode::kWebContents)) {
+ new_mode.set_mode(ui::AXMode::kInlineTextBoxes, true);
+ new_mode.set_mode(ui::AXMode::kScreenReader, true);
+ new_mode.set_mode(ui::AXMode::kHTML, true);
+ }
+
+ content::BrowserAccessibilityState* state =
+ content::BrowserAccessibilityState::GetInstance();
+ if (enabled)
+ state->AddAccessibilityModeFlags(new_mode);
+ else
+ state->RemoveAccessibilityModeFlags(new_mode);
+}
+
+void AccessibilityUIMessageHandler::RequestWebContentsTree(
+ const base::ListValue* args) {
+ std::string process_id_str;
+ std::string route_id_str;
+ int process_id;
+ int route_id;
+ CHECK_EQ(2U, args->GetSize());
+ CHECK(args->GetString(0, &process_id_str));
+ CHECK(args->GetString(1, &route_id_str));
+ CHECK(base::StringToInt(process_id_str, &process_id));
+ CHECK(base::StringToInt(route_id_str, &route_id));
+
+ AllowJavascript();
+ content::RenderViewHost* rvh =
+ content::RenderViewHost::FromID(process_id, route_id);
+ if (!rvh) {
+ std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
+ result->SetInteger(kProcessIdField, process_id);
+ result->SetInteger(kRouteIdField, route_id);
+ result->SetString("error", "Renderer no longer exists.");
+ CallJavascriptFunction("accessibility.showTree", *(result.get()));
+ return;
+ }
+
+ std::unique_ptr<base::DictionaryValue> result(BuildTargetDescriptor(rvh));
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderViewHost(rvh);
+ // No matter the state of the current web_contents, we want to force the mode
+ // because we are about to show the accessibility tree
+ web_contents->SetAccessibilityMode(
+ ui::AXMode(ui::AXMode::kNativeAPIs | ui::AXMode::kWebContents));
+
+ PrefService* pref = Profile::FromWebUI(web_ui())->GetPrefs();
+ bool internal = pref->GetBoolean(prefs::kShowInternalAccessibilityTree);
+ base::string16 accessibility_contents_utf16 =
+ web_contents->DumpAccessibilityTree(internal);
+ result->SetString("tree", base::UTF16ToUTF8(accessibility_contents_utf16));
+ CallJavascriptFunction("accessibility.showTree", *(result.get()));
+}
+
+void AccessibilityUIMessageHandler::RequestNativeUITree(
+ const base::ListValue* args) {
+ AllowJavascript();
+ base::Value browser_list(base::Value::Type::LIST);
+
+#if !defined(OS_ANDROID)
+ for (Browser* browser : *BrowserList::GetInstance()) {
+ base::Value browser_tree(base::Value::Type::DICTIONARY);
+ browser_tree.SetKey("id", base::Value(browser->session_id().id()));
+ browser_tree.SetKey(
+ "title", base::Value(browser->GetWindowTitleForCurrentTab(false)));
+
+ gfx::NativeWindow native_window = browser->window()->GetNativeWindow();
+ ui::AXPlatformNode* node =
+ ui::AXPlatformNode::FromNativeWindow(native_window);
+ browser_tree.SetKey(
+ "tree", base::Value(RecursiveDumpAXPlatformNodeAsString(node, 0)));
+
+ browser_list.GetList().push_back(std::move(browser_tree));
+ }
+#endif // !defined(OS_ANDROID)
+ CallJavascriptFunction("accessibility.showNativeUITree", browser_list);
+}
+
+// static
+void AccessibilityUIMessageHandler::RegisterProfilePrefs(
+ user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterBooleanPref(prefs::kShowInternalAccessibilityTree, false);
+}
diff --git a/chromium/chrome/browser/accessibility/accessibility_ui.h b/chromium/chrome/browser/accessibility/accessibility_ui.h
new file mode 100644
index 00000000000..8a2f32e1ef4
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/accessibility_ui.h
@@ -0,0 +1,45 @@
+// 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 CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_UI_H_
+#define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_UI_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_ui_controller.h"
+#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/browser/web_ui_message_handler.h"
+
+namespace base {
+class ListValue;
+} // namespace base
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+} // namespace user_prefs
+
+class AccessibilityUI : public content::WebUIController {
+ public:
+ explicit AccessibilityUI(content::WebUI* web_ui);
+ ~AccessibilityUI() override;
+};
+
+class AccessibilityUIMessageHandler : public content::WebUIMessageHandler {
+ public:
+ AccessibilityUIMessageHandler();
+ ~AccessibilityUIMessageHandler() override;
+
+ void RegisterMessages() override;
+
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
+ private:
+ void ToggleAccessibility(const base::ListValue* args);
+ void SetGlobalFlag(const base::ListValue* args);
+ void RequestWebContentsTree(const base::ListValue* args);
+ void RequestNativeUITree(const base::ListValue* args);
+
+ DISALLOW_COPY_AND_ASSIGN(AccessibilityUIMessageHandler);
+};
+
+#endif // CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_UI_H_
diff --git a/chromium/chrome/browser/accessibility/animation_policy_prefs.cc b/chromium/chrome/browser/accessibility/animation_policy_prefs.cc
new file mode 100644
index 00000000000..6974c40d520
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/animation_policy_prefs.cc
@@ -0,0 +1,17 @@
+// Copyright 2015 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/accessibility/animation_policy_prefs.h"
+
+#include "chrome/common/pref_names.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+
+const char kAnimationPolicyAllowed[] = "allowed";
+const char kAnimationPolicyOnce[] = "once";
+const char kAnimationPolicyNone[] = "none";
+
+void RegisterAnimationPolicyPrefs(user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterStringPref(prefs::kAnimationPolicy,
+ kAnimationPolicyAllowed);
+}
diff --git a/chromium/chrome/browser/accessibility/animation_policy_prefs.h b/chromium/chrome/browser/accessibility/animation_policy_prefs.h
new file mode 100644
index 00000000000..b7ef181ad27
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/animation_policy_prefs.h
@@ -0,0 +1,18 @@
+// Copyright 2015 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_ACCESSIBILITY_ANIMATION_POLICY_PREFS_H_
+#define CHROME_BROWSER_ACCESSIBILITY_ANIMATION_POLICY_PREFS_H_
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+extern const char kAnimationPolicyAllowed[];
+extern const char kAnimationPolicyOnce[];
+extern const char kAnimationPolicyNone[];
+
+void RegisterAnimationPolicyPrefs(user_prefs::PrefRegistrySyncable* registry);
+
+#endif // CHROME_BROWSER_ACCESSIBILITY_ANIMATION_POLICY_PREFS_H_
diff --git a/chromium/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc b/chromium/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc
new file mode 100644
index 00000000000..9aeb266eccd
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/browser_accessibility_state_browsertest.cc
@@ -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.
+
+#include "base/test/metrics/histogram_tester.h"
+#include "build/build_config.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "content/public/browser/browser_accessibility_state.h"
+
+namespace content {
+
+// Note: even though BrowserAccessibilityStateImpl is in content, this
+// test should be in Chrome because otherwise the Chrome-OS-specific
+// histograms won't get updated.
+class BrowserAccessibilityStateImplTest : public InProcessBrowserTest {
+};
+
+IN_PROC_BROWSER_TEST_F(BrowserAccessibilityStateImplTest, TestHistograms) {
+ base::HistogramTester histograms;
+
+ BrowserAccessibilityState::GetInstance()->UpdateHistogramsForTesting();
+ histograms.ExpectTotalCount("Accessibility.State", 1);
+#if defined(OS_WIN)
+ histograms.ExpectTotalCount("Accessibility.WinScreenReader", 1);
+#elif defined(OS_CHROMEOS)
+ histograms.ExpectTotalCount("Accessibility.CrosSpokenFeedback", 1);
+#endif
+}
+
+} // namespace content
diff --git a/chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc b/chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc
new file mode 100644
index 00000000000..d49feb689af
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc
@@ -0,0 +1,81 @@
+// 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 "chrome/browser/ssl/ssl_blocking_page.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "components/security_interstitials/core/controller_client.h"
+#include "content/public/browser/interstitial_page.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/test/browser_test_utils.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "net/test/embedded_test_server/request_handler_util.h"
+
+const base::FilePath::CharType kDocRoot[] =
+ FILE_PATH_LITERAL("chrome/test/data");
+
+class InterstitialAccessibilityBrowserTest : public InProcessBrowserTest {
+ public:
+ InterstitialAccessibilityBrowserTest()
+ : https_server_mismatched_(net::EmbeddedTestServer::TYPE_HTTPS) {
+ https_server_mismatched_.SetSSLConfig(
+ net::EmbeddedTestServer::CERT_MISMATCHED_NAME);
+ https_server_mismatched_.AddDefaultHandlers(base::FilePath(kDocRoot));
+ }
+
+ std::string GetNameOfFocusedNode(content::WebContents* web_contents) {
+ ui::AXNodeData focused_node_data =
+ content::GetFocusedAccessibilityNodeInfo(web_contents);
+ return focused_node_data.GetStringAttribute(
+ ax::mojom::StringAttribute::kName);
+ }
+
+ protected:
+ net::EmbeddedTestServer https_server_mismatched_;
+
+ void ProceedThroughInterstitial(content::WebContents* web_contents) {
+ content::InterstitialPage* interstitial_page =
+ web_contents->GetInterstitialPage();
+ ASSERT_TRUE(interstitial_page);
+ ASSERT_EQ(SSLBlockingPage::kTypeForTesting,
+ interstitial_page->GetDelegateForTesting()->GetTypeForTesting());
+ SSLBlockingPage* ssl_interstitial = static_cast<SSLBlockingPage*>(
+ interstitial_page->GetDelegateForTesting());
+ ssl_interstitial->CommandReceived(
+ base::IntToString(security_interstitials::CMD_PROCEED));
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(InterstitialAccessibilityBrowserTest,
+ TestSSLInterstitialAccessibility) {
+ ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
+
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ content::EnableAccessibilityForWebContents(web_contents);
+
+ ASSERT_TRUE(https_server_mismatched_.Start());
+
+ // Navigate to a page with an SSL error on it.
+ ui_test_utils::NavigateToURL(
+ browser(), https_server_mismatched_.GetURL("/ssl/blank_page.html"));
+
+ // Ensure that we got an interstitial page.
+ ASSERT_FALSE(web_contents->IsCrashed());
+ EXPECT_TRUE(web_contents->ShowingInterstitialPage());
+
+ // Now check from the perspective of accessibility - we should be focused
+ // on a page with title "Privacy error". Keep waiting on accessibility
+ // focus events until we get that page.
+ while (GetNameOfFocusedNode(web_contents) != "Privacy error")
+ content::WaitForAccessibilityFocusChange();
+
+ // Now proceed through the interstitial and ensure we get accessibility
+ // focus on the actual page.
+ ProceedThroughInterstitial(web_contents);
+ while (GetNameOfFocusedNode(web_contents) != "I am a blank page.")
+ content::WaitForAccessibilityFocusChange();
+}
diff --git a/chromium/chrome/browser/accessibility/invert_bubble_prefs.cc b/chromium/chrome/browser/accessibility/invert_bubble_prefs.cc
new file mode 100644
index 00000000000..44d90f0b8f1
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/invert_bubble_prefs.cc
@@ -0,0 +1,12 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/accessibility/invert_bubble_prefs.h"
+
+#include "chrome/common/pref_names.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+
+void RegisterInvertBubbleUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterBooleanPref(prefs::kInvertNotificationShown, false);
+}
diff --git a/chromium/chrome/browser/accessibility/invert_bubble_prefs.h b/chromium/chrome/browser/accessibility/invert_bubble_prefs.h
new file mode 100644
index 00000000000..0513cf16b99
--- /dev/null
+++ b/chromium/chrome/browser/accessibility/invert_bubble_prefs.h
@@ -0,0 +1,14 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ACCESSIBILITY_INVERT_BUBBLE_PREFS_H_
+#define CHROME_BROWSER_ACCESSIBILITY_INVERT_BUBBLE_PREFS_H_
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+void RegisterInvertBubbleUserPrefs(user_prefs::PrefRegistrySyncable* registry);
+
+#endif // CHROME_BROWSER_ACCESSIBILITY_INVERT_BUBBLE_PREFS_H_
diff --git a/chromium/chrome/browser/android/download/manifest.json b/chromium/chrome/browser/android/download/manifest.json
index d6af6c82aeb..4c79e62c585 100644
--- a/chromium/chrome/browser/android/download/manifest.json
+++ b/chromium/chrome/browser/android/download/manifest.json
@@ -3,12 +3,14 @@
{
"name": "download_manager",
"display_name": "Download Manager",
+ "options" : {
+ "instance_sharing" : "singleton"
+ },
"interface_provider_specs": {
"service_manager:connector": {
"provides": {},
"requires": {
- "network": [ "network_service"],
- "service_manager": [ "service_manager:singleton" ]
+ "network": [ "network_service"]
}
}
}
diff --git a/chromium/chrome/browser/android/metrics/BUILD.gn b/chromium/chrome/browser/android/metrics/BUILD.gn
index af1cf686e09..21800622d84 100644
--- a/chromium/chrome/browser/android/metrics/BUILD.gn
+++ b/chromium/chrome/browser/android/metrics/BUILD.gn
@@ -13,6 +13,8 @@ if (is_android) {
deps = [
"//chrome/browser:browser",
"//chrome/browser/android/metrics:jni_headers",
+ "//components/metrics_services_manager:metrics_services_manager",
+ "//components/ukm:ukm",
]
}
diff --git a/chromium/chrome/browser/android/vr/BUILD.gn b/chromium/chrome/browser/android/vr/BUILD.gn
index d2c2b2fe9dc..a5deea70f12 100644
--- a/chromium/chrome/browser/android/vr/BUILD.gn
+++ b/chromium/chrome/browser/android/vr/BUILD.gn
@@ -20,6 +20,8 @@ static_library("vr_android") {
"autocomplete_controller.cc",
"autocomplete_controller.h",
"gl_browser_interface.h",
+ "gvr_controller_delegate.cc",
+ "gvr_controller_delegate.h",
"gvr_keyboard_delegate.cc",
"gvr_keyboard_delegate.h",
"gvr_keyboard_shim.cc",
@@ -29,6 +31,9 @@ static_library("vr_android") {
"mailbox_to_surface_bridge.h",
"metrics_util_android.cc",
"metrics_util_android.h",
+ "register_jni.h",
+ "render_loop_factory.cc",
+ "render_loop_factory.h",
"scoped_gpu_trace.cc",
"scoped_gpu_trace.h",
"vr_controller.cc",
@@ -39,6 +44,7 @@ static_library("vr_android") {
"vr_gl_thread.h",
"vr_input_connection.cc",
"vr_input_connection.h",
+ "vr_module_provider.cc",
"vr_shell.cc",
"vr_shell.h",
"vr_shell_delegate.cc",
@@ -47,12 +53,16 @@ static_library("vr_android") {
"vr_shell_gl.h",
"vr_web_contents_observer.cc",
"vr_web_contents_observer.h",
+ "web_xr_presentation_state.cc",
+ "web_xr_presentation_state.h",
]
if (enable_arcore) {
sources += [
"arcore_device/ar_image_transport.cc",
"arcore_device/ar_image_transport.h",
+ "arcore_device/ar_renderer.cc",
+ "arcore_device/ar_renderer.h",
"arcore_device/arcore.h",
"arcore_device/arcore_device.cc",
"arcore_device/arcore_device.h",
@@ -77,16 +87,22 @@ static_library("vr_android") {
":vr_jni_headers",
"//base",
"//cc",
+ "//chrome/browser/ui:ui",
+ "//chrome/browser/vr:vr_base",
"//chrome/browser/vr:vr_common",
+ "//chrome/common:common",
+ "//chrome/common:constants",
"//components/omnibox/browser",
"//components/rappor",
+ "//components/search_engines:search_engines",
"//content/public/browser",
"//content/public/common",
"//device/gamepad",
"//device/vr",
+ "//device/vr/buildflags:buildflags",
"//services/device/public/mojom",
"//services/metrics/public/cpp:ukm_builders",
- "//services/ui/public/cpp/gpu",
+ "//services/ws/public/cpp/gpu",
"//third_party/gvr-android-sdk:gvr_shim",
"//ui/android",
"//ui/base",
@@ -115,14 +131,67 @@ static_library("vr_android") {
}
}
+android_library("java") {
+ java_files = [
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/AndroidUiGestureTarget.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/AndroidVSyncHelper.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/EmptySniffingVrViewContainer.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/keyboard/BuildConstants.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/keyboard/GvrKeyboardLoaderClient.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/keyboard/TextEditAction.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/keyboard/VrInputMethodManagerWrapper.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/NoopCanvas.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/OnDispatchTouchEventCallback.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrAlertDialog.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrCancelAnimationActivity.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrCompositorSurfaceManager.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrCoreInfo.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrCoreVersionChecker.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrDaydreamApi.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateImpl.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrDelegateProviderImpl.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrDialog.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrDialogManager.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrFeedbackStatus.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrFirstRunActivity.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrInputConnection.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrIntentUtils.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrModalPresenter.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrPopupWindow.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrShell.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrShellDelegate.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrToast.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrToastManager.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrUiWidgetFactory.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrViewContainer.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrWindowAndroid.java",
+ ]
+
+ classpath_deps = [
+ "//base:base_java",
+ "//chrome/android:chrome_java",
+ "//components/policy/android:policy_java",
+ "//content/public/android:content_java",
+ "//third_party/android_tools:android_arch_lifecycle_common_java",
+ "//third_party/android_tools:android_arch_lifecycle_runtime_java",
+ "//third_party/android_tools:android_support_annotations_java",
+ "//third_party/android_tools:android_support_v7_appcompat_java",
+ "//third_party/gvr-android-keyboard:kb_java",
+ "//third_party/gvr-android-sdk:gvr_common_java",
+ "//ui/android:ui_full_java",
+ "//ui/android:ui_utils_java",
+ ]
+}
+
generate_jni("vr_jni_headers") {
sources = [
"//chrome/android/java/src/org/chromium/chrome/browser/vr/AndroidUiGestureTarget.java",
"//chrome/android/java/src/org/chromium/chrome/browser/vr/AndroidVSyncHelper.java",
"//chrome/android/java/src/org/chromium/chrome/browser/vr/VrCoreInfo.java",
"//chrome/android/java/src/org/chromium/chrome/browser/vr/VrInputConnection.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrModuleProvider.java",
+ "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrShell.java",
"//chrome/android/java/src/org/chromium/chrome/browser/vr/VrShellDelegate.java",
- "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrShellImpl.java",
"//chrome/android/java/src/org/chromium/chrome/browser/vr/keyboard/GvrKeyboardLoaderClient.java",
"//chrome/android/java/src/org/chromium/chrome/browser/vr/keyboard/TextEditAction.java",
]
@@ -137,3 +206,11 @@ if (enable_arcore) {
jni_package = "vr"
}
}
+
+if (current_toolchain == default_toolchain) {
+ generate_jni_registration("jni_registration") {
+ target = ":java"
+ output = "$target_gen_dir/${target_name}.h"
+ namespace = "vr"
+ }
+}
diff --git a/chromium/chrome/browser/apps/BUILD.gn b/chromium/chrome/browser/apps/BUILD.gn
new file mode 100644
index 00000000000..52efd75a06e
--- /dev/null
+++ b/chromium/chrome/browser/apps/BUILD.gn
@@ -0,0 +1,21 @@
+# 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.
+
+import("//extensions/buildflags/buildflags.gni")
+
+# TODO(loyso): Remove this assertion. apps/ will be based off-extensions.
+assert(enable_extensions)
+
+source_set("apps") {
+ sources = [
+ "apps_launch.cc",
+ "apps_launch.h",
+ ]
+
+ deps = [
+ "//chrome/browser/apps/platform_apps",
+ ]
+
+ configs += [ "//build/config/compiler:wexit_time_destructors" ]
+}
diff --git a/chromium/chrome/browser/apps/app_shim/BUILD.gn b/chromium/chrome/browser/apps/app_shim/BUILD.gn
index f8a6d186878..82b974deadd 100644
--- a/chromium/chrome/browser/apps/app_shim/BUILD.gn
+++ b/chromium/chrome/browser/apps/app_shim/BUILD.gn
@@ -21,7 +21,18 @@ source_set("app_shim") {
]
deps = [
+ "//apps",
+ "//chrome/browser/apps/platform_apps",
+ "//chrome/browser/extensions",
+ "//chrome/browser/web_applications/components",
+ "//chrome/browser/web_applications/extensions",
+ "//chrome/common",
+ "//chrome/common:app_mode_app_support",
+ "//chrome/common:constants",
"//chrome/common:mojo_bindings",
+ "//chrome/common:non_code_constants",
+ "//components/crx_file",
+ "//components/version_info",
"//content/public/browser",
"//content/public/common",
"//extensions/browser",
diff --git a/chromium/chrome/browser/apps/foundation/app_service/BUILD.gn b/chromium/chrome/browser/apps/foundation/app_service/BUILD.gn
index 5b26c5b7c50..e3a3254d120 100644
--- a/chromium/chrome/browser/apps/foundation/app_service/BUILD.gn
+++ b/chromium/chrome/browser/apps/foundation/app_service/BUILD.gn
@@ -16,6 +16,7 @@ source_set("lib") {
deps = [
"//base",
+ "//components/pref_registry",
"//components/prefs",
"//mojo/public/cpp/bindings",
"//services/preferences/public/cpp",
diff --git a/chromium/chrome/browser/apps/platform_apps/BUILD.gn b/chromium/chrome/browser/apps/platform_apps/BUILD.gn
index 144aaa6e3c4..bc3c6e68588 100644
--- a/chromium/chrome/browser/apps/platform_apps/BUILD.gn
+++ b/chromium/chrome/browser/apps/platform_apps/BUILD.gn
@@ -14,12 +14,16 @@ source_set("platform_apps") {
"app_load_service.h",
"app_load_service_factory.cc",
"app_load_service_factory.h",
+ "app_termination_observer.cc",
+ "app_termination_observer.h",
"app_window_registry_util.cc",
"app_window_registry_util.h",
"browser_context_keyed_service_factories.cc",
"browser_context_keyed_service_factories.h",
"install_chrome_app.cc",
"install_chrome_app.h",
+ "platform_app_launch.cc",
+ "platform_app_launch.h",
"platform_app_navigation_redirector.cc",
"platform_app_navigation_redirector.h",
"shortcut_manager.cc",
@@ -38,6 +42,7 @@ source_set("platform_apps") {
"//chrome/app:command_ids",
"//chrome/browser/extensions",
"//chrome/browser/media/router/discovery",
+ "//chrome/browser/web_applications/extensions",
"//chrome/common",
"//components/crx_file",
"//components/keyed_service/content",
diff --git a/chromium/chrome/browser/browser_resources.grd b/chromium/chrome/browser/browser_resources.grd
index 5e8e3db0cd3..994e15e9ae8 100644
--- a/chromium/chrome/browser/browser_resources.grd
+++ b/chromium/chrome/browser/browser_resources.grd
@@ -38,8 +38,8 @@
<structure name="IDR_OOBE_ENROLLMENT_CSS" file="resources\chromeos\login\oobe_screen_oauth_enrollment.css" flattenhtml="true" type="chrome_html" />
<structure name="IDR_OOBE_ENROLLMENT_JS" file="resources\chromeos\login\oobe_screen_oauth_enrollment.js" flattenhtml="true" type="chrome_html" />
<structure name="IDR_KEYBOARD_UTILS_JS" file="resources\chromeos\keyboard\keyboard_utils.js" flattenhtml="true" type="chrome_html" />
- <structure name="IDR_CHROMEOS_DISCOVER_HTML" file="resources\chromeos\login\discover\discover_app.html" flattenhtml="true" type="chrome_html"/>
- <structure name="IDR_CHROMEOS_DISCOVER_JS" file="resources\chromeos\login\discover\discover_app.js" flattenhtml="true" type="chrome_html"/>
+ <structure name="IDR_CHROMEOS_DISCOVER_APP_HTML" file="resources\chromeos\login\discover\discover_app.html" flattenhtml="true" type="chrome_html"/>
+ <structure name="IDR_CHROMEOS_DISCOVER_APP_JS" file="resources\chromeos\login\discover\discover_app.js" flattenhtml="true" type="chrome_html"/>
<structure name="IDR_CUSTOM_ELEMENTS_OOBE_HTML" file="resources\chromeos\login\custom_elements_oobe.html" flattenhtml="true" type="chrome_html" />
<structure name="IDR_CUSTOM_ELEMENTS_OOBE_JS" file="resources\chromeos\login\custom_elements_oobe.js" flattenhtml="true" type="chrome_html" />
<structure name="IDR_CUSTOM_ELEMENTS_LOCK_HTML" file="resources\chromeos\login\custom_elements_lock.html" flattenhtml="true" type="chrome_html" />
@@ -92,6 +92,9 @@
<if expr="not is_android">
<include name="IDR_ABOUT_SYS_HTML" file="resources\about_sys\about_sys.html" flattenhtml="true" type="BINDATA" />
</if>
+ <include name="IDR_ACCESSIBILITY_HTML" file="resources\accessibility\accessibility.html" flattenhtml="true" allowexternalscript="true" compress="gzip" type="BINDATA" />
+ <include name="IDR_ACCESSIBILITY_CSS" file="resources\accessibility\accessibility.css" compress="gzip" type="BINDATA" />
+ <include name="IDR_ACCESSIBILITY_JS" file="resources\accessibility\accessibility.js" flattenhtml="true" compress="gzip" type="BINDATA" />
<include name="IDR_AD_NETWORK_HASHES" file="resources\ad_networks.dat" type="BINDATA" />
<include name="IDR_BLUETOOTH_ADAPTER_MOJO_JS" file="${root_gen_dir}\device\bluetooth\public\mojom\adapter.mojom.js" use_base_dir="false" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_DEVICE_MOJO_JS" file="${root_gen_dir}\device\bluetooth\public\mojom\device.mojom.js" use_base_dir="false" type="BINDATA" compress="gzip" />
@@ -140,6 +143,8 @@
<include name="IDR_DOWNLOAD_INTERNALS_JS" file="resources\download_internals\download_internals.js" type="BINDATA" compress="gzip" />
<include name="IDR_DOWNLOAD_INTERNALS_BROWSER_PROXY_JS" file="resources\download_internals\download_internals_browser_proxy.js" type="BINDATA" compress="gzip" />
<include name="IDR_DOWNLOAD_INTERNALS_VISUALS_JS" file="resources\download_internals\download_internals_visuals.js" type="BINDATA" compress="gzip" />
+ <include name="IDR_UKM_INTERNALS_HTML" file="../../components/ukm/debug/ukm_internals.html" flattenhtml="true" allowexternalscript="true" compress="gzip" type="BINDATA" />
+ <include name="IDR_UKM_INTERNALS_JS" file="../../components/ukm/debug/ukm_internals.js" flattenhtml="true" compress="gzip" type="BINDATA" />
<if expr="not is_android">
<include name="IDR_MD_DOWNLOADS_1X_INCOGNITO_MARKER_PNG" file="resources\md_downloads\1x\incognito_marker.png" type="BINDATA" />
<include name="IDR_MD_DOWNLOADS_2X_INCOGNITO_MARKER_PNG" file="resources\md_downloads\2x\incognito_marker.png" type="BINDATA" />
@@ -148,6 +153,7 @@
<if expr="optimize_webui">
<then>
<include name="IDR_MD_DOWNLOADS_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_downloads\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_MD_DOWNLOADS_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\md_downloads\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_MD_DOWNLOADS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_downloads\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
</then>
<else>
@@ -200,6 +206,7 @@
<if expr="optimize_webui">
<then>
<include name="IDR_MD_BOOKMARKS_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_bookmarks\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_MD_BOOKMARKS_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\md_bookmarks\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_MD_BOOKMARKS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_bookmarks\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
</then>
<else>
@@ -261,8 +268,10 @@
<if expr="optimize_webui">
<then>
<include name="IDR_MD_HISTORY_APP_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_history\app.vulcanized.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
+ <include name="IDR_MD_HISTORY_APP_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\md_history\app.vulcanized.p2.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
<include name="IDR_MD_HISTORY_APP_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_history\app.crisper.js" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
<include name="IDR_MD_HISTORY_LAZY_LOAD_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_history\lazy_load.vulcanized.html" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
+ <include name="IDR_MD_HISTORY_LAZY_LOAD_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\md_history\lazy_load.vulcanized.p2.html" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
<include name="IDR_MD_HISTORY_LAZY_LOAD_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_history\lazy_load.crisper.js" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
</then>
<else>
@@ -449,6 +458,7 @@
<if expr="optimize_webui">
<then>
<include name="IDR_BLUETOOTH_PAIRING_DIALOG_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\bluetooth_pairing_dialog\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_BLUETOOTH_PAIRING_DIALOG_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\bluetooth_pairing_dialog\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_BLUETOOTH_PAIRING_DIALOG_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\bluetooth_pairing_dialog\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
</then>
<else>
@@ -477,8 +487,10 @@
<if expr="optimize_webui">
<then>
<include name="IDR_INTERNET_CONFIG_DIALOG_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_config_dialog\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_INTERNET_CONFIG_DIALOG_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_config_dialog\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_INTERNET_CONFIG_DIALOG_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_config_dialog\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
<include name="IDR_INTERNET_DETAIL_DIALOG_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_detail_dialog\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_INTERNET_DETAIL_DIALOG_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_detail_dialog\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_INTERNET_DETAIL_DIALOG_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_detail_dialog\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
</then>
<else>
@@ -674,6 +686,9 @@
<if expr="not is_android">
<include name="IDR_TAB_RANKER_EXAMPLE_PREPROCESSOR_CONFIG_PB" file="resource_coordinator\tab_ranker\example_preprocessor_config.pb" type="BINDATA" />
</if>
+ <if expr="chromeos">
+ <include name="IDR_SMART_DIM_EXAMPLE_PREPROCESSOR_CONFIG_PB" file="chromeos\power\ml\smart_dim\example_preprocessor_config.pb" type="BINDATA" />
+ </if>
</includes>
</release>
</grit>
diff --git a/chromium/chrome/browser/chrome_content_browser_manifest_overlay.json b/chromium/chrome/browser/chrome_content_browser_manifest_overlay.json
index 3608badd382..3425d64746d 100644
--- a/chromium/chrome/browser/chrome_content_browser_manifest_overlay.json
+++ b/chromium/chrome/browser/chrome_content_browser_manifest_overlay.json
@@ -10,6 +10,7 @@
"renderer": [
"autofill.mojom.AutofillDriver",
"autofill.mojom.PasswordManagerDriver",
+ "chrome.mojom.AvailableOfflineContentProvider",
"chrome.mojom.CacheStatsRecorder",
"chrome.mojom.NetBenchmarking",
"extensions.StashService",
@@ -29,7 +30,6 @@
},
"requires": {
"apps": [ "app_registry" ],
- "autoclick_app": [ "chromeos:autoclick" ],
"ash": [ "system_ui", "test", "display" ],
// Only used in classic ash case.
"ash_pref_connector": [ "pref_connector" ],
@@ -48,6 +48,7 @@
"device_sync": [ "device_sync" ],
"file_util": [ "analyze_archive", "zip_file" ],
"identity": [ "identity_manager" ],
+ "ime": [ "input_engine" ],
// Only used in classic ash case.
"local_state": [ "pref_client" ],
"media_gallery_util": [ "parse_media" ],
@@ -64,14 +65,14 @@
"secure_channel": [ "secure_channel" ],
"shortcut_viewer_app": [ "shortcut_viewer" ],
"ui": [
- "display_dev",
"ime_registrar",
"input_device_controller",
"window_manager"
],
"unzip": [ "unzip_file" ],
"util_win" : [ "shell_util_win" ],
- "wifi_util_win": [ "wifi_credentials" ]
+ "wifi_util_win": [ "wifi_credentials" ],
+ "xr_device_service": [ "xr_device_provider" ]
}
},
"navigation:frame": {
@@ -79,7 +80,6 @@
"renderer": [
"autofill.mojom.AutofillDriver",
"autofill.mojom.PasswordManagerDriver",
- "blink.mojom.BudgetService",
"blink.mojom.CredentialManager",
"blink.mojom.InstalledAppProvider",
"blink.mojom.MediaDownloadInProductHelp",
@@ -87,6 +87,7 @@
"blink.mojom.TextSuggestionHost",
"chrome.mojom.OpenSearchDocumentDescriptionHandler",
"chrome.mojom.PrerenderCanceler",
+ "chromeos.ime.mojom.InputEngineManager",
"contextual_search.mojom.ContextualSearchJsApiService",
"dom_distiller.mojom.DistillabilityService",
"dom_distiller.mojom.DistillerJavaScriptService",
@@ -117,27 +118,6 @@
"chromeos.multidevice_setup.mojom.MultiDeviceSetup"
]
}
- },
- "navigation:dedicated_worker": {
- "provides": {
- "renderer": [
- "blink.mojom.BudgetService"
- ]
- }
- },
- "navigation:service_worker": {
- "provides": {
- "renderer": [
- "blink.mojom.BudgetService"
- ]
- }
- },
- "navigation:shared_worker": {
- "provides": {
- "renderer": [
- "blink.mojom.BudgetService"
- ]
- }
}
}
}
diff --git a/chromium/chrome/browser/chrome_notification_types.h b/chromium/chrome/browser/chrome_notification_types.h
index aaf3be55c35..ba9365391c4 100644
--- a/chromium/chrome/browser/chrome_notification_types.h
+++ b/chromium/chrome/browser/chrome_notification_types.h
@@ -258,14 +258,6 @@ enum NotificationType {
NOTIFICATION_COOKIE_CHANGED_FOR_EXTENSIONS,
#endif
- // Download Notifications --------------------------------------------------
-
- // Sent when a download is initiated. It is possible that the download will
- // not actually begin due to the DownloadRequestLimiter cancelling it
- // prematurely.
- // The source is the corresponding WebContents. There are no details.
- NOTIFICATION_DOWNLOAD_INITIATED,
-
// Misc --------------------------------------------------------------------
#if defined(OS_CHROMEOS)
diff --git a/chromium/chrome/browser/chromeos/BUILD.gn b/chromium/chrome/browser/chromeos/BUILD.gn
index 17a4335af8e..cd49c59859a 100644
--- a/chromium/chrome/browser/chromeos/BUILD.gn
+++ b/chromium/chrome/browser/chromeos/BUILD.gn
@@ -45,6 +45,7 @@ source_set("chromeos") {
# TODO(tbarzic): Cleanup this list.
":attestation_proto",
":backdrop_wallpaper_proto",
+ ":device_configuration_proto",
":device_policy_remover_generated",
":screen_brightness_event_proto",
":user_activity_event_proto",
@@ -56,13 +57,18 @@ source_set("chromeos") {
"//cc/paint",
"//chrome/app:command_ids",
"//chrome/app/vector_icons",
- "//chrome/browser:rlz",
"//chrome/browser/apps/foundation/app_service:lib",
+ "//chrome/browser/apps/platform_apps",
+ "//chrome/browser/chromeos/android_sms:android_sms_urls",
+ "//chrome/browser/chromeos/power/ml:user_activity_ukm_logger_helpers",
+ "//chrome/browser/chromeos/power/ml/smart_dim",
"//chrome/browser/devtools",
"//chrome/browser/extensions",
"//chrome/browser/resource_coordinator:tab_metrics_event_proto",
- "//chrome/browser/safe_browsing:chunk_proto",
"//chrome/browser/ssl:proto",
+ "//chrome/browser/web_applications",
+ "//chrome/browser/web_applications/bookmark_apps",
+ "//chrome/browser/web_applications/components",
"//chrome/common",
"//chrome/common/extensions/api",
"//chrome/common/net",
@@ -81,8 +87,11 @@ source_set("chromeos") {
"//chromeos/components/proximity_auth",
"//chromeos/components/proximity_auth/logging",
"//chromeos/components/tether",
- "//chromeos/services/device_sync/public/cpp/",
- "//chromeos/services/multidevice_setup/public/cpp/",
+ "//chromeos/services/device_sync/public/cpp",
+ "//chromeos/services/multidevice_setup/public/cpp",
+ "//chromeos/services/multidevice_setup/public/cpp:android_sms_app_helper_delegate",
+ "//chromeos/services/multidevice_setup/public/cpp:auth_token_validator",
+ "//chromeos/services/multidevice_setup/public/cpp:prefs",
"//chromeos/services/secure_channel/public/cpp/client",
"//components/arc",
"//components/browser_sync",
@@ -104,6 +113,7 @@ source_set("chromeos") {
"//components/feedback",
"//components/flags_ui",
"//components/gcm_driver",
+ "//components/google/core/common:common",
"//components/guest_view/browser",
"//components/image_fetcher/core",
"//components/invalidation/impl",
@@ -121,11 +131,13 @@ source_set("chromeos") {
"//components/password_manager/core/browser:hash_password_manager",
"//components/policy:generated",
"//components/policy/core/browser",
+ "//components/policy/core/common:common",
"//components/pref_registry",
"//components/proxy_config",
"//components/quirks",
"//components/rappor",
"//components/renderer_context_menu",
+ "//components/rlz",
"//components/safe_browsing:csd_proto",
"//components/safe_browsing/db:metadata_proto",
"//components/session_manager/core",
@@ -180,13 +192,13 @@ source_set("chromeos") {
"//services/preferences/public/mojom",
"//services/service_manager/public/cpp",
"//services/service_manager/runner/common",
- "//services/ui/public/interfaces/display",
# TODO: care about enable_basic_printing and enable_print_preview.
"//components/sync",
"//printing",
- "//services/ui/public/cpp",
- "//services/ui/public/cpp/input_devices",
+ "//remoting/host/it2me:chrome_os_host",
+ "//services/ws/public/cpp",
+ "//services/ws/public/cpp/input_devices",
"//skia",
"//storage/browser",
"//storage/common",
@@ -200,6 +212,7 @@ source_set("chromeos") {
"//third_party/re2",
"//third_party/webrtc_overrides",
"//third_party/zlib",
+ "//third_party/zlib/google:compression_utils",
"//ui/aura",
"//ui/base",
"//ui/chromeos",
@@ -232,11 +245,16 @@ source_set("chromeos") {
":dbus_service_files",
]
- allow_circular_includes_from = [ "//chrome/browser/extensions" ]
+ allow_circular_includes_from = [
+ "//chrome/browser/extensions",
+ "//chrome/browser/web_applications/bookmark_apps",
+ ]
sources = [
"accessibility/accessibility_extension_loader.cc",
"accessibility/accessibility_extension_loader.h",
+ "accessibility/accessibility_input_method_observer.cc",
+ "accessibility/accessibility_input_method_observer.h",
"accessibility/accessibility_manager.cc",
"accessibility/accessibility_manager.h",
"accessibility/accessibility_panel.cc",
@@ -258,6 +276,8 @@ source_set("chromeos") {
"accessibility/spoken_feedback_event_rewriter_delegate.h",
"accessibility/switch_access_event_handler.cc",
"accessibility/switch_access_event_handler.h",
+ "account_mapper_util.cc",
+ "account_mapper_util.h",
"app_mode/app_launch_utils.cc",
"app_mode/app_launch_utils.h",
"app_mode/app_session.cc",
@@ -448,6 +468,10 @@ source_set("chromeos") {
"arc/optin/arc_terms_of_service_negotiator.h",
"arc/optin/arc_terms_of_service_oobe_negotiator.cc",
"arc/optin/arc_terms_of_service_oobe_negotiator.h",
+ "arc/pip/arc_picture_in_picture_window_controller_impl.cc",
+ "arc/pip/arc_picture_in_picture_window_controller_impl.h",
+ "arc/pip/arc_pip_bridge.cc",
+ "arc/pip/arc_pip_bridge.h",
"arc/policy/arc_android_management_checker.cc",
"arc/policy/arc_android_management_checker.h",
"arc/policy/arc_policy_bridge.cc",
@@ -549,8 +573,14 @@ source_set("chromeos") {
"crostini/crostini_registry_service_factory.h",
"crostini/crostini_remover.cc",
"crostini/crostini_remover.h",
+ "crostini/crostini_reporting_util.cc",
+ "crostini/crostini_reporting_util.h",
"crostini/crostini_util.cc",
"crostini/crostini_util.h",
+ "crostini/crosvm_metrics.cc",
+ "crostini/crosvm_metrics.h",
+ "crostini/crosvm_process_list.cc",
+ "crostini/crosvm_process_list.h",
"cryptauth/chrome_cryptauth_service.cc",
"cryptauth/chrome_cryptauth_service.h",
"cryptauth/chrome_cryptauth_service_factory.cc",
@@ -565,20 +595,22 @@ source_set("chromeos") {
"customization/customization_wallpaper_downloader.h",
"customization/customization_wallpaper_util.cc",
"customization/customization_wallpaper_util.h",
- "dbus/chrome_proxy_resolution_service_provider_delegate.cc",
- "dbus/chrome_proxy_resolution_service_provider_delegate.h",
- "dbus/chrome_virtual_file_request_service_provider_delegate.cc",
- "dbus/chrome_virtual_file_request_service_provider_delegate.h",
+ "dbus/chrome_features_service_provider.cc",
+ "dbus/chrome_features_service_provider.h",
"dbus/component_updater_service_provider.cc",
"dbus/component_updater_service_provider.h",
- "dbus/finch_features_service_provider_delegate.cc",
- "dbus/finch_features_service_provider_delegate.h",
+ "dbus/drive_file_stream_service_provider.cc",
+ "dbus/drive_file_stream_service_provider.h",
"dbus/kiosk_info_service_provider.cc",
"dbus/kiosk_info_service_provider.h",
+ "dbus/proxy_resolution_service_provider.cc",
+ "dbus/proxy_resolution_service_provider.h",
"dbus/screen_lock_service_provider.cc",
"dbus/screen_lock_service_provider.h",
- "dbus/vm_applications_service_provider_delegate.cc",
- "dbus/vm_applications_service_provider_delegate.h",
+ "dbus/virtual_file_request_service_provider.cc",
+ "dbus/virtual_file_request_service_provider.h",
+ "dbus/vm_applications_service_provider.cc",
+ "dbus/vm_applications_service_provider.h",
"device_sync/device_sync_client_factory.cc",
"device_sync/device_sync_client_factory.h",
"display/output_protection_controller_ash.cc",
@@ -603,6 +635,10 @@ source_set("chromeos") {
"drive/file_task_executor.h",
"drive/fileapi/async_file_util.cc",
"drive/fileapi/async_file_util.h",
+ "drive/fileapi/drivefs_async_file_util.cc",
+ "drive/fileapi/drivefs_async_file_util.h",
+ "drive/fileapi/drivefs_file_system_backend_delegate.cc",
+ "drive/fileapi/drivefs_file_system_backend_delegate.h",
"drive/fileapi/file_system_backend_delegate.cc",
"drive/fileapi/file_system_backend_delegate.h",
"drive/fileapi/fileapi_worker.cc",
@@ -835,7 +871,6 @@ source_set("chromeos") {
"first_run/steps/help_step.h",
"first_run/steps/tray_step.cc",
"first_run/steps/tray_step.h",
- "genius_app/app_id.h",
"hats/hats_dialog.cc",
"hats/hats_dialog.h",
"hats/hats_finch_helper.cc",
@@ -866,8 +901,6 @@ source_set("chromeos") {
"input_method/input_method_persistence.h",
"input_method/input_method_syncer.cc",
"input_method/input_method_syncer.h",
- "input_method/mode_indicator_controller.cc",
- "input_method/mode_indicator_controller.h",
"language_preferences.cc",
"language_preferences.h",
"launchable.cc",
@@ -915,8 +948,12 @@ source_set("chromeos") {
"login/chrome_restart_request.h",
"login/demo_mode/demo_app_launcher.cc",
"login/demo_mode/demo_app_launcher.h",
+ "login/demo_mode/demo_extensions_external_loader.cc",
+ "login/demo_mode/demo_extensions_external_loader.h",
"login/demo_mode/demo_mode_detector.cc",
"login/demo_mode/demo_mode_detector.h",
+ "login/demo_mode/demo_mode_resources_remover.cc",
+ "login/demo_mode/demo_mode_resources_remover.h",
"login/demo_mode/demo_session.cc",
"login/demo_mode/demo_session.h",
"login/demo_mode/demo_setup_controller.cc",
@@ -1003,9 +1040,11 @@ source_set("chromeos") {
"login/lock/webui_screen_locker.h",
"login/lock_screen_utils.cc",
"login/lock_screen_utils.h",
+ "login/login_auth_recorder.cc",
+ "login/login_auth_recorder.h",
"login/login_wizard.h",
- "login/mojo_version_info_dispatcher.cc",
- "login/mojo_version_info_dispatcher.h",
+ "login/mojo_system_info_dispatcher.cc",
+ "login/mojo_system_info_dispatcher.h",
"login/oobe_configuration.cc",
"login/oobe_configuration.h",
"login/oobe_screen.cc",
@@ -1047,6 +1086,9 @@ source_set("chromeos") {
"login/screens/arc_terms_of_service_screen.h",
"login/screens/arc_terms_of_service_screen_view.h",
"login/screens/arc_terms_of_service_screen_view_observer.h",
+ "login/screens/assistant_optin_flow_screen.cc",
+ "login/screens/assistant_optin_flow_screen.h",
+ "login/screens/assistant_optin_flow_screen_view.h",
"login/screens/base_screen.cc",
"login/screens/base_screen.h",
"login/screens/base_screen_delegate.h",
@@ -1082,6 +1124,9 @@ source_set("chromeos") {
"login/screens/eula_screen.cc",
"login/screens/eula_screen.h",
"login/screens/eula_view.h",
+ "login/screens/fingerprint_setup_screen.cc",
+ "login/screens/fingerprint_setup_screen.h",
+ "login/screens/fingerprint_setup_screen_view.h",
"login/screens/gaia_screen.cc",
"login/screens/gaia_screen.h",
"login/screens/gaia_view.h",
@@ -1098,10 +1143,18 @@ source_set("chromeos") {
"login/screens/kiosk_enable_screen.cc",
"login/screens/kiosk_enable_screen.h",
"login/screens/kiosk_enable_screen_view.h",
+ "login/screens/marketing_opt_in_screen.cc",
+ "login/screens/marketing_opt_in_screen.h",
+ "login/screens/marketing_opt_in_screen_view.h",
"login/screens/model_view_channel.h",
"login/screens/network_error.cc",
"login/screens/network_error.h",
"login/screens/network_error_view.h",
+ "login/screens/network_screen.cc",
+ "login/screens/network_screen.h",
+ "login/screens/network_screen_view.h",
+ "login/screens/recommend_apps/recommend_apps_fetcher.cc",
+ "login/screens/recommend_apps/recommend_apps_fetcher.h",
"login/screens/recommend_apps_screen.cc",
"login/screens/recommend_apps_screen.h",
"login/screens/recommend_apps_screen_view.h",
@@ -1272,6 +1325,12 @@ source_set("chromeos") {
"mobile/mobile_activator.h",
"mobile_config.cc",
"mobile_config.h",
+ "multidevice_setup/android_sms_app_helper_delegate_impl.cc",
+ "multidevice_setup/android_sms_app_helper_delegate_impl.h",
+ "multidevice_setup/auth_token_validator_factory.cc",
+ "multidevice_setup/auth_token_validator_factory.h",
+ "multidevice_setup/auth_token_validator_impl.cc",
+ "multidevice_setup/auth_token_validator_impl.h",
"multidevice_setup/multidevice_setup_client_factory.cc",
"multidevice_setup/multidevice_setup_client_factory.h",
"net/cert_verify_proc_chromeos.cc",
@@ -1367,6 +1426,8 @@ source_set("chromeos") {
"policy/configuration_policy_handler_chromeos.h",
"policy/device_auto_update_time_restrictions_decoder.cc",
"policy/device_auto_update_time_restrictions_decoder.h",
+ "policy/device_auto_update_time_restrictions_utils.cc",
+ "policy/device_auto_update_time_restrictions_utils.h",
"policy/device_cloud_policy_initializer.cc",
"policy/device_cloud_policy_initializer.h",
"policy/device_cloud_policy_manager_chromeos.cc",
@@ -1436,6 +1497,8 @@ source_set("chromeos") {
"policy/pre_signin_policy_fetcher.h",
"policy/remote_commands/affiliated_remote_commands_invalidator.cc",
"policy/remote_commands/affiliated_remote_commands_invalidator.h",
+ "policy/remote_commands/crd_host_delegate.cc",
+ "policy/remote_commands/crd_host_delegate.h",
"policy/remote_commands/device_command_fetch_status_job.cc",
"policy/remote_commands/device_command_fetch_status_job.h",
"policy/remote_commands/device_command_reboot_job.cc",
@@ -1444,6 +1507,8 @@ source_set("chromeos") {
"policy/remote_commands/device_command_screenshot_job.h",
"policy/remote_commands/device_command_set_volume_job.cc",
"policy/remote_commands/device_command_set_volume_job.h",
+ "policy/remote_commands/device_command_start_crd_session_job.cc",
+ "policy/remote_commands/device_command_start_crd_session_job.h",
"policy/remote_commands/device_command_wipe_users_job.cc",
"policy/remote_commands/device_command_wipe_users_job.h",
"policy/remote_commands/device_commands_factory_chromeos.cc",
@@ -1489,6 +1554,11 @@ source_set("chromeos") {
"policy/user_network_configuration_updater_factory.h",
"policy/user_policy_manager_factory_chromeos.cc",
"policy/user_policy_manager_factory_chromeos.h",
+ "policy/value_validation/onc_device_policy_value_validator.cc",
+ "policy/value_validation/onc_device_policy_value_validator.h",
+ "policy/value_validation/onc_policy_value_validator_base.h",
+ "policy/value_validation/onc_user_policy_value_validator.cc",
+ "policy/value_validation/onc_user_policy_value_validator.h",
"policy/weekly_time/time_utils.cc",
"policy/weekly_time/time_utils.h",
"policy/weekly_time/weekly_time.cc",
@@ -1519,9 +1589,6 @@ source_set("chromeos") {
"power/ml/real_boot_clock.h",
"power/ml/recent_events_counter.cc",
"power/ml/recent_events_counter.h",
- "power/ml/smart_dim_model.h",
- "power/ml/smart_dim_model_impl.cc",
- "power/ml/smart_dim_model_impl.h",
"power/ml/user_activity_controller.cc",
"power/ml/user_activity_controller.h",
"power/ml/user_activity_manager.cc",
@@ -1533,6 +1600,8 @@ source_set("chromeos") {
"power/power_data_collector.h",
"power/power_metrics_reporter.cc",
"power/power_metrics_reporter.h",
+ "power/process_data_collector.cc",
+ "power/process_data_collector.h",
"power/renderer_freezer.cc",
"power/renderer_freezer.h",
"preferences.cc",
@@ -1682,6 +1751,8 @@ source_set("chromeos") {
"system/input_device_settings_impl_ozone.cc",
"system/pointer_device_observer.cc",
"system/pointer_device_observer.h",
+ "system/procfs_util.cc",
+ "system/procfs_util.h",
"system/system_clock.cc",
"system/system_clock.h",
"system/system_clock_observer.cc",
@@ -1720,6 +1791,8 @@ source_set("chromeos") {
"tether/tether_service_factory.h",
"tpm_firmware_update.cc",
"tpm_firmware_update.h",
+ "tpm_firmware_update_notification.cc",
+ "tpm_firmware_update_notification.h",
"ui/echo_dialog_listener.h",
"ui/echo_dialog_view.cc",
"ui/echo_dialog_view.h",
@@ -1735,12 +1808,12 @@ source_set("chromeos") {
"ui/request_pin_view.h",
"ui/screen_capture_notification_ui_chromeos.cc",
"ui/screen_capture_notification_ui_chromeos.h",
- "upgrade_detector_chromeos.cc",
- "upgrade_detector_chromeos.h",
"virtual_machines/virtual_machines_util.cc",
"virtual_machines/virtual_machines_util.h",
# Extension API implementations.
+ "extensions/arc_apps_private_api.cc",
+ "extensions/arc_apps_private_api.h",
"extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.cc",
"extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.h",
"extensions/echo_private_api.cc",
@@ -1824,8 +1897,14 @@ source_set("chromeos") {
copy("dbus_service_files") {
sources = [
+ "dbus/org.chromium.ChromeFeaturesService.conf",
"dbus/org.chromium.ComponentUpdaterService.conf",
+ "dbus/org.chromium.DriveFileStreamService.conf",
+ "dbus/org.chromium.KioskAppService.conf",
+ "dbus/org.chromium.NetworkProxyService.conf",
"dbus/org.chromium.ScreenLockService.conf",
+ "dbus/org.chromium.VirtualFileRequestService.conf",
+ "dbus/org.chromium.VmApplicationsService.conf",
]
outputs = [
"$root_out_dir/dbus/{{source_file_part}}",
@@ -1870,6 +1949,8 @@ static_library("test_support") {
"login/screens/mock_error_screen.h",
"login/screens/mock_model_view_channel.cc",
"login/screens/mock_model_view_channel.h",
+ "login/screens/mock_network_screen.cc",
+ "login/screens/mock_network_screen.h",
"login/screens/mock_update_screen.cc",
"login/screens/mock_update_screen.h",
"login/screens/mock_welcome_screen.cc",
@@ -1946,6 +2027,7 @@ source_set("unit_tests") {
"arc/notification/arc_provision_notification_service_unittest.cc",
"arc/notification/arc_supervision_transition_notification_unittest.cc",
"arc/optin/arc_terms_of_service_default_negotiator_unittest.cc",
+ "arc/pip/arc_pip_bridge_unittest.cc",
"arc/policy/arc_policy_bridge_unittest.cc",
"arc/process/arc_process_unittest.cc",
"arc/tts/arc_tts_service_unittest.cc",
@@ -1964,7 +2046,10 @@ source_set("unit_tests") {
"certificate_provider/certificate_provider_service_unittest.cc",
"child_accounts/usage_time_limit_processor_unittest.cc",
"crostini/crostini_manager_unittest.cc",
+ "crostini/crosvm_metrics_unittest.cc",
+ "crostini/crosvm_process_list_unittest.cc",
"customization/customization_document_unittest.cc",
+ "dbus/proxy_resolution_service_provider_unittest.cc",
"drive/download_handler_unittest.cc",
"drive/drive_file_stream_reader_unittest.cc",
"drive/drive_integration_service_unittest.cc",
@@ -1984,6 +2069,7 @@ source_set("unit_tests") {
"extensions/file_manager/drivefs_event_router_unittest.cc",
"extensions/file_manager/job_event_router_unittest.cc",
"extensions/gfx_utils_unittest.cc",
+ "extensions/install_limiter_unittest.cc",
"extensions/permissions_updater_delegate_chromeos_unittest.cc",
"extensions/public_session_permission_helper_unittest.cc",
"extensions/quick_unlock_private/quick_unlock_private_api_unittest.cc",
@@ -2059,12 +2145,15 @@ source_set("unit_tests") {
"lock_screen_apps/lock_screen_profile_creator_impl_unittest.cc",
"lock_screen_apps/state_controller_unittest.cc",
"login/auth/cryptohome_authenticator_unittest.cc",
+ "login/demo_mode/demo_extensions_external_loader_unittest.cc",
+ "login/demo_mode/demo_mode_resources_remover_unittest.cc",
"login/demo_mode/demo_session_unittest.cc",
"login/demo_mode/demo_setup_controller_unittest.cc",
"login/demo_mode/demo_setup_test_utils.h",
"login/easy_unlock/easy_unlock_challenge_wrapper_unittest.cc",
"login/easy_unlock/easy_unlock_tpm_key_manager_unittest.cc",
"login/enrollment/enrollment_screen_unittest.cc",
+ "login/enterprise_user_session_metrics_unittest.cc",
"login/error_screens_histogram_helper_unittest.cc",
"login/existing_user_controller_auto_login_unittest.cc",
"login/hwid_checker_unittest.cc",
@@ -2073,8 +2162,8 @@ source_set("unit_tests") {
"login/quick_unlock/pin_storage_prefs_unittest.cc",
"login/quick_unlock/quick_unlock_storage_unittest.cc",
"login/saml/saml_offline_signin_limiter_unittest.cc",
+ "login/screens/network_screen_unittest.cc",
"login/screens/update_screen_unittest.cc",
- "login/screens/welcome_screen_unittest.cc",
"login/signin/merge_session_navigation_throttle_unittest.cc",
"login/signin_partition_manager_unittest.cc",
"login/supervised/supervised_user_authentication_unittest.cc",
@@ -2083,6 +2172,7 @@ source_set("unit_tests") {
"login/users/user_manager_unittest.cc",
"mobile/mobile_activator_unittest.cc",
"mobile_config_unittest.cc",
+ "multidevice_setup/android_sms_app_helper_delegate_impl_unittest.cc",
"net/cert_verify_proc_chromeos_unittest.cc",
"net/client_cert_store_chromeos_unittest.cc",
"net/network_portal_detector_impl_unittest.cc",
@@ -2115,10 +2205,12 @@ source_set("unit_tests") {
"policy/component_active_directory_policy_service_unittest.cc",
"policy/configuration_policy_handler_chromeos_unittest.cc",
"policy/device_auto_update_time_restrictions_decoder_unittest.cc",
+ "policy/device_auto_update_time_restrictions_utils_unittest.cc",
"policy/device_cloud_policy_initializer_unittest.cc",
"policy/device_cloud_policy_manager_chromeos_unittest.cc",
"policy/device_cloud_policy_store_chromeos_unittest.cc",
"policy/device_local_account_policy_service_unittest.cc",
+ "policy/device_policy_decoder_chromeos_unittest.cc",
"policy/dm_token_storage_unittest.cc",
"policy/extension_cache_unittest.cc",
"policy/fake_affiliated_invalidation_service_provider.cc",
@@ -2132,6 +2224,7 @@ source_set("unit_tests") {
"policy/pre_signin_policy_fetcher_unittest.cc",
"policy/remote_commands/device_command_screenshot_job_unittest.cc",
"policy/remote_commands/device_command_set_volume_job_unittest.cc",
+ "policy/remote_commands/device_command_start_crd_session_unittest.cc",
"policy/remote_commands/device_command_wipe_users_job_unittest.cc",
"policy/remote_commands/user_command_arc_job_unittest.cc",
"policy/secondary_google_account_signin_policy_handler_unittest.cc",
@@ -2143,6 +2236,7 @@ source_set("unit_tests") {
"policy/upload_job_unittest.cc",
"policy/user_cloud_policy_manager_chromeos_unittest.cc",
"policy/user_cloud_policy_store_chromeos_unittest.cc",
+ "policy/weekly_time/time_utils_unittest.cc",
"policy/weekly_time/weekly_time_interval_unittest.cc",
"policy/weekly_time/weekly_time_unittest.cc",
"power/cpu_data_collector_unittest.cc",
@@ -2154,10 +2248,13 @@ source_set("unit_tests") {
"power/ml/idle_event_notifier_unittest.cc",
"power/ml/real_boot_clock_unittest.cc",
"power/ml/recent_events_counter_unittest.cc",
+ "power/ml/smart_dim/model_unittest.cc",
"power/ml/user_activity_manager_unittest.cc",
+ "power/ml/user_activity_ukm_logger_helpers_unittest.cc",
"power/ml/user_activity_ukm_logger_unittest.cc",
"power/power_data_collector_unittest.cc",
"power/power_metrics_reporter_unittest.cc",
+ "power/process_data_collector_unittest.cc",
"power/renderer_freezer_unittest.cc",
"preferences_unittest.cc",
"printing/cups_printers_manager_unittest.cc",
@@ -2196,6 +2293,7 @@ source_set("unit_tests") {
"smb_client/temp_file_manager_unittest.cc",
"system/automatic_reboot_manager_unittest.cc",
"system/device_disabling_manager_unittest.cc",
+ "system/procfs_util_unittest.cc",
"system/user_removal_manager_unittest.cc",
"system_logs/single_debug_daemon_log_source_unittest.cc",
"system_logs/single_log_file_log_source_unittest.cc",
@@ -2221,12 +2319,15 @@ source_set("unit_tests") {
"../ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc",
"../ui/webui/settings/chromeos/easy_unlock_settings_handler_unittest.cc",
"../ui/webui/settings/chromeos/internet_handler_unittest.cc",
+ "../ui/webui/settings/chromeos/multidevice_handler_unittest.cc",
"//components/drive/about_resource_loader_unittest.cc",
"//components/drive/change_list_loader_unittest.cc",
"//components/drive/change_list_processor_unittest.cc",
"//components/drive/chromeos/file_cache_unittest.cc",
"//components/drive/directory_loader_unittest.cc",
"//components/drive/drive_file_util_unittest.cc",
+ "//components/drive/drive_notification_manager_unittest.cc",
+ "//components/drive/drive_operation_queue_unittest.cc",
"//components/drive/fake_file_system_unittest.cc",
"//components/drive/file_change_unittest.cc",
"//components/drive/file_system/copy_operation_unittest.cc",
@@ -2270,15 +2371,19 @@ source_set("unit_tests") {
":arc_test_support",
":attestation_proto",
":test_support",
+ ":user_activity_event_proto",
"//ash",
"//ash/system/message_center/arc:test_support",
"//base",
+ "//chrome/browser/chromeos/android_sms:unit_tests",
"//chrome/browser/resources/chromeos/zip_archiver:char_coding",
+ "//chrome/browser/web_applications/components:test_support",
"//chrome/common",
"//chromeos:login_manager_proto",
"//chromeos/components/tether:test_support",
"//chromeos/ime:gencode",
"//chromeos/services/device_sync/public/cpp:test_support",
+ "//chromeos/services/multidevice_setup/public/cpp:prefs",
"//chromeos/services/multidevice_setup/public/cpp:test_support",
"//chromeos/services/secure_channel/public/cpp/client:test_support",
"//components/cryptauth:test_support",
@@ -2339,6 +2444,13 @@ proto_library("backdrop_wallpaper_proto") {
generate_python = false
}
+proto_library("device_configuration_proto") {
+ sources = [
+ "login/screens/recommend_apps/device_configuration.proto",
+ ]
+ generate_python = false
+}
+
service_manifest("ash_pref_connector_manifest") {
name = "ash_pref_connector"
source = "prefs/ash_pref_connector_manifest.json"
@@ -2359,12 +2471,12 @@ action("device_policy_remover_generate") {
args = [
# generated file name
- rebase_path(device_policy_remover_path),
+ rebase_path(device_policy_remover_path, root_build_dir),
# directories for PATH variable to compile generated file
- rebase_path(descriptor_pool_path),
- rebase_path(symbol_database_path),
- rebase_path(chrome_device_policy_pb2_path),
+ rebase_path(descriptor_pool_path, root_build_dir),
+ rebase_path(symbol_database_path, root_build_dir),
+ rebase_path(chrome_device_policy_pb2_path, root_build_dir),
]
public_deps = [
diff --git a/chromium/chrome/browser/chromeos/android_sms/BUILD.gn b/chromium/chrome/browser/chromeos/android_sms/BUILD.gn
new file mode 100644
index 00000000000..3531206ca50
--- /dev/null
+++ b/chromium/chrome/browser/chromeos/android_sms/BUILD.gn
@@ -0,0 +1,78 @@
+# 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.
+
+source_set("android_sms_urls") {
+ sources = [
+ "android_sms_switches.cc",
+ "android_sms_switches.h",
+ "android_sms_urls.cc",
+ "android_sms_urls.h",
+ ]
+
+ deps = [
+ "//base",
+ "//url",
+ ]
+}
+
+static_library("android_sms") {
+ sources = [
+ "android_sms_service.cc",
+ "android_sms_service.h",
+ "android_sms_service_factory.cc",
+ "android_sms_service_factory.h",
+ "connection_establisher.h",
+ "connection_establisher_impl.cc",
+ "connection_establisher_impl.h",
+ "connection_manager.cc",
+ "connection_manager.h",
+ ]
+
+ deps = [
+ ":android_sms_urls",
+ "//base",
+ "//chrome/browser/chromeos:chromeos",
+ "//chromeos:chromeos",
+ "//chromeos/components/proximity_auth/logging",
+ "//chromeos/services/multidevice_setup/public/cpp:cpp",
+ "//chromeos/services/multidevice_setup/public/cpp:prefs",
+ "//components/keyed_service/content:content",
+ "//components/keyed_service/core:core",
+ "//components/session_manager/core:core",
+ "//content/public/browser",
+ ]
+}
+
+static_library("test_support") {
+ testonly = true
+
+ sources = [
+ "fake_connection_establisher.cc",
+ "fake_connection_establisher.h",
+ ]
+
+ deps = [
+ ":android_sms",
+ "//content/public/browser",
+ ]
+}
+
+source_set("unit_tests") {
+ testonly = true
+
+ sources = [
+ "connection_establisher_impl_unittest.cc",
+ "connection_manager_unittest.cc",
+ ]
+
+ deps = [
+ ":android_sms",
+ ":android_sms_urls",
+ ":test_support",
+ "//chromeos/services/multidevice_setup/public/cpp:test_support",
+ "//content/public/browser",
+ "//content/test:test_support",
+ "//testing/gtest",
+ ]
+}
diff --git a/chromium/chrome/browser/chromeos/device_sync/BUILD.gn b/chromium/chrome/browser/chromeos/device_sync/BUILD.gn
deleted file mode 100644
index e2ac34afc87..00000000000
--- a/chromium/chrome/browser/chromeos/device_sync/BUILD.gn
+++ /dev/null
@@ -1,14 +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.
-
-static_library("device_sync") {
- sources = [
- "device_sync_client_factory.cc",
- "device_sync_client_factory.h",
- ]
-
- deps = [
- "//chromeos/services/device_sync/public/cpp/",
- ]
-}
diff --git a/chromium/chrome/browser/chromeos/multidevice_setup/BUILD.gn b/chromium/chrome/browser/chromeos/multidevice_setup/BUILD.gn
deleted file mode 100644
index 5f3ac251444..00000000000
--- a/chromium/chrome/browser/chromeos/multidevice_setup/BUILD.gn
+++ /dev/null
@@ -1,14 +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.
-
-component("multidevice_setup") {
- sources = [
- "multidevice_setup_client_factory.cc",
- "multidevice_setup_client_factory.h",
- ]
-
- deps = [
- "//chromeos/services/multidevice_setup/public/cpp",
- ]
-}
diff --git a/chromium/chrome/browser/chromeos/power/ml/BUILD.gn b/chromium/chrome/browser/chromeos/power/ml/BUILD.gn
new file mode 100644
index 00000000000..0bcddd465a9
--- /dev/null
+++ b/chromium/chrome/browser/chromeos/power/ml/BUILD.gn
@@ -0,0 +1,19 @@
+# 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.
+
+source_set("user_activity_ukm_logger_helpers") {
+ public = [
+ "user_activity_ukm_logger_helpers.h",
+ ]
+
+ sources = [
+ "user_activity_ukm_logger_helpers.cc",
+ ]
+
+ deps = [
+ "//base",
+ "//chrome/browser/chromeos:user_activity_event_proto",
+ "//ui/base",
+ ]
+}
diff --git a/chromium/chrome/browser/chromeos/power/ml/smart_dim/BUILD.gn b/chromium/chrome/browser/chromeos/power/ml/smart_dim/BUILD.gn
new file mode 100644
index 00000000000..5707ed859bf
--- /dev/null
+++ b/chromium/chrome/browser/chromeos/power/ml/smart_dim/BUILD.gn
@@ -0,0 +1,29 @@
+# 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.
+
+source_set("smart_dim") {
+ # Dependent targets should not include tf_native_inference.h directly.
+ public = [
+ "model.h",
+ "model_impl.h",
+ ]
+
+ sources = [
+ "model_impl.cc",
+ "tf_native_inference.cc",
+ "tf_native_inference.h",
+ ]
+
+ deps = [
+ "//base",
+ "//chrome/browser:resources",
+ "//chrome/browser/chromeos:user_activity_event_proto",
+ "//chrome/browser/chromeos/power/ml:user_activity_ukm_logger_helpers",
+ "//chrome/common:constants",
+ "//components/assist_ranker",
+ "//components/assist_ranker/proto",
+ "//components/sessions",
+ "//ui/base",
+ ]
+}
diff --git a/chromium/chrome/browser/devtools/BUILD.gn b/chromium/chrome/browser/devtools/BUILD.gn
index d43ebd43b74..8e4c3ab3e21 100644
--- a/chromium/chrome/browser/devtools/BUILD.gn
+++ b/chromium/chrome/browser/devtools/BUILD.gn
@@ -145,6 +145,8 @@ static_library("devtools") {
"device/usb/usb_device_provider.h",
"devtools_auto_opener.cc",
"devtools_auto_opener.h",
+ "devtools_browser_context_manager.cc",
+ "devtools_browser_context_manager.h",
"devtools_contents_resizing_strategy.cc",
"devtools_contents_resizing_strategy.h",
"devtools_embedder_message_dispatcher.cc",
diff --git a/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.cc b/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
index cc71fb5c7f0..b78a02e5661 100644
--- a/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
+++ b/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.cc
@@ -6,11 +6,13 @@
#include <utility>
+#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/devtools/chrome_devtools_session.h"
#include "chrome/browser/devtools/device/android_device_manager.h"
#include "chrome/browser/devtools/device/tcp_device_provider.h"
+#include "chrome/browser/devtools/devtools_browser_context_manager.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/devtools/protocol/target_handler.h"
#include "chrome/browser/extensions/extension_tab_util.h"
@@ -24,6 +26,7 @@
#include "components/guest_view/browser/guest_view_base.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_registry.h"
@@ -95,21 +98,20 @@ void ChromeDevToolsManagerDelegate::Inspect(
DevToolsWindow::OpenDevToolsWindow(agent_host, nullptr);
}
-bool ChromeDevToolsManagerDelegate::HandleCommand(
+void ChromeDevToolsManagerDelegate::HandleCommand(
DevToolsAgentHost* agent_host,
content::DevToolsAgentHostClient* client,
- base::DictionaryValue* command_dict) {
+ std::unique_ptr<base::DictionaryValue> command_dict,
+ const std::string& message,
+ NotHandledCallback callback) {
DCHECK(sessions_.find(client) != sessions_.end());
- auto response = sessions_[client]->dispatcher()->dispatch(
- protocol::toProtocolValue(command_dict, 1000));
- return response != protocol::DispatchResponse::Status::kFallThrough;
+ sessions_[client]->HandleCommand(std::move(command_dict), message,
+ std::move(callback));
}
std::string ChromeDevToolsManagerDelegate::GetTargetType(
content::WebContents* web_contents) {
- auto& all_tabs = AllTabContentses();
- auto it = std::find(all_tabs.begin(), all_tabs.end(), web_contents);
- if (it != all_tabs.end())
+ if (base::ContainsValue(AllTabContentses(), web_contents))
return DevToolsAgentHost::kTypePage;
std::string extension_name;
@@ -128,11 +130,12 @@ std::string ChromeDevToolsManagerDelegate::GetTargetTitle(
return extension_name;
}
-bool ChromeDevToolsManagerDelegate::AllowInspectingWebContents(
- content::WebContents* web_contents) {
- return AllowInspection(
- Profile::FromBrowserContext(web_contents->GetBrowserContext()),
- web_contents);
+bool ChromeDevToolsManagerDelegate::AllowInspectingRenderFrameHost(
+ content::RenderFrameHost* rfh) {
+ Profile* profile =
+ Profile::FromBrowserContext(rfh->GetProcess()->GetBrowserContext());
+ return AllowInspection(profile, extensions::ProcessManager::Get(profile)
+ ->GetExtensionForRenderFrameHost(rfh));
}
// static
@@ -220,6 +223,28 @@ std::string ChromeDevToolsManagerDelegate::GetDiscoveryPageHTML() {
.as_string();
}
+std::vector<content::BrowserContext*>
+ChromeDevToolsManagerDelegate::GetBrowserContexts() {
+ return DevToolsBrowserContextManager::GetInstance().GetBrowserContexts();
+}
+
+content::BrowserContext*
+ChromeDevToolsManagerDelegate::GetDefaultBrowserContext() {
+ return DevToolsBrowserContextManager::GetInstance()
+ .GetDefaultBrowserContext();
+}
+
+content::BrowserContext* ChromeDevToolsManagerDelegate::CreateBrowserContext() {
+ return DevToolsBrowserContextManager::GetInstance().CreateBrowserContext();
+}
+
+void ChromeDevToolsManagerDelegate::DisposeBrowserContext(
+ content::BrowserContext* context,
+ DisposeCallback callback) {
+ DevToolsBrowserContextManager::GetInstance().DisposeBrowserContext(
+ context, std::move(callback));
+}
+
bool ChromeDevToolsManagerDelegate::HasBundledFrontendResources() {
return true;
}
diff --git a/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.h b/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.h
index 2d851bc2d35..f5ac9d7ba3d 100644
--- a/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.h
+++ b/chromium/chrome/browser/devtools/chrome_devtools_manager_delegate.h
@@ -51,12 +51,21 @@ class ChromeDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
// content::DevToolsManagerDelegate implementation.
void Inspect(content::DevToolsAgentHost* agent_host) override;
- bool HandleCommand(content::DevToolsAgentHost* agent_host,
+ void HandleCommand(content::DevToolsAgentHost* agent_host,
content::DevToolsAgentHostClient* client,
- base::DictionaryValue* command_dict) override;
+ std::unique_ptr<base::DictionaryValue> command_dict,
+ const std::string& message,
+ NotHandledCallback callback) override;
std::string GetTargetType(content::WebContents* web_contents) override;
std::string GetTargetTitle(content::WebContents* web_contents) override;
- bool AllowInspectingWebContents(content::WebContents* web_contents) override;
+
+ std::vector<content::BrowserContext*> GetBrowserContexts() override;
+ content::BrowserContext* GetDefaultBrowserContext() override;
+ content::BrowserContext* CreateBrowserContext() override;
+ void DisposeBrowserContext(content::BrowserContext*,
+ DisposeCallback callback) override;
+
+ bool AllowInspectingRenderFrameHost(content::RenderFrameHost* rfh) override;
void ClientAttached(content::DevToolsAgentHost* agent_host,
content::DevToolsAgentHostClient* client) override;
void ClientDetached(content::DevToolsAgentHost* agent_host,
diff --git a/chromium/chrome/browser/devtools/chrome_devtools_session.cc b/chromium/chrome/browser/devtools/chrome_devtools_session.cc
index 93cf08d982f..bc54c10ee61 100644
--- a/chromium/chrome/browser/devtools/chrome_devtools_session.cc
+++ b/chromium/chrome/browser/devtools/chrome_devtools_session.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/devtools/protocol/target_handler.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_agent_host_client.h"
+#include "content/public/browser/devtools_manager_delegate.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/devtools/protocol/window_manager_handler.h"
@@ -20,7 +21,6 @@ ChromeDevToolsSession::ChromeDevToolsSession(
: agent_host_(agent_host),
client_(client),
dispatcher_(std::make_unique<protocol::UberDispatcher>(this)) {
- dispatcher_->setFallThroughForNotFound(true);
if (agent_host->GetWebContents() &&
agent_host->GetType() == content::DevToolsAgentHost::kTypePage) {
page_handler_ = std::make_unique<PageHandler>(agent_host->GetWebContents(),
@@ -39,9 +39,37 @@ ChromeDevToolsSession::~ChromeDevToolsSession() = default;
void ChromeDevToolsSession::sendProtocolResponse(
int call_id,
std::unique_ptr<protocol::Serializable> message) {
+ pending_commands_.erase(call_id);
client_->DispatchProtocolMessage(agent_host_, message->serialize());
}
+void ChromeDevToolsSession::HandleCommand(
+ std::unique_ptr<base::DictionaryValue> command_dict,
+ const std::string& message,
+ content::DevToolsManagerDelegate::NotHandledCallback callback) {
+ int call_id;
+ std::string method;
+ std::unique_ptr<protocol::Value> protocolCommand =
+ protocol::toProtocolValue(command_dict.get(), 1000);
+ if (!dispatcher_->parseCommand(protocolCommand.get(), &call_id, &method))
+ return;
+ if (dispatcher_->canDispatch(method)) {
+ pending_commands_[call_id] =
+ std::make_pair(std::move(callback), std::move(command_dict));
+ dispatcher_->dispatch(call_id, method, std::move(protocolCommand), message);
+ return;
+ }
+ std::move(callback).Run(std::move(command_dict), message);
+}
+
+void ChromeDevToolsSession::fallThrough(int call_id,
+ const std::string& method,
+ const std::string& message) {
+ PendingCommand command = std::move(pending_commands_[call_id]);
+ pending_commands_.erase(call_id);
+ std::move(command.first).Run(std::move(command.second), message);
+}
+
void ChromeDevToolsSession::sendProtocolNotification(
std::unique_ptr<protocol::Serializable> message) {
client_->DispatchProtocolMessage(agent_host_, message->serialize());
diff --git a/chromium/chrome/browser/devtools/chrome_devtools_session.h b/chromium/chrome/browser/devtools/chrome_devtools_session.h
index 69edba9af6d..b1d9acc1fe5 100644
--- a/chromium/chrome/browser/devtools/chrome_devtools_session.h
+++ b/chromium/chrome/browser/devtools/chrome_devtools_session.h
@@ -7,8 +7,10 @@
#include <memory>
+#include "base/values.h"
#include "chrome/browser/devtools/protocol/forward.h"
#include "chrome/browser/devtools/protocol/protocol.h"
+#include "content/public/browser/devtools_manager_delegate.h"
namespace content {
class DevToolsAgentHost;
@@ -28,6 +30,11 @@ class ChromeDevToolsSession : public protocol::FrontendChannel {
protocol::UberDispatcher* dispatcher() { return dispatcher_.get(); }
+ void HandleCommand(
+ std::unique_ptr<base::DictionaryValue> command_dict,
+ const std::string& message,
+ content::DevToolsManagerDelegate::NotHandledCallback callback);
+
TargetHandler* target_handler() { return target_handler_.get(); }
private:
@@ -38,9 +45,16 @@ class ChromeDevToolsSession : public protocol::FrontendChannel {
void sendProtocolNotification(
std::unique_ptr<protocol::Serializable> message) override;
void flushProtocolNotifications() override;
+ void fallThrough(int call_id,
+ const std::string& method,
+ const std::string& message) override;
content::DevToolsAgentHost* const agent_host_;
content::DevToolsAgentHostClient* const client_;
+ using PendingCommand =
+ std::pair<content::DevToolsManagerDelegate::NotHandledCallback,
+ std::unique_ptr<base::DictionaryValue>>;
+ base::flat_map<int, PendingCommand> pending_commands_;
std::unique_ptr<protocol::UberDispatcher> dispatcher_;
std::unique_ptr<BrowserHandler> browser_handler_;
diff --git a/chromium/chrome/browser/devtools/device/android_device_manager.cc b/chromium/chrome/browser/devtools/device/android_device_manager.cc
index 6f1d6059e0d..18025ac1a6a 100644
--- a/chromium/chrome/browser/devtools/device/android_device_manager.cc
+++ b/chromium/chrome/browser/devtools/device/android_device_manager.cc
@@ -16,7 +16,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -191,9 +191,10 @@ class HttpRequest {
std::string request = base::StrCat(pieces);
scoped_refptr<net::IOBuffer> base_buffer =
- new net::IOBuffer(request.size());
+ base::MakeRefCounted<net::IOBuffer>(request.size());
memcpy(base_buffer->data(), request.data(), request.size());
- request_ = new net::DrainableIOBuffer(base_buffer.get(), request.size());
+ request_ = base::MakeRefCounted<net::DrainableIOBuffer>(
+ std::move(base_buffer), request.size());
DoSendRequest(net::OK);
}
@@ -534,7 +535,7 @@ AndroidDeviceManager::HandlerThread::~HandlerThread() {
return;
// Shut down thread on a thread other than UI so it can join a thread.
base::PostTaskWithTraits(FROM_HERE,
- {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&HandlerThread::StopThread, thread_));
}
diff --git a/chromium/chrome/browser/devtools/device/devtools_device_discovery.cc b/chromium/chrome/browser/devtools/device/devtools_device_discovery.cc
index fbada044c5c..ed5e08a2be3 100644
--- a/chromium/chrome/browser/devtools/device/devtools_device_discovery.cc
+++ b/chromium/chrome/browser/devtools/device/devtools_device_discovery.cc
@@ -365,11 +365,15 @@ class DevToolsDeviceDiscovery::DiscoveryRequest
: public base::RefCountedThreadSafe<DiscoveryRequest,
BrowserThread::DeleteOnUIThread> {
public:
- DiscoveryRequest(AndroidDeviceManager* device_manager,
- const DevToolsDeviceDiscovery::DeviceListCallback& callback);
+ static void Start(
+ AndroidDeviceManager* device_manager,
+ const DevToolsDeviceDiscovery::DeviceListCallback& callback);
+
private:
friend struct BrowserThread::DeleteOnThread<BrowserThread::UI>;
friend class base::DeleteHelper<DiscoveryRequest>;
+ explicit DiscoveryRequest(
+ const DevToolsDeviceDiscovery::DeviceListCallback& callback);
virtual ~DiscoveryRequest();
void ReceivedDevices(const AndroidDeviceManager::Devices& devices);
@@ -387,13 +391,20 @@ class DevToolsDeviceDiscovery::DiscoveryRequest
DevToolsDeviceDiscovery::CompleteDevices complete_devices_;
};
-DevToolsDeviceDiscovery::DiscoveryRequest::DiscoveryRequest(
+// static
+void DevToolsDeviceDiscovery::DiscoveryRequest::Start(
AndroidDeviceManager* device_manager,
+ const DevToolsDeviceDiscovery::DeviceListCallback& callback) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ auto request = base::WrapRefCounted(new DiscoveryRequest(callback));
+ device_manager->QueryDevices(
+ base::Bind(&DiscoveryRequest::ReceivedDevices, request));
+}
+
+DevToolsDeviceDiscovery::DiscoveryRequest::DiscoveryRequest(
const DevToolsDeviceDiscovery::DeviceListCallback& callback)
: callback_(callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- device_manager->QueryDevices(
- base::Bind(&DiscoveryRequest::ReceivedDevices, this));
}
DevToolsDeviceDiscovery::DiscoveryRequest::~DiscoveryRequest() {
@@ -599,10 +610,9 @@ DevToolsDeviceDiscovery::CreateBrowserAgentHost(
void DevToolsDeviceDiscovery::RequestDeviceList() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- new DiscoveryRequest(
- device_manager_,
- base::Bind(&DevToolsDeviceDiscovery::ReceivedDeviceList,
- weak_factory_.GetWeakPtr()));
+ DiscoveryRequest::Start(
+ device_manager_, base::Bind(&DevToolsDeviceDiscovery::ReceivedDeviceList,
+ weak_factory_.GetWeakPtr()));
}
void DevToolsDeviceDiscovery::ReceivedDeviceList(
diff --git a/chromium/chrome/browser/devtools/device/port_forwarding_controller.cc b/chromium/chrome/browser/devtools/device/port_forwarding_controller.cc
index 601373da41f..5081852e007 100644
--- a/chromium/chrome/browser/devtools/device/port_forwarding_controller.cc
+++ b/chromium/chrome/browser/devtools/device/port_forwarding_controller.cc
@@ -207,7 +207,7 @@ class SocketTunnel {
base::Bind(
&SocketTunnel::OnRead, base::Unretained(this), from, to, buffer));
if (result != net::ERR_IO_PENDING)
- OnRead(from, to, buffer, result);
+ OnRead(from, to, std::move(buffer), result);
}
void OnRead(net::StreamSocket* from,
@@ -221,7 +221,7 @@ class SocketTunnel {
int total = result;
scoped_refptr<net::DrainableIOBuffer> drainable =
- new net::DrainableIOBuffer(buffer.get(), total);
+ base::MakeRefCounted<net::DrainableIOBuffer>(std::move(buffer), total);
++pending_writes_;
result = to->Write(drainable.get(), total,
diff --git a/chromium/chrome/browser/devtools/devtools_auto_opener.cc b/chromium/chrome/browser/devtools/devtools_auto_opener.cc
index 834030e387d..d55387ba052 100644
--- a/chromium/chrome/browser/devtools/devtools_auto_opener.cc
+++ b/chromium/chrome/browser/devtools/devtools_auto_opener.cc
@@ -15,10 +15,15 @@ DevToolsAutoOpener::DevToolsAutoOpener()
DevToolsAutoOpener::~DevToolsAutoOpener() {
}
-void DevToolsAutoOpener::TabInsertedAt(TabStripModel* tab_strip_model,
- content::WebContents* contents,
- int index,
- bool foreground) {
- if (!DevToolsWindow::IsDevToolsWindow(contents))
- DevToolsWindow::OpenDevToolsWindow(contents);
+void DevToolsAutoOpener::OnTabStripModelChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) {
+ if (change.type() != TabStripModelChange::kInserted)
+ return;
+
+ for (const auto& delta : change.deltas()) {
+ if (!DevToolsWindow::IsDevToolsWindow(delta.insert.contents))
+ DevToolsWindow::OpenDevToolsWindow(delta.insert.contents);
+ }
}
diff --git a/chromium/chrome/browser/devtools/devtools_auto_opener.h b/chromium/chrome/browser/devtools/devtools_auto_opener.h
index 7efe2ea7b79..05a52465c4d 100644
--- a/chromium/chrome/browser/devtools/devtools_auto_opener.h
+++ b/chromium/chrome/browser/devtools/devtools_auto_opener.h
@@ -15,10 +15,10 @@ class DevToolsAutoOpener : public TabStripModelObserver {
private:
// TabStripModelObserver overrides.
- void TabInsertedAt(TabStripModel* tab_strip_model,
- content::WebContents* contents,
- int index,
- bool foreground) override;
+ void OnTabStripModelChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) override;
BrowserTabStripTracker browser_tab_strip_tracker_;
diff --git a/chromium/chrome/browser/devtools/devtools_browser_context_manager.cc b/chromium/chrome/browser/devtools/devtools_browser_context_manager.cc
new file mode 100644
index 00000000000..f762f80c69f
--- /dev/null
+++ b/chromium/chrome/browser/devtools/devtools_browser_context_manager.cc
@@ -0,0 +1,127 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/devtools/devtools_browser_context_manager.h"
+
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_list.h"
+
+DevToolsBrowserContextManager::DevToolsBrowserContextManager()
+ : weak_factory_(this) {}
+
+DevToolsBrowserContextManager::~DevToolsBrowserContextManager() = default;
+
+// static
+DevToolsBrowserContextManager& DevToolsBrowserContextManager::GetInstance() {
+ static base::NoDestructor<DevToolsBrowserContextManager> instance;
+ return *instance;
+}
+
+Profile* DevToolsBrowserContextManager::GetProfileById(
+ const std::string& context_id) {
+ auto it = registrations_.find(context_id);
+ if (it == registrations_.end())
+ return nullptr;
+ return it->second->profile();
+}
+
+content::BrowserContext* DevToolsBrowserContextManager::CreateBrowserContext() {
+ Profile* original_profile =
+ ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
+
+ auto registration =
+ IndependentOTRProfileManager::GetInstance()->CreateFromOriginalProfile(
+ original_profile,
+ base::BindOnce(
+ &DevToolsBrowserContextManager::OnOriginalProfileDestroyed,
+ weak_factory_.GetWeakPtr()));
+ content::BrowserContext* context = registration->profile();
+ const std::string& context_id = context->UniqueId();
+ registrations_[context_id] = std::move(registration);
+ return context;
+}
+
+std::vector<content::BrowserContext*>
+DevToolsBrowserContextManager::GetBrowserContexts() {
+ std::vector<content::BrowserContext*> result;
+ for (const auto& registration_pair : registrations_)
+ result.push_back(registration_pair.second->profile());
+ return result;
+}
+
+content::BrowserContext*
+DevToolsBrowserContextManager::GetDefaultBrowserContext() {
+ return ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
+}
+
+void DevToolsBrowserContextManager::DisposeBrowserContext(
+ content::BrowserContext* context,
+ content::DevToolsManagerDelegate::DisposeCallback callback) {
+ std::string context_id = context->UniqueId();
+ if (pending_context_disposals_.find(context_id) !=
+ pending_context_disposals_.end()) {
+ std::move(callback).Run(false, "Disposal of browser context " + context_id +
+ " is already pending");
+ return;
+ }
+ auto it = registrations_.find(context_id);
+ if (it == registrations_.end()) {
+ std::move(callback).Run(
+ false, "Failed to find browser context with id " + context_id);
+ return;
+ }
+
+ Profile* profile = it->second->profile();
+ bool has_opened_browser = false;
+ for (auto* opened_browser : *BrowserList::GetInstance()) {
+ if (opened_browser->profile() == profile) {
+ has_opened_browser = true;
+ break;
+ }
+ }
+
+ // If no browsers are opened - dispose right away.
+ if (!has_opened_browser) {
+ registrations_.erase(it);
+ std::move(callback).Run(true, "");
+ return;
+ }
+
+ if (pending_context_disposals_.empty())
+ BrowserList::AddObserver(this);
+
+ pending_context_disposals_[context_id] = std::move(callback);
+ BrowserList::CloseAllBrowsersWithIncognitoProfile(
+ profile, base::DoNothing(), base::DoNothing(),
+ true /* skip_beforeunload */);
+}
+
+void DevToolsBrowserContextManager::OnOriginalProfileDestroyed(
+ Profile* profile) {
+ base::EraseIf(registrations_, [&profile](const auto& it) {
+ return it.second->profile()->GetOriginalProfile() == profile;
+ });
+}
+
+void DevToolsBrowserContextManager::OnBrowserRemoved(Browser* browser) {
+ std::string context_id = browser->profile()->UniqueId();
+ auto pending_disposal = pending_context_disposals_.find(context_id);
+ if (pending_disposal == pending_context_disposals_.end())
+ return;
+ for (auto* opened_browser : *BrowserList::GetInstance()) {
+ if (opened_browser->profile() == browser->profile())
+ return;
+ }
+ auto it = registrations_.find(context_id);
+ // We cannot delete immediately here: the profile might still be referenced
+ // during the browser tier-down process.
+ base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE,
+ it->second.release());
+ registrations_.erase(it);
+ std::move(pending_disposal->second).Run(true, "");
+ pending_context_disposals_.erase(pending_disposal);
+ if (pending_context_disposals_.empty())
+ BrowserList::RemoveObserver(this);
+}
diff --git a/chromium/chrome/browser/devtools/devtools_browser_context_manager.h b/chromium/chrome/browser/devtools/devtools_browser_context_manager.h
new file mode 100644
index 00000000000..6a001856b68
--- /dev/null
+++ b/chromium/chrome/browser/devtools/devtools_browser_context_manager.h
@@ -0,0 +1,44 @@
+// 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 CHROME_BROWSER_DEVTOOLS_DEVTOOLS_BROWSER_CONTEXT_MANAGER_H_
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_BROWSER_CONTEXT_MANAGER_H_
+
+#include "base/memory/weak_ptr.h"
+#include "base/no_destructor.h"
+#include "chrome/browser/media/router/presentation/independent_otr_profile_manager.h"
+#include "content/public/browser/devtools_manager_delegate.h"
+
+class DevToolsBrowserContextManager : public BrowserListObserver {
+ public:
+ static DevToolsBrowserContextManager& GetInstance();
+
+ Profile* GetProfileById(const std::string& browser_context_id);
+ std::vector<content::BrowserContext*> GetBrowserContexts();
+ content::BrowserContext* GetDefaultBrowserContext();
+ content::BrowserContext* CreateBrowserContext();
+ void DisposeBrowserContext(
+ content::BrowserContext* context,
+ content::DevToolsManagerDelegate::DisposeCallback callback);
+
+ private:
+ friend class base::NoDestructor<DevToolsBrowserContextManager>;
+ DevToolsBrowserContextManager();
+ ~DevToolsBrowserContextManager() override;
+ void OnOriginalProfileDestroyed(Profile* profile);
+
+ void OnBrowserRemoved(Browser* browser) override;
+
+ base::flat_map<
+ std::string,
+ std::unique_ptr<IndependentOTRProfileManager::OTRProfileRegistration>>
+ registrations_;
+ base::flat_map<std::string, content::DevToolsManagerDelegate::DisposeCallback>
+ pending_context_disposals_;
+
+ base::WeakPtrFactory<DevToolsBrowserContextManager> weak_factory_;
+ DISALLOW_COPY_AND_ASSIGN(DevToolsBrowserContextManager);
+};
+
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_BROWSER_CONTEXT_MANAGER_H_
diff --git a/chromium/chrome/browser/devtools/devtools_eye_dropper.cc b/chromium/chrome/browser/devtools/devtools_eye_dropper.cc
index b82f19a109b..3bb3aa80cc8 100644
--- a/chromium/chrome/browser/devtools/devtools_eye_dropper.cc
+++ b/chromium/chrome/browser/devtools/devtools_eye_dropper.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/memory/shared_memory_mapping.h"
#include "build/build_config.h"
#include "cc/paint/skia_paint_canvas.h"
#include "components/viz/common/features.h"
@@ -18,6 +19,7 @@
#include "content/public/common/cursor_info.h"
#include "content/public/common/screen_info.h"
#include "media/base/limits.h"
+#include "media/base/video_frame.h"
#include "third_party/blink/public/platform/web_input_event.h"
#include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/skia/include/core/SkCanvas.h"
@@ -33,18 +35,12 @@ DevToolsEyeDropper::DevToolsEyeDropper(content::WebContents* web_contents,
last_cursor_x_(-1),
last_cursor_y_(-1),
host_(nullptr),
- use_video_capture_api_(
- base::FeatureList::IsEnabled(features::kVizDisplayCompositor) ||
- base::FeatureList::IsEnabled(
- features::kUseVideoCaptureApiForDevToolsSnapshots)),
weak_factory_(this) {
mouse_event_callback_ =
base::Bind(&DevToolsEyeDropper::HandleMouseEvent, base::Unretained(this));
content::RenderViewHost* rvh = web_contents->GetRenderViewHost();
- if (rvh) {
+ if (rvh)
AttachToHost(rvh->GetWidget());
- UpdateFrame();
- }
}
DevToolsEyeDropper::~DevToolsEyeDropper() {
@@ -55,9 +51,6 @@ void DevToolsEyeDropper::AttachToHost(content::RenderWidgetHost* host) {
host_ = host;
host_->AddMouseEventCallback(mouse_event_callback_);
- if (!use_video_capture_api_)
- return;
-
// The view can be null if the renderer process has crashed.
// (https://crbug.com/847363)
if (!host_->GetView())
@@ -94,10 +87,8 @@ void DevToolsEyeDropper::DetachFromHost() {
}
void DevToolsEyeDropper::RenderViewCreated(content::RenderViewHost* host) {
- if (!host_) {
+ if (!host_)
AttachToHost(host->GetWidget());
- UpdateFrame();
- }
}
void DevToolsEyeDropper::RenderViewDeleted(content::RenderViewHost* host) {
@@ -113,43 +104,15 @@ void DevToolsEyeDropper::RenderViewHostChanged(
if ((old_host && old_host->GetWidget() == host_) || (!old_host && !host_)) {
DetachFromHost();
AttachToHost(new_host->GetWidget());
- UpdateFrame();
}
}
-void DevToolsEyeDropper::DidReceiveCompositorFrame() {
- UpdateFrame();
-}
-
-void DevToolsEyeDropper::UpdateFrame() {
- if (use_video_capture_api_ || !host_ || !host_->GetView())
- return;
-
- // TODO(miu): This is the wrong size. It's the size of the view on-screen, and
- // not the rendering size of the view. The latter is what is wanted here, so
- // that the resulting bitmap's pixel coordinates line-up with the
- // blink::WebMouseEvent coordinates. http://crbug.com/73362
- gfx::Size should_be_rendering_size = host_->GetView()->GetViewBounds().size();
- host_->GetView()->CopyFromSurface(
- gfx::Rect(), should_be_rendering_size,
- base::BindOnce(&DevToolsEyeDropper::FrameUpdated,
- weak_factory_.GetWeakPtr()));
-}
-
void DevToolsEyeDropper::ResetFrame() {
frame_.reset();
last_cursor_x_ = -1;
last_cursor_y_ = -1;
}
-void DevToolsEyeDropper::FrameUpdated(const SkBitmap& bitmap) {
- DCHECK(!use_video_capture_api_);
- if (bitmap.drawsNothing())
- return;
- frame_ = bitmap;
- UpdateCursor();
-}
-
bool DevToolsEyeDropper::HandleMouseEvent(const blink::WebMouseEvent& event) {
last_cursor_x_ = event.PositionInWidget().x;
last_cursor_y_ = event.PositionInWidget().y;
@@ -311,8 +274,7 @@ void DevToolsEyeDropper::UpdateCursor() {
}
void DevToolsEyeDropper::OnFrameCaptured(
- mojo::ScopedSharedBufferHandle buffer,
- uint32_t buffer_size,
+ base::ReadOnlySharedMemoryRegion data,
::media::mojom::VideoFrameInfoPtr info,
const gfx::Rect& update_rect,
const gfx::Rect& content_rect,
@@ -324,25 +286,46 @@ void DevToolsEyeDropper::OnFrameCaptured(
return;
}
- if (!buffer.is_valid()) {
+ if (!data.IsValid()) {
callbacks->Done();
return;
}
- mojo::ScopedSharedBufferMapping mapping = buffer->Map(buffer_size);
- if (!mapping) {
+ base::ReadOnlySharedMemoryMapping mapping = data.Map();
+ if (!mapping.IsValid()) {
DLOG(ERROR) << "Shared memory mapping failed.";
return;
}
+ if (mapping.size() <
+ media::VideoFrame::AllocationSize(info->pixel_format, info->coded_size)) {
+ DLOG(ERROR) << "Shared memory size was less than expected.";
+ return;
+ }
- SkImageInfo image_info = SkImageInfo::MakeN32(
- content_rect.width(), content_rect.height(), kPremul_SkAlphaType);
- SkPixmap pixmap(image_info, mapping.get(),
- media::VideoFrame::RowBytes(media::VideoFrame::kARGBPlane,
- info->pixel_format,
- info->coded_size.width()));
- frame_.installPixels(pixmap);
- shared_memory_mapping_ = std::move(mapping);
- shared_memory_releaser_ = std::move(callbacks);
+ // The SkBitmap's pixels will be marked as immutable, but the installPixels()
+ // API requires a non-const pointer. So, cast away the const.
+ void* const pixels = const_cast<void*>(mapping.memory());
+
+ // Call installPixels() with a |releaseProc| that: 1) notifies the capturer
+ // that this consumer has finished with the frame, and 2) releases the shared
+ // memory mapping.
+ struct FramePinner {
+ // Keeps the shared memory that backs |frame_| mapped.
+ base::ReadOnlySharedMemoryMapping mapping;
+ // Prevents FrameSinkVideoCapturer from recycling the shared memory that
+ // backs |frame_|.
+ viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr releaser;
+ };
+ frame_.installPixels(
+ SkImageInfo::MakeN32(content_rect.width(), content_rect.height(),
+ kPremul_SkAlphaType),
+ pixels,
+ media::VideoFrame::RowBytes(media::VideoFrame::kARGBPlane,
+ info->pixel_format, info->coded_size.width()),
+ [](void* addr, void* context) {
+ delete static_cast<FramePinner*>(context);
+ },
+ new FramePinner{std::move(mapping), std::move(callbacks)});
+ frame_.setImmutable();
UpdateCursor();
}
diff --git a/chromium/chrome/browser/devtools/devtools_eye_dropper.h b/chromium/chrome/browser/devtools/devtools_eye_dropper.h
index 0dde971eb9a..aaa87d23db3 100644
--- a/chromium/chrome/browser/devtools/devtools_eye_dropper.h
+++ b/chromium/chrome/browser/devtools/devtools_eye_dropper.h
@@ -13,7 +13,6 @@
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents_observer.h"
#include "media/renderers/paint_canvas_video_renderer.h"
-#include "mojo/public/cpp/bindings/binding.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace blink {
@@ -34,13 +33,11 @@ class DevToolsEyeDropper : public content::WebContentsObserver,
void DetachFromHost();
// content::WebContentsObserver.
- void DidReceiveCompositorFrame() override;
void RenderViewCreated(content::RenderViewHost* host) override;
void RenderViewDeleted(content::RenderViewHost* host) override;
void RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) override;
- void UpdateFrame();
void ResetFrame();
void FrameUpdated(const SkBitmap&);
bool HandleMouseEvent(const blink::WebMouseEvent& event);
@@ -48,21 +45,13 @@ class DevToolsEyeDropper : public content::WebContentsObserver,
// viz::mojom::FrameSinkVideoConsumer implementation.
void OnFrameCaptured(
- mojo::ScopedSharedBufferHandle buffer,
- uint32_t buffer_size,
+ base::ReadOnlySharedMemoryRegion data,
::media::mojom::VideoFrameInfoPtr info,
const gfx::Rect& update_rect,
const gfx::Rect& content_rect,
viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks) override;
void OnStopped() override;
- // This object keeps the shared memory that backs |frame_| mapped.
- mojo::ScopedSharedBufferMapping shared_memory_mapping_;
-
- // This object prevents FrameSinkVideoCapturer from recycling the shared
- // memory that backs |frame_|.
- viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr shared_memory_releaser_;
-
EyeDropperCallback callback_;
SkBitmap frame_;
int last_cursor_x_;
@@ -70,7 +59,6 @@ class DevToolsEyeDropper : public content::WebContentsObserver,
content::RenderWidgetHost::MouseEventCallback mouse_event_callback_;
content::RenderWidgetHost* host_;
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;
- const bool use_video_capture_api_;
media::PaintCanvasVideoRenderer video_renderer_;
base::WeakPtrFactory<DevToolsEyeDropper> weak_factory_;
diff --git a/chromium/chrome/browser/devtools/devtools_file_helper.cc b/chromium/chrome/browser/devtools/devtools_file_helper.cc
index 104c3e6501c..0cc55275037 100644
--- a/chromium/chrome/browser/devtools/devtools_file_helper.cc
+++ b/chromium/chrome/browser/devtools/devtools_file_helper.cc
@@ -14,7 +14,7 @@
#include "base/macros.h"
#include "base/md5.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/value_conversions.h"
#include "chrome/browser/browser_process.h"
@@ -296,8 +296,7 @@ void DevToolsFileHelper::SaveAsFileSelected(const std::string& url,
DictionaryPrefUpdate update(profile_->GetPrefs(),
prefs::kDevToolsEditedFiles);
base::DictionaryValue* files_map = update.Get();
- files_map->SetWithoutPathExpansion(base::MD5String(url),
- base::CreateFilePathValue(path));
+ files_map->SetKey(base::MD5String(url), base::CreateFilePathValue(path));
std::string file_system_path = path.AsUTF8Unsafe();
callback.Run(file_system_path);
file_task_runner_->PostTask(FROM_HERE, BindOnce(&WriteToFile, path, content));
diff --git a/chromium/chrome/browser/devtools/devtools_file_system_indexer.cc b/chromium/chrome/browser/devtools/devtools_file_system_indexer.cc
index 24e0ba728f6..f682861641d 100644
--- a/chromium/chrome/browser/devtools/devtools_file_system_indexer.cc
+++ b/chromium/chrome/browser/devtools/devtools_file_system_indexer.cc
@@ -19,8 +19,8 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/lazy_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/lazy_task_runner.h"
+#include "base/task/post_task.h"
#include "content/public/browser/browser_thread.h"
@@ -41,8 +41,8 @@ namespace {
using std::set;
base::SequencedTaskRunner* impl_task_runner() {
- constexpr base::TaskTraits kBlockingTraits = {base::MayBlock(),
- base::TaskPriority::BACKGROUND};
+ constexpr base::TaskTraits kBlockingTraits = {
+ base::MayBlock(), base::TaskPriority::BEST_EFFORT};
static base::LazySequencedTaskRunner s_sequenced_task_task_runner =
LAZY_SEQUENCED_TASK_RUNNER_INITIALIZER(kBlockingTraits);
return s_sequenced_task_task_runner.Get().get();
diff --git a/chromium/chrome/browser/devtools/devtools_file_watcher.cc b/chromium/chrome/browser/devtools/devtools_file_watcher.cc
index bfd7570a957..3ea1d41d658 100644
--- a/chromium/chrome/browser/devtools/devtools_file_watcher.cc
+++ b/chromium/chrome/browser/devtools/devtools_file_watcher.cc
@@ -16,7 +16,7 @@
#include "base/files/file_util.h"
#include "base/memory/ref_counted.h"
#include "base/sequenced_task_runner.h"
-#include "base/task_scheduler/lazy_task_runner.h"
+#include "base/task/lazy_task_runner.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "content/public/browser/browser_thread.h"
@@ -185,8 +185,8 @@ void DevToolsFileWatcher::SharedFileWatcher::DispatchNotifications() {
namespace {
base::SequencedTaskRunner* impl_task_runner() {
- constexpr base::TaskTraits kImplTaskTraits = {base::MayBlock(),
- base::TaskPriority::BACKGROUND};
+ constexpr base::TaskTraits kImplTaskTraits = {
+ base::MayBlock(), base::TaskPriority::BEST_EFFORT};
static base::LazySequencedTaskRunner s_file_task_runner =
LAZY_SEQUENCED_TASK_RUNNER_INITIALIZER(kImplTaskTraits);
diff --git a/chromium/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chromium/chrome/browser/devtools/devtools_sanity_browsertest.cc
index a1219d85870..be6f28bdc51 100644
--- a/chromium/chrome/browser/devtools/devtools_sanity_browsertest.cc
+++ b/chromium/chrome/browser/devtools/devtools_sanity_browsertest.cc
@@ -55,6 +55,7 @@
#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/autofill_manager_test_delegate.h"
+#include "components/autofill/core/common/autofill_features.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_data.h"
@@ -300,7 +301,7 @@ DevToolsWindowBeforeUnloadObserver::DevToolsWindowBeforeUnloadObserver(
void DevToolsWindowBeforeUnloadObserver::Wait() {
if (m_fired)
return;
- message_loop_runner_ = new content::MessageLoopRunner;
+ message_loop_runner_ = base::MakeRefCounted<content::MessageLoopRunner>();
message_loop_runner_->Run();
}
@@ -339,8 +340,7 @@ class DevToolsBeforeUnloadTest: public DevToolsSanityTest {
base::Callback<void(void)> close_method,
bool wait_for_browser_close = true) {
OpenDevToolsWindow(kDebuggerTestPage, is_docked);
- scoped_refptr<content::MessageLoopRunner> runner =
- new content::MessageLoopRunner;
+ auto runner = base::MakeRefCounted<content::MessageLoopRunner>();
DevToolsWindowTesting::Get(window_)->
SetCloseCallback(runner->QuitClosure());
InjectBeforeUnloadListener(main_web_contents());
@@ -728,8 +728,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsBeforeUnloadTest,
DevToolsWindow* devtools_window = OpenDevToolWindowOnWebContents(
GetInspectedTab(), false);
- scoped_refptr<content::MessageLoopRunner> runner =
- new content::MessageLoopRunner;
+ auto runner = base::MakeRefCounted<content::MessageLoopRunner>();
DevToolsWindowTesting::Get(devtools_window)->SetCloseCallback(
runner->QuitClosure());
@@ -762,19 +761,19 @@ IN_PROC_BROWSER_TEST_F(DevToolsBeforeUnloadTest,
LoadTestPage(kDebuggerTestPage);
std::vector<DevToolsWindow*> windows;
- std::vector<content::WindowedNotificationObserver*> close_observers;
+ std::vector<std::unique_ptr<content::WindowedNotificationObserver>>
+ close_observers;
content::WebContents* inspected_web_contents = GetInspectedTab();
for (int i = 0; i < 3; ++i) {
DevToolsWindow* devtools_window = OpenDevToolWindowOnWebContents(
inspected_web_contents, i == 0);
windows.push_back(devtools_window);
- content::WindowedNotificationObserver* close_observer =
- new content::WindowedNotificationObserver(
- content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
- content::Source<content::WebContents>(
- DevToolsWindowTesting::Get(devtools_window)->
- main_web_contents()));
- close_observers.push_back(close_observer);
+ close_observers.push_back(
+ std::make_unique<content::WindowedNotificationObserver>(
+ content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
+ content::Source<content::WebContents>(
+ DevToolsWindowTesting::Get(devtools_window)
+ ->main_web_contents())));
inspected_web_contents =
DevToolsWindowTesting::Get(devtools_window)->main_web_contents();
}
@@ -812,10 +811,8 @@ IN_PROC_BROWSER_TEST_F(DevToolsBeforeUnloadTest,
AcceptModalDialog();
close_observer.Wait();
}
- for (size_t i = 0; i < close_observers.size(); ++i) {
- close_observers[i]->Wait();
- delete close_observers[i];
- }
+ for (auto& close_observer : close_observers)
+ close_observer->Wait();
}
// Tests scripts panel showing.
@@ -1362,8 +1359,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsExtensionTest,
DevToolsExtensionSecurityPolicyGrants) {
ASSERT_TRUE(embedded_test_server()->Start());
- std::unique_ptr<extensions::TestExtensionDir> dir(
- new extensions::TestExtensionDir());
+ auto dir = std::make_unique<extensions::TestExtensionDir>();
extensions::DictionaryBuilder manifest;
dir->WriteManifest(extensions::DictionaryBuilder()
@@ -1648,7 +1644,7 @@ class AutofillDevToolsSanityTest : public DevToolsSanityTest,
void SetUpOnMainThread() override {
const bool popup_views_enabled = GetParam();
scoped_feature_list_.InitWithFeatureState(
- autofill::kAutofillExpandedPopupViews, popup_views_enabled);
+ autofill::features::kAutofillExpandedPopupViews, popup_views_enabled);
}
private:
@@ -1752,7 +1748,7 @@ class DevToolsAutoOpenerTest : public DevToolsSanityTest {
public:
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(switches::kAutoOpenDevToolsForTabs);
- observer_.reset(new DevToolsWindowCreationObserver());
+ observer_ = std::make_unique<DevToolsWindowCreationObserver>();
}
protected:
std::unique_ptr<DevToolsWindowCreationObserver> observer_;
@@ -1930,9 +1926,8 @@ class DevToolsSanityExtensionTest : public extensions::ExtensionBrowserTest {
// Installs an extensions, emulating that it has been force-installed by
// policy.
// Contains assertions - callers should wrap calls of this method in
- // |ASSERT_NO_FATAL_FAILURE|. Fills |*out_web_contents| with a |WebContents|
- // that belongs to the force-installed extension.
- void ForceInstallExtension(content::WebContents** out_web_contents) {
+ // |ASSERT_NO_FATAL_FAILURE|.
+ void ForceInstallExtension(std::string* extension_id) {
base::FilePath crx_path;
base::PathService::Get(chrome::DIR_TEST_DATA, &crx_path);
crx_path = crx_path.AppendASCII("devtools")
@@ -1941,8 +1936,15 @@ class DevToolsSanityExtensionTest : public extensions::ExtensionBrowserTest {
const Extension* extension = InstallExtension(
crx_path, 1, extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD);
ASSERT_TRUE(extension);
+ *extension_id = extension->id();
+ }
- GURL url("chrome-extension://" + extension->id() + "/options.html");
+ // Same as above, but also fills |*out_web_contents| with a |WebContents|
+ // that has been navigated to the force-installed extension.
+ void ForceInstallExtensionAndOpen(content::WebContents** out_web_contents) {
+ std::string extension_id;
+ ForceInstallExtension(&extension_id);
+ GURL url("chrome-extension://" + extension_id + "/options.html");
ui_test_utils::NavigateToURL(browser(), url);
content::WebContents* web_contents =
browser()->tab_strip_model()->GetWebContentsAt(0);
@@ -1958,13 +1960,38 @@ IN_PROC_BROWSER_TEST_F(DevToolsSanityExtensionTest,
kDisallowedForForceInstalledExtensions));
content::WebContents* web_contents = nullptr;
- ASSERT_NO_FATAL_FAILURE(ForceInstallExtension(&web_contents));
+ ASSERT_NO_FATAL_FAILURE(ForceInstallExtensionAndOpen(&web_contents));
DevToolsWindow::OpenDevToolsWindow(web_contents);
auto agent_host = content::DevToolsAgentHost::GetOrCreateFor(web_contents);
ASSERT_FALSE(DevToolsWindow::FindDevToolsWindow(agent_host.get()));
}
+IN_PROC_BROWSER_TEST_F(
+ DevToolsSanityExtensionTest,
+ PolicyDisallowedForForceInstalledExtensionsAfterNavigation) {
+ browser()->profile()->GetPrefs()->SetInteger(
+ prefs::kDevToolsAvailability,
+ static_cast<int>(policy::DeveloperToolsPolicyHandler::Availability::
+ kDisallowedForForceInstalledExtensions));
+
+ std::string extension_id;
+ ASSERT_NO_FATAL_FAILURE(ForceInstallExtension(&extension_id));
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetWebContentsAt(0);
+
+ // It's possible to open DevTools for about:blank.
+ ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
+ DevToolsWindow::OpenDevToolsWindow(web_contents);
+ auto agent_host = content::DevToolsAgentHost::GetOrCreateFor(web_contents);
+ ASSERT_TRUE(DevToolsWindow::FindDevToolsWindow(agent_host.get()));
+
+ // Navigating to extension page should close DevTools.
+ ui_test_utils::NavigateToURL(
+ browser(), GURL("chrome-extension://" + extension_id + "/options.html"));
+ ASSERT_FALSE(DevToolsWindow::FindDevToolsWindow(agent_host.get()));
+}
+
class DevToolsAllowedByCommandLineSwitch : public DevToolsSanityExtensionTest {
public:
void SetUpCommandLine(base::CommandLine* command_line) override {
@@ -1989,7 +2016,7 @@ IN_PROC_BROWSER_TEST_F(DevToolsAllowedByCommandLineSwitch,
kDisallowedForForceInstalledExtensions));
content::WebContents* web_contents = nullptr;
- ASSERT_NO_FATAL_FAILURE(ForceInstallExtension(&web_contents));
+ ASSERT_NO_FATAL_FAILURE(ForceInstallExtensionAndOpen(&web_contents));
DevToolsWindow::OpenDevToolsWindow(web_contents);
auto agent_host = content::DevToolsAgentHost::GetOrCreateFor(web_contents);
@@ -2097,12 +2124,13 @@ class MockWebUIProvider
public:
MockWebUIProvider(const std::string& source, const std::string& content)
: source_(source), content_(content) {}
+ ~MockWebUIProvider() override = default;
- content::WebUIController* NewWebUI(content::WebUI* web_ui,
- const GURL& url) override {
+ std::unique_ptr<content::WebUIController> NewWebUI(content::WebUI* web_ui,
+ const GURL& url) override {
content::URLDataSource::Add(Profile::FromWebUI(web_ui),
new StaticURLDataSource(source_, content_));
- return new content::WebUIController(web_ui);
+ return std::make_unique<content::WebUIController>(web_ui);
}
private:
diff --git a/chromium/chrome/browser/devtools/devtools_ui_bindings.cc b/chromium/chrome/browser/devtools/devtools_ui_bindings.cc
index 44f3282497a..8ddcad12a00 100644
--- a/chromium/chrome/browser/devtools/devtools_ui_bindings.cc
+++ b/chromium/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -61,6 +61,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/permissions/permissions_data.h"
#include "ipc/ipc_channel.h"
+#include "net/base/completion_once_callback.h"
#include "net/base/escape.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -216,11 +217,11 @@ class ResponseWriter : public net::URLFetcherResponseWriter {
~ResponseWriter() override;
// URLFetcherResponseWriter overrides:
- int Initialize(const net::CompletionCallback& callback) override;
+ int Initialize(net::CompletionOnceCallback callback) override;
int Write(net::IOBuffer* buffer,
int num_bytes,
- const net::CompletionCallback& callback) override;
- int Finish(int net_error, const net::CompletionCallback& callback) override;
+ net::CompletionOnceCallback callback) override;
+ int Finish(int net_error, net::CompletionOnceCallback callback) override;
private:
base::WeakPtr<DevToolsUIBindings> bindings_;
@@ -239,13 +240,13 @@ ResponseWriter::ResponseWriter(base::WeakPtr<DevToolsUIBindings> bindings,
ResponseWriter::~ResponseWriter() {
}
-int ResponseWriter::Initialize(const net::CompletionCallback& callback) {
+int ResponseWriter::Initialize(net::CompletionOnceCallback callback) {
return net::OK;
}
int ResponseWriter::Write(net::IOBuffer* buffer,
int num_bytes,
- const net::CompletionCallback& callback) {
+ net::CompletionOnceCallback callback) {
std::string chunk = std::string(buffer->data(), num_bytes);
bool encoded = false;
if (!base::IsStringUTF8(chunk)) {
@@ -266,7 +267,7 @@ int ResponseWriter::Write(net::IOBuffer* buffer,
}
int ResponseWriter::Finish(int net_error,
- const net::CompletionCallback& callback) {
+ net::CompletionOnceCallback callback) {
return net::OK;
}
@@ -1255,13 +1256,32 @@ void DevToolsUIBindings::FilePathsChanged(
const std::vector<std::string>& changed_paths,
const std::vector<std::string>& added_paths,
const std::vector<std::string>& removed_paths) {
- base::ListValue changed, added, removed;
- changed.AppendStrings(changed_paths);
- added.AppendStrings(added_paths);
- removed.AppendStrings(removed_paths);
-
- CallClientFunction("DevToolsAPI.fileSystemFilesChangedAddedRemoved", &changed,
- &added, &removed);
+ const int kMaxPathsPerMessage = 1000;
+ size_t changed_index = 0;
+ size_t added_index = 0;
+ size_t removed_index = 0;
+ // Dispatch limited amount of file paths in a time to avoid
+ // IPC max message size limit. See https://crbug.com/797817.
+ while (changed_index < changed_paths.size() ||
+ added_index < added_paths.size() ||
+ removed_index < removed_paths.size()) {
+ int budget = kMaxPathsPerMessage;
+ base::ListValue changed, added, removed;
+ while (budget > 0 && changed_index < changed_paths.size()) {
+ changed.AppendString(changed_paths[changed_index++]);
+ --budget;
+ }
+ while (budget > 0 && added_index < added_paths.size()) {
+ added.AppendString(added_paths[added_index++]);
+ --budget;
+ }
+ while (budget > 0 && removed_index < removed_paths.size()) {
+ removed.AppendString(removed_paths[removed_index++]);
+ --budget;
+ }
+ CallClientFunction("DevToolsAPI.fileSystemFilesChangedAddedRemoved",
+ &changed, &added, &removed);
+ }
}
void DevToolsUIBindings::IndexingTotalWorkCalculated(
diff --git a/chromium/chrome/browser/devtools/global_confirm_info_bar.cc b/chromium/chrome/browser/devtools/global_confirm_info_bar.cc
index d283a99766a..e2622431a4c 100644
--- a/chromium/chrome/browser/devtools/global_confirm_info_bar.cc
+++ b/chromium/chrome/browser/devtools/global_confirm_info_bar.cc
@@ -177,11 +177,15 @@ GlobalConfirmInfoBar::~GlobalConfirmInfoBar() {
}
}
-void GlobalConfirmInfoBar::TabInsertedAt(TabStripModel* tab_strip_model,
- content::WebContents* web_contents,
- int index,
- bool foreground) {
- MaybeAddInfoBar(web_contents);
+void GlobalConfirmInfoBar::OnTabStripModelChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) {
+ if (change.type() != TabStripModelChange::kInserted)
+ return;
+
+ for (const auto& delta : change.deltas())
+ MaybeAddInfoBar(delta.insert.contents);
}
void GlobalConfirmInfoBar::TabChangedAt(content::WebContents* web_contents,
diff --git a/chromium/chrome/browser/devtools/global_confirm_info_bar.h b/chromium/chrome/browser/devtools/global_confirm_info_bar.h
index 7843f269827..6410931d60f 100644
--- a/chromium/chrome/browser/devtools/global_confirm_info_bar.h
+++ b/chromium/chrome/browser/devtools/global_confirm_info_bar.h
@@ -43,10 +43,10 @@ class GlobalConfirmInfoBar : public TabStripModelObserver,
class DelegateProxy;
// TabStripModelObserver:
- void TabInsertedAt(TabStripModel* tab_strip_model,
- content::WebContents* web_contents,
- int index,
- bool foreground) override;
+ void OnTabStripModelChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) override;
void TabChangedAt(content::WebContents* web_contents,
int index,
TabChangeType change_type) override;
diff --git a/chromium/chrome/browser/devtools/inspector_protocol_config.json b/chromium/chrome/browser/devtools/inspector_protocol_config.json
index 38dfa64c028..923fea67431 100644
--- a/chromium/chrome/browser/devtools/inspector_protocol_config.json
+++ b/chromium/chrome/browser/devtools/inspector_protocol_config.json
@@ -18,8 +18,7 @@
},
{
"domain": "Target",
- "include": [ "setRemoteLocations", "createBrowserContext", "getBrowserContexts", "createTarget", "disposeBrowserContext" ],
- "async": ["disposeBrowserContext"],
+ "include": [ "setRemoteLocations", "createTarget" ],
"include_events": []
},
{
diff --git a/chromium/chrome/browser/devtools/protocol/target_handler.cc b/chromium/chrome/browser/devtools/protocol/target_handler.cc
index f5c62726504..84c56145490 100644
--- a/chromium/chrome/browser/devtools/protocol/target_handler.cc
+++ b/chromium/chrome/browser/devtools/protocol/target_handler.cc
@@ -5,151 +5,13 @@
#include "chrome/browser/devtools/protocol/target_handler.h"
#include "chrome/browser/devtools/chrome_devtools_manager_delegate.h"
+#include "chrome/browser/devtools/devtools_browser_context_manager.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "content/public/browser/devtools_agent_host.h"
-namespace {
-
-class DevToolsBrowserContextManager : public BrowserListObserver {
- public:
- DevToolsBrowserContextManager();
- protocol::Response CreateBrowserContext(std::string* out_context_id);
- protocol::Response GetBrowserContexts(
- std::unique_ptr<protocol::Array<protocol::String>>* browser_context_ids);
- Profile* GetBrowserContext(const std::string& context_id);
- void DisposeBrowserContext(
- const std::string& context_id,
- std::unique_ptr<TargetHandler::DisposeBrowserContextCallback> callback);
-
- private:
- void OnOriginalProfileDestroyed(Profile* profile);
-
- void OnBrowserRemoved(Browser* browser) override;
-
- base::flat_map<
- std::string,
- std::unique_ptr<IndependentOTRProfileManager::OTRProfileRegistration>>
- registrations_;
- base::flat_map<std::string,
- std::unique_ptr<TargetHandler::DisposeBrowserContextCallback>>
- pending_context_disposals_;
-
- base::WeakPtrFactory<DevToolsBrowserContextManager> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(DevToolsBrowserContextManager);
-};
-
-DevToolsBrowserContextManager::DevToolsBrowserContextManager()
- : weak_factory_(this) {}
-
-Profile* DevToolsBrowserContextManager::GetBrowserContext(
- const std::string& context_id) {
- auto it = registrations_.find(context_id);
- return it == registrations_.end() ? nullptr : it->second->profile();
-}
-
-protocol::Response DevToolsBrowserContextManager::CreateBrowserContext(
- std::string* out_context_id) {
- Profile* original_profile =
- ProfileManager::GetActiveUserProfile()->GetOriginalProfile();
-
- auto registration =
- IndependentOTRProfileManager::GetInstance()->CreateFromOriginalProfile(
- original_profile,
- base::BindOnce(
- &DevToolsBrowserContextManager::OnOriginalProfileDestroyed,
- weak_factory_.GetWeakPtr()));
- *out_context_id = registration->profile()->UniqueId();
- registrations_[*out_context_id] = std::move(registration);
- return protocol::Response::OK();
-}
-
-protocol::Response DevToolsBrowserContextManager::GetBrowserContexts(
- std::unique_ptr<protocol::Array<protocol::String>>* browser_context_ids) {
- *browser_context_ids = std::make_unique<protocol::Array<protocol::String>>();
- for (const auto& registration_pair : registrations_) {
- (*browser_context_ids)
- ->addItem(registration_pair.second->profile()->UniqueId());
- }
- return protocol::Response::OK();
-}
-
-void DevToolsBrowserContextManager::DisposeBrowserContext(
- const std::string& context_id,
- std::unique_ptr<TargetHandler::DisposeBrowserContextCallback> callback) {
- if (pending_context_disposals_.find(context_id) !=
- pending_context_disposals_.end()) {
- callback->sendFailure(protocol::Response::Error(
- "Disposal of browser context " + context_id + " is already pending"));
- return;
- }
- auto it = registrations_.find(context_id);
- if (it == registrations_.end()) {
- callback->sendFailure(protocol::Response::InvalidParams(
- "Failed to find browser context with id " + context_id));
- return;
- }
-
- Profile* profile = it->second->profile();
- bool has_opened_browser = false;
- for (auto* opened_browser : *BrowserList::GetInstance()) {
- if (opened_browser->profile() == profile) {
- has_opened_browser = true;
- break;
- }
- }
-
- // If no browsers are opened - dispose right away.
- if (!has_opened_browser) {
- registrations_.erase(it);
- callback->sendSuccess();
- return;
- }
-
- if (pending_context_disposals_.empty())
- BrowserList::AddObserver(this);
-
- pending_context_disposals_[context_id] = std::move(callback);
- BrowserList::CloseAllBrowsersWithIncognitoProfile(
- profile, base::DoNothing(), base::DoNothing(),
- true /* skip_beforeunload */);
-}
-
-void DevToolsBrowserContextManager::OnOriginalProfileDestroyed(
- Profile* profile) {
- base::EraseIf(registrations_, [&profile](const auto& it) {
- return it.second->profile()->GetOriginalProfile() == profile;
- });
-}
-
-void DevToolsBrowserContextManager::OnBrowserRemoved(Browser* browser) {
- std::string context_id = browser->profile()->UniqueId();
- auto pending_disposal = pending_context_disposals_.find(context_id);
- if (pending_disposal == pending_context_disposals_.end())
- return;
- for (auto* opened_browser : *BrowserList::GetInstance()) {
- if (opened_browser->profile() == browser->profile())
- return;
- }
- auto it = registrations_.find(context_id);
- // We cannot delete immediately here: the profile might still be referenced
- // during the browser tier-down process.
- base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE,
- it->second.release());
- registrations_.erase(it);
- pending_disposal->second->sendSuccess();
- pending_context_disposals_.erase(pending_disposal);
- if (pending_context_disposals_.empty())
- BrowserList::RemoveObserver(this);
-}
-
-base::LazyInstance<DevToolsBrowserContextManager>::Leaky
- g_devtools_browser_context_manager;
-
-} // namespace
-
TargetHandler::TargetHandler(protocol::UberDispatcher* dispatcher) {
protocol::Target::Dispatcher::wire(dispatcher, this);
}
@@ -192,7 +54,7 @@ protocol::Response TargetHandler::CreateTarget(
if (browser_context_id.isJust()) {
std::string profile_id = browser_context_id.fromJust();
profile =
- g_devtools_browser_context_manager.Get().GetBrowserContext(profile_id);
+ DevToolsBrowserContextManager::GetInstance().GetProfileById(profile_id);
if (!profile) {
return protocol::Response::Error(
"Failed to find browser context with id " + profile_id);
@@ -227,22 +89,4 @@ protocol::Response TargetHandler::CreateTarget(
return protocol::Response::OK();
}
-protocol::Response TargetHandler::CreateBrowserContext(
- std::string* out_context_id) {
- return g_devtools_browser_context_manager.Get().CreateBrowserContext(
- out_context_id);
-}
-
-protocol::Response TargetHandler::GetBrowserContexts(
- std::unique_ptr<protocol::Array<protocol::String>>* browser_context_ids) {
- return g_devtools_browser_context_manager.Get().GetBrowserContexts(
- browser_context_ids);
-}
-
-void TargetHandler::DisposeBrowserContext(
- const std::string& context_id,
- std::unique_ptr<DisposeBrowserContextCallback> callback) {
- g_devtools_browser_context_manager.Get().DisposeBrowserContext(
- context_id, std::move(callback));
-}
diff --git a/chromium/chrome/browser/devtools/protocol/target_handler.h b/chromium/chrome/browser/devtools/protocol/target_handler.h
index e9933b095b6..23f580c1dbd 100644
--- a/chromium/chrome/browser/devtools/protocol/target_handler.h
+++ b/chromium/chrome/browser/devtools/protocol/target_handler.h
@@ -28,7 +28,6 @@ class TargetHandler : public protocol::Target::Backend {
protocol::Response SetRemoteLocations(
std::unique_ptr<protocol::Array<protocol::Target::RemoteLocation>>
in_locations) override;
- protocol::Response CreateBrowserContext(std::string* out_context_id) override;
protocol::Response CreateTarget(
const std::string& url,
protocol::Maybe<int> width,
@@ -36,12 +35,6 @@ class TargetHandler : public protocol::Target::Backend {
protocol::Maybe<std::string> browser_context_id,
protocol::Maybe<bool> enable_begin_frame_control,
std::string* out_target_id) override;
- protocol::Response GetBrowserContexts(
- std::unique_ptr<protocol::Array<protocol::String>>* browser_context_ids)
- override;
- void DisposeBrowserContext(
- const std::string& context_id,
- std::unique_ptr<DisposeBrowserContextCallback> callback) override;
private:
RemoteLocations remote_locations_;
diff --git a/chromium/chrome/browser/extensions/BUILD.gn b/chromium/chrome/browser/extensions/BUILD.gn
index 6763b220d94..1a9a0f64cdf 100644
--- a/chromium/chrome/browser/extensions/BUILD.gn
+++ b/chromium/chrome/browser/extensions/BUILD.gn
@@ -160,6 +160,8 @@ jumbo_static_library("extensions") {
"api/downloads/downloads_api.h",
"api/downloads_internal/downloads_internal_api.cc",
"api/downloads_internal/downloads_internal_api.h",
+ "api/enterprise_hardware_platform/enterprise_hardware_platform_api.cc",
+ "api/enterprise_hardware_platform/enterprise_hardware_platform_api.h",
"api/extension_action/extension_action_api.cc",
"api/extension_action/extension_action_api.h",
"api/extension_action/extension_page_actions_api_constants.cc",
@@ -387,8 +389,8 @@ jumbo_static_library("extensions") {
"api/system_indicator/system_indicator_manager_factory.h",
"api/system_private/system_private_api.cc",
"api/system_private/system_private_api.h",
- "api/tab_capture/offscreen_tab.cc",
- "api/tab_capture/offscreen_tab.h",
+ "api/tab_capture/offscreen_tabs_owner.cc",
+ "api/tab_capture/offscreen_tabs_owner.h",
"api/tab_capture/tab_capture_api.cc",
"api/tab_capture/tab_capture_api.h",
"api/tab_capture/tab_capture_registry.cc",
@@ -472,6 +474,8 @@ jumbo_static_library("extensions") {
"chrome_content_verifier_delegate.h",
"chrome_extension_api_frame_id_map_helper.cc",
"chrome_extension_api_frame_id_map_helper.h",
+ "chrome_extension_browser_constants.cc",
+ "chrome_extension_browser_constants.h",
"chrome_extension_chooser_dialog.h",
"chrome_extension_function.cc",
"chrome_extension_function.h",
@@ -481,6 +485,8 @@ jumbo_static_library("extensions") {
"chrome_extension_host_delegate.h",
"chrome_extension_web_contents_observer.cc",
"chrome_extension_web_contents_observer.h",
+ "chrome_extensions_browser_api_provider.cc",
+ "chrome_extensions_browser_api_provider.h",
"chrome_extensions_browser_client.cc",
"chrome_extensions_browser_client.h",
"chrome_extensions_interface_registration.cc",
@@ -633,8 +639,6 @@ jumbo_static_library("extensions") {
"external_provider_impl.h",
"external_registry_loader_win.cc",
"external_registry_loader_win.h",
- "favicon_downloader.cc",
- "favicon_downloader.h",
"forced_extensions/installation_tracker.cc",
"forced_extensions/installation_tracker.h",
"global_shortcut_listener.cc",
@@ -773,6 +777,10 @@ jumbo_static_library("extensions") {
]
defines = []
+ # TODO(loyso): Remove this circular dependency. http://crbug.com/876576.
+ allow_circular_includes_from =
+ [ "//chrome/browser/web_applications/extensions" ]
+
# Since browser and browser_extensions actually depend on each other,
# we must omit the dependency from browser_extensions to browser.
# However, this means browser_extensions and browser should more or less
@@ -801,6 +809,7 @@ jumbo_static_library("extensions") {
"//chrome/browser/media/router/discovery",
"//chrome/browser/resource_coordinator:mojo_bindings",
"//chrome/browser/safe_browsing",
+ "//chrome/browser/web_applications/components",
"//chrome/browser/web_applications/extensions",
"//chrome/common",
"//chrome/common/extensions:mojo_bindings",
@@ -874,7 +883,7 @@ jumbo_static_library("extensions") {
"//device/bluetooth",
"//extensions:extensions_resources",
"//extensions/browser",
- "//extensions/browser/api:api_registration",
+ "//extensions/browser:core_api_provider",
"//extensions/buildflags",
"//extensions/common",
"//extensions/common/api",
@@ -903,6 +912,7 @@ jumbo_static_library("extensions") {
"//third_party/leveldatabase",
"//third_party/libaddressinput:util",
"//third_party/re2",
+ "//third_party/sqlite",
"//third_party/zlib/google:zip",
"//ui/accessibility:ax_enums_mojo",
"//ui/base",
@@ -995,6 +1005,8 @@ jumbo_static_library("extensions") {
"//ash/public/cpp",
"//chromeos/components/proximity_auth",
"//chromeos/components/proximity_auth/logging",
+ "//chromeos/services/ime/public/cpp:features",
+ "//chromeos/services/ime/public/mojom",
"//components/arc",
"//components/chrome_apps",
"//components/constrained_window",
@@ -1003,7 +1015,7 @@ jumbo_static_library("extensions") {
"//components/user_manager",
"//remoting/base",
"//remoting/host",
- "//remoting/host/it2me:common",
+ "//remoting/host/it2me:chrome_os_host",
"//services/video_capture/public/mojom:constants",
"//third_party/protobuf:protobuf_lite",
"//ui/chromeos",
@@ -1021,8 +1033,12 @@ jumbo_static_library("extensions") {
sources += [
"api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc",
"api/enterprise_reporting_private/chrome_desktop_report_request_helper.h",
+ "api/enterprise_reporting_private/enterprise_reporting_policy_migrator.cc",
+ "api/enterprise_reporting_private/enterprise_reporting_policy_migrator.h",
"api/enterprise_reporting_private/enterprise_reporting_private_api.cc",
"api/enterprise_reporting_private/enterprise_reporting_private_api.h",
+ "api/enterprise_reporting_private/prefs.cc",
+ "api/enterprise_reporting_private/prefs.h",
"api/image_writer_private/operation_nonchromeos.cc",
"api/image_writer_private/removable_storage_provider_linux.cc",
"api/messaging/native_message_process_host.cc",
diff --git a/chromium/chrome/browser/extensions/api/BUILD.gn b/chromium/chrome/browser/extensions/api/BUILD.gn
index ee871a22d98..d6ca561c0b3 100644
--- a/chromium/chrome/browser/extensions/api/BUILD.gn
+++ b/chromium/chrome/browser/extensions/api/BUILD.gn
@@ -10,17 +10,15 @@ import("//tools/json_schema_compiler/json_schema_api.gni")
assert(enable_extensions,
"Cannot depend on extensions because enable_extensions=false.")
-json_schema_api("api_registration") {
- sources = chrome_extensions_api_schema_sources
+function_registration("api_registration") {
+ sources = chrome_extensions_api_schema_sources +
+ chrome_extensions_api_uncompiled_sources
impl_dir = "//chrome/browser/extensions/api"
- bundle_registration = true
configs = [ "//build/config:precompiled_headers" ]
bundle_name = "Chrome"
root_namespace = chrome_extensions_api_root_namespace
schema_include_rules = chrome_extensions_api_schema_include_rules
- uncompiled_sources = chrome_extensions_api_uncompiled_sources
-
deps = [
# Different APIs include headers from these targets.
"//content/public/browser",
diff --git a/chromium/chrome/browser/extensions/api/DEPS b/chromium/chrome/browser/extensions/api/DEPS
index d7be18a52d9..5dc13a559c9 100644
--- a/chromium/chrome/browser/extensions/api/DEPS
+++ b/chromium/chrome/browser/extensions/api/DEPS
@@ -1,10 +1,7 @@
include_rules = [
"+apps",
- "+chrome/browser/apps",
- "+components/about_handler",
- "+components/guest_view/common",
- "+components/language/core/browser",
"+services/device/public",
+
# Enable remote assistance on Chrome OS
"+remoting/base",
"+remoting/host",
diff --git a/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc b/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc
index 76fa90e5d6f..6de7439ca22 100644
--- a/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.cc
@@ -14,8 +14,13 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/autofill_private/autofill_util.h"
#include "chrome/common/extensions/api/autofill_private.h"
+#include "components/autofill/content/browser/content_autofill_driver.h"
+#include "components/autofill/content/browser/content_autofill_driver_factory.h"
+#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/autofill_profile.h"
+#include "components/autofill/core/browser/local_card_migration_manager.h"
#include "components/autofill/core/browser/personal_data_manager.h"
+#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/extension_function_registry.h"
#include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_ui.h"
@@ -531,4 +536,54 @@ AutofillPrivateGetCreditCardListFunction::Run() {
credit_card_list)));
}
+////////////////////////////////////////////////////////////////////////////////
+// AutofillPrivateMigrateCreditCardsFunction
+
+AutofillPrivateMigrateCreditCardsFunction::
+ AutofillPrivateMigrateCreditCardsFunction()
+ : chrome_details_(this) {}
+
+AutofillPrivateMigrateCreditCardsFunction::
+ ~AutofillPrivateMigrateCreditCardsFunction() {}
+
+ExtensionFunction::ResponseAction
+AutofillPrivateMigrateCreditCardsFunction::Run() {
+ autofill::PersonalDataManager* personal_data =
+ autofill::PersonalDataManagerFactory::GetForProfile(
+ chrome_details_.GetProfile());
+ // Get the web contents to get autofill manager.
+ content::WebContents* web_contents = GetSenderWebContents();
+ if (!personal_data || !personal_data->IsDataLoaded() || !web_contents)
+ return RespondNow(Error(kErrorDataUnavailable));
+
+ // Get the autofill manager from the web contains. Autofill manager owns an
+ // unique_ptr of form data importer.
+ autofill::AutofillManager* autofill_manager =
+ autofill::ContentAutofillDriverFactory::FromWebContents(web_contents)
+ ->DriverForFrame(web_contents->GetMainFrame())
+ ->autofill_manager();
+ if (!autofill_manager)
+ return RespondNow(Error(kErrorDataUnavailable));
+
+ // Get the form data importer from autofill manager. Form data importer owns
+ // an unique_ptr of local card migration manager.
+ autofill::FormDataImporter* form_data_importer =
+ autofill_manager->form_data_importer();
+ if (!form_data_importer)
+ return RespondNow(Error(kErrorDataUnavailable));
+
+ // Get local card migration manager from form data importer.
+ autofill::LocalCardMigrationManager* local_card_migration_manager =
+ form_data_importer->local_card_migration_manager();
+ if (!local_card_migration_manager)
+ return RespondNow(Error(kErrorDataUnavailable));
+
+ // Since we already check the migration requirements on the settings page, we
+ // don't check the migration requirements again.
+ local_card_migration_manager->GetMigratableCreditCards();
+ local_card_migration_manager->AttemptToOfferLocalCardMigration(
+ /*is_from_settings_page=*/true);
+ return RespondNow(NoArguments());
+}
+
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.h b/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.h
index db7e98cfc25..a1b14bed656 100644
--- a/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.h
+++ b/chromium/chrome/browser/extensions/api/autofill_private/autofill_private_api.h
@@ -174,6 +174,25 @@ class AutofillPrivateGetCreditCardListFunction
DISALLOW_COPY_AND_ASSIGN(AutofillPrivateGetCreditCardListFunction);
};
+class AutofillPrivateMigrateCreditCardsFunction
+ : public UIThreadExtensionFunction {
+ public:
+ AutofillPrivateMigrateCreditCardsFunction();
+ DECLARE_EXTENSION_FUNCTION("autofillPrivate.migrateCreditCards",
+ AUTOFILLPRIVATE_MIGRATECREDITCARDS);
+
+ protected:
+ ~AutofillPrivateMigrateCreditCardsFunction() override;
+
+ // ExtensionFunction overrides.
+ ResponseAction Run() override;
+
+ private:
+ ChromeExtensionFunctionDetails chrome_details_;
+
+ DISALLOW_COPY_AND_ASSIGN(AutofillPrivateMigrateCreditCardsFunction);
+};
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_AUTOFILL_PRIVATE_AUTOFILL_PRIVATE_API_H_
diff --git a/chromium/chrome/browser/extensions/api/autofill_private/autofill_util.cc b/chromium/chrome/browser/extensions/api/autofill_private/autofill_util.cc
index 2f3640b72fa..157f6c089b9 100644
--- a/chromium/chrome/browser/extensions/api/autofill_private/autofill_util.cc
+++ b/chromium/chrome/browser/extensions/api/autofill_private/autofill_util.cc
@@ -132,7 +132,8 @@ autofill_private::CountryEntry CountryToCountryEntry(
}
autofill_private::CreditCardEntry CreditCardToCreditCardEntry(
- const autofill::CreditCard& credit_card) {
+ const autofill::CreditCard& credit_card,
+ const autofill::PersonalDataManager& personal_data) {
autofill_private::CreditCardEntry card;
// Add all credit card fields to the entry.
@@ -158,6 +159,11 @@ autofill_private::CreditCardEntry CreditCardToCreditCardEntry(
credit_card.record_type() == autofill::CreditCard::LOCAL_CARD));
metadata->is_cached.reset(new bool(
credit_card.record_type() == autofill::CreditCard::FULL_SERVER_CARD));
+ // IsValid() checks if both card number and expiration date are valid.
+ // IsServerCard() checks whether there is a duplicated server card in
+ // |personal_data|.
+ metadata->is_migratable.reset(new bool(
+ credit_card.IsValid() && !personal_data.IsServerCard(&credit_card)));
card.metadata = std::move(metadata);
return card;
@@ -210,7 +216,7 @@ CreditCardEntryList GenerateCreditCardList(
CreditCardEntryList list;
for (const autofill::CreditCard* card : cards)
- list.push_back(CreditCardToCreditCardEntry(*card));
+ list.push_back(CreditCardToCreditCardEntry(*card, personal_data));
return list;
}
diff --git a/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.cc b/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.cc
index b9eeb7c6b1e..ec98e3dff27 100644
--- a/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.cc
+++ b/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.cc
@@ -115,6 +115,9 @@ void AutomationEventRouter::DispatchTreeDestroyedEvent(
api::automation_internal::OnAccessibilityTreeDestroyed::kEventName,
std::move(args), browser_context);
EventRouter::Get(browser_context)->BroadcastEvent(std::move(event));
+
+ if (tree_destroyed_callback_for_test_)
+ tree_destroyed_callback_for_test_.Run(tree_id);
}
void AutomationEventRouter::DispatchActionResult(const ui::AXActionData& data,
@@ -135,6 +138,11 @@ void AutomationEventRouter::DispatchActionResult(const ui::AXActionData& data,
->DispatchEventToExtension(data.source_extension_id, std::move(event));
}
+void AutomationEventRouter::SetTreeDestroyedCallbackForTest(
+ base::RepeatingCallback<void(int)> cb) {
+ tree_destroyed_callback_for_test_ = cb;
+}
+
AutomationEventRouter::AutomationListener::AutomationListener() {
}
diff --git a/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.h b/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.h
index 4994b1462a6..51dfc3f55d1 100644
--- a/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.h
+++ b/chromium/chrome/browser/extensions/api/automation_internal/automation_event_router.h
@@ -8,6 +8,7 @@
#include <set>
#include <vector>
+#include "base/callback_forward.h"
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "chrome/common/extensions/api/automation_internal.h"
@@ -65,6 +66,8 @@ class AutomationEventRouter : public content::NotificationObserver {
// Notify the source extension of the action of an action result.
void DispatchActionResult(const ui::AXActionData& data, bool result);
+ void SetTreeDestroyedCallbackForTest(base::RepeatingCallback<void(int)> cb);
+
private:
struct AutomationListener {
AutomationListener();
@@ -109,6 +112,8 @@ class AutomationEventRouter : public content::NotificationObserver {
Profile* active_profile_;
+ base::RepeatingCallback<void(int)> tree_destroyed_callback_for_test_;
+
friend struct base::DefaultSingletonTraits<AutomationEventRouter>;
DISALLOW_COPY_AND_ASSIGN(AutomationEventRouter);
diff --git a/chromium/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc b/chromium/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
index 86fd2e7fe18..c2caa575b25 100644
--- a/chromium/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
+++ b/chromium/chrome/browser/extensions/api/automation_internal/automation_internal_api.cc
@@ -52,8 +52,6 @@ namespace extensions {
class AutomationWebContentsObserver;
} // namespace extensions
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::AutomationWebContentsObserver);
-
namespace extensions {
namespace {
diff --git a/chromium/chrome/browser/extensions/api/autotest_private/DEPS b/chromium/chrome/browser/extensions/api/autotest_private/DEPS
new file mode 100644
index 00000000000..53fd62a1517
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/autotest_private/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+chrome/browser/ui/views/crostini",
+]
diff --git a/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.cc b/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.cc
index 49f4f3272c4..44c72495440 100644
--- a/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.cc
@@ -31,15 +31,19 @@
#include "ash/public/interfaces/constants.mojom.h"
#include "base/feature_list.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
+#include "chrome/browser/chromeos/crostini/crostini_manager.h"
+#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
#include "chrome/browser/chromeos/printing/cups_printers_manager.h"
#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/login_screen_client.h"
+#include "chrome/browser/ui/views/crostini/crostini_installer_view.h"
#include "chrome/common/chrome_features.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/printing/printer_configuration.h"
+#include "components/arc/arc_prefs.h"
#include "components/user_manager/user_manager.h"
#include "content/public/common/service_manager_connection.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
@@ -573,6 +577,8 @@ AutotestPrivateSetPlayStoreEnabledFunction::Run() {
return RespondNow(
Error("ARC enabled state cannot be changed for the current user"));
}
+ profile->GetPrefs()->SetBoolean(arc::prefs::kArcLocationServiceEnabled,
+ true);
return RespondNow(NoArguments());
} else {
return RespondNow(Error("ARC is not available for the current user"));
@@ -581,6 +587,44 @@ AutotestPrivateSetPlayStoreEnabledFunction::Run() {
return RespondNow(Error("ARC is not available for the current platform"));
}
+ExtensionFunction::ResponseAction
+AutotestPrivateRunCrostiniInstallerFunction::Run() {
+ DVLOG(1) << "AutotestPrivateInstallCrostiniFunction";
+#if defined(OS_CHROMEOS)
+ if (!IsCrostiniUIAllowedForProfile(ProfileManager::GetActiveUserProfile())) {
+ return RespondNow(Error("Crostini is not available for the current user"));
+ }
+ // Run GUI installer which will install crostini vm / container and
+ // start terminal app on completion. After starting the installer,
+ // we call RestartCrostini and we will be put in the pending restarters
+ // queue and be notified on success/otherwise of installation.
+ Profile* profile = Profile::FromBrowserContext(browser_context());
+ CrostiniInstallerView::Show(profile);
+ CrostiniInstallerView::GetActiveViewForTesting()->Accept();
+ crostini::CrostiniManager::GetInstance()->RestartCrostini(
+ profile, kCrostiniDefaultVmName, kCrostiniDefaultContainerName,
+ base::BindOnce(
+ &AutotestPrivateRunCrostiniInstallerFunction::CrostiniRestarted,
+ this));
+
+ return RespondLater();
+#else
+ return RespondNow(
+ Error("Crostini is not available for the current platform"));
+#endif
+}
+
+#if defined(OS_CHROMEOS)
+void AutotestPrivateRunCrostiniInstallerFunction::CrostiniRestarted(
+ crostini::ConciergeClientResult result) {
+ if (result == crostini::ConciergeClientResult::SUCCESS) {
+ Respond(NoArguments());
+ } else {
+ Respond(Error("Error installing crostini"));
+ }
+}
+#endif
+
static base::LazyInstance<BrowserContextKeyedAPIFactory<AutotestPrivateAPI>>::
DestructorAtExit g_autotest_private_api_factory = LAZY_INSTANCE_INITIALIZER;
diff --git a/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.h b/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.h
index 4575604fc44..b0623a31be7 100644
--- a/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.h
+++ b/chromium/chrome/browser/extensions/api/autotest_private/autotest_private_api.h
@@ -21,6 +21,12 @@ namespace message_center {
class Notification;
}
+#if defined(OS_CHROMEOS)
+namespace crostini {
+enum class ConciergeClientResult;
+}
+#endif
+
namespace extensions {
class AutotestPrivateLogoutFunction : public UIThreadExtensionFunction {
@@ -225,6 +231,23 @@ class AutotestPrivateSetPlayStoreEnabledFunction
ResponseAction Run() override;
};
+class AutotestPrivateRunCrostiniInstallerFunction
+ : public UIThreadExtensionFunction {
+ public:
+ AutotestPrivateRunCrostiniInstallerFunction() = default;
+ DECLARE_EXTENSION_FUNCTION("autotestPrivate.runCrostiniInstaller",
+ AUTOTESTPRIVATE_RUNCROSTINIINSTALLER)
+
+ private:
+ ~AutotestPrivateRunCrostiniInstallerFunction() override = default;
+ ResponseAction Run() override;
+#if defined(OS_CHROMEOS)
+ void CrostiniRestarted(crostini::ConciergeClientResult);
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(AutotestPrivateRunCrostiniInstallerFunction);
+};
+
class AutotestPrivateGetPrinterListFunction : public UIThreadExtensionFunction {
public:
AutotestPrivateGetPrinterListFunction() = default;
diff --git a/chromium/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc b/chromium/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
index bbda385c078..17e44aa888b 100644
--- a/chromium/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc
@@ -51,9 +51,6 @@ using bookmarks::BookmarkNode;
using bookmarks::BookmarkNodeData;
using content::WebContents;
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(
- extensions::BookmarkManagerPrivateDragEventRouter);
-
namespace extensions {
namespace bookmark_keys = bookmark_api_constants;
diff --git a/chromium/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chromium/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
index c4d79e3a704..5d6b31d7100 100644
--- a/chromium/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
+++ b/chromium/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
@@ -21,7 +21,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
diff --git a/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller.h b/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller.h
index 5b575d2a32e..528720943d7 100644
--- a/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller.h
+++ b/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller.h
@@ -24,7 +24,7 @@ class BrailleController {
static BrailleController* GetInstance();
virtual std::unique_ptr<DisplayState> GetDisplayState() = 0;
- virtual void WriteDots(const std::vector<char>& cells,
+ virtual void WriteDots(const std::vector<uint8_t>& cells,
unsigned int cols,
unsigned int rows) = 0;
virtual void AddObserver(BrailleObserver* observer) = 0;
diff --git a/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc b/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc
index a57126facdc..9b506217c61 100644
--- a/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc
+++ b/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc
@@ -15,7 +15,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/macros.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/time/time.h"
#include "chrome/browser/extensions/api/braille_display_private/brlapi_connection.h"
#include "chrome/browser/extensions/api/braille_display_private/brlapi_keycode_map.h"
@@ -27,12 +27,17 @@ namespace api {
namespace braille_display_private {
namespace {
+
// Delay between detecting a directory update and trying to connect
// to the brlapi.
-const int64_t kConnectionDelayMs = 500;
+constexpr base::TimeDelta kConnectionDelay =
+ base::TimeDelta::FromMilliseconds(500);
+
// How long to periodically retry connecting after a brltty restart.
// Some displays are slow to connect.
-const int64_t kConnectRetryTimeout = 20000;
+constexpr base::TimeDelta kConnectRetryTimeout =
+ base::TimeDelta::FromSeconds(20);
+
} // namespace
BrailleController::BrailleController() {
@@ -100,7 +105,7 @@ std::unique_ptr<DisplayState> BrailleControllerImpl::GetDisplayState() {
return display_state;
}
-void BrailleControllerImpl::WriteDots(const std::vector<char>& cells,
+void BrailleControllerImpl::WriteDots(const std::vector<uint8_t>& cells,
unsigned int cells_cols,
unsigned int cells_rows) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -248,19 +253,16 @@ void BrailleControllerImpl::TryToConnect() {
void BrailleControllerImpl::ResetRetryConnectHorizon() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- retry_connect_horizon_ =
- base::Time::Now() +
- base::TimeDelta::FromMilliseconds(kConnectRetryTimeout);
+ retry_connect_horizon_ = base::Time::Now() + kConnectRetryTimeout;
}
void BrailleControllerImpl::ScheduleTryToConnect() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
- base::TimeDelta delay(base::TimeDelta::FromMilliseconds(kConnectionDelayMs));
// Don't reschedule if there's already a connect scheduled or
// the next attempt would fall outside of the retry limit.
if (connect_scheduled_)
return;
- if (base::Time::Now() + delay > retry_connect_horizon_) {
+ if (base::Time::Now() + kConnectionDelay > retry_connect_horizon_) {
VLOG(1) << "Stopping to retry to connect to brlapi";
return;
}
@@ -270,7 +272,7 @@ void BrailleControllerImpl::ScheduleTryToConnect() {
BrowserThread::IO, FROM_HERE,
base::BindOnce(&BrailleControllerImpl::TryToConnect,
base::Unretained(this)),
- delay);
+ kConnectionDelay);
}
void BrailleControllerImpl::Disconnect() {
diff --git a/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h b/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h
index 82fe471bf73..fc98d3d832d 100644
--- a/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h
+++ b/chromium/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h
@@ -25,7 +25,7 @@ class BrailleControllerImpl : public BrailleController {
public:
static BrailleControllerImpl* GetInstance();
std::unique_ptr<DisplayState> GetDisplayState() override;
- void WriteDots(const std::vector<char>& cells,
+ void WriteDots(const std::vector<uint8_t>& cells,
unsigned int cols,
unsigned int rows) override;
void AddObserver(BrailleObserver* observer) override;
@@ -78,7 +78,7 @@ class BrailleControllerImpl : public BrailleController {
scoped_refptr<base::SequencedTaskRunner> sequenced_task_runner_;
// Manipulated on the UI thread.
- base::ObserverList<BrailleObserver> observers_;
+ base::ObserverList<BrailleObserver>::Unchecked observers_;
// Manipulated by the SequencedTaskRunner.
base::FilePathWatcher file_path_watcher_;
diff --git a/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.cc b/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.cc
index 5e8a8c5be24..e732981f223 100644
--- a/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.cc
+++ b/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.cc
@@ -15,7 +15,7 @@ std::unique_ptr<DisplayState> StubBrailleController::GetDisplayState() {
return std::unique_ptr<DisplayState>(new DisplayState);
}
-void StubBrailleController::WriteDots(const std::vector<char>& cells,
+void StubBrailleController::WriteDots(const std::vector<uint8_t>& cells,
unsigned int cols,
unsigned int rows) {}
diff --git a/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.h b/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.h
index cc159125575..44f36ad080b 100644
--- a/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.h
+++ b/chromium/chrome/browser/extensions/api/braille_display_private/stub_braille_controller.h
@@ -17,7 +17,7 @@ class StubBrailleController : public BrailleController {
public:
StubBrailleController();
std::unique_ptr<DisplayState> GetDisplayState() override;
- void WriteDots(const std::vector<char>& cells,
+ void WriteDots(const std::vector<uint8_t>& cells,
unsigned int cols,
unsigned int rows) override;
void AddObserver(BrailleObserver* observer) override;
diff --git a/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc b/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc
index 244be025170..9c960c21cdb 100644
--- a/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc
+++ b/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.cc
@@ -14,11 +14,15 @@
#include "base/values.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
#include "chrome/browser/plugins/plugin_data_remover_helper.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/account_reconcilor_factory.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
@@ -123,6 +127,16 @@ bool IsRemovalPermitted(int removal_mask, PrefService* prefs) {
return true;
}
+// Returns true if Sync is currently running (i.e. enabled and not in error).
+bool IsSyncRunning(Profile* profile) {
+ browser_sync::ProfileSyncService* sync_service =
+ ProfileSyncServiceFactory::GetForProfile(profile);
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(profile);
+ sync_ui_util::MessageType sync_status =
+ sync_ui_util::GetStatus(profile, sync_service, *signin_manager);
+ return sync_status == sync_ui_util::SYNCED;
+}
} // namespace
bool BrowsingDataSettingsFunction::isDataTypeSelected(
@@ -253,11 +267,9 @@ BrowsingDataRemoverFunction::BrowsingDataRemoverFunction() : observer_(this) {}
void BrowsingDataRemoverFunction::OnBrowsingDataRemoverDone() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
+ synced_data_deletion_.reset();
observer_.RemoveAll();
-
this->SendResponse(true);
-
Release(); // Balanced in RunAsync.
}
@@ -316,6 +328,10 @@ bool BrowsingDataRemoverFunction::RunAsync() {
BrowsingDataRemoverFunction::~BrowsingDataRemoverFunction() {}
+bool BrowsingDataRemoverFunction::IsPauseSyncAllowed() {
+ return true;
+}
+
void BrowsingDataRemoverFunction::CheckRemovingPluginDataSupported(
scoped_refptr<PluginPrefs> plugin_prefs) {
if (!PluginDataRemoverHelper::IsSupported(plugin_prefs.get()))
@@ -327,11 +343,20 @@ void BrowsingDataRemoverFunction::CheckRemovingPluginDataSupported(
}
void BrowsingDataRemoverFunction::StartRemoving() {
+ Profile* profile = GetProfile();
content::BrowsingDataRemover* remover =
- content::BrowserContext::GetBrowsingDataRemover(GetProfile());
+ content::BrowserContext::GetBrowsingDataRemover(profile);
+
// Add a ref (Balanced in OnBrowsingDataRemoverDone)
AddRef();
+ // Prevent Sync from being paused, if required.
+ DCHECK(!synced_data_deletion_);
+ if (!IsPauseSyncAllowed() && IsSyncRunning(profile)) {
+ synced_data_deletion_ = AccountReconcilorFactory::GetForProfile(profile)
+ ->GetScopedSyncDataDeletion();
+ }
+
// Create a BrowsingDataRemover, set the current object as an observer (so
// that we're notified after removal) and call remove() with the arguments
// we've generated above. We can use a raw pointer here, as the browsing data
@@ -418,6 +443,10 @@ bool BrowsingDataRemoveFunction::GetRemovalMask(int* removal_mask) {
return true;
}
+bool BrowsingDataRemoveFunction::IsPauseSyncAllowed() {
+ return false;
+}
+
bool BrowsingDataRemoveAppcacheFunction::GetRemovalMask(int* removal_mask) {
*removal_mask = content::BrowsingDataRemover::DATA_TYPE_APP_CACHE;
return true;
diff --git a/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.h b/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.h
index 15db8b7d0ed..d288fc63ee5 100644
--- a/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.h
+++ b/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_api.h
@@ -14,6 +14,7 @@
#include "base/scoped_observer.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "components/browsing_data/core/browsing_data_utils.h"
+#include "components/signin/core/browser/account_reconcilor.h"
#include "content/public/browser/browsing_data_remover.h"
class PluginPrefs;
@@ -104,13 +105,19 @@ class BrowsingDataRemoverFunction
protected:
~BrowsingDataRemoverFunction() override;
+ private:
// Children should override this method to provide the proper removal mask
// based on the API call they represent.
// Returns whether or not removal mask retrieval was successful.
// |removal_mask| is populated with the result, if successful.
virtual bool GetRemovalMask(int* removal_mask) = 0;
- private:
+ // Returns true if the data removal is allowed to pause Sync. Returns true by
+ // default. Subclasses can override it to return false and prevent Sync from
+ // being paused. This is important when synced data is being removed, and
+ // pausing Sync would prevent the data from being deleted on the server.
+ virtual bool IsPauseSyncAllowed();
+
// Updates the removal bitmask according to whether removing plugin data is
// supported or not.
void CheckRemovingPluginDataSupported(
@@ -131,6 +138,8 @@ class BrowsingDataRemoverFunction
ScopedObserver<content::BrowsingDataRemover,
content::BrowsingDataRemover::Observer>
observer_;
+ std::unique_ptr<AccountReconcilor::ScopedSyncedDataDeletion>
+ synced_data_deletion_;
};
class BrowsingDataRemoveAppcacheFunction : public BrowsingDataRemoverFunction {
@@ -154,6 +163,7 @@ class BrowsingDataRemoveFunction : public BrowsingDataRemoverFunction {
// BrowsingDataRemoverFunction:
bool GetRemovalMask(int* removal_mask) override;
+ bool IsPauseSyncAllowed() override;
};
class BrowsingDataRemoveCacheFunction : public BrowsingDataRemoverFunction {
diff --git a/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc b/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
index aeea3eef7bb..4208518f151 100644
--- a/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
+++ b/chromium/chrome/browser/extensions/api/browsing_data/browsing_data_test.cc
@@ -5,23 +5,42 @@
#include <memory>
#include <string>
+#include "base/callback.h"
#include "base/json/json_string_value_serializer.h"
#include "base/memory/ref_counted.h"
#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
+#include "base/test/bind_test_util.h"
#include "base/values.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
#include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/signin/account_reconcilor_factory.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chrome/browser/signin/scoped_account_consistency.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/in_process_browser_test.h"
+#include "components/browser_sync/profile_sync_service.h"
#include "components/browsing_data/core/browsing_data_utils.h"
#include "components/browsing_data/core/pref_names.h"
#include "components/prefs/pref_service.h"
+#include "components/signin/core/browser/account_reconcilor.h"
+#include "components/signin/core/browser/profile_oauth2_token_service.h"
+#include "components/signin/core/browser/signin_buildflags.h"
+#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browsing_data_remover.h"
+#include "content/public/browser/storage_partition.h"
+#include "google_apis/gaia/gaia_urls.h"
+#include "google_apis/gaia/google_service_auth_error.h"
+#include "mojo/public/cpp/bindings/callback_helpers.h"
+#include "net/cookies/canonical_cookie.h"
+#include "url/gurl.h"
using extension_function_test_utils::RunFunctionAndReturnError;
using extension_function_test_utils::RunFunctionAndReturnSingleResult;
@@ -298,6 +317,34 @@ class ExtensionBrowsingDataTest : public InProcessBrowserTest {
content::BrowsingDataRemover* remover_;
};
+#if BUILDFLAG(ENABLE_DICE_SUPPORT)
+// Sets the APISID Gaia cookie, which is monitored by the AccountReconcilor.
+bool SetGaiaCookieForProfile(Profile* profile) {
+ GURL google_url = GaiaUrls::GetInstance()->google_url();
+ net::CanonicalCookie cookie("APISID", std::string(), "." + google_url.host(),
+ "/", base::Time(), base::Time(), base::Time(),
+ false, false, net::CookieSameSite::DEFAULT_MODE,
+ net::COOKIE_PRIORITY_DEFAULT);
+
+ bool success = false;
+ base::RunLoop loop;
+ base::OnceClosure loop_quit = loop.QuitClosure();
+ base::OnceCallback<void(bool)> callback =
+ base::BindLambdaForTesting([&success, &loop_quit](bool s) {
+ success = s;
+ std::move(loop_quit).Run();
+ });
+ network::mojom::CookieManager* cookie_manager =
+ content::BrowserContext::GetDefaultStoragePartition(profile)
+ ->GetCookieManagerForBrowserProcess();
+ cookie_manager->SetCanonicalCookie(
+ cookie, true, true,
+ mojo::WrapCallbackWithDefaultInvokeIfNotRun(std::move(callback), false));
+ loop.Run();
+ return success;
+}
+#endif
+
} // namespace
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, RemovalProhibited) {
@@ -358,6 +405,101 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, RemoveBrowsingDataAll) {
GetRemovalMask());
}
+#if BUILDFLAG(ENABLE_DICE_SUPPORT)
+// Test that Sync is not paused when browsing data is cleared.
+IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, Syncing) {
+ Profile* profile = browser()->profile();
+ // Set a Gaia cookie.
+ ASSERT_TRUE(SetGaiaCookieForProfile(profile));
+ // Set a Sync account and a secondary account.
+ const char kPrimaryAccountId[] = "primary_account_id";
+ const char kSecondaryAccountId[] = "secondary_account_id";
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+ token_service->UpdateCredentials(kPrimaryAccountId, "token");
+ ASSERT_TRUE(token_service->RefreshTokenIsAvailable(kPrimaryAccountId));
+ token_service->UpdateCredentials(kSecondaryAccountId, "token");
+ ASSERT_TRUE(token_service->RefreshTokenIsAvailable(kSecondaryAccountId));
+ SigninManager* signin_manager = SigninManagerFactory::GetForProfile(profile);
+ signin_manager->SetAuthenticatedAccountInfo(kPrimaryAccountId,
+ "user@gmail.com");
+ // Sync is running.
+ browser_sync::ProfileSyncService* sync_service =
+ ProfileSyncServiceFactory::GetForProfile(profile);
+ sync_service->SetFirstSetupComplete();
+ sync_ui_util::MessageType sync_status =
+ sync_ui_util::GetStatus(profile, sync_service, *signin_manager);
+ ASSERT_EQ(sync_ui_util::SYNCED, sync_status);
+ // Clear browsing data.
+ scoped_refptr<BrowsingDataRemoveFunction> function =
+ new BrowsingDataRemoveFunction();
+ EXPECT_EQ(NULL, RunFunctionAndReturnSingleResult(
+ function.get(), kRemoveEverythingArguments, browser()));
+ // Check that the Sync token was not revoked.
+ EXPECT_TRUE(token_service->RefreshTokenIsAvailable(kPrimaryAccountId));
+ EXPECT_FALSE(token_service->RefreshTokenHasError(kPrimaryAccountId));
+ // Check that the secondary token was revoked.
+ EXPECT_FALSE(token_service->RefreshTokenIsAvailable(kSecondaryAccountId));
+}
+
+// Test that Sync is paused when browsing data is cleared if Sync was in
+// authentication error.
+IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, SyncError) {
+ Profile* profile = browser()->profile();
+ // Set a Gaia cookie.
+ ASSERT_TRUE(SetGaiaCookieForProfile(profile));
+ // Set a Sync account with authentication error.
+ const char kAccountId[] = "account_id";
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+ token_service->UpdateCredentials(kAccountId, "token");
+ ASSERT_TRUE(token_service->RefreshTokenIsAvailable(kAccountId));
+ SigninManager* signin_manager = SigninManagerFactory::GetForProfile(profile);
+ signin_manager->SetAuthenticatedAccountInfo(kAccountId, "user@gmail.com");
+ token_service->GetDelegate()->UpdateAuthError(
+ kAccountId, GoogleServiceAuthError::FromInvalidGaiaCredentialsReason(
+ GoogleServiceAuthError::InvalidGaiaCredentialsReason::
+ CREDENTIALS_REJECTED_BY_SERVER));
+ // Sync is not running.
+ sync_ui_util::MessageType sync_status = sync_ui_util::GetStatus(
+ profile, ProfileSyncServiceFactory::GetForProfile(profile),
+ *signin_manager);
+ ASSERT_NE(sync_ui_util::SYNCED, sync_status);
+ // Clear browsing data.
+ scoped_refptr<BrowsingDataRemoveFunction> function =
+ new BrowsingDataRemoveFunction();
+ EXPECT_EQ(NULL, RunFunctionAndReturnSingleResult(
+ function.get(), kRemoveEverythingArguments, browser()));
+ // Check that the account was not removed and Sync was paused.
+ EXPECT_TRUE(token_service->RefreshTokenIsAvailable(kAccountId));
+ EXPECT_EQ(GoogleServiceAuthError::InvalidGaiaCredentialsReason::
+ CREDENTIALS_REJECTED_BY_CLIENT,
+ token_service->GetAuthError(kAccountId)
+ .GetInvalidGaiaCredentialsReason());
+}
+
+// Test that the tokens are revoked when browsing data is cleared when there is
+// no primary account.
+IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, NotSyncing) {
+ Profile* profile = browser()->profile();
+ // Set a Gaia cookie.
+ ASSERT_TRUE(SetGaiaCookieForProfile(profile));
+ // Set a non-Sync account.
+ const char kAccountId[] = "account_id";
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+ token_service->UpdateCredentials(kAccountId, "token");
+ ASSERT_TRUE(token_service->RefreshTokenIsAvailable(kAccountId));
+ // Clear browsing data.
+ scoped_refptr<BrowsingDataRemoveFunction> function =
+ new BrowsingDataRemoveFunction();
+ EXPECT_EQ(NULL, RunFunctionAndReturnSingleResult(
+ function.get(), kRemoveEverythingArguments, browser()));
+ // Check that the account was removed.
+ EXPECT_FALSE(token_service->RefreshTokenIsAvailable(kAccountId));
+}
+#endif
+
IN_PROC_BROWSER_TEST_F(ExtensionBrowsingDataTest, BrowsingDataOriginTypeMask) {
RunBrowsingDataRemoveFunctionAndCompareOriginTypeMask("{}", 0);
diff --git a/chromium/chrome/browser/extensions/api/certificate_provider/certificate_provider_api.cc b/chromium/chrome/browser/extensions/api/certificate_provider/certificate_provider_api.cc
index 8596f7dd5f0..260ed83d77f 100644
--- a/chromium/chrome/browser/extensions/api/certificate_provider/certificate_provider_api.cc
+++ b/chromium/chrome/browser/extensions/api/certificate_provider/certificate_provider_api.cc
@@ -96,7 +96,7 @@ CertificateProviderInternalReportCertificatesFunction::Run() {
}
chromeos::certificate_provider::CertificateInfoList cert_infos;
- std::vector<std::vector<char>> rejected_certificates;
+ std::vector<std::vector<uint8_t>> rejected_certificates;
for (const api_cp::CertificateInfo& input_cert_info : *params->certificates) {
chromeos::certificate_provider::CertificateInfo parsed_cert_info;
@@ -122,7 +122,7 @@ bool CertificateProviderInternalReportCertificatesFunction::
ParseCertificateInfo(
const api_cp::CertificateInfo& info,
chromeos::certificate_provider::CertificateInfo* out_info) {
- const std::vector<char>& cert_der = info.certificate;
+ const std::vector<uint8_t>& cert_der = info.certificate;
if (cert_der.empty()) {
WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_ERROR,
kCertificateProviderErrorInvalidX509Cert);
@@ -134,7 +134,7 @@ bool CertificateProviderInternalReportCertificatesFunction::
net::X509Certificate::UnsafeCreateOptions options;
options.printable_string_is_utf8 = true;
out_info->certificate = net::X509Certificate::CreateFromBytesUnsafeOptions(
- cert_der.data(), cert_der.size(), options);
+ reinterpret_cast<const char*>(cert_der.data()), cert_der.size(), options);
if (!out_info->certificate) {
WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_ERROR,
kCertificateProviderErrorInvalidX509Cert);
diff --git a/chromium/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc b/chromium/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc
index 193801d9a5f..817b5ca8b26 100644
--- a/chromium/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/cloud_print_private/cloud_print_private_api.cc
@@ -6,6 +6,7 @@
#include <memory>
#include <string>
+#include <utility>
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
#include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h"
@@ -109,10 +110,8 @@ ExtensionFunction::ResponseAction CloudPrintPrivateGetPrintersFunction::Run() {
if (!service)
return RespondNow(Error(kErrorIncognito));
- // TODO(https://crbug.com/845250): CloudPrintProxyService::GetPrinters() may
- // not invoke the callback, which means this function may never respond.
service->GetPrinters(
- base::Bind(&CloudPrintPrivateGetPrintersFunction::SendResults, this));
+ base::BindOnce(&CloudPrintPrivateGetPrintersFunction::SendResults, this));
return RespondLater();
}
diff --git a/chromium/chrome/browser/extensions/api/commands/command_service.h b/chromium/chrome/browser/extensions/api/commands/command_service.h
index 378922ae5fe..22d82e817a1 100644
--- a/chromium/chrome/browser/extensions/api/commands/command_service.h
+++ b/chromium/chrome/browser/extensions/api/commands/command_service.h
@@ -265,7 +265,7 @@ class CommandService : public BrowserContextKeyedAPI,
ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
extension_registry_observer_;
- base::ObserverList<Observer> observers_;
+ base::ObserverList<Observer>::Unchecked observers_;
DISALLOW_COPY_AND_ASSIGN(CommandService);
};
diff --git a/chromium/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chromium/chrome/browser/extensions/api/content_settings/content_settings_api.cc
index b361c7babdc..85bbb998db9 100644
--- a/chromium/chrome/browser/extensions/api/content_settings/content_settings_api.cc
+++ b/chromium/chrome/browser/extensions/api/content_settings/content_settings_api.cc
@@ -11,6 +11,8 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/feature_list.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
@@ -24,6 +26,7 @@
#include "chrome/browser/plugins/plugin_finder.h"
#include "chrome/browser/plugins/plugin_installer.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/content_settings.h"
#include "components/content_settings/core/browser/content_settings_info.h"
@@ -31,6 +34,7 @@
#include "components/content_settings/core/browser/content_settings_utils.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "components/content_settings/core/common/content_settings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/common/webplugininfo.h"
@@ -214,6 +218,10 @@ ContentSettingsContentSettingSetFunction::Run() {
->Get(content_type)
->IsSettingValid(setting));
+ const content_settings::ContentSettingsInfo* info =
+ content_settings::ContentSettingsRegistry::GetInstance()->Get(
+ content_type);
+
// Some content setting types support the full set of values listed in
// content_settings.json only for exceptions. For the default setting,
// some values might not be supported.
@@ -221,9 +229,7 @@ ContentSettingsContentSettingSetFunction::Run() {
// [ask, block] for the default setting.
if (primary_pattern == ContentSettingsPattern::Wildcard() &&
secondary_pattern == ContentSettingsPattern::Wildcard() &&
- !content_settings::ContentSettingsRegistry::GetInstance()
- ->Get(content_type)
- ->IsDefaultSettingValid(setting)) {
+ !info->IsDefaultSettingValid(setting)) {
static const char kUnsupportedDefaultSettingError[] =
"'%s' is not supported as the default setting of %s.";
@@ -243,6 +249,15 @@ ContentSettingsContentSettingSetFunction::Run() {
readable_type_name.c_str())));
}
+ if (primary_pattern != secondary_pattern &&
+ secondary_pattern != ContentSettingsPattern::Wildcard() &&
+ !info->website_settings_info()->SupportsEmbeddedExceptions() &&
+ base::FeatureList::IsEnabled(::features::kPermissionDelegation)) {
+ static const char kUnsupportedEmbeddedException[] =
+ "Embedded patterns are not supported for this setting.";
+ return RespondNow(Error(kUnsupportedEmbeddedException));
+ }
+
ExtensionPrefsScope scope = kExtensionPrefsScopeRegular;
bool incognito = false;
if (params->details.scope ==
@@ -273,6 +288,18 @@ ContentSettingsContentSettingSetFunction::Run() {
return RespondNow(Error(pref_keys::kIncognitoSessionOnlyErrorMessage));
}
+ size_t num_values = 0;
+ int histogram_value =
+ ContentSettingTypeToHistogramValue(content_type, &num_values);
+ if (primary_pattern != secondary_pattern &&
+ secondary_pattern != ContentSettingsPattern::Wildcard()) {
+ UMA_HISTOGRAM_EXACT_LINEAR("ContentSettings.ExtensionEmbeddedSettingSet",
+ histogram_value, num_values);
+ } else {
+ UMA_HISTOGRAM_EXACT_LINEAR("ContentSettings.ExtensionNonEmbeddedSettingSet",
+ histogram_value, num_values);
+ }
+
scoped_refptr<ContentSettingsStore> store =
ContentSettingsService::Get(browser_context())->content_settings_store();
store->SetExtensionContentSetting(extension_id(), primary_pattern,
diff --git a/chromium/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc b/chromium/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
index 2699c31961f..155603ec248 100644
--- a/chromium/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/content_settings/content_settings_apitest.cc
@@ -8,6 +8,8 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/metrics/histogram_tester.h"
+#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -17,9 +19,11 @@
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
+#include "components/content_settings/core/common/content_settings.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
#include "components/prefs/pref_service.h"
@@ -359,4 +363,50 @@ IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest,
<< message_;
}
+IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest,
+ EmbeddedSettingsMetric) {
+ base::HistogramTester histogram_tester;
+ const char kExtensionPath[] = "content_settings/embeddedsettingsmetric";
+ EXPECT_TRUE(RunExtensionSubtest(kExtensionPath, "test.html")) << message_;
+
+ size_t num_values = 0;
+ int javascript_type = ContentSettingTypeToHistogramValue(
+ CONTENT_SETTINGS_TYPE_IMAGES, &num_values);
+ int geolocation_type = ContentSettingTypeToHistogramValue(
+ CONTENT_SETTINGS_TYPE_GEOLOCATION, &num_values);
+ int cookies_type = ContentSettingTypeToHistogramValue(
+ CONTENT_SETTINGS_TYPE_COOKIES, &num_values);
+
+ histogram_tester.ExpectBucketCount(
+ "ContentSettings.ExtensionEmbeddedSettingSet", javascript_type, 1);
+ histogram_tester.ExpectBucketCount(
+ "ContentSettings.ExtensionEmbeddedSettingSet", geolocation_type, 1);
+ histogram_tester.ExpectTotalCount(
+ "ContentSettings.ExtensionEmbeddedSettingSet", 2);
+
+ histogram_tester.ExpectBucketCount(
+ "ContentSettings.ExtensionNonEmbeddedSettingSet", javascript_type, 1);
+ histogram_tester.ExpectBucketCount(
+ "ContentSettings.ExtensionNonEmbeddedSettingSet", cookies_type, 1);
+ histogram_tester.ExpectTotalCount(
+ "ContentSettings.ExtensionNonEmbeddedSettingSet", 2);
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest, EmbeddedSettings) {
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndDisableFeature(features::kPermissionDelegation);
+ const char kExtensionPath[] = "content_settings/embeddedsettings";
+ EXPECT_TRUE(RunExtensionSubtest(kExtensionPath, "test.html")) << message_;
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionContentSettingsApiTest,
+ EmbeddedSettingsPermissionDelegation) {
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(features::kPermissionDelegation);
+ const char kExtensionPath[] = "content_settings/embeddedsettings";
+ EXPECT_TRUE(
+ RunExtensionSubtest(kExtensionPath, "test.html?permission_delegation"))
+ << message_;
+}
+
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.cc b/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.cc
index 83169fca6d7..272f5ee9eb2 100644
--- a/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.cc
+++ b/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/extensions/api/content_settings/content_settings_service.h"
#include "base/lazy_instance.h"
-#include "chrome/browser/extensions/api/content_settings/content_settings_store.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_prefs_scope.h"
#include "extensions/browser/pref_names.h"
diff --git a/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.h b/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.h
index 96fa0e8d102..0b4d70ca25f 100644
--- a/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.h
+++ b/chromium/chrome/browser/extensions/api/content_settings/content_settings_service.h
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "chrome/browser/extensions/api/content_settings/content_settings_store.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_prefs_observer.h"
diff --git a/chromium/chrome/browser/extensions/api/content_settings/content_settings_store.h b/chromium/chrome/browser/extensions/api/content_settings/content_settings_store.h
index 3a9033a4747..ea311c4b725 100644
--- a/chromium/chrome/browser/extensions/api/content_settings/content_settings_store.h
+++ b/chromium/chrome/browser/extensions/api/content_settings/content_settings_store.h
@@ -140,7 +140,7 @@ class ContentSettingsStore
// The entries.
ExtensionEntries entries_;
- base::ObserverList<Observer, false> observers_;
+ base::ObserverList<Observer, false>::Unchecked observers_;
mutable base::Lock lock_;
diff --git a/chromium/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc b/chromium/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc
index 4554ed65ee5..856b74eb55e 100644
--- a/chromium/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/context_menus/context_menu_apitest.cc
@@ -273,11 +273,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuApiTest,
VerifyMenuItem("parent", top_level_model_, top_level_index(),
ui::MenuModel::TYPE_SUBMENU, true);
- // Since the extension submenu is shown, the previous separator should be in
- // the model.
- EXPECT_EQ(ui::MenuModel::TYPE_SEPARATOR,
- top_level_model_->GetTypeAt(top_level_index() - 1));
-
ui::MenuModel* submodel =
top_level_model_->GetSubmenuModelAt(top_level_index());
ASSERT_TRUE(submodel);
@@ -306,11 +301,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuApiTest,
VerifyMenuItem("parent", top_level_model_, top_level_index(),
ui::MenuModel::TYPE_SUBMENU, true);
- // Since the extension submenu is shown, the previous separator should be in
- // the model.
- EXPECT_EQ(ui::MenuModel::TYPE_SEPARATOR,
- top_level_model_->GetTypeAt(top_level_index() - 1));
-
ui::MenuModel* submodel =
top_level_model_->GetSubmenuModelAt(top_level_index());
ASSERT_TRUE(submodel);
@@ -339,11 +329,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuApiTest,
VerifyMenuItem(extension()->name(), top_level_model_, top_level_index(),
ui::MenuModel::TYPE_SUBMENU, true);
- // Since the extension submenu is shown, the previous separator should be in
- // the model.
- EXPECT_EQ(ui::MenuModel::TYPE_SEPARATOR,
- top_level_model_->GetTypeAt(top_level_index() - 1));
-
ui::MenuModel* submodel =
top_level_model_->GetSubmenuModelAt(top_level_index());
ASSERT_TRUE(submodel);
@@ -378,11 +363,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionContextMenuApiTest,
VerifyMenuItem(extension()->name(), top_level_model_, top_level_index(),
ui::MenuModel::TYPE_SUBMENU, true);
- // Since the extension submenu is shown, the previous separator should be in
- // the model.
- EXPECT_EQ(ui::MenuModel::TYPE_SEPARATOR,
- top_level_model_->GetTypeAt(top_level_index() - 1));
-
ui::MenuModel* submodel =
top_level_model_->GetSubmenuModelAt(top_level_index());
ASSERT_TRUE(submodel);
diff --git a/chromium/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc b/chromium/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc
index 44223d6702c..a36c6245c28 100644
--- a/chromium/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc
@@ -32,7 +32,7 @@ constexpr const char* kGoogleGstaticAppIds[] = {
// ContainsAppIdByHash returns true iff the SHA-256 hash of one of the
// elements of |list| equals |hash|.
bool ContainsAppIdByHash(const base::ListValue& list,
- const std::vector<char>& hash) {
+ const std::vector<uint8_t>& hash) {
if (hash.size() != crypto::kSHA256Length) {
return false;
}
@@ -44,9 +44,10 @@ bool ContainsAppIdByHash(const base::ListValue& list,
continue;
}
- if (crypto::SHA256HashString(s).compare(0, crypto::kSHA256Length,
- hash.data(),
- crypto::kSHA256Length) == 0) {
+ if (crypto::SHA256HashString(s).compare(
+ 0, crypto::kSHA256Length,
+ reinterpret_cast<const char*>(hash.data()),
+ crypto::kSHA256Length) == 0) {
return true;
}
}
diff --git a/chromium/chrome/browser/extensions/api/debugger/debugger_api.cc b/chromium/chrome/browser/extensions/api/debugger/debugger_api.cc
index c3ce2dda86d..70600589c31 100644
--- a/chromium/chrome/browser/extensions/api/debugger/debugger_api.cc
+++ b/chromium/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -44,6 +44,7 @@
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/url_constants.h"
#include "content/public/common/url_utils.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_host.h"
@@ -90,6 +91,9 @@ bool ExtensionCanAttachToURL(const Extension& extension,
const GURL& url,
Profile* profile,
std::string* error) {
+ if (url == content::kUnreachableWebDataURL)
+ return true;
+
// NOTE: The `debugger` permission implies all URLs access (and indicates
// such to the user), so we don't check explicit page access. However, we
// still need to check if it's an otherwise-restricted URL.
@@ -361,9 +365,8 @@ bool ExtensionDevToolsClientHost::MayAttachToRenderer(
const GURL& site_instance_url =
render_frame_host->GetSiteInstance()->GetSiteURL();
- if (site_instance_url.is_empty()) {
- // |site_instance_url| is empty for about:blank. Allow the extension to
- // attach.
+ if (site_instance_url.is_empty() || site_instance_url == "about:") {
+ // Allow the extension to attach to about:blank.
return true;
}
diff --git a/chromium/chrome/browser/extensions/api/declarative/declarative_apitest.cc b/chromium/chrome/browser/extensions/api/declarative/declarative_apitest.cc
index bf1db39d6bf..449b6e1bf25 100644
--- a/chromium/chrome/browser/extensions/api/declarative/declarative_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/declarative/declarative_apitest.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/storage_partition.h"
#include "extensions/browser/api/declarative/rules_registry_service.h"
#include "extensions/browser/api/declarative_webrequest/webrequest_constants.h"
#include "extensions/browser/api/declarative_webrequest/webrequest_rules_registry.h"
@@ -151,6 +152,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PRE_PersistRules) {
}
IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PersistRules) {
+ // Wait for declarative rules to be set up from PRE test.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl));
EXPECT_EQ(kTestTitle, GetTitle());
}
@@ -180,6 +184,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeApiTest,
const Extension* extension = InstallExtensionWithUIAutoConfirm(
ext_dir.Pack(), 1 /*+1 installed extension*/, browser());
ASSERT_TRUE(extension);
+ // Wait for declarative rules to be set up.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
std::string extension_id(extension->id());
ASSERT_TRUE(ready.WaitUntilSatisfied());
ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl));
@@ -254,6 +261,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, MAYBE_NoTracesAfterUninstalling) {
const Extension* extension = InstallExtensionWithUIAutoConfirm(
ext_dir.Pack(), 1 /*+1 installed extension*/, browser());
ASSERT_TRUE(extension);
+ // Wait for declarative rules to be set up.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
std::string extension_id(extension->id());
ASSERT_TRUE(ready.WaitUntilSatisfied());
ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl));
@@ -264,6 +274,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, MAYBE_NoTracesAfterUninstalling) {
// 2. Uninstall the extension. Rules are gone and preferences should be empty.
UninstallExtension(extension_id);
+ // Wait for declarative rules to be removed.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl));
EXPECT_NE(kTestTitle, GetTitle());
EXPECT_EQ(0u, NumberOfRegisteredRules(extension_id));
diff --git a/chromium/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc b/chromium/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
index df8b818e031..792970cdbab 100644
--- a/chromium/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test_utils.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
@@ -361,6 +362,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, ReusedActionInstance) {
ExtensionTestMessageListener ready("ready", false);
const Extension* extension = LoadExtension(ext_dir_.UnpackedPath());
ASSERT_TRUE(extension);
+ // Wait for declarative rules to be set up.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
const ExtensionAction* page_action =
ExtensionActionManager::Get(browser()->profile())
->GetPageAction(*extension);
@@ -605,6 +609,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest,
ext_dir_.WriteFile(FILE_PATH_LITERAL("background.js"), kBackgroundHelpers);
const Extension* extension = LoadExtension(ext_dir_.UnpackedPath());
ASSERT_TRUE(extension);
+ // Wait for declarative rules to be set up.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
const std::string extension_id = extension->id();
const ExtensionAction* page_action = ExtensionActionManager::Get(
browser()->profile())->GetPageAction(*extension);
@@ -631,6 +638,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest,
EXPECT_EQ(1u, extension_action_test_util::GetTotalPageActionCount(tab));
ReloadExtension(extension_id); // Invalidates page_action and extension.
+ // Wait for declarative rules to be removed.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
EXPECT_EQ("test_rule",
ExecuteScriptInBackgroundPage(extension_id, kTestRule));
// TODO(jyasskin): Apply new rules to existing tabs, without waiting for a
@@ -641,6 +651,9 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest,
EXPECT_EQ(1u, extension_action_test_util::GetTotalPageActionCount(tab));
UnloadExtension(extension_id);
+ // Wait for declarative rules to be removed.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
NavigateInRenderer(tab, GURL("http://test/"));
EXPECT_TRUE(WaitForPageActionVisibilityChangeTo(0));
EXPECT_EQ(0u, extension_action_test_util::GetVisiblePageActionCount(tab));
@@ -722,6 +735,9 @@ IN_PROC_BROWSER_TEST_P(ShowPageActionWithoutPageActionTest, Test) {
scoped_refptr<const Extension> extension =
loader.LoadExtension(ext_dir_.UnpackedPath());
ASSERT_TRUE(extension);
+ // Wait for declarative rules to be set up.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
const char kScript[] =
"setRules([{\n"
diff --git a/chromium/chrome/browser/extensions/api/declarative_content/set_icon_apitest.cc b/chromium/chrome/browser/extensions/api/declarative_content/set_icon_apitest.cc
index 72a79c3313d..b06f9309bf5 100644
--- a/chromium/chrome/browser/extensions/api/declarative_content/set_icon_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/declarative_content/set_icon_apitest.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "components/version_info/version_info.h"
+#include "content/public/browser/storage_partition.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/test_extension_dir.h"
@@ -74,6 +75,9 @@ IN_PROC_BROWSER_TEST_F(SetIconAPITest, Overview) {
ExtensionTestMessageListener ready("ready", false);
const Extension* extension = LoadExtension(ext_dir_.UnpackedPath());
ASSERT_TRUE(extension);
+ // Wait for declarative rules to be set up.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
const ExtensionAction* page_action =
ExtensionActionManager::Get(browser()->profile())->
GetPageAction(*extension);
diff --git a/chromium/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc b/chromium/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc
index 43c0ea8cd18..5f086a51ea0 100644
--- a/chromium/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc
+++ b/chromium/chrome/browser/extensions/api/declarative_net_request/declarative_net_request_browsertest.cc
@@ -19,6 +19,7 @@
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/threading/thread_restrictions.h"
@@ -52,6 +53,7 @@
#include "extensions/browser/api/declarative_net_request/ruleset_manager.h"
#include "extensions/browser/api/declarative_net_request/ruleset_matcher.h"
#include "extensions/browser/api/declarative_net_request/test_utils.h"
+#include "extensions/browser/api/declarative_net_request/utils.h"
#include "extensions/browser/api/web_request/web_request_info.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
@@ -338,18 +340,10 @@ class DeclarativeNetRequestBrowserTest
}
ASSERT_TRUE(extension);
- EXPECT_TRUE(HasValidIndexedRuleset(*extension, profile()));
// Ensure the ruleset is also loaded on the IO thread.
content::RunAllTasksUntilIdle();
- // Wait for the background page to load if needed.
- if (has_background_script_)
- WaitForBackgroundScriptToLoad(extension->id());
-
- // Ensure no load errors were reported.
- EXPECT_TRUE(LoadErrorReporter::GetInstance()->GetErrors()->empty());
-
tester.ExpectTotalCount(kIndexRulesTimeHistogram, 1);
tester.ExpectTotalCount(kIndexAndPersistRulesTimeHistogram, 1);
tester.ExpectUniqueSample(kManifestRulesCountHistogram,
@@ -359,6 +353,15 @@ class DeclarativeNetRequestBrowserTest
tester.ExpectUniqueSample(
"Extensions.DeclarativeNetRequest.LoadRulesetResult",
RulesetMatcher::kLoadSuccess /*sample*/, 1 /*count*/);
+
+ EXPECT_TRUE(HasValidIndexedRuleset(*extension, profile()));
+
+ // Wait for the background page to load if needed.
+ if (has_background_script_)
+ WaitForBackgroundScriptToLoad(extension->id());
+
+ // Ensure no load errors were reported.
+ EXPECT_TRUE(LoadErrorReporter::GetInstance()->GetErrors()->empty());
}
void LoadExtensionWithRules(const std::vector<TestRule>& rules) {
@@ -480,7 +483,10 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
{"|http://*.us", 3},
{"pages_with_script/page2.html|", 4},
{"|http://msn*/pages_with_script/page.html|", 5},
- {"%20", 6}, // Block any urls with space.
+ {"%20", 6}, // Block any urls with space.
+ {"%C3%A9", 7}, // Percent-encoded non-ascii character Ă©.
+ // Internationalized domain "â±´ase.com" in punycode.
+ {"|http://xn--ase-7z0b.com", 8},
};
// Rule |i| is the rule with id |i|.
@@ -504,6 +510,12 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
{"abc.com", "/pages_with_script/page.html?q=hi bye", false}, // Rule 6
{"abc.com", "/pages_with_script/page.html?q=hi%20bye", false}, // Rule 6
{"abc.com", "/pages_with_script/page.html?q=hibye", true},
+ {"abc.com",
+ "/pages_with_script/page.html?q=" + base::WideToUTF8(L"\u00E9"),
+ false}, // Rule 7
+ {base::WideToUTF8(L"\x2c74"
+ L"ase.com"),
+ "/pages_with_script/page.html", false}, // Rule 8
};
// Load the extension.
@@ -653,7 +665,10 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
size_t id;
std::vector<std::string> domains;
std::vector<std::string> excluded_domains;
- } rules_data[] = {{"child_frame.html?frame=1", 1, {"x.com"}, {"a.x.com"}},
+ } rules_data[] = {{"child_frame.html?frame=1",
+ 1,
+ {"x.com", "xn--36c-tfa.com" /* punycode for 36°c.com */},
+ {"a.x.com"}},
{"child_frame.html?frame=2", 2, {}, {"a.y.com"}}};
std::vector<TestRule> rules;
@@ -679,6 +694,9 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
bool expect_frame_2_loaded;
} test_cases[] = {
{"x.com", false /* Rule 1 */, false /* Rule 2 */},
+ {base::WideToUTF8(L"36\x00b0"
+ L"c.com" /* 36°c.com */),
+ false /*Rule 1*/, false /*Rule 2*/},
{"b.x.com", false /* Rule 1 */, false /* Rule 2 */},
{"a.x.com", true, false /* Rule 2 */},
{"b.a.x.com", true, false /* Rule 2 */},
@@ -1307,7 +1325,7 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
// affecting requests.
PrefService* pref_service = browser()->profile()->GetPrefs();
pref_service->Set(proxy_config::prefs::kProxy,
- *ProxyConfigDictionary::CreatePacScript(
+ ProxyConfigDictionary::CreatePacScript(
embedded_test_server()->GetURL("/self.pac").spec(),
true /* pac_mandatory */));
// Flush the proxy configuration change over the Mojo pipe to avoid any races.
@@ -1632,15 +1650,6 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
request->resource_type = content::ResourceType::RESOURCE_TYPE_SCRIPT;
request->render_frame_id = MSG_ROUTING_NONE;
- // TODO(https://crbug.com/857577): remove this hack. When an unrelated
- // browser issued request (typically from GaiaAuthFetcher) has run, it causes
- // the StoragePartitionImpl to create and cache a URLLoaderFactory without the
- // web request proxying. This resets it so one with the web request proxying
- // is created the next time a request is made.
- base::RunLoop().RunUntilIdle();
- content::BrowserContext::GetDefaultStoragePartition(profile())
- ->ResetURLLoaderFactoryForBrowserProcessForTesting();
-
auto loader = network::SimpleURLLoader::Create(std::move(request),
TRAFFIC_ANNOTATION_FOR_TESTS);
content::SimpleURLLoaderTestHelper loader_helper;
@@ -1816,10 +1825,11 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest_Packed,
verify_page_load(false);
}
- // Overwrite the indexed ruleset file with arbitrary data to mimic corruption.
+ // Overwrite the indexed ruleset file with arbitrary data to mimic corruption,
+ // while maintaining the correct version header.
{
base::ScopedAllowBlockingForTesting scoped_allow_blocking;
- std::string corrupted_data = "data";
+ std::string corrupted_data = GetVersionHeaderForTesting() + "data";
ASSERT_EQ(static_cast<int>(corrupted_data.size()),
base::WriteFile(file_util::GetIndexedRulesetPath(extension_path),
corrupted_data.c_str(), corrupted_data.size()));
@@ -1844,7 +1854,7 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest_Packed,
EXPECT_EQ(1, tester.GetBucketCount(
"Extensions.DeclarativeNetRequest.LoadRulesetResult",
RulesetMatcher::LoadRulesetResult::
- kLoadErrorRulesetVerification /*sample*/));
+ kLoadErrorChecksumMismatch /*sample*/));
EXPECT_EQ(1,
tester.GetBucketCount(
"Extensions.DeclarativeNetRequest.LoadRulesetResult",
@@ -1877,7 +1887,7 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
// Mimic extension prefs corruption by overwriting the indexed ruleset
// checksum.
const int kInvalidRulesetChecksum = -1;
- ExtensionPrefs::Get(profile())->SetDNRRulesetChecksumForTesting(
+ ExtensionPrefs::Get(profile())->SetDNRRulesetChecksum(
extension_id, kInvalidRulesetChecksum);
TestExtensionRegistryObserver registry_observer(
@@ -1904,7 +1914,7 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
EXPECT_EQ(1, tester.GetBucketCount(
"Extensions.DeclarativeNetRequest.LoadRulesetResult",
RulesetMatcher::LoadRulesetResult::
- kLoadErrorRulesetVerification /*sample*/));
+ kLoadErrorChecksumMismatch /*sample*/));
// Verify that re-indexing the ruleset failed.
tester.ExpectUniqueSample(
@@ -1912,6 +1922,60 @@ IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest,
false /*sample*/, 1 /*count*/);
}
+// Tests that we reindex the extension ruleset in case its ruleset format
+// version is not the same as one used by Chrome.
+IN_PROC_BROWSER_TEST_P(DeclarativeNetRequestBrowserTest_Packed,
+ ReindexOnRulesetVersionMismatch) {
+ // Set up an observer for RulesetMatcher to monitor the number of extension
+ // rulesets.
+ RulesetCountWaiter ruleset_count_waiter;
+ ScopedRulesetManagerTestObserver scoped_observer(
+ &ruleset_count_waiter,
+ base::WrapRefCounted(ExtensionSystem::Get(profile())->info_map()));
+
+ TestRule rule = CreateGenericRule();
+ rule.condition->url_filter = std::string("*");
+ ASSERT_NO_FATAL_FAILURE(LoadExtensionWithRules({rule}));
+ ruleset_count_waiter.WaitForRulesetCount(1);
+
+ const ExtensionId extension_id = last_loaded_extension_id();
+ const auto* rules_monitor_service = BrowserContextKeyedAPIFactory<
+ declarative_net_request::RulesMonitorService>::Get(profile());
+ EXPECT_TRUE(rules_monitor_service->HasRegisteredRuleset(extension_id));
+
+ DisableExtension(extension_id);
+ ruleset_count_waiter.WaitForRulesetCount(0);
+ EXPECT_FALSE(rules_monitor_service->HasRegisteredRuleset(extension_id));
+
+ // Now change the current indexed ruleset format version. This should cause a
+ // version mismatch when the extension is loaded again, but reindexing should
+ // still succeed.
+ const int kIndexedRulesetFormatVersion = 100;
+ std::string old_version_header = GetVersionHeaderForTesting();
+ SetIndexedRulesetFormatVersionForTesting(kIndexedRulesetFormatVersion);
+ ASSERT_NE(old_version_header, GetVersionHeaderForTesting());
+
+ base::HistogramTester tester;
+ EnableExtension(extension_id);
+ ruleset_count_waiter.WaitForRulesetCount(1);
+ EXPECT_TRUE(rules_monitor_service->HasRegisteredRuleset(extension_id));
+
+ // Verify that loading the ruleset would have failed initially due to
+ // version header mismatch and later succeeded.
+ EXPECT_EQ(1, tester.GetBucketCount(
+ "Extensions.DeclarativeNetRequest.LoadRulesetResult",
+ RulesetMatcher::LoadRulesetResult::
+ kLoadErrorVersionMismatch /*sample*/));
+ EXPECT_EQ(1, tester.GetBucketCount(
+ "Extensions.DeclarativeNetRequest.LoadRulesetResult",
+ RulesetMatcher::LoadRulesetResult::kLoadSuccess /*sample*/));
+
+ // Verify that reindexing succeeded.
+ tester.ExpectUniqueSample(
+ "Extensions.DeclarativeNetRequest.RulesetReindexSuccessful",
+ true /*sample*/, 1 /*count*/);
+}
+
// Test fixture to verify that host permissions for the request url and the
// request initiator are properly checked. Loads an example.com url with four
// sub-frames named frame_[1..4] from hosts frame_[1..4].com. The initiator for
diff --git a/chromium/chrome/browser/extensions/api/declarative_net_request/ruleset_matcher_unittest.cc b/chromium/chrome/browser/extensions/api/declarative_net_request/ruleset_matcher_unittest.cc
index 90209860ec6..2948dde85c1 100644
--- a/chromium/chrome/browser/extensions/api/declarative_net_request/ruleset_matcher_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/declarative_net_request/ruleset_matcher_unittest.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/profiles/profile.h"
#include "components/url_pattern_index/flat/url_pattern_index_generated.h"
#include "extensions/browser/api/declarative_net_request/test_utils.h"
+#include "extensions/browser/api/declarative_net_request/utils.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/api/declarative_net_request/constants.h"
#include "extensions/common/api/declarative_net_request/test_utils.h"
@@ -123,7 +124,8 @@ TEST_P(RulesetMatcherTest, FailedVerification) {
base::FilePath indexed_ruleset_path =
file_util::GetIndexedRulesetPath(extension()->path());
- // Persist invalid data to the ruleset file.
+ // Persist invalid data to the ruleset file and ensure that a version mismatch
+ // occurs.
std::string data = "invalid data";
ASSERT_EQ(static_cast<int>(data.size()),
base::WriteFile(indexed_ruleset_path, data.c_str(), data.size()));
@@ -134,7 +136,17 @@ TEST_P(RulesetMatcherTest, FailedVerification) {
->GetDNRRulesetChecksum(extension()->id(), &expected_checksum));
std::unique_ptr<RulesetMatcher> matcher;
- EXPECT_EQ(RulesetMatcher::kLoadErrorRulesetVerification,
+ EXPECT_EQ(RulesetMatcher::kLoadErrorVersionMismatch,
+ RulesetMatcher::CreateVerifiedMatcher(indexed_ruleset_path,
+ expected_checksum, &matcher));
+
+ // Now, persist invalid data to the ruleset file, while maintaining the
+ // correct version header. Ensure that it fails verification due to checksum
+ // mismatch.
+ data = GetVersionHeaderForTesting() + "invalid data";
+ ASSERT_EQ(static_cast<int>(data.size()),
+ base::WriteFile(indexed_ruleset_path, data.c_str(), data.size()));
+ EXPECT_EQ(RulesetMatcher::kLoadErrorChecksumMismatch,
RulesetMatcher::CreateVerifiedMatcher(indexed_ruleset_path,
expected_checksum, &matcher));
}
diff --git a/chromium/chrome/browser/extensions/api/desktop_capture/OWNERS b/chromium/chrome/browser/extensions/api/desktop_capture/OWNERS
index c43cfad6ede..62e34f14d33 100644
--- a/chromium/chrome/browser/extensions/api/desktop_capture/OWNERS
+++ b/chromium/chrome/browser/extensions/api/desktop_capture/OWNERS
@@ -1,7 +1,7 @@
-# Please send the changes to zijiehe@chromium.org first.
+# Please send the changes to braveyao@chromium.org first.
sergeyu@chromium.org
wez@chromium.org
-zijiehe@chromium.org
+braveyao@chromium.org
# TEAM: media-capture-and-streams@grotations.appspotmail.com
# COMPONENT: Blink>GetUserMedia>Desktop
diff --git a/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc b/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
index 66e3efd2644..4345409664f 100644
--- a/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_apitest.cc
@@ -8,11 +8,10 @@
#include "base/macros.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
-#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/desktop_capture/desktop_capture_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
-#include "chrome/browser/media/webrtc/fake_desktop_media_list.h"
+#include "chrome/browser/media/webrtc/fake_desktop_media_picker_factory.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -30,20 +29,6 @@ namespace extensions {
namespace {
-struct TestFlags {
- bool expect_screens;
- bool expect_windows;
- bool expect_tabs;
- bool expect_audio;
- DesktopMediaID selected_source;
- bool cancelled;
-
- // Following flags are set by FakeDesktopMediaPicker when it's created and
- // deleted.
- bool picker_created;
- bool picker_deleted;
-};
-
// TODO(crbug.com/805145): Uncomment this when test is re-enabled.
#if 0
DesktopMediaID MakeFakeWebContentsMediaId(bool audio_share) {
@@ -56,104 +41,6 @@ DesktopMediaID MakeFakeWebContentsMediaId(bool audio_share) {
}
#endif
-class FakeDesktopMediaPicker : public DesktopMediaPicker {
- public:
- explicit FakeDesktopMediaPicker(TestFlags* expectation)
- : expectation_(expectation),
- weak_factory_(this) {
- expectation_->picker_created = true;
- }
- ~FakeDesktopMediaPicker() override { expectation_->picker_deleted = true; }
-
- // DesktopMediaPicker interface.
- void Show(const DesktopMediaPicker::Params& params,
- std::vector<std::unique_ptr<DesktopMediaList>> source_lists,
- const DoneCallback& done_callback) override {
- bool show_screens = false;
- bool show_windows = false;
- bool show_tabs = false;
-
- for (auto& source_list : source_lists) {
- switch (source_list->GetMediaListType()) {
- case DesktopMediaID::TYPE_NONE:
- break;
- case DesktopMediaID::TYPE_SCREEN:
- show_screens = true;
- break;
- case DesktopMediaID::TYPE_WINDOW:
- show_windows = true;
- break;
- case DesktopMediaID::TYPE_WEB_CONTENTS:
- show_tabs = true;
- break;
- }
- }
- EXPECT_EQ(expectation_->expect_screens, show_screens);
- EXPECT_EQ(expectation_->expect_windows, show_windows);
- EXPECT_EQ(expectation_->expect_tabs, show_tabs);
- EXPECT_EQ(expectation_->expect_audio, params.request_audio);
- EXPECT_EQ(params.modality, ui::ModalType::MODAL_TYPE_CHILD);
-
- if (!expectation_->cancelled) {
- // Post a task to call the callback asynchronously.
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(&FakeDesktopMediaPicker::CallCallback,
- weak_factory_.GetWeakPtr(), done_callback));
- } else {
- // If we expect the dialog to be cancelled then store the callback to
- // retain reference to the callback handler.
- done_callback_ = done_callback;
- }
- }
-
- private:
- void CallCallback(DoneCallback done_callback) {
- done_callback.Run(expectation_->selected_source);
- }
-
- TestFlags* expectation_;
- DoneCallback done_callback_;
-
- base::WeakPtrFactory<FakeDesktopMediaPicker> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(FakeDesktopMediaPicker);
-};
-
-class FakeDesktopMediaPickerFactory :
- public DesktopCaptureChooseDesktopMediaFunction::PickerFactory {
- public:
- FakeDesktopMediaPickerFactory() {}
- ~FakeDesktopMediaPickerFactory() override {}
-
- void SetTestFlags(TestFlags* test_flags, int tests_count) {
- test_flags_ = test_flags;
- tests_count_ = tests_count;
- current_test_ = 0;
- }
-
- std::unique_ptr<DesktopMediaPicker> CreatePicker() override {
- EXPECT_LE(current_test_, tests_count_);
- if (current_test_ >= tests_count_)
- return std::unique_ptr<DesktopMediaPicker>();
- ++current_test_;
- return std::unique_ptr<DesktopMediaPicker>(
- new FakeDesktopMediaPicker(test_flags_ + current_test_ - 1));
- }
-
- std::unique_ptr<DesktopMediaList> CreateMediaList(
- DesktopMediaID::Type type) override {
- EXPECT_LE(current_test_, tests_count_);
- return std::unique_ptr<DesktopMediaList>(new FakeDesktopMediaList(type));
- }
-
- private:
- TestFlags* test_flags_;
- int tests_count_;
- int current_test_;
-
- DISALLOW_COPY_AND_ASSIGN(FakeDesktopMediaPickerFactory);
-};
-
class DesktopCaptureApiTest : public ExtensionApiTest {
public:
DesktopCaptureApiTest() {
@@ -195,7 +82,7 @@ class DesktopCaptureApiTest : public ExtensionApiTest {
IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, MAYBE_ChooseDesktopMedia) {
// Each element in the following array corresponds to one test in
// chrome/test/data/extensions/api_test/desktop_capture/test.js .
- TestFlags test_flags[] = {
+ FakeDesktopMediaPickerFactory::TestFlags test_flags[] = {
// pickerUiCanceled()
{true, true, false, false, DesktopMediaID()},
// chooseMedia()
@@ -269,7 +156,7 @@ IN_PROC_BROWSER_TEST_F(DesktopCaptureApiTest, DISABLED_Delegation) {
ui_test_utils::NavigateToURL(
browser(), GetURLForPath("example.com", "/example.com.html"));
- TestFlags test_flags[] = {
+ FakeDesktopMediaPickerFactory::TestFlags test_flags[] = {
{true, true, false, false,
DesktopMediaID(DesktopMediaID::TYPE_SCREEN, DesktopMediaID::kNullId)},
{true, true, false, false,
diff --git a/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc b/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
index 4e8b6cc9ffa..29040b29d65 100644
--- a/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
+++ b/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.cc
@@ -13,7 +13,7 @@
#include "build/build_config.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/media/webrtc/desktop_media_list_ash.h"
-#include "chrome/browser/media/webrtc/desktop_streams_registry.h"
+#include "chrome/browser/media/webrtc/desktop_media_picker_factory_impl.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/browser/media/webrtc/native_desktop_media_list.h"
#include "chrome/browser/media/webrtc/tab_desktop_media_list.h"
@@ -21,6 +21,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/grit/chromium_strings.h"
#include "content/public/browser/desktop_capture.h"
+#include "content/public/browser/desktop_streams_registry.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
@@ -39,20 +40,18 @@ const char kInvalidSourceNameError[] = "Invalid source type specified.";
const char kEmptySourcesListError[] =
"At least one source type must be specified.";
-DesktopCaptureChooseDesktopMediaFunctionBase::PickerFactory* g_picker_factory =
- NULL;
+DesktopMediaPickerFactory* g_picker_factory = nullptr;
} // namespace
// static
void DesktopCaptureChooseDesktopMediaFunctionBase::SetPickerFactoryForTests(
- PickerFactory* factory) {
+ DesktopMediaPickerFactory* factory) {
g_picker_factory = factory;
}
DesktopCaptureChooseDesktopMediaFunctionBase::
- DesktopCaptureChooseDesktopMediaFunctionBase() {
-}
+ DesktopCaptureChooseDesktopMediaFunctionBase() = default;
DesktopCaptureChooseDesktopMediaFunctionBase::
~DesktopCaptureChooseDesktopMediaFunctionBase() {
@@ -94,12 +93,8 @@ bool DesktopCaptureChooseDesktopMediaFunctionBase::Execute(
parent_window = target_browser->window()->GetNativeWindow();
}
- // Keep same order as the input |sources| and avoid duplicates.
- std::vector<std::unique_ptr<DesktopMediaList>> source_lists;
- bool have_screen_list = false;
- bool have_window_list = false;
- bool have_tab_list = false;
bool request_audio = false;
+ std::vector<content::DesktopMediaID::Type> media_types;
for (auto source_type : sources) {
switch (source_type) {
case api::desktop_capture::DESKTOP_CAPTURE_SOURCE_TYPE_NONE: {
@@ -107,98 +102,45 @@ bool DesktopCaptureChooseDesktopMediaFunctionBase::Execute(
return false;
}
case api::desktop_capture::DESKTOP_CAPTURE_SOURCE_TYPE_SCREEN: {
- if (have_screen_list) {
- continue;
- }
- std::unique_ptr<DesktopMediaList> screen_list;
- if (g_picker_factory) {
- screen_list =
- g_picker_factory->CreateMediaList(DesktopMediaID::TYPE_SCREEN);
- } else {
-#if defined(OS_CHROMEOS)
- screen_list = std::make_unique<DesktopMediaListAsh>(
- DesktopMediaID::TYPE_SCREEN);
-#else // !defined(OS_CHROMEOS)
- screen_list = std::make_unique<NativeDesktopMediaList>(
- content::DesktopMediaID::TYPE_SCREEN,
- content::desktop_capture::CreateScreenCapturer());
-#endif // !defined(OS_CHROMEOS)
- }
- have_screen_list = true;
- source_lists.push_back(std::move(screen_list));
+ media_types.push_back(content::DesktopMediaID::TYPE_SCREEN);
break;
}
case api::desktop_capture::DESKTOP_CAPTURE_SOURCE_TYPE_WINDOW: {
- if (have_window_list) {
- continue;
- }
- std::unique_ptr<DesktopMediaList> window_list;
- if (g_picker_factory) {
- window_list =
- g_picker_factory->CreateMediaList(DesktopMediaID::TYPE_WINDOW);
- } else {
-#if defined(OS_CHROMEOS)
- window_list = std::make_unique<DesktopMediaListAsh>(
- DesktopMediaID::TYPE_WINDOW);
-#else // !defined(OS_CHROMEOS)
- // NativeDesktopMediaList calls the capturers on a background thread.
- // This means that the two DesktopCapturer instances (for screens and
- // windows) created here cannot share the same DesktopCaptureOptions
- // instance. DesktopCaptureOptions owns X connection, which cannot be
- // used on multiple threads concurrently.
- window_list = std::make_unique<NativeDesktopMediaList>(
- content::DesktopMediaID::TYPE_WINDOW,
- content::desktop_capture::CreateWindowCapturer());
-#endif // !defined(OS_CHROMEOS)
- }
- have_window_list = true;
- source_lists.push_back(std::move(window_list));
+ media_types.push_back(content::DesktopMediaID::TYPE_WINDOW);
break;
}
case api::desktop_capture::DESKTOP_CAPTURE_SOURCE_TYPE_TAB: {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- extensions::switches::kDisableTabForDesktopShare) ||
- have_tab_list) {
+ extensions::switches::kDisableTabForDesktopShare)) {
continue;
}
- std::unique_ptr<DesktopMediaList> tab_list;
- if (g_picker_factory) {
- tab_list = g_picker_factory->CreateMediaList(
- DesktopMediaID::TYPE_WEB_CONTENTS);
- } else {
- tab_list = std::make_unique<TabDesktopMediaList>();
- }
- have_tab_list = true;
- source_lists.push_back(std::move(tab_list));
+ media_types.push_back(content::DesktopMediaID::TYPE_WEB_CONTENTS);
break;
}
case api::desktop_capture::DESKTOP_CAPTURE_SOURCE_TYPE_AUDIO: {
- bool audio_capture_disabled =
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- extensions::switches::kDisableDesktopCaptureAudio);
- if (!audio_capture_disabled) {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ extensions::switches::kDisableDesktopCaptureAudio)) {
request_audio = true;
}
break;
}
}
}
+
+ DesktopMediaPickerFactory* picker_factory =
+ g_picker_factory ? g_picker_factory
+ : DesktopMediaPickerFactoryImpl::GetInstance();
+ // Keep same order as the input |sources| and avoid duplicates.
+ std::vector<std::unique_ptr<DesktopMediaList>> source_lists =
+ picker_factory->CreateMediaList(media_types);
if (source_lists.empty()) {
error_ = kEmptySourcesListError;
return false;
}
-
- if (g_picker_factory) {
- picker_ = g_picker_factory->CreatePicker();
- } else {
- // DesktopMediaPicker is implemented only for Windows, OSX and
- // Aura Linux builds.
-#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
- picker_ = DesktopMediaPicker::Create();
-#else
+ picker_ = picker_factory->CreatePicker();
+ if (!picker_) {
error_ = "Desktop Capture API is not yet implemented for this platform.";
return false;
-#endif
}
DesktopMediaPicker::DoneCallback callback = base::Bind(
@@ -234,20 +176,15 @@ void DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults(
DesktopMediaID source) {
std::string result;
if (source.type != DesktopMediaID::TYPE_NONE && web_contents()) {
- DesktopStreamsRegistry* registry =
- MediaCaptureDevicesDispatcher::GetInstance()->
- GetDesktopStreamsRegistry();
// TODO(miu): Once render_frame_host() is being set, we should register the
// exact RenderFrame requesting the stream, not the main RenderFrame. With
// that change, also update
// MediaCaptureDevicesDispatcher::ProcessDesktopCaptureAccessRequest().
// http://crbug.com/304341
content::RenderFrameHost* const main_frame = web_contents()->GetMainFrame();
- result = registry->RegisterStream(main_frame->GetProcess()->GetID(),
- main_frame->GetRoutingID(),
- origin_,
- source,
- extension()->name());
+ result = content::DesktopStreamsRegistry::GetInstance()->RegisterStream(
+ main_frame->GetProcess()->GetID(), main_frame->GetRoutingID(), origin_,
+ source, extension()->name(), content::kRegistryStreamTypeDesktop);
}
Options options;
@@ -258,9 +195,7 @@ void DesktopCaptureChooseDesktopMediaFunctionBase::OnPickerDialogResults(
DesktopCaptureRequestsRegistry::RequestId::RequestId(int process_id,
int request_id)
- : process_id(process_id),
- request_id(request_id) {
-}
+ : process_id(process_id), request_id(request_id) {}
bool DesktopCaptureRequestsRegistry::RequestId::operator<(
const RequestId& other) const {
@@ -312,5 +247,4 @@ void DesktopCaptureRequestsRegistry::CancelRequest(int process_id,
it->second->Cancel();
}
-
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h b/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h
index a56432871db..595a331a6a2 100644
--- a/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h
+++ b/chromium/chrome/browser/extensions/api/desktop_capture/desktop_capture_base.h
@@ -14,6 +14,7 @@
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/media/webrtc/desktop_media_list.h"
#include "chrome/browser/media/webrtc/desktop_media_picker.h"
+#include "chrome/browser/media/webrtc/desktop_media_picker_factory.h"
#include "chrome/common/extensions/api/desktop_capture.h"
#include "content/public/browser/web_contents_observer.h"
#include "url/gurl.h"
@@ -24,26 +25,10 @@ class DesktopCaptureChooseDesktopMediaFunctionBase
: public ChromeAsyncExtensionFunction,
public content::WebContentsObserver {
public:
- // Factory creating DesktopMediaList and DesktopMediaPicker instances.
- // Used for tests to supply fake picker.
- class PickerFactory {
- public:
- virtual std::unique_ptr<DesktopMediaPicker> CreatePicker() = 0;
- virtual std::unique_ptr<DesktopMediaList> CreateMediaList(
- content::DesktopMediaID::Type type) = 0;
-
- protected:
- PickerFactory() = default;
- virtual ~PickerFactory() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PickerFactory);
- };
-
// Used to set PickerFactory used to create mock DesktopMediaPicker instances
// for tests. Calling tests keep ownership of the factory. Can be called with
// |factory| set to NULL at the end of the test.
- static void SetPickerFactoryForTests(PickerFactory* factory);
+ static void SetPickerFactoryForTests(DesktopMediaPickerFactory* factory);
DesktopCaptureChooseDesktopMediaFunctionBase();
@@ -77,6 +62,7 @@ class DesktopCaptureChooseDesktopMediaFunctionBase
// URL of page that desktop capture was requested for.
GURL origin_;
+ std::unique_ptr<DesktopMediaPickerFactory> picker_factory_;
std::unique_ptr<DesktopMediaPicker> picker_;
};
diff --git a/chromium/chrome/browser/extensions/api/developer_private/DEPS b/chromium/chrome/browser/extensions/api/developer_private/DEPS
index 5ad83b64961..5b9436cd654 100644
--- a/chromium/chrome/browser/extensions/api/developer_private/DEPS
+++ b/chromium/chrome/browser/extensions/api/developer_private/DEPS
@@ -1,4 +1,8 @@
specific_include_rules = {
+ "show_permissions_dialog_helper.cc": [
+ #TODO(https://crbug.com/873872): Remove this.
+ "+chrome/browser/apps/platform_apps/app_load_service.h",
+ ],
"developer_private_api_unittest.cc": [
# Allow the unittest to create a data_decoder service.
"+services/data_decoder"
diff --git a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc
index 27e3b46092f..52d4edb8c3e 100644
--- a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -18,7 +18,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/api/developer_private/developer_private_mangle.h"
#include "chrome/browser/extensions/api/developer_private/entry_picker.h"
@@ -27,12 +27,14 @@
#include "chrome/browser/extensions/chrome_zipfile_installer.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/devtools_util.h"
+#include "chrome/browser/extensions/error_console/error_console_factory.h"
#include "chrome/browser/extensions/extension_commands_global_registry.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/extensions/extension_ui_util.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/install_verifier.h"
+#include "chrome/browser/extensions/permissions_updater.h"
#include "chrome/browser/extensions/scripting_permissions_modifier.h"
#include "chrome/browser/extensions/shared_module_service.h"
#include "chrome/browser/extensions/unpacked_installer.h"
@@ -52,7 +54,9 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/notification_source.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/site_instance.h"
@@ -66,15 +70,20 @@
#include "extensions/browser/content_verifier.h"
#include "extensions/browser/disable_reason.h"
#include "extensions/browser/error_map.h"
+#include "extensions/browser/event_router_factory.h"
#include "extensions/browser/extension_error.h"
#include "extensions/browser/extension_prefs.h"
+#include "extensions/browser/extension_prefs_factory.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/extension_registry_factory.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/file_highlighter.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/notification_types.h"
#include "extensions/browser/path_util.h"
+#include "extensions/browser/process_manager_factory.h"
#include "extensions/browser/warning_service.h"
+#include "extensions/browser/warning_service_factory.h"
#include "extensions/browser/zipfile_installer.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/feature_switch.h"
@@ -259,6 +268,25 @@ developer::LoadError CreateLoadError(
return response;
}
+base::Optional<URLPattern> ParseRuntimePermissionsPattern(
+ const std::string& pattern_str) {
+ constexpr int kValidRuntimePermissionSchemes = URLPattern::SCHEME_HTTP |
+ URLPattern::SCHEME_HTTPS |
+ URLPattern::SCHEME_FILE;
+
+ URLPattern pattern(kValidRuntimePermissionSchemes);
+ if (pattern.Parse(pattern_str) != URLPattern::PARSE_SUCCESS)
+ return base::nullopt;
+
+ // We don't allow adding paths for permissions, because they aren't meaningful
+ // in terms of origin access. The frontend should validate this, but there's
+ // a chance something can slip through, so we should fail gracefully.
+ if (pattern.path() != "/*")
+ return base::nullopt;
+
+ return pattern;
+}
+
} // namespace
namespace ChoosePath = api::developer_private::ChoosePath;
@@ -302,6 +330,20 @@ DeveloperPrivateAPI::GetFactoryInstance() {
return g_developer_private_api_factory.Pointer();
}
+template <>
+void BrowserContextKeyedAPIFactory<
+ DeveloperPrivateAPI>::DeclareFactoryDependencies() {
+ DependsOn(ExtensionRegistryFactory::GetInstance());
+ DependsOn(ErrorConsoleFactory::GetInstance());
+ DependsOn(ProcessManagerFactory::GetInstance());
+ DependsOn(AppWindowRegistry::Factory::GetInstance());
+ DependsOn(WarningServiceFactory::GetInstance());
+ DependsOn(ExtensionPrefsFactory::GetInstance());
+ DependsOn(ExtensionManagementFactory::GetInstance());
+ DependsOn(CommandService::GetFactoryInstance());
+ DependsOn(EventRouterFactory::GetInstance());
+}
+
// static
DeveloperPrivateAPI* DeveloperPrivateAPI::Get(
content::BrowserContext* context) {
@@ -341,6 +383,9 @@ DeveloperPrivateEventRouter::DeveloperPrivateEventRouter(Profile* profile)
prefs::kExtensionsUIDeveloperMode,
base::Bind(&DeveloperPrivateEventRouter::OnProfilePrefChanged,
base::Unretained(this)));
+ notification_registrar_.Add(
+ this, extensions::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
+ content::Source<Profile>(profile_));
}
DeveloperPrivateEventRouter::~DeveloperPrivateEventRouter() {
@@ -448,6 +493,12 @@ void DeveloperPrivateEventRouter::OnExtensionDisableReasonsChanged(
BroadcastItemStateChanged(developer::EVENT_TYPE_PREFS_CHANGED, extension_id);
}
+void DeveloperPrivateEventRouter::OnExtensionRuntimePermissionsChanged(
+ const std::string& extension_id) {
+ BroadcastItemStateChanged(developer::EVENT_TYPE_PERMISSIONS_CHANGED,
+ extension_id);
+}
+
void DeveloperPrivateEventRouter::OnExtensionManagementSettingsChanged() {
std::unique_ptr<base::ListValue> args(new base::ListValue());
args->Append(CreateProfileInfo(profile_)->ToValue());
@@ -463,6 +514,18 @@ void DeveloperPrivateEventRouter::ExtensionWarningsChanged(
BroadcastItemStateChanged(developer::EVENT_TYPE_WARNINGS_CHANGED, id);
}
+void DeveloperPrivateEventRouter::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
+ DCHECK_EQ(NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED, type);
+
+ UpdatedExtensionPermissionsInfo* info =
+ content::Details<UpdatedExtensionPermissionsInfo>(details).ptr();
+ BroadcastItemStateChanged(developer::EVENT_TYPE_PERMISSIONS_CHANGED,
+ info->extension->id());
+}
+
void DeveloperPrivateEventRouter::OnProfilePrefChanged() {
std::unique_ptr<base::ListValue> args(new base::ListValue());
args->Append(CreateProfileInfo(profile_)->ToValue());
@@ -1932,30 +1995,27 @@ DeveloperPrivateAddHostPermissionFunction::Run() {
developer::AddHostPermission::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
- GURL host(params->host);
- if (!host.is_valid() || host.path_piece().length() > 1 || host.has_query() ||
- host.has_ref()) {
+ base::Optional<URLPattern> pattern =
+ ParseRuntimePermissionsPattern(params->host);
+ if (!pattern)
return RespondNow(Error(kInvalidHost));
- }
const Extension* extension = GetExtensionById(params->extension_id);
if (!extension)
return RespondNow(Error(kNoSuchExtensionError));
- ScriptingPermissionsModifier scripting_modifier(browser_context(), extension);
- if (!scripting_modifier.CanAffectExtension())
+ if (!ScriptingPermissionsModifier(browser_context(), extension)
+ .CanAffectExtension()) {
return RespondNow(Error(kCannotChangeHostPermissions));
-
- // Only grant withheld permissions. This also ensures that we won't grant
- // any permission for a host that shouldn't be accessible to the extension,
- // like chrome:-scheme urls.
- if (!extension->permissions_data()
- ->withheld_permissions()
- .HasEffectiveAccessToURL(host)) {
- return RespondNow(Error("Cannot grant a permission that wasn't withheld."));
}
- scripting_modifier.GrantHostPermission(host);
+ URLPatternSet new_host_permissions({*pattern});
+ PermissionsUpdater(browser_context())
+ .GrantRuntimePermissions(
+ *extension,
+ PermissionSet(APIPermissionSet(), ManifestPermissionSet(),
+ new_host_permissions, new_host_permissions));
+
return RespondNow(NoArguments());
}
@@ -1970,11 +2030,10 @@ DeveloperPrivateRemoveHostPermissionFunction::Run() {
developer::RemoveHostPermission::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
- GURL host(params->host);
- if (!host.is_valid() || host.path_piece().length() > 1 || host.has_query() ||
- host.has_ref()) {
+ base::Optional<URLPattern> pattern =
+ ParseRuntimePermissionsPattern(params->host);
+ if (!pattern)
return RespondNow(Error(kInvalidHost));
- }
const Extension* extension = GetExtensionById(params->extension_id);
if (!extension)
@@ -1984,10 +2043,18 @@ DeveloperPrivateRemoveHostPermissionFunction::Run() {
if (!scripting_modifier.CanAffectExtension())
return RespondNow(Error(kCannotChangeHostPermissions));
- if (!scripting_modifier.HasGrantedHostPermission(host))
+ URLPatternSet host_permissions_to_remove({*pattern});
+ std::unique_ptr<const PermissionSet> permissions_to_remove =
+ PermissionSet::CreateIntersection(
+ PermissionSet(APIPermissionSet(), ManifestPermissionSet(),
+ host_permissions_to_remove, host_permissions_to_remove),
+ *scripting_modifier.GetRevokablePermissions(),
+ URLPatternSet::IntersectionBehavior::kDetailed);
+ if (permissions_to_remove->IsEmpty())
return RespondNow(Error("Cannot remove a host that hasn't been granted."));
- scripting_modifier.RemoveGrantedHostPermission(host);
+ PermissionsUpdater(browser_context())
+ .RevokeRuntimePermissions(*extension, *permissions_to_remove);
return RespondNow(NoArguments());
}
diff --git a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.h
index 1d59e38c25a..373a4300e99 100644
--- a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.h
+++ b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api.h
@@ -23,6 +23,8 @@
#include "chrome/common/extensions/api/developer_private.h"
#include "chrome/common/extensions/webstore_install_result.h"
#include "components/prefs/pref_change_registrar.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/api/file_system/file_system_api.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
@@ -59,7 +61,8 @@ class DeveloperPrivateEventRouter : public ExtensionRegistryObserver,
public CommandService::Observer,
public ExtensionPrefsObserver,
public ExtensionManagement::Observer,
- public WarningService::Observer {
+ public WarningService::Observer,
+ public content::NotificationObserver {
public:
explicit DeveloperPrivateEventRouter(Profile* profile);
~DeveloperPrivateEventRouter() override;
@@ -107,6 +110,8 @@ class DeveloperPrivateEventRouter : public ExtensionRegistryObserver,
// ExtensionPrefsObserver:
void OnExtensionDisableReasonsChanged(const std::string& extension_id,
int disable_reasons) override;
+ void OnExtensionRuntimePermissionsChanged(
+ const std::string& extension_id) override;
// ExtensionManagement::Observer:
void OnExtensionManagementSettingsChanged() override;
@@ -115,6 +120,11 @@ class DeveloperPrivateEventRouter : public ExtensionRegistryObserver,
void ExtensionWarningsChanged(
const ExtensionIdSet& affected_extensions) override;
+ // content::NotificationObserver:
+ void Observe(int notification_type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
+
// Handles a profile preferance change.
void OnProfilePrefChanged();
@@ -157,6 +167,8 @@ class DeveloperPrivateEventRouter : public ExtensionRegistryObserver,
PrefChangeRegistrar pref_change_registrar_;
+ content::NotificationRegistrar notification_registrar_;
+
base::WeakPtrFactory<DeveloperPrivateEventRouter> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateEventRouter);
@@ -267,6 +279,10 @@ class DeveloperPrivateAPI : public BrowserContextKeyedAPI,
DISALLOW_COPY_AND_ASSIGN(DeveloperPrivateAPI);
};
+template <>
+void BrowserContextKeyedAPIFactory<
+ DeveloperPrivateAPI>::DeclareFactoryDependencies();
+
namespace api {
class DeveloperPrivateAPIFunction : public UIThreadExtensionFunction {
diff --git a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc
index e5c2c3880ee..a4579c439a6 100644
--- a/chromium/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/developer_private/developer_private_api_unittest.cc
@@ -10,6 +10,7 @@
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/scoped_observer.h"
+#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -21,6 +22,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_with_install.h"
#include "chrome/browser/extensions/extension_util.h"
+#include "chrome/browser/extensions/permissions_updater.h"
#include "chrome/browser/extensions/scripting_permissions_modifier.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "chrome/browser/extensions/unpacked_installer.h"
@@ -41,6 +43,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/test/web_contents_tester.h"
#include "extensions/browser/api_test_utils.h"
+#include "extensions/browser/event_router.h"
#include "extensions/browser/event_router_factory.h"
#include "extensions/browser/extension_dialog_auto_confirm.h"
#include "extensions/browser/extension_error_test_util.h"
@@ -51,12 +54,15 @@
#include "extensions/browser/extension_util.h"
#include "extensions/browser/install/extension_install_ui.h"
#include "extensions/browser/mock_external_provider.h"
+#include "extensions/browser/test_event_router_observer.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest_constants.h"
+#include "extensions/common/permissions/permission_set.h"
+#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/value_builder.h"
#include "extensions/test/test_extension_dir.h"
#include "services/data_decoder/data_decoder_service.h"
@@ -90,6 +96,34 @@ bool HasPrefsPermission(bool (*has_pref)(const std::string&,
return has_pref(id, context);
}
+bool WasPermissionsUpdatedEventDispatched(
+ const TestEventRouterObserver& observer,
+ const ExtensionId& extension_id) {
+ const std::string kEventName =
+ api::developer_private::OnItemStateChanged::kEventName;
+ const auto& event_map = observer.events();
+ auto iter = event_map.find(kEventName);
+ if (iter == event_map.end())
+ return false;
+
+ const Event& event = *iter->second;
+ CHECK(event.event_args);
+ CHECK_GE(1u, event.event_args->GetList().size());
+ std::unique_ptr<api::developer_private::EventData> event_data =
+ api::developer_private::EventData::FromValue(
+ event.event_args->GetList()[0]);
+ if (!event_data)
+ return false;
+
+ if (event_data->item_id != extension_id ||
+ event_data->event_type !=
+ api::developer_private::EVENT_TYPE_PERMISSIONS_CHANGED) {
+ return false;
+ }
+
+ return true;
+}
+
} // namespace
class DeveloperPrivateApiUnitTest : public ExtensionServiceTestWithInstall {
@@ -1341,19 +1375,33 @@ TEST_F(DeveloperPrivateApiUnitTest, GrantHostPermission) {
}
};
- GURL host("https://example.com");
- EXPECT_FALSE(modifier.HasGrantedHostPermission(host));
- run_add_host_permission(host.spec(), true, nullptr);
+ const GURL kExampleCom("https://example.com/");
+ EXPECT_FALSE(modifier.HasGrantedHostPermission(kExampleCom));
+ run_add_host_permission("https://example.com/*", true, nullptr);
+ EXPECT_TRUE(modifier.HasGrantedHostPermission(kExampleCom));
+
+ const GURL kGoogleCom("https://google.com");
+ const GURL kMapsGoogleCom("https://maps.google.com/");
+ EXPECT_FALSE(modifier.HasGrantedHostPermission(kGoogleCom));
+ EXPECT_FALSE(modifier.HasGrantedHostPermission(kMapsGoogleCom));
+ run_add_host_permission("https://*.google.com/*", true, nullptr);
+ EXPECT_TRUE(modifier.HasGrantedHostPermission(kGoogleCom));
+ EXPECT_TRUE(modifier.HasGrantedHostPermission(kMapsGoogleCom));
run_add_host_permission(kInvalidHost, false, kInvalidHostError);
+ // Path of the pattern must exactly match "/*".
+ run_add_host_permission("https://example.com/", false, kInvalidHostError);
run_add_host_permission("https://example.com/foobar", false,
kInvalidHostError);
run_add_host_permission("https://example.com/#foobar", false,
kInvalidHostError);
+ run_add_host_permission("https://example.com/*foobar", false,
+ kInvalidHostError);
+
+ // Cannot grant chrome:-scheme URLs.
+ GURL chrome_host("chrome://settings/*");
+ run_add_host_permission(chrome_host.spec(), false, kInvalidHostError);
- GURL chrome_host("chrome://settings");
- run_add_host_permission(chrome_host.spec(), false,
- "Cannot grant a permission that wasn't withheld.");
EXPECT_FALSE(modifier.HasGrantedHostPermission(chrome_host));
}
@@ -1386,22 +1434,41 @@ TEST_F(DeveloperPrivateApiUnitTest, RemoveHostPermission) {
}
};
- GURL host("https://example.com");
- run_remove_host_permission(host.spec(), false,
+ run_remove_host_permission("https://example.com/*", false,
"Cannot remove a host that hasn't been granted.");
- modifier.GrantHostPermission(host);
- EXPECT_TRUE(modifier.HasGrantedHostPermission(host));
+ const GURL kExampleCom("https://example.com");
+ modifier.GrantHostPermission(kExampleCom);
+ EXPECT_TRUE(modifier.HasGrantedHostPermission(kExampleCom));
+ // Path of the pattern must exactly match "/*".
+ run_remove_host_permission("https://example.com/", false, kInvalidHostError);
run_remove_host_permission("https://example.com/foobar", false,
kInvalidHostError);
run_remove_host_permission("https://example.com/#foobar", false,
kInvalidHostError);
+ run_remove_host_permission("https://example.com/*foobar", false,
+ kInvalidHostError);
run_remove_host_permission(kInvalidHost, false, kInvalidHostError);
- EXPECT_TRUE(modifier.HasGrantedHostPermission(host));
+ EXPECT_TRUE(modifier.HasGrantedHostPermission(kExampleCom));
+
+ run_remove_host_permission("https://example.com/*", true, nullptr);
+ EXPECT_FALSE(modifier.HasGrantedHostPermission(kExampleCom));
+
+ URLPattern new_pattern(Extension::kValidHostPermissionSchemes,
+ "https://*.google.com/*");
+ PermissionsUpdater(profile()).GrantRuntimePermissions(
+ *extension, PermissionSet(APIPermissionSet(), ManifestPermissionSet(),
+ URLPatternSet({new_pattern}), URLPatternSet()));
+
+ const GURL kGoogleCom("https://google.com/");
+ const GURL kMapsGoogleCom("https://maps.google.com/");
+ EXPECT_TRUE(modifier.HasGrantedHostPermission(kGoogleCom));
+ EXPECT_TRUE(modifier.HasGrantedHostPermission(kMapsGoogleCom));
- run_remove_host_permission(host.spec(), true, nullptr);
- EXPECT_FALSE(modifier.HasGrantedHostPermission(host));
+ run_remove_host_permission("https://*.google.com/*", true, nullptr);
+ EXPECT_FALSE(modifier.HasGrantedHostPermission(kGoogleCom));
+ EXPECT_FALSE(modifier.HasGrantedHostPermission(kMapsGoogleCom));
}
TEST_F(DeveloperPrivateApiUnitTest, UpdateHostAccess) {
@@ -1494,6 +1561,165 @@ TEST_F(DeveloperPrivateApiUnitTest,
EXPECT_FALSE(modifier.HasGrantedHostPermission(example_com));
}
+TEST_F(DeveloperPrivateApiUnitTest,
+ UpdateHostAccess_GrantScopeGreaterThanRequestedScope) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndEnableFeature(features::kRuntimeHostPermissions);
+
+ scoped_refptr<const Extension> extension =
+ ExtensionBuilder("test").AddPermission("http://*/*").Build();
+ service()->AddExtension(extension.get());
+ ScriptingPermissionsModifier modifier(profile(), extension.get());
+ modifier.SetWithholdHostPermissions(true);
+
+ ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(profile());
+ EXPECT_EQ(PermissionSet(),
+ extension->permissions_data()->active_permissions());
+ EXPECT_EQ(PermissionSet(),
+ *extension_prefs->GetRuntimeGrantedPermissions(extension->id()));
+
+ {
+ scoped_refptr<UIThreadExtensionFunction> function =
+ base::MakeRefCounted<api::DeveloperPrivateAddHostPermissionFunction>();
+ std::string args = base::StringPrintf(
+ R"(["%s", "%s"])", extension->id().c_str(), "*://chromium.org/*");
+ EXPECT_TRUE(api_test_utils::RunFunction(function.get(), args, profile()))
+ << function->GetError();
+ }
+
+ // The active permissions (which are given to the extension process) should
+ // only include the intersection of what was requested by the extension and
+ // the runtime granted permissions - which is http://chromium.org/*.
+ URLPattern http_chromium(Extension::kValidHostPermissionSchemes,
+ "http://chromium.org/*");
+ const PermissionSet http_chromium_set(
+ APIPermissionSet(), ManifestPermissionSet(),
+ URLPatternSet({http_chromium}), URLPatternSet());
+ EXPECT_EQ(http_chromium_set,
+ extension->permissions_data()->active_permissions());
+
+ // The runtime granted permissions should include all of what was approved by
+ // the user, which is *://chromium.org/*, and should be present in both the
+ // scriptable and explicit hosts.
+ URLPattern all_chromium(Extension::kValidHostPermissionSchemes,
+ "*://chromium.org/*");
+ const PermissionSet all_chromium_set(
+ APIPermissionSet(), ManifestPermissionSet(),
+ URLPatternSet({all_chromium}), URLPatternSet({all_chromium}));
+ EXPECT_EQ(all_chromium_set,
+ *extension_prefs->GetRuntimeGrantedPermissions(extension->id()));
+
+ {
+ scoped_refptr<UIThreadExtensionFunction> function = base::MakeRefCounted<
+ api::DeveloperPrivateRemoveHostPermissionFunction>();
+ std::string args = base::StringPrintf(
+ R"(["%s", "%s"])", extension->id().c_str(), "*://chromium.org/*");
+ EXPECT_TRUE(api_test_utils::RunFunction(function.get(), args, profile()))
+ << function->GetError();
+ }
+
+ // Removing the granted permission should remove it entirely from both
+ // the active and the stored permissions.
+ EXPECT_EQ(PermissionSet(),
+ extension->permissions_data()->active_permissions());
+ EXPECT_EQ(PermissionSet(),
+ *extension_prefs->GetRuntimeGrantedPermissions(extension->id()));
+}
+
+TEST_F(DeveloperPrivateApiUnitTest,
+ UpdateHostAccess_UnrequestedHostsDispatchUpdateEvents) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndEnableFeature(features::kRuntimeHostPermissions);
+
+ scoped_refptr<const Extension> extension =
+ ExtensionBuilder("test").AddPermission("http://google.com/*").Build();
+ service()->AddExtension(extension.get());
+ ScriptingPermissionsModifier modifier(profile(), extension.get());
+ modifier.SetWithholdHostPermissions(true);
+
+ // We need to call DeveloperPrivateAPI::Get() in order to instantiate the
+ // keyed service, since it's not created by default in unit tests.
+ DeveloperPrivateAPI::Get(profile());
+ const ExtensionId listener_id = crx_file::id_util::GenerateId("listener");
+ EventRouter* event_router = EventRouter::Get(profile());
+
+ // The DeveloperPrivateEventRouter will only dispatch events if there's at
+ // least one listener to dispatch to. Create one.
+ content::RenderProcessHost* process = nullptr;
+ const char* kEventName =
+ api::developer_private::OnItemStateChanged::kEventName;
+ event_router->AddEventListener(kEventName, process, listener_id);
+
+ TestEventRouterObserver test_observer(event_router);
+ EXPECT_FALSE(
+ WasPermissionsUpdatedEventDispatched(test_observer, extension->id()));
+
+ URLPatternSet hosts({URLPattern(Extension::kValidHostPermissionSchemes,
+ "https://example.com/*")});
+ PermissionSet permissions(APIPermissionSet(), ManifestPermissionSet(), hosts,
+ hosts);
+ PermissionsUpdater(profile()).GrantRuntimePermissions(*extension,
+ permissions);
+ // The event router fetches icons from a blocking thread when sending the
+ // update event; allow it to finish before verifying the event was dispatched.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(
+ WasPermissionsUpdatedEventDispatched(test_observer, extension->id()));
+
+ test_observer.ClearEvents();
+
+ PermissionsUpdater(profile()).RevokeRuntimePermissions(*extension,
+ permissions);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(
+ WasPermissionsUpdatedEventDispatched(test_observer, extension->id()));
+}
+
+TEST_F(DeveloperPrivateApiUnitTest, ExtensionUpdatedEventOnPermissionsChange) {
+ // We need to call DeveloperPrivateAPI::Get() in order to instantiate the
+ // keyed service, since it's not created by default in unit tests.
+ DeveloperPrivateAPI::Get(profile());
+ const ExtensionId listener_id = crx_file::id_util::GenerateId("listener");
+ EventRouter* event_router = EventRouter::Get(profile());
+
+ // The DeveloperPrivateEventRouter will only dispatch events if there's at
+ // least one listener to dispatch to. Create one.
+ content::RenderProcessHost* process = nullptr;
+ const char* kEventName =
+ api::developer_private::OnItemStateChanged::kEventName;
+ event_router->AddEventListener(kEventName, process, listener_id);
+
+ scoped_refptr<const Extension> dummy_extension =
+ ExtensionBuilder("dummy")
+ .SetManifestKey("optional_permissions",
+ ListBuilder().Append("tabs").Build())
+ .Build();
+
+ TestEventRouterObserver test_observer(event_router);
+ EXPECT_FALSE(WasPermissionsUpdatedEventDispatched(test_observer,
+ dummy_extension->id()));
+
+ APIPermissionSet apis;
+ apis.insert(APIPermission::kTab);
+ PermissionSet permissions(apis, ManifestPermissionSet(), URLPatternSet(),
+ URLPatternSet());
+ PermissionsUpdater(profile()).GrantOptionalPermissions(*dummy_extension,
+ permissions);
+ // The event router fetches icons from a blocking thread when sending the
+ // update event; allow it to finish before verifying the event was dispatched.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(WasPermissionsUpdatedEventDispatched(test_observer,
+ dummy_extension->id()));
+
+ test_observer.ClearEvents();
+
+ PermissionsUpdater(profile()).RevokeOptionalPermissions(
+ *dummy_extension, permissions, PermissionsUpdater::REMOVE_HARD);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_TRUE(WasPermissionsUpdatedEventDispatched(test_observer,
+ dummy_extension->id()));
+}
+
class DeveloperPrivateZipInstallerUnitTest
: public DeveloperPrivateApiUnitTest {
public:
diff --git a/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator.cc b/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
index 98edfbd90b7..d17531186eb 100644
--- a/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
+++ b/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
@@ -273,24 +273,33 @@ void AddPermissionsInfo(content::BrowserContext* browser_context,
if (!permissions_modifier.HasWithheldHostPermissions()) {
permissions->host_access = developer::HOST_ACCESS_ON_ALL_SITES;
} else {
- constexpr bool include_rcd = true;
- constexpr bool exclude_file_scheme = true;
- std::set<std::string> distinct_hosts =
- permission_message_util::GetDistinctHosts(
- active_permissions.effective_hosts(), include_rcd,
- exclude_file_scheme);
- // TODO(devlin): This isn't quite right - it's possible the user just
- // selected "on specific sites" from the dropdown, and hasn't yet added
- // any sites. We'll need to handle this.
- // https://crbug.com/844128.
- if (!distinct_hosts.empty()) {
+ ExtensionPrefs* extension_prefs = ExtensionPrefs::Get(browser_context);
+ std::unique_ptr<const PermissionSet> runtime_granted_permissions =
+ extension_prefs->GetRuntimeGrantedPermissions(extension.id());
+ if (runtime_granted_permissions->effective_hosts().is_empty()) {
+ // TODO(devlin): This isn't quite right - it's possible the user just
+ // selected "on specific sites" from the dropdown, and hasn't yet added
+ // any sites. We'll need to handle this.
+ // https://crbug.com/844128.
+ permissions->host_access = developer::HOST_ACCESS_ON_CLICK;
+ } else {
permissions->host_access = developer::HOST_ACCESS_ON_SPECIFIC_SITES;
+ std::set<std::string> distinct_hosts;
+ for (auto pattern : runtime_granted_permissions->effective_hosts()) {
+ // We only allow addition/removal of full hosts (since from a
+ // permissions point of view, path is irrelevant). We always make the
+ // path wildcard when adding through this UI, but the optional
+ // permissions API may allow adding permissions with paths.
+ // TODO(devlin): Investigate, and possibly change the optional
+ // permissions API.
+ pattern.SetPath("/*");
+ distinct_hosts.insert(pattern.GetAsString());
+ }
+
permissions->runtime_host_permissions =
std::make_unique<std::vector<std::string>>(
std::make_move_iterator(distinct_hosts.begin()),
std::make_move_iterator(distinct_hosts.end()));
- } else {
- permissions->host_access = developer::HOST_ACCESS_ON_CLICK;
}
}
}
diff --git a/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc b/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
index a8184d3e998..9d8496fb56c 100644
--- a/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/developer_private/extension_info_generator_unittest.cc
@@ -36,7 +36,10 @@
#include "extensions/common/extension_features.h"
#include "extensions/common/feature_switch.h"
#include "extensions/common/permissions/permission_message.h"
+#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/permissions_data.h"
+#include "extensions/common/url_pattern.h"
+#include "extensions/common/url_pattern_set.h"
#include "extensions/common/value_builder.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -430,7 +433,7 @@ TEST_F(ExtensionInfoGeneratorUnitTest, RuntimeHostPermissions) {
info->permissions.host_access);
ASSERT_TRUE(info->permissions.runtime_host_permissions);
EXPECT_THAT(*info->permissions.runtime_host_permissions,
- testing::UnorderedElementsAre("example.com"));
+ testing::UnorderedElementsAre("https://example.com/*"));
EXPECT_THAT(info->permissions.simple_permissions, testing::IsEmpty());
// An extension that doesn't request any host permissions should not have
@@ -457,6 +460,50 @@ TEST_F(ExtensionInfoGeneratorUnitTest, RuntimeHostPermissionsWithoutFeature) {
info->permissions.simple_permissions[0].message);
}
+// Tests that runtime_host_permissions is correctly populated when permissions
+// are granted by the user beyond what the extension originally requested in the
+// manifest.
+TEST_F(ExtensionInfoGeneratorUnitTest,
+ RuntimeHostPermissionsBeyondRequestedScope) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndEnableFeature(features::kRuntimeHostPermissions);
+
+ scoped_refptr<const Extension> extension =
+ CreateExtension("extension", ListBuilder().Append("http://*/*").Build(),
+ Manifest::INTERNAL);
+
+ std::unique_ptr<developer::ExtensionInfo> info =
+ GenerateExtensionInfo(extension->id());
+
+ // Withhold permissions, and grant *://chromium.org/*.
+ ScriptingPermissionsModifier permissions_modifier(profile(), extension);
+ permissions_modifier.SetWithholdHostPermissions(true);
+ URLPattern all_chromium(Extension::kValidHostPermissionSchemes,
+ "*://chromium.org/*");
+ PermissionSet all_chromium_set(APIPermissionSet(), ManifestPermissionSet(),
+ URLPatternSet({all_chromium}),
+ URLPatternSet({all_chromium}));
+ PermissionsUpdater(profile()).GrantRuntimePermissions(*extension,
+ all_chromium_set);
+
+ // The extension should only be granted http://chromium.org/* (since that's
+ // the intersection with what it requested).
+ URLPattern http_chromium(Extension::kValidHostPermissionSchemes,
+ "http://chromium.org/*");
+ EXPECT_EQ(PermissionSet(APIPermissionSet(), ManifestPermissionSet(),
+ URLPatternSet({http_chromium}), URLPatternSet()),
+ extension->permissions_data()->active_permissions());
+
+ // The generated info should use the entirety of the granted permission,
+ // which is *://chromium.org/*.
+ info = GenerateExtensionInfo(extension->id());
+ EXPECT_EQ(developer::HOST_ACCESS_ON_SPECIFIC_SITES,
+ info->permissions.host_access);
+ ASSERT_TRUE(info->permissions.runtime_host_permissions);
+ EXPECT_THAT(*info->permissions.runtime_host_permissions,
+ testing::UnorderedElementsAre("*://chromium.org/*"));
+}
+
// Test that file:// access checkbox does not show up when the user can't
// modify an extension's settings. https://crbug.com/173640.
TEST_F(ExtensionInfoGeneratorUnitTest, ExtensionInfoLockedAllUrls) {
diff --git a/chromium/chrome/browser/extensions/api/downloads/downloads_api.cc b/chromium/chrome/browser/extensions/api/downloads/downloads_api.cc
index 1205f08f044..9ad91ec7fcf 100644
--- a/chromium/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chromium/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -642,12 +642,7 @@ class ExtensionDownloadsEventRouterData : public base::SupportsUserData::Data {
download_item->SetUserData(kKey, base::WrapUnique(this));
}
- ~ExtensionDownloadsEventRouterData() override {
- if (updated_ > 0) {
- UMA_HISTOGRAM_PERCENTAGE("Download.OnChanged",
- (changed_fired_ * 100 / updated_));
- }
- }
+ ~ExtensionDownloadsEventRouterData() override = default;
void set_is_download_completed(bool is_download_completed) {
is_download_completed_ = is_download_completed;
diff --git a/chromium/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc b/chromium/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
index a6529fc0fdb..e0fbac65374 100644
--- a/chromium/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
+++ b/chromium/chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
@@ -1496,12 +1496,21 @@ IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
ASSERT_EQ(items[2]->GetTargetFilePath().value(), item_name);
}
+// https://crbug.com/874946, flaky on Win.
+#if defined(OS_WIN)
+#define MAYBE_DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito \
+ DISABLED_DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito
+#else
+#define MAYBE_DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito \
+ DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito
+#endif
// Test that incognito downloads are only visible in incognito contexts, and
// test that on-record downloads are visible in both incognito and on-record
// contexts, for DownloadsSearchFunction, DownloadsPauseFunction,
// DownloadsResumeFunction, and DownloadsCancelFunction.
-IN_PROC_BROWSER_TEST_F(DownloadExtensionTest,
- DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito) {
+IN_PROC_BROWSER_TEST_F(
+ DownloadExtensionTest,
+ MAYBE_DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito) {
std::unique_ptr<base::Value> result_value;
base::ListValue* result_list = NULL;
base::DictionaryValue* result_dict = NULL;
diff --git a/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc b/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
index d29ba90273d..72e1f6400f1 100644
--- a/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_api.cc
@@ -13,7 +13,7 @@
#include "base/lazy_instance.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
@@ -26,6 +26,7 @@
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_factory.h"
+#include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.h"
#include "chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/proximity_auth/proximity_auth_error_bubble.h"
diff --git a/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.h b/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.h
index 90b1b9080e2..987e88500e4 100644
--- a/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.h
+++ b/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection.h
@@ -11,12 +11,20 @@
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/api_resource.h"
#include "extensions/browser/api/api_resource_manager.h"
+#include "extensions/browser/browser_context_keyed_api_factory.h"
namespace cryptauth {
class Connection;
} // namespace cryptauth
namespace extensions {
+
+class EasyUnlockPrivateConnection;
+
+template <>
+BrowserContextKeyedAPIFactory<ApiResourceManager<EasyUnlockPrivateConnection>>*
+ApiResourceManager<EasyUnlockPrivateConnection>::GetFactoryInstance();
+
// An ApiResource wrapper for a cryptauth::Connection.
class EasyUnlockPrivateConnection : public ApiResource {
public:
diff --git a/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc b/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc
index 3d694cbfe8d..58ec3c09ffa 100644
--- a/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc
+++ b/chromium/chrome/browser/extensions/api/easy_unlock_private/easy_unlock_private_connection_manager.cc
@@ -136,7 +136,7 @@ void EasyUnlockPrivateConnectionManager::OnMessageReceived(
std::string event_name = api::easy_unlock_private::OnDataReceived::kEventName;
events::HistogramValue histogram_value =
events::EASY_UNLOCK_PRIVATE_ON_DATA_RECEIVED;
- std::vector<char> data(message.body().begin(), message.body().end());
+ std::vector<uint8_t> data(message.body().begin(), message.body().end());
std::unique_ptr<base::ListValue> args =
api::easy_unlock_private::OnDataReceived::Create(0, data);
DispatchConnectionEvent(event_name, histogram_value, &connection,
@@ -156,7 +156,7 @@ void EasyUnlockPrivateConnectionManager::OnSendCompleted(
api::easy_unlock_private::OnSendCompleted::kEventName;
events::HistogramValue histogram_value =
events::EASY_UNLOCK_PRIVATE_ON_SEND_COMPLETED;
- std::vector<char> data(message.payload().begin(), message.payload().end());
+ std::vector<uint8_t> data(message.payload().begin(), message.payload().end());
std::unique_ptr<base::ListValue> args =
api::easy_unlock_private::OnSendCompleted::Create(0, data, success);
DispatchConnectionEvent(event_name, histogram_value, &connection,
diff --git a/chromium/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc b/chromium/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc
index c923b2d663b..07767f021ca 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_device_attributes/enterprise_device_attributes_apitest.cc
@@ -55,10 +55,17 @@ constexpr char kAnotherAffiliationID[] = "another-affiliation-id";
constexpr char kTestExtensionID[] = "nbiliclbejdndfpchgkbmfoppjplbdok";
struct Params {
- explicit Params(bool affiliated) : affiliated_(affiliated) {}
- bool affiliated_;
+ explicit Params(bool affiliated) : affiliated(affiliated) {}
+ bool affiliated;
};
+// Must be a valid test name (no spaces etc.). Makes the test show up as e.g.
+// AffiliationCheck/U.A.B.T.Affiliated/NotAffiliated_NotActiveDirectory
+std::string PrintParam(testing::TestParamInfo<Params> param_info) {
+ return base::StringPrintf("%sAffiliated",
+ param_info.param.affiliated ? "" : "Not");
+}
+
base::Value BuildCustomArg(const std::string& expected_directory_device_id,
const std::string& expected_serial_number,
const std::string& expected_asset_id,
@@ -78,9 +85,9 @@ base::Value BuildCustomArg(const std::string& expected_directory_device_id,
namespace extensions {
-class EnterpriseDeviceAttributesTest :
- public ExtensionApiTest,
- public ::testing::WithParamInterface<Params> {
+class EnterpriseDeviceAttributesTest
+ : public ExtensionApiTest,
+ public ::testing::WithParamInterface<Params> {
public:
EnterpriseDeviceAttributesTest() {
fake_statistics_provider_.SetMachineStatistic(
@@ -93,8 +100,8 @@ class EnterpriseDeviceAttributesTest :
// ExtensionApiTest
void SetUpCommandLine(base::CommandLine* command_line) override {
ExtensionApiTest::SetUpCommandLine(command_line);
- policy::affiliation_test_helper::
- AppendCommandLineSwitchesForLoginManager(command_line);
+ policy::AffiliationTestHelper::AppendCommandLineSwitchesForLoginManager(
+ command_line);
}
void SetUpInProcessBrowserTestFixture() override {
@@ -106,29 +113,24 @@ class EnterpriseDeviceAttributesTest :
std::unique_ptr<chromeos::SessionManagerClient>(
fake_session_manager_client));
+ policy::AffiliationTestHelper affiliation_helper =
+ policy::AffiliationTestHelper::CreateForCloud(
+ fake_session_manager_client);
+
std::set<std::string> device_affiliation_ids;
device_affiliation_ids.insert(kAffiliationID);
- policy::affiliation_test_helper::SetDeviceAffiliationID(
- &test_helper_, fake_session_manager_client, device_affiliation_ids);
+ ASSERT_NO_FATAL_FAILURE(affiliation_helper.SetDeviceAffiliationIDs(
+ &test_helper_, device_affiliation_ids));
std::set<std::string> user_affiliation_ids;
- if (GetParam().affiliated_) {
+ if (GetParam().affiliated) {
user_affiliation_ids.insert(kAffiliationID);
} else {
user_affiliation_ids.insert(kAnotherAffiliationID);
}
policy::UserPolicyBuilder user_policy;
- policy::affiliation_test_helper::SetUserAffiliationIDs(
- &user_policy, fake_session_manager_client, affiliated_account_id_,
- user_affiliation_ids);
-
- // Set up fake install attributes.
- std::unique_ptr<chromeos::StubInstallAttributes> attributes =
- std::make_unique<chromeos::StubInstallAttributes>();
-
- attributes->SetCloudManaged("fake-domain", "fake-id");
- policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
- attributes.release());
+ ASSERT_NO_FATAL_FAILURE(affiliation_helper.SetUserAffiliationIDs(
+ &user_policy, affiliated_account_id_, user_affiliation_ids));
test_helper_.InstallOwnerKey();
// Init the device policy.
@@ -157,7 +159,7 @@ class EnterpriseDeviceAttributesTest :
const base::ListValue* users =
g_browser_process->local_state()->GetList("LoggedInUsers");
if (!users->empty())
- policy::affiliation_test_helper::LoginUser(affiliated_account_id_);
+ policy::AffiliationTestHelper::LoginUser(affiliated_account_id_);
ExtensionApiTest::SetUpOnMainThread();
}
@@ -221,13 +223,16 @@ class EnterpriseDeviceAttributesTest :
kAffiliatedUserGaiaId);
private:
+ chromeos::ScopedStubInstallAttributes test_install_attributes_{
+ chromeos::StubInstallAttributes::CreateCloudManaged("fake-domain",
+ "fake-id")};
policy::MockConfigurationPolicyProvider policy_provider_;
policy::DevicePolicyCrosTestHelper test_helper_;
chromeos::system::ScopedFakeStatisticsProvider fake_statistics_provider_;
};
IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, PRE_Success) {
- policy::affiliation_test_helper::PreLoginUser(affiliated_account_id_);
+ policy::AffiliationTestHelper::PreLoginUser(affiliated_account_id_);
}
IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, Success) {
@@ -237,17 +242,18 @@ IN_PROC_BROWSER_TEST_P(EnterpriseDeviceAttributesTest, Success) {
SetPolicy();
- EXPECT_EQ(GetParam().affiliated_, user_manager::UserManager::Get()->
- FindUser(affiliated_account_id_)->IsAffiliated());
+ EXPECT_EQ(GetParam().affiliated, user_manager::UserManager::Get()
+ ->FindUser(affiliated_account_id_)
+ ->IsAffiliated());
// Device attributes are available only for affiliated user.
std::string expected_directory_device_id =
- GetParam().affiliated_ ? kDeviceId : "";
+ GetParam().affiliated ? kDeviceId : "";
std::string expected_serial_number =
- GetParam().affiliated_ ? kSerialNumber : "";
- std::string expected_asset_id = GetParam().affiliated_ ? kAssetId : "";
+ GetParam().affiliated ? kSerialNumber : "";
+ std::string expected_asset_id = GetParam().affiliated ? kAssetId : "";
std::string expected_annotated_location =
- GetParam().affiliated_ ? kAnnotatedLocation : "";
+ GetParam().affiliated ? kAnnotatedLocation : "";
// Pass the expected value (device_id) to test.
ASSERT_TRUE(TestExtension(
@@ -284,6 +290,8 @@ IN_PROC_BROWSER_TEST_F(
// Both cases of affiliated and non-affiliated on the device user are tested.
INSTANTIATE_TEST_CASE_P(AffiliationCheck,
- EnterpriseDeviceAttributesTest,
- ::testing::Values(Params(true), Params(false)));
+ EnterpriseDeviceAttributesTest,
+ ::testing::Values(Params(true /* affiliated */),
+ Params(false /* affiliated */)),
+ PrintParam);
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/OWNERS b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/OWNERS
new file mode 100644
index 00000000000..05cb9bd3c02
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/OWNERS
@@ -0,0 +1 @@
+guidou@chromium.org
diff --git a/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.cc b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.cc
new file mode 100644
index 00000000000..3a75d928dd4
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.cc
@@ -0,0 +1,38 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h"
+
+#include <utility>
+
+#include "base/bind.h"
+#include "chrome/common/extensions/api/enterprise_hardware_platform.h"
+
+namespace extensions {
+
+EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction::
+ EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction() = default;
+
+EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction::
+ ~EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction() = default;
+
+ExtensionFunction::ResponseAction
+EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction::Run() {
+ base::SysInfo::GetHardwareInfo(base::BindOnce(
+ &EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction::
+ OnHardwarePlatformInfo,
+ this));
+ return RespondLater();
+}
+
+void EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction::
+ OnHardwarePlatformInfo(base::SysInfo::HardwareInfo info) {
+ api::enterprise_hardware_platform::HardwarePlatformInfo result;
+ result.manufacturer = std::move(info.manufacturer);
+ result.model = std::move(info.model);
+ Respond(ArgumentList(api::enterprise_hardware_platform::
+ GetHardwarePlatformInfo::Results::Create(result)));
+}
+
+} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h
new file mode 100644
index 00000000000..70726063ac1
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h
@@ -0,0 +1,37 @@
+// 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 CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_HARDWARE_PLATFORM_ENTERPRISE_HARDWARE_PLATFORM_API_H_
+#define CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_HARDWARE_PLATFORM_ENTERPRISE_HARDWARE_PLATFORM_API_H_
+
+#include "base/macros.h"
+#include "base/sys_info.h"
+#include "extensions/browser/extension_function.h"
+
+namespace extensions {
+
+class EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction
+ : public UIThreadExtensionFunction {
+ public:
+ EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction();
+
+ protected:
+ ~EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction() override;
+
+ ResponseAction Run() override;
+
+ private:
+ DECLARE_EXTENSION_FUNCTION(
+ "enterprise.hardwarePlatform.getHardwarePlatformInfo",
+ ENTERPRISE_HARDWAREPLATFORM_GETHARDWAREPLATFORMINFO);
+
+ void OnHardwarePlatformInfo(base::SysInfo::HardwareInfo info);
+
+ DISALLOW_COPY_AND_ASSIGN(
+ EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_HARDWARE_PLATFORM_ENTERPRISE_HARDWARE_PLATFORM_API_H_
diff --git a/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api_unittest.cc b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api_unittest.cc
new file mode 100644
index 00000000000..285c63683a1
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api_unittest.cc
@@ -0,0 +1,84 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/enterprise_hardware_platform/enterprise_hardware_platform_api.h"
+
+#include <memory>
+#include <string>
+
+#include "base/json/json_writer.h"
+#include "chrome/browser/extensions/extension_api_unittest.h"
+#include "chrome/browser/extensions/extension_function_test_utils.h"
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_service_test_with_install.h"
+#include "components/crx_file/id_util.h"
+#include "extensions/common/extension_builder.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace extensions {
+
+class EnterpriseHardwarePlatformAPITest
+ : public ExtensionServiceTestWithInstall {
+ public:
+ EnterpriseHardwarePlatformAPITest() = default;
+ ~EnterpriseHardwarePlatformAPITest() override = default;
+ Browser* browser() { return browser_.get(); }
+
+ private:
+ void SetUp() override {
+ ExtensionServiceTestWithInstall::SetUp();
+ InitializeEmptyExtensionService();
+ browser_window_ = std::make_unique<TestBrowserWindow>();
+ Browser::CreateParams params(profile(), true);
+ params.type = Browser::TYPE_TABBED;
+ params.window = browser_window_.get();
+ browser_ = std::make_unique<Browser>(params);
+ }
+
+ void TearDown() override {
+ browser_.reset();
+ browser_window_.reset();
+ ExtensionServiceTestWithInstall::TearDown();
+ }
+
+ std::unique_ptr<TestBrowserWindow> browser_window_;
+ std::unique_ptr<Browser> browser_;
+
+ DISALLOW_COPY_AND_ASSIGN(EnterpriseHardwarePlatformAPITest);
+};
+
+TEST_F(EnterpriseHardwarePlatformAPITest, GetHardwarePlatformInfo) {
+ scoped_refptr<const Extension> extension = ExtensionBuilder("Test").Build();
+ scoped_refptr<EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction>
+ function =
+ new EnterpriseHardwarePlatformGetHardwarePlatformInfoFunction();
+ function->set_extension(extension.get());
+ function->set_has_callback(true);
+
+ std::string args;
+ base::JSONWriter::Write(base::ListValue(), &args);
+
+ std::unique_ptr<base::Value> result(
+ extension_function_test_utils::RunFunctionAndReturnSingleResult(
+ function.get(), args, browser()));
+ base::RunLoop().RunUntilIdle();
+
+ ASSERT_TRUE(result);
+ ASSERT_TRUE(result->is_dict());
+ ASSERT_EQ(result->DictSize(), 2u);
+
+ const base::Value* val =
+ result->FindKeyOfType("manufacturer", base::Value::Type::STRING);
+ ASSERT_TRUE(val);
+ const std::string& manufacturer = val->GetString();
+
+ val = result->FindKeyOfType("model", base::Value::Type::STRING);
+ ASSERT_TRUE(val);
+ const std::string& model = val->GetString();
+
+ EXPECT_FALSE(manufacturer.empty());
+ EXPECT_FALSE(model.empty());
+}
+
+} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc b/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
index 20f62befb7d..7136b037ebe 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc
@@ -32,11 +32,11 @@ const char kEnterprisePlatformErrorInternal[] = "Internal Error.";
const char kEnterprisePlatformErrorInvalidX509Cert[] =
"Certificate is not a valid X.509 certificate.";
-std::vector<char> VectorFromString(const std::string& s) {
- return std::vector<char>(s.begin(), s.end());
+std::vector<uint8_t> VectorFromString(const std::string& s) {
+ return std::vector<uint8_t>(s.begin(), s.end());
}
-std::string StringFromVector(const std::vector<char>& v) {
+std::string StringFromVector(const std::vector<uint8_t>& v) {
return std::string(v.begin(), v.end());
}
@@ -77,7 +77,7 @@ void EnterprisePlatformKeysInternalGenerateKeyFunction::OnGeneratedKey(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (error_message.empty()) {
Respond(ArgumentList(api_epki::GenerateKey::Results::Create(
- std::vector<char>(public_key_der.begin(), public_key_der.end()))));
+ std::vector<uint8_t>(public_key_der.begin(), public_key_der.end()))));
} else {
Respond(Error(error_message));
}
@@ -142,14 +142,15 @@ EnterprisePlatformKeysImportCertificateFunction::Run() {
if (!platform_keys::ValidateToken(params->token_id, &platform_keys_token_id))
return RespondNow(Error(platform_keys::kErrorInvalidToken));
- const std::vector<char>& cert_der = params->certificate;
+ const std::vector<uint8_t>& cert_der = params->certificate;
// Allow UTF-8 inside PrintableStrings in client certificates. See
// crbug.com/770323 and crbug.com/788655.
net::X509Certificate::UnsafeCreateOptions options;
options.printable_string_is_utf8 = true;
scoped_refptr<net::X509Certificate> cert_x509 =
net::X509Certificate::CreateFromBytesUnsafeOptions(
- cert_der.data(), cert_der.size(), options);
+ reinterpret_cast<const char*>(cert_der.data()), cert_der.size(),
+ options);
if (!cert_x509.get())
return RespondNow(Error(kEnterprisePlatformErrorInvalidX509Cert));
@@ -185,14 +186,15 @@ EnterprisePlatformKeysRemoveCertificateFunction::Run() {
if (!platform_keys::ValidateToken(params->token_id, &platform_keys_token_id))
return RespondNow(Error(platform_keys::kErrorInvalidToken));
- const std::vector<char>& cert_der = params->certificate;
+ const std::vector<uint8_t>& cert_der = params->certificate;
// Allow UTF-8 inside PrintableStrings in client certificates. See
// crbug.com/770323 and crbug.com/788655.
net::X509Certificate::UnsafeCreateOptions options;
options.printable_string_is_utf8 = true;
scoped_refptr<net::X509Certificate> cert_x509 =
net::X509Certificate::CreateFromBytesUnsafeOptions(
- cert_der.data(), cert_der.size(), options);
+ reinterpret_cast<const char*>(cert_der.data()), cert_der.size(),
+ options);
if (!cert_x509.get())
return RespondNow(Error(kEnterprisePlatformErrorInvalidX509Cert));
diff --git a/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc b/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
index d6cdb2102e3..30be624ce38 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api_unittest.cc
@@ -13,6 +13,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
#include "chrome/browser/chromeos/settings/stub_install_attributes.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
@@ -24,6 +25,7 @@
#include "chrome/test/base/testing_profile_manager.h"
#include "chromeos/attestation/mock_attestation_flow.h"
#include "chromeos/cryptohome/async_method_caller.h"
+#include "chromeos/cryptohome/cryptohome_parameters.h"
#include "chromeos/cryptohome/mock_async_method_caller.h"
#include "chromeos/dbus/attestation_constants.h"
#include "chromeos/dbus/dbus_method_call_status.h"
@@ -366,7 +368,7 @@ TEST_F(EPKChallengeMachineKeyTest, Success) {
ASSERT_TRUE(value->is_blob());
EXPECT_EQ("response",
- std::string(value->GetBlob().data(), value->GetBlob().size()));
+ std::string(value->GetBlob().begin(), value->GetBlob().end()));
}
TEST_F(EPKChallengeMachineKeyTest, KeyRegisteredSuccess) {
@@ -395,7 +397,7 @@ TEST_F(EPKChallengeMachineKeyTest, KeyRegisteredSuccess) {
ASSERT_TRUE(value->is_blob());
EXPECT_EQ("response",
- std::string(value->GetBlob().data(), value->GetBlob().size()));
+ std::string(value->GetBlob().begin(), value->GetBlob().end()));
}
TEST_F(EPKChallengeMachineKeyTest, AttestationNotPrepared) {
@@ -511,7 +513,8 @@ TEST_F(EPKChallengeUserKeyTest, KeyRegistrationFailed) {
TEST_F(EPKChallengeUserKeyTest, KeyExists) {
cryptohome_client_.SetTpmAttestationUserCertificate(
- cryptohome::Identification(AccountId::FromUserEmail(kUserEmail)),
+ cryptohome::CreateAccountIdentifierFromAccountId(
+ AccountId::FromUserEmail(kUserEmail)),
"attest-ent-user", std::string());
// GetCertificate must not be called if the key exists.
EXPECT_CALL(mock_attestation_flow_, GetCertificate(_, _, _, _, _)).Times(0);
@@ -563,7 +566,7 @@ TEST_F(EPKChallengeUserKeyTest, Success) {
ASSERT_TRUE(value->is_blob());
EXPECT_EQ("response",
- std::string(value->GetBlob().data(), value->GetBlob().size()));
+ std::string(value->GetBlob().begin(), value->GetBlob().end()));
}
TEST_F(EPKChallengeUserKeyTest, AttestationNotPrepared) {
diff --git a/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc b/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc
index 8435980e7af..ba1f6042883 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api.cc
@@ -224,7 +224,8 @@ void EPKPChallengeKeyBase::IsAttestationPreparedCallback(
}
// Attestation is available, see if the key we need already exists.
cryptohome_client_->TpmAttestationDoesKeyExist(
- context.key_type, cryptohome::Identification(context.account_id),
+ context.key_type,
+ cryptohome::CreateAccountIdentifierFromAccountId(context.account_id),
context.key_name,
base::BindOnce(&EPKPChallengeKeyBase::DoesKeyExistCallback,
base::Unretained(this), context));
diff --git a/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc b/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
index fb7241aa4fa..62671ff64c8 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_platform_keys_private/enterprise_platform_keys_private_api_unittest.cc
@@ -14,6 +14,7 @@
#include "base/values.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
#include "chrome/browser/chromeos/settings/stub_install_attributes.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
@@ -485,7 +486,8 @@ TEST_F(EPKPChallengeUserKeyTest, KeyRegistrationFailed) {
TEST_F(EPKPChallengeUserKeyTest, KeyExists) {
cryptohome_client_.SetTpmAttestationUserCertificate(
- cryptohome::Identification(AccountId::FromUserEmail(kUserEmail)),
+ cryptohome::CreateAccountIdentifierFromAccountId(
+ AccountId::FromUserEmail(kUserEmail)),
"attest-ent-user", std::string());
// GetCertificate must not be called if the key exists.
EXPECT_CALL(mock_attestation_flow_, GetCertificate(_, _, _, _, _))
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc
index a9177d0b6db..b31517c9a8c 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper.cc
@@ -12,6 +12,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/api/enterprise_reporting_private/prefs.h"
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
#include "chrome/browser/policy/machine_level_user_cloud_policy_controller.h"
#include "chrome/browser/policy/policy_conversions.h"
@@ -77,42 +78,53 @@ int64_t GetMachineLevelUserCloudPolicyFetchTimestamp() {
void AppendAdditionalBrowserInformation(em::ChromeDesktopReportRequest* request,
Profile* profile) {
- // Set Chrome version number
- request->mutable_browser_report()->set_browser_version(
- version_info::GetVersionNumber());
- // Set Chrome channel
- request->mutable_browser_report()->set_channel(
- static_cast<em::BrowserReport_Channel>(chrome::GetChannel()));
- // Set Chrome executable path
- request->mutable_browser_report()->set_executable_path(GetChromePath());
+ const PrefService* prefs = profile->GetPrefs();
+
+ if (prefs->GetBoolean(enterprise_reporting::kReportVersionData)) {
+ // Set Chrome version number
+ request->mutable_browser_report()->set_browser_version(
+ version_info::GetVersionNumber());
+ // Set Chrome channel
+ request->mutable_browser_report()->set_channel(
+ policy::ConvertToProtoChannel(chrome::GetChannel()));
+ }
// Add a new profile report if extension doesn't report any profile.
if (request->browser_report().chrome_user_profile_reports_size() == 0)
request->mutable_browser_report()->add_chrome_user_profile_reports();
DCHECK_EQ(1, request->browser_report().chrome_user_profile_reports_size());
- // Set profile ID for the first profile.
- request->mutable_browser_report()
- ->mutable_chrome_user_profile_reports(0)
- ->set_id(GetProfileId(profile));
-
- // Set policy data of the first profile. Extension will report this data in
- // the future.
- request->mutable_browser_report()
- ->mutable_chrome_user_profile_reports(0)
- ->set_policy_data(policy::GetAllPolicyValuesAsJSON(profile, true, false));
-
- int64_t timestamp = GetMachineLevelUserCloudPolicyFetchTimestamp();
- if (timestamp > 0) {
+
+ if (prefs->GetBoolean(enterprise_reporting::kReportUserIDData)) {
+ // Set Chrome executable path
+ request->mutable_browser_report()->set_executable_path(GetChromePath());
+
+ // Set profile ID for the first profile.
+ request->mutable_browser_report()
+ ->mutable_chrome_user_profile_reports(0)
+ ->set_id(GetProfileId(profile));
+
+ // Set the profile name
request->mutable_browser_report()
->mutable_chrome_user_profile_reports(0)
- ->set_policy_fetched_timestamp(timestamp);
+ ->set_name(prefs->GetString(prefs::kProfileName));
}
- // Set the profile name
- request->mutable_browser_report()
- ->mutable_chrome_user_profile_reports(0)
- ->set_name(profile->GetPrefs()->GetString(prefs::kProfileName));
+ if (prefs->GetBoolean(enterprise_reporting::kReportPolicyData)) {
+ // Set policy data of the first profile. Extension will report this data in
+ // the future.
+ request->mutable_browser_report()
+ ->mutable_chrome_user_profile_reports(0)
+ ->set_policy_data(
+ policy::GetAllPolicyValuesAsJSON(profile, true, false));
+
+ int64_t timestamp = GetMachineLevelUserCloudPolicyFetchTimestamp();
+ if (timestamp > 0) {
+ request->mutable_browser_report()
+ ->mutable_chrome_user_profile_reports(0)
+ ->set_policy_fetched_timestamp(timestamp);
+ }
+ }
}
bool UpdateJSONEncodedStringEntry(const base::Value& dict_value,
@@ -135,37 +147,49 @@ bool UpdateJSONEncodedStringEntry(const base::Value& dict_value,
return true;
}
-void AppendPlatformInformation(em::ChromeDesktopReportRequest* request) {
- const char kComputerName[] = "computername";
- const char kUsername[] = "username";
-
- base::Value os_info = base::Value(base::Value::Type::DICTIONARY);
- os_info.SetKey(kOS, base::Value(policy::GetOSPlatform()));
- os_info.SetKey(kOSVersion, base::Value(policy::GetOSVersion()));
- os_info.SetKey(kOSArch, base::Value(policy::GetOSArchitecture()));
- base::JSONWriter::Write(os_info, request->mutable_os_info());
+void AppendPlatformInformation(em::ChromeDesktopReportRequest* request,
+ const PrefService* prefs) {
+ if (prefs->GetBoolean(enterprise_reporting::kReportVersionData)) {
+ base::Value os_info = base::Value(base::Value::Type::DICTIONARY);
+ os_info.SetKey(kOS, base::Value(policy::GetOSPlatform()));
+ os_info.SetKey(kOSVersion, base::Value(policy::GetOSVersion()));
+ os_info.SetKey(kOSArch, base::Value(policy::GetOSArchitecture()));
+ base::JSONWriter::Write(os_info, request->mutable_os_info());
+ }
- base::Value machine_name = base::Value(base::Value::Type::DICTIONARY);
- machine_name.SetKey(kComputerName, base::Value(policy::GetMachineName()));
- base::JSONWriter::Write(machine_name, request->mutable_machine_name());
+ if (prefs->GetBoolean(enterprise_reporting::kReportMachineIDData)) {
+ const char kComputerName[] = "computername";
+ base::Value machine_name = base::Value(base::Value::Type::DICTIONARY);
+ machine_name.SetKey(kComputerName, base::Value(policy::GetMachineName()));
+ base::JSONWriter::Write(machine_name, request->mutable_machine_name());
+ }
- base::Value os_user = base::Value(base::Value::Type::DICTIONARY);
- os_user.SetKey(kUsername, base::Value(policy::GetOSUsername()));
- base::JSONWriter::Write(os_user, request->mutable_os_user());
+ if (prefs->GetBoolean(enterprise_reporting::kReportUserIDData)) {
+ const char kUsername[] = "username";
+ base::Value os_user = base::Value(base::Value::Type::DICTIONARY);
+ os_user.SetKey(kUsername, base::Value(policy::GetOSUsername()));
+ base::JSONWriter::Write(os_user, request->mutable_os_user());
+ }
}
std::unique_ptr<em::ChromeUserProfileReport>
-GenerateChromeUserProfileReportRequest(const base::Value& profile_report) {
+GenerateChromeUserProfileReportRequest(const base::Value& profile_report,
+ const PrefService* prefs) {
if (!profile_report.is_dict())
return nullptr;
std::unique_ptr<em::ChromeUserProfileReport> request =
std::make_unique<em::ChromeUserProfileReport>();
- if (!UpdateJSONEncodedStringEntry(profile_report, kChromeSignInUser,
- request->mutable_chrome_signed_in_user(),
- DICTIONARY) ||
- !UpdateJSONEncodedStringEntry(profile_report, kExtensionData,
+ if (prefs->GetBoolean(enterprise_reporting::kReportUserIDData)) {
+ if (!UpdateJSONEncodedStringEntry(profile_report, kChromeSignInUser,
+ request->mutable_chrome_signed_in_user(),
+ DICTIONARY)) {
+ return nullptr;
+ }
+ }
+
+ if (!UpdateJSONEncodedStringEntry(profile_report, kExtensionData,
request->mutable_extension_data(), LIST) ||
!UpdateJSONEncodedStringEntry(profile_report, kPlugins,
request->mutable_plugins(), LIST)) {
@@ -197,7 +221,9 @@ GenerateChromeDesktopReportRequest(const base::DictionaryValue& report,
std::unique_ptr<em::ChromeDesktopReportRequest> request =
std::make_unique<em::ChromeDesktopReportRequest>();
- AppendPlatformInformation(request.get());
+ const PrefService* prefs = profile->GetPrefs();
+
+ AppendPlatformInformation(request.get(), prefs);
if (const base::Value* browser_report =
report.FindKeyOfType(kBrowserReport, base::Value::Type::DICTIONARY)) {
@@ -208,7 +234,7 @@ GenerateChromeDesktopReportRequest(const base::DictionaryValue& report,
// Currently, profile send their browser reports individually.
std::unique_ptr<em::ChromeUserProfileReport> profile_report_request =
GenerateChromeUserProfileReportRequest(
- profile_reports->GetList()[0]);
+ profile_reports->GetList()[0], prefs);
if (!profile_report_request)
return nullptr;
request->mutable_browser_report()
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper_unittest.cc b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper_unittest.cc
index 97d58f1c3ac..2c669521c57 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/chrome_desktop_report_request_helper_unittest.cc
@@ -7,6 +7,7 @@
#include "base/json/json_reader.h"
#include "base/json/string_escape.h"
#include "base/values.h"
+#include "chrome/browser/extensions/api/enterprise_reporting_private/prefs.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "components/policy/core/common/cloud/cloud_policy_util.h"
@@ -19,6 +20,20 @@ namespace em = enterprise_management;
namespace extensions {
+namespace {
+
+base::DictionaryValue CreateReport(base::Value profile_report) {
+ base::Value profile_reports(base::Value::Type::LIST);
+ profile_reports.GetList().push_back(std::move(profile_report));
+
+ base::DictionaryValue report;
+ report.SetPath({"browserReport", "chromeUserProfileReport"},
+ std::move(profile_reports));
+ return report;
+}
+
+} // namespace
+
class ChromeDesktopReportRequestGeneratorTest : public ::testing::Test {
protected:
content::TestBrowserThreadBundle test_browser_thread_bundle_;
@@ -183,4 +198,67 @@ TEST_F(ChromeDesktopReportRequestGeneratorTest, SafeBrowsing) {
.safe_browsing_warnings_click_through());
}
+TEST_F(ChromeDesktopReportRequestGeneratorTest, DontReportVersionData) {
+ PrefService* prefs = profile_.GetPrefs();
+ prefs->SetBoolean(enterprise_reporting::kReportVersionData, false);
+
+ std::unique_ptr<em::ChromeDesktopReportRequest> request;
+
+ request =
+ GenerateChromeDesktopReportRequest(base::DictionaryValue(), &profile_);
+
+ ASSERT_TRUE(request);
+ EXPECT_FALSE(request->has_os_info());
+ EXPECT_FALSE(request->browser_report().has_browser_version());
+ EXPECT_FALSE(request->browser_report().has_channel());
+}
+
+TEST_F(ChromeDesktopReportRequestGeneratorTest, DontReportPolicyData) {
+ PrefService* prefs = profile_.GetPrefs();
+ prefs->SetBoolean(enterprise_reporting::kReportPolicyData, false);
+
+ std::unique_ptr<em::ChromeDesktopReportRequest> request =
+ GenerateChromeDesktopReportRequest(base::DictionaryValue(), &profile_);
+
+ ASSERT_TRUE(request);
+ const em::ChromeUserProfileReport& profile =
+ request->browser_report().chrome_user_profile_reports(0);
+ EXPECT_FALSE(profile.has_policy_data());
+ EXPECT_FALSE(profile.has_policy_fetched_timestamp());
+}
+
+TEST_F(ChromeDesktopReportRequestGeneratorTest, DontReportMachineIDData) {
+ PrefService* prefs = profile_.GetPrefs();
+ prefs->SetBoolean(enterprise_reporting::kReportMachineIDData, false);
+
+ std::unique_ptr<em::ChromeDesktopReportRequest> request =
+ GenerateChromeDesktopReportRequest(base::DictionaryValue(), &profile_);
+
+ ASSERT_TRUE(request);
+ EXPECT_FALSE(request->has_machine_name());
+}
+
+TEST_F(ChromeDesktopReportRequestGeneratorTest, DontReportUserIDData) {
+ PrefService* prefs = profile_.GetPrefs();
+ prefs->SetBoolean(enterprise_reporting::kReportUserIDData, false);
+
+ base::Value profile_report(base::Value::Type::DICTIONARY);
+ profile_report.SetPath({"chromeSignInUser", "email"},
+ base::Value("john_doe@gmail.com"));
+ profile_report.SetPath({"chromeSignInUser", "id"}, base::Value("123456789"));
+
+ std::unique_ptr<em::ChromeDesktopReportRequest> request =
+ GenerateChromeDesktopReportRequest(
+ CreateReport(std::move(profile_report)), &profile_);
+
+ ASSERT_TRUE(request);
+ EXPECT_FALSE(request->has_os_user());
+ EXPECT_FALSE(request->browser_report().has_executable_path());
+ const em::ChromeUserProfileReport& profile =
+ request->browser_report().chrome_user_profile_reports(0);
+ EXPECT_FALSE(profile.has_id());
+ EXPECT_FALSE(profile.has_name());
+ EXPECT_FALSE(profile.has_chrome_signed_in_user());
+}
+
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.cc b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.cc
new file mode 100644
index 00000000000..50cf0293da0
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.cc
@@ -0,0 +1,40 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.h"
+
+#include "components/policy/policy_constants.h"
+
+namespace extensions {
+namespace enterprise_reporting {
+
+namespace {
+
+// Extension ID for the Chrome Reporting Extension.
+// https://chrome.google.com/webstore/detail/chrome-reporting-extensio/emahakmocgideepebncgnmlmliepgpgb
+const char kStableExtensionId[] = "emahakmocgideepebncgnmlmliepgpgb";
+
+// Beta extension ID.
+const char kBetaExtensionId[] = "kigjhoekjcpdfjpimbdjegmgecmlicaf";
+
+const policy::ExtensionPolicyMigrator::Migration kMigrations[] = {
+ {"report_version_data", policy::key::kReportVersionData},
+ {"report_policy_data", policy::key::kReportPolicyData},
+ {"report_machine_id_data", policy::key::kReportMachineIDData},
+ {"report_user_id_data", policy::key::kReportUserIDData},
+};
+
+} // namespace
+
+EnterpriseReportingPolicyMigrator::EnterpriseReportingPolicyMigrator() {}
+
+EnterpriseReportingPolicyMigrator::~EnterpriseReportingPolicyMigrator() {}
+
+void EnterpriseReportingPolicyMigrator::Migrate(policy::PolicyBundle* bundle) {
+ CopyPoliciesIfUnset(bundle, kStableExtensionId, kMigrations);
+ CopyPoliciesIfUnset(bundle, kBetaExtensionId, kMigrations);
+}
+
+} // namespace enterprise_reporting
+} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.h b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.h
new file mode 100644
index 00000000000..f08a41a3944
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.h
@@ -0,0 +1,25 @@
+// 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 CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_REPORTING_PRIVATE_ENTERPRISE_REPORTING_POLICY_MIGRATOR_H_
+#define CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_REPORTING_PRIVATE_ENTERPRISE_REPORTING_POLICY_MIGRATOR_H_
+
+#include "components/policy/core/common/extension_policy_migrator.h"
+
+namespace extensions {
+namespace enterprise_reporting {
+
+class EnterpriseReportingPolicyMigrator
+ : public policy::ExtensionPolicyMigrator {
+ public:
+ EnterpriseReportingPolicyMigrator();
+ ~EnterpriseReportingPolicyMigrator() override;
+
+ void Migrate(policy::PolicyBundle* bundle) override;
+};
+
+} // namespace enterprise_reporting
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_REPORTING_PRIVATE_ENTERPRISE_REPORTING_POLICY_MIGRATOR_H_
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator_unittest.cc b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator_unittest.cc
new file mode 100644
index 00000000000..2b40d89276d
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator_unittest.cc
@@ -0,0 +1,72 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_policy_migrator.h"
+
+#include "base/bind.h"
+#include "base/callback.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/values.h"
+#include "components/policy/policy_constants.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace extensions {
+namespace enterprise_reporting {
+
+namespace {
+
+const char kStableExtensionId[] = "emahakmocgideepebncgnmlmliepgpgb";
+const char kBetaExtensionId[] = "kigjhoekjcpdfjpimbdjegmgecmlicaf";
+
+const policy::ExtensionPolicyMigrator::Migration kMigrations[] = {
+ {"report_version_data", policy::key::kReportVersionData},
+ {"report_policy_data", policy::key::kReportPolicyData},
+ {"report_machine_id_data", policy::key::kReportMachineIDData},
+ {"report_user_id_data", policy::key::kReportUserIDData},
+};
+
+void SetPolicy(policy::PolicyMap* policy,
+ const char* policy_name,
+ std::unique_ptr<base::Value> value) {
+ policy->Set(policy_name, policy::POLICY_LEVEL_MANDATORY,
+ policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
+ std::move(value), nullptr);
+}
+
+} // namespace
+
+TEST(EnterpriseReportingPolicyMigratorTest, Migrate) {
+ policy::PolicyBundle bundle;
+
+ policy::PolicyMap& stable_extension_map = bundle.Get(policy::PolicyNamespace(
+ policy::POLICY_DOMAIN_EXTENSIONS, kStableExtensionId));
+ SetPolicy(&stable_extension_map, kMigrations[0].old_name,
+ std::make_unique<base::Value>(false));
+ SetPolicy(&stable_extension_map, kMigrations[1].old_name,
+ std::make_unique<base::Value>(false));
+ SetPolicy(&stable_extension_map, kMigrations[2].old_name,
+ std::make_unique<base::Value>(false));
+
+ policy::PolicyMap& beta_extension_map = bundle.Get(policy::PolicyNamespace(
+ policy::POLICY_DOMAIN_EXTENSIONS, kBetaExtensionId));
+ SetPolicy(&beta_extension_map, kMigrations[2].old_name,
+ std::make_unique<base::Value>(true));
+ SetPolicy(&beta_extension_map, kMigrations[3].old_name,
+ std::make_unique<base::Value>(true));
+
+ EnterpriseReportingPolicyMigrator().Migrate(&bundle);
+
+ policy::PolicyMap& chrome_map = bundle.Get(policy::PolicyNamespace(
+ policy::POLICY_DOMAIN_CHROME, /* component_id */ std::string()));
+
+ EXPECT_EQ(4u, chrome_map.size());
+ EXPECT_EQ(base::Value(false), *chrome_map.GetValue(kMigrations[0].new_name));
+ EXPECT_EQ(base::Value(false), *chrome_map.GetValue(kMigrations[1].new_name));
+ // Stable takes priority over Beta, when the policy is set.
+ EXPECT_EQ(base::Value(false), *chrome_map.GetValue(kMigrations[2].new_name));
+ EXPECT_EQ(base::Value(true), *chrome_map.GetValue(kMigrations[3].new_name));
+}
+
+} // namespace enterprise_reporting
+} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
index 4d3ed0a610f..b7ac4535e8d 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_api.cc
@@ -19,7 +19,6 @@
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/proto/device_management_backend.pb.h"
-#include "net/url_request/url_request_context_getter.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace em = enterprise_management;
@@ -60,7 +59,7 @@ EnterpriseReportingPrivateUploadChromeDesktopReportFunction::
cloud_policy_client_ = std::make_unique<policy::CloudPolicyClient>(
std::string() /* machine_id */, std::string() /* machine_model */,
std::string() /* brand_code */, device_management_service,
- g_browser_process->system_request_context(), url_loader_factory, nullptr,
+ std::move(url_loader_factory), nullptr,
policy::CloudPolicyClient::DeviceDMTokenCallback());
dm_token_ = policy::BrowserDMTokenStorage::Get()->RetrieveDMToken();
client_id_ = policy::BrowserDMTokenStorage::Get()->RetrieveClientId();
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc
index 6cd8da022ff..58dfc380424 100644
--- a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/enterprise_reporting_private_unittest.cc
@@ -27,7 +27,9 @@ const char kFakeMachineNameReport[] = "{\"computername\":\"name\"}";
class MockCloudPolicyClient : public policy::MockCloudPolicyClient {
public:
- MockCloudPolicyClient() = default;
+ explicit MockCloudPolicyClient(
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
+ : policy::MockCloudPolicyClient(std::move(url_loader_factory)) {}
void UploadChromeDesktopReport(
std::unique_ptr<enterprise_management::ChromeDesktopReportRequest>
@@ -69,8 +71,8 @@ class EnterpriseReportingPrivateTest : public ExtensionApiUnittest {
EnterpriseReportingPrivateUploadChromeDesktopReportFunction* function =
EnterpriseReportingPrivateUploadChromeDesktopReportFunction::
CreateForTesting(test_shared_loader_factory_);
- std::unique_ptr<MockCloudPolicyClient> client =
- std::make_unique<MockCloudPolicyClient>();
+ auto client =
+ std::make_unique<MockCloudPolicyClient>(test_shared_loader_factory_);
client_ = client.get();
function->SetCloudPolicyClientForTesting(std::move(client));
function->SetRegistrationInfoForTesting(dm_token, kFakeClientId);
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.cc b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.cc
new file mode 100644
index 00000000000..09239d5b5d5
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.cc
@@ -0,0 +1,29 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/enterprise_reporting_private/prefs.h"
+
+#include "components/pref_registry/pref_registry_syncable.h"
+
+namespace extensions {
+namespace enterprise_reporting {
+
+const char kReportVersionData[] = "enterprise_reporting.report_version_data";
+
+const char kReportPolicyData[] = "enterprise_reporting.report_policy_data";
+
+const char kReportMachineIDData[] =
+ "enterprise_reporting.report_machine_id_data";
+
+const char kReportUserIDData[] = "enterprise_reporting.report_user_id_data";
+
+void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterBooleanPref(kReportVersionData, true);
+ registry->RegisterBooleanPref(kReportPolicyData, true);
+ registry->RegisterBooleanPref(kReportMachineIDData, true);
+ registry->RegisterBooleanPref(kReportUserIDData, true);
+}
+
+} // namespace enterprise_reporting
+} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.h b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.h
new file mode 100644
index 00000000000..8471671b8a4
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/enterprise_reporting_private/prefs.h
@@ -0,0 +1,32 @@
+// 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 CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_REPORTING_PRIVATE_PREFS_H_
+#define CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_REPORTING_PRIVATE_PREFS_H_
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+} // namespace user_prefs
+
+namespace extensions {
+namespace enterprise_reporting {
+
+// Controls reporting of OS/Chrome version information.
+extern const char kReportVersionData[];
+
+// Controls reporting of Chrome policy data and policy fetch timestamps.
+extern const char kReportPolicyData[];
+
+// Controls reporting of information that can identify machines.
+extern const char kReportMachineIDData[];
+
+// Controls reporting of information that can identify users.
+extern const char kReportUserIDData[];
+
+void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
+} // namespace enterprise_reporting
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_ENTERPRISE_REPORTING_PRIVATE_PREFS_H_
diff --git a/chromium/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc b/chromium/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc
index d7bd3505ef5..cac23b180ec 100644
--- a/chromium/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc
@@ -9,6 +9,8 @@
#include "base/files/scoped_temp_dir.h"
#include "base/macros.h"
#include "base/run_loop.h"
+#include "base/strings/stringprintf.h"
+#include "base/test/metrics/histogram_tester.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "chrome/browser/download/download_prefs.h"
@@ -34,6 +36,7 @@
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/browser/picture_in_picture_window_controller.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test_utils.h"
@@ -368,6 +371,60 @@ IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, DynamicBrowserAction) {
EXPECT_EQ(kEmptyPathError, catcher.message());
}
+IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, InvisibleIconBrowserAction) {
+ // Turn this on so errors are reported.
+ ExtensionActionSetIconFunction::SetReportErrorForInvisibleIconForTesting(
+ true);
+ ASSERT_TRUE(RunExtensionTest("browser_action/invisible_icon")) << message_;
+ const Extension* extension = GetSingleLoadedExtension();
+ ASSERT_TRUE(extension) << message_;
+
+ // Test there is a browser action in the toolbar.
+ ASSERT_EQ(1, GetBrowserActionsBar()->NumberOfBrowserActions());
+ EXPECT_TRUE(GetBrowserActionsBar()->HasIcon(0));
+ gfx::Image initial_bar_icon = GetBrowserActionsBar()->GetIcon(0);
+
+ ExtensionHost* background_page =
+ ProcessManager::Get(profile())->GetBackgroundHostForExtension(
+ extension->id());
+ ASSERT_TRUE(background_page);
+
+ static constexpr char kScript[] =
+ "setIcon(%s).then(function(arg) {"
+ " domAutomationController.send(arg);"
+ "});";
+
+ const std::string histogram_name =
+ "Extensions.DynamicExtensionActionIconWasVisible";
+ {
+ base::HistogramTester histogram_tester;
+ std::string result;
+ EXPECT_TRUE(ExecuteScriptAndExtractString(
+ background_page->host_contents(),
+ base::StringPrintf(kScript, "invisible"), &result));
+ EXPECT_EQ("Icon not sufficiently visible.", result);
+ // The icon should not have changed.
+ EXPECT_TRUE(gfx::test::AreImagesEqual(initial_bar_icon,
+ GetBrowserActionsBar()->GetIcon(0)));
+ EXPECT_THAT(histogram_tester.GetAllSamples(histogram_name),
+ testing::ElementsAre(base::Bucket(0, 1)));
+ }
+
+ {
+ base::HistogramTester histogram_tester;
+ std::string result;
+ EXPECT_TRUE(ExecuteScriptAndExtractString(
+ background_page->host_contents(),
+ base::StringPrintf(kScript, "visible"), &result));
+ EXPECT_EQ("", result);
+ // The icon should have changed.
+ EXPECT_FALSE(gfx::test::AreImagesEqual(initial_bar_icon,
+ GetBrowserActionsBar()->GetIcon(0)));
+ EXPECT_THAT(histogram_tester.GetAllSamples(histogram_name),
+ testing::ElementsAre(base::Bucket(1, 1)));
+ }
+}
+
IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, TabSpecificBrowserActionState) {
ASSERT_TRUE(RunExtensionTest("browser_action/tab_specific_state")) <<
message_;
@@ -1059,5 +1116,48 @@ IN_PROC_BROWSER_TEST_F(NavigatingExtensionPopupBrowserTest, DownloadViaPost) {
#endif
}
+// Verify video can enter and exit Picture-in_Picture when browser action icon
+// is clicked.
+IN_PROC_BROWSER_TEST_F(BrowserActionApiTest,
+ TestPictureInPictureOnBrowserActionIconClick) {
+ ASSERT_TRUE(StartEmbeddedTestServer());
+
+ ASSERT_TRUE(
+ RunExtensionTest("trigger_actions/browser_action_picture_in_picture"))
+ << message_;
+ const Extension* extension = GetSingleLoadedExtension();
+ ASSERT_TRUE(extension) << message_;
+
+ // Test that there is a browser action in the toolbar.
+ ASSERT_EQ(1, GetBrowserActionsBar()->NumberOfBrowserActions());
+
+ ExtensionAction* browser_action = GetBrowserAction(*extension);
+ EXPECT_TRUE(browser_action);
+
+ // Find the background page.
+ ProcessManager* process_manager =
+ extensions::ProcessManager::Get(browser()->profile());
+ content::WebContents* web_contents =
+ process_manager->GetBackgroundHostForExtension(extension->id())
+ ->web_contents();
+ ASSERT_TRUE(web_contents);
+ content::PictureInPictureWindowController* window_controller =
+ content::PictureInPictureWindowController::GetOrCreateForWebContents(
+ web_contents);
+ ASSERT_TRUE(window_controller->GetWindowForTesting());
+ EXPECT_FALSE(window_controller->GetWindowForTesting()->IsVisible());
+
+ // Click on the browser action icon to enter Picture-in-Picture.
+ ResultCatcher catcher;
+ GetBrowserActionsBar()->Press(0);
+ EXPECT_TRUE(catcher.GetNextResult());
+ EXPECT_TRUE(window_controller->GetWindowForTesting()->IsVisible());
+
+ // Click on the browser action icon to exit Picture-in-Picture.
+ GetBrowserActionsBar()->Press(0);
+ EXPECT_TRUE(catcher.GetNextResult());
+ EXPECT_FALSE(window_controller->GetWindowForTesting()->IsVisible());
+}
+
} // namespace
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.cc b/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.cc
index 9e4a41060ab..a12b3d54afa 100644
--- a/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.cc
+++ b/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.cc
@@ -11,6 +11,7 @@
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -59,6 +60,8 @@ const char kOpenPopupError[] =
const char kInvalidColorError[] =
"The color specification could not be parsed.";
+bool g_report_error_for_invisible_icon = false;
+
} // namespace
//
@@ -421,6 +424,12 @@ ExtensionActionHideFunction::RunExtensionAction() {
return RespondNow(NoArguments());
}
+// static
+void ExtensionActionSetIconFunction::SetReportErrorForInvisibleIconForTesting(
+ bool value) {
+ g_report_error_for_invisible_icon = value;
+}
+
ExtensionFunction::ResponseAction
ExtensionActionSetIconFunction::RunExtensionAction() {
EXTENSION_FUNCTION_VALIDATE(details_);
@@ -438,7 +447,17 @@ ExtensionActionSetIconFunction::RunExtensionAction() {
if (icon.isNull())
return RespondNow(Error("Icon invalid."));
- extension_action_->SetIcon(tab_id_, gfx::Image(icon));
+ gfx::Image icon_image(icon);
+
+ const bool is_visible =
+ image_util::IsIconSufficientlyVisible(icon_image.AsBitmap());
+ UMA_HISTOGRAM_BOOLEAN("Extensions.DynamicExtensionActionIconWasVisible",
+ is_visible);
+
+ if (!is_visible && g_report_error_for_invisible_icon)
+ return RespondNow(Error("Icon not sufficiently visible."));
+
+ extension_action_->SetIcon(tab_id_, icon_image);
} else if (details_->GetInteger("iconIndex", &icon_index)) {
// Obsolete argument: ignore it.
return RespondNow(NoArguments());
diff --git a/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.h b/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.h
index 051518beed5..a9c08ccb71e 100644
--- a/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.h
+++ b/chromium/chrome/browser/extensions/api/extension_action/extension_action_api.h
@@ -128,7 +128,7 @@ class ExtensionActionAPI : public BrowserContextKeyedAPI {
static const char* service_name() { return "ExtensionActionAPI"; }
static const bool kServiceRedirectedInIncognito = true;
- base::ObserverList<Observer> observers_;
+ base::ObserverList<Observer>::Unchecked observers_;
content::BrowserContext* browser_context_;
@@ -197,6 +197,9 @@ class ExtensionActionHideFunction : public ExtensionActionFunction {
// setIcon
class ExtensionActionSetIconFunction : public ExtensionActionFunction {
+ public:
+ static void SetReportErrorForInvisibleIconForTesting(bool value);
+
protected:
~ExtensionActionSetIconFunction() override {}
ResponseAction RunExtensionAction() override;
diff --git a/chromium/chrome/browser/extensions/api/extension_action/extension_action_apitest.cc b/chromium/chrome/browser/extensions/api/extension_action/extension_action_apitest.cc
index f12831ad5e7..c4229c5e970 100644
--- a/chromium/chrome/browser/extensions/api/extension_action/extension_action_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/extension_action/extension_action_apitest.cc
@@ -6,9 +6,9 @@
#include <string>
#include "base/macros.h"
-#include "base/run_loop.h"
#include "base/scoped_observer.h"
#include "base/strings/stringprintf.h"
+#include "chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h"
#include "chrome/browser/extensions/extension_action.h"
#include "chrome/browser/extensions/extension_action_manager.h"
#include "chrome/browser/extensions/extension_apitest.h"
@@ -57,42 +57,6 @@ class TestStateStoreObserver : public StateStore::TestObserver {
DISALLOW_COPY_AND_ASSIGN(TestStateStoreObserver);
};
-// A helper class to observe ExtensionActionAPI changes.
-class TestExtensionActionAPIObserver : public ExtensionActionAPI::Observer {
- public:
- TestExtensionActionAPIObserver(content::BrowserContext* context,
- const std::string& extension_id)
- : extension_id_(extension_id), scoped_observer_(this) {
- scoped_observer_.Add(ExtensionActionAPI::Get(context));
- }
- ~TestExtensionActionAPIObserver() override {}
-
- void OnExtensionActionUpdated(
- ExtensionAction* extension_action,
- content::WebContents* web_contents,
- content::BrowserContext* browser_context) override {
- if (extension_action->extension_id() == extension_id_) {
- last_web_contents_ = web_contents;
- run_loop_.QuitWhenIdle();
- }
- }
-
- const content::WebContents* last_web_contents() const {
- return last_web_contents_;
- }
-
- void Wait() { run_loop_.Run(); }
-
- private:
- content::WebContents* last_web_contents_ = nullptr;
- std::string extension_id_;
- base::RunLoop run_loop_;
- ScopedObserver<ExtensionActionAPI, ExtensionActionAPI::Observer>
- scoped_observer_;
-
- DISALLOW_COPY_AND_ASSIGN(TestExtensionActionAPIObserver);
-};
-
} // namespace
using ExtensionActionAPITest = ExtensionApiTest;
diff --git a/chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.cc b/chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.cc
new file mode 100644
index 00000000000..2083a406aa9
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.cc
@@ -0,0 +1,32 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h"
+
+namespace extensions {
+
+TestExtensionActionAPIObserver::TestExtensionActionAPIObserver(
+ content::BrowserContext* context,
+ const ExtensionId& extension_id)
+ : extension_id_(extension_id), scoped_observer_(this) {
+ scoped_observer_.Add(ExtensionActionAPI::Get(context));
+}
+
+TestExtensionActionAPIObserver::~TestExtensionActionAPIObserver() = default;
+
+void TestExtensionActionAPIObserver::Wait() {
+ run_loop_.Run();
+}
+
+void TestExtensionActionAPIObserver::OnExtensionActionUpdated(
+ ExtensionAction* extension_action,
+ content::WebContents* web_contents,
+ content::BrowserContext* browser_context) {
+ if (extension_action->extension_id() == extension_id_) {
+ last_web_contents_ = web_contents;
+ run_loop_.QuitWhenIdle();
+ }
+}
+
+} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h b/chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h
new file mode 100644
index 00000000000..11b35f5b279
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h
@@ -0,0 +1,55 @@
+// 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 CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_TEST_EXTENSION_ACTION_API_OBSERVER_H_
+#define CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_TEST_EXTENSION_ACTION_API_OBSERVER_H_
+
+#include "base/macros.h"
+#include "base/run_loop.h"
+#include "base/scoped_observer.h"
+#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
+#include "extensions/common/extension_id.h"
+
+namespace content {
+class BrowserContext;
+class WebContents;
+} // namespace content
+
+namespace extensions {
+
+// A helper class to observe ExtensionActionAPI changes.
+class TestExtensionActionAPIObserver : public ExtensionActionAPI::Observer {
+ public:
+ TestExtensionActionAPIObserver(content::BrowserContext* context,
+ const ExtensionId& extension_id);
+ ~TestExtensionActionAPIObserver() override;
+
+ // Waits till the extension action is updated.
+ void Wait();
+
+ // Returns the web contents for which the extension action was updated. Must
+ // be called after calling Wait().
+ const content::WebContents* last_web_contents() const {
+ return last_web_contents_;
+ }
+
+ private:
+ // ExtensionActionAPI::Observer override:
+ void OnExtensionActionUpdated(
+ ExtensionAction* extension_action,
+ content::WebContents* web_contents,
+ content::BrowserContext* browser_context) override;
+
+ content::WebContents* last_web_contents_ = nullptr;
+ ExtensionId extension_id_;
+ base::RunLoop run_loop_;
+ ScopedObserver<ExtensionActionAPI, ExtensionActionAPI::Observer>
+ scoped_observer_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestExtensionActionAPIObserver);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_EXTENSION_ACTION_TEST_EXTENSION_ACTION_API_OBSERVER_H_
diff --git a/chromium/chrome/browser/extensions/api/file_system/DEPS b/chromium/chrome/browser/extensions/api/file_system/DEPS
index b9a9cec2c20..9bf73e30601 100644
--- a/chromium/chrome/browser/extensions/api/file_system/DEPS
+++ b/chromium/chrome/browser/extensions/api/file_system/DEPS
@@ -1,9 +1,3 @@
include_rules = [
"+chrome/browser/ui/views/extensions",
]
-
-specific_include_rules = {
- "file_system_apitest_chromeos\.cc": [
- "+components/drive"
- ],
-}
diff --git a/chromium/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc b/chromium/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
index 1657c78bb85..3c640ff82b5 100644
--- a/chromium/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
+++ b/chromium/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
@@ -11,7 +11,7 @@
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/signin/chrome_signin_client_factory.h"
+#include "chrome/browser/signin/chrome_device_id_helper.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
@@ -58,11 +58,8 @@ GaiaWebAuthFlow::GaiaWebAuthFlow(Delegate* delegate,
std::reverse(client_id_parts.begin(), client_id_parts.end());
redirect_scheme_ = base::JoinString(client_id_parts, ".");
std::string signin_scoped_device_id;
- // profile_ can be nullptr in unittests.
- SigninClient* signin_client =
- profile_ ? ChromeSigninClientFactory::GetForProfile(profile_) : nullptr;
- if (signin_client)
- signin_scoped_device_id = signin_client->GetSigninScopedDeviceId();
+ if (profile_)
+ signin_scoped_device_id = GetSigninScopedDeviceIdForProfile(profile_);
redirect_path_prefix_ = base::StringPrintf(kOAuth2RedirectPathFormat,
token_key->extension_id.c_str());
diff --git a/chromium/chrome/browser/extensions/api/identity/identity_apitest.cc b/chromium/chrome/browser/extensions/api/identity/identity_apitest.cc
index 574f1a83551..be2c71148f1 100644
--- a/chromium/chrome/browser/extensions/api/identity/identity_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -65,6 +65,7 @@
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "services/identity/public/cpp/identity_test_utils.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
@@ -169,7 +170,7 @@ class TestHangOAuth2MintTokenFlow : public OAuth2MintTokenFlow {
TestHangOAuth2MintTokenFlow()
: OAuth2MintTokenFlow(NULL, OAuth2MintTokenFlow::Parameters()) {}
- void Start(net::URLRequestContextGetter* context,
+ void Start(scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const std::string& access_token) override {
// Do nothing, simulating a hanging network call.
}
@@ -191,7 +192,7 @@ class TestOAuth2MintTokenFlow : public OAuth2MintTokenFlow {
result_(result),
delegate_(delegate) {}
- void Start(net::URLRequestContextGetter* context,
+ void Start(scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const std::string& access_token) override {
switch (result_) {
case ISSUE_ADVICE_SUCCESS: {
@@ -465,9 +466,6 @@ class IdentityTestWithSignin : public AsyncExtensionBrowserTest {
ProfileOAuth2TokenServiceFactory::GetInstance()->GetForProfile(
profile()));
ASSERT_TRUE(token_service_);
- GaiaCookieManagerServiceFactory::GetInstance()
- ->GetForProfile(profile())
- ->Init();
#if defined(OS_CHROMEOS)
// On ChromeOS, ProfileOAuth2TokenService does not fire
@@ -862,6 +860,19 @@ IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
EXPECT_TRUE(func->login_ui_shown());
EXPECT_FALSE(func->scope_ui_shown());
}
+
+IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
+ InteractiveNotSignedAndSigninNotAllowed) {
+ browser()->profile()->GetPrefs()->SetBoolean(prefs::kSigninAllowed, false);
+ scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
+ func->set_extension(CreateExtension(CLIENT_ID | SCOPES));
+ func->set_login_ui_result(false);
+ std::string error = utils::RunFunctionAndReturnError(
+ func.get(), "[{\"interactive\": true}]", browser());
+ EXPECT_EQ(std::string(errors::kBrowserSigninNotAllowed), error);
+ EXPECT_FALSE(func->login_ui_shown());
+ EXPECT_FALSE(func->scope_ui_shown());
+}
#endif
IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionTest,
@@ -1936,21 +1947,13 @@ class GetAuthTokenFunctionPublicSessionTest : public GetAuthTokenFunctionTest {
protected:
void SetUpInProcessBrowserTestFixture() override {
- GetAuthTokenFunctionTest::SetUpInProcessBrowserTestFixture();
-
- // Set up the user manager to fake a public session.
- EXPECT_CALL(*user_manager_, IsLoggedInAsKioskApp())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*user_manager_, IsLoggedInAsPublicAccount())
- .WillRepeatedly(Return(true));
-
- // Set up fake install attributes to make the device appeared as
- // enterprise-managed.
- std::unique_ptr<chromeos::StubInstallAttributes> attributes =
- std::make_unique<chromeos::StubInstallAttributes>();
- attributes->SetCloudManaged("example.com", "fake-id");
- policy::BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(
- attributes.release());
+ GetAuthTokenFunctionTest::SetUpInProcessBrowserTestFixture();
+
+ // Set up the user manager to fake a public session.
+ EXPECT_CALL(*user_manager_, IsLoggedInAsKioskApp())
+ .WillRepeatedly(Return(false));
+ EXPECT_CALL(*user_manager_, IsLoggedInAsPublicAccount())
+ .WillRepeatedly(Return(true));
}
scoped_refptr<Extension> CreateTestExtension(const std::string& id) {
@@ -1964,6 +1967,12 @@ class GetAuthTokenFunctionPublicSessionTest : public GetAuthTokenFunctionTest {
.Build();
}
+ // Set up fake install attributes to make the device appeared as
+ // enterprise-managed.
+ chromeos::ScopedStubInstallAttributes test_install_attributes_{
+ chromeos::StubInstallAttributes::CreateCloudManaged("example.com",
+ "fake-id")};
+
// Owned by |user_manager_enabler|.
chromeos::MockUserManager* user_manager_;
};
diff --git a/chromium/chrome/browser/extensions/api/identity/identity_constants.cc b/chromium/chrome/browser/extensions/api/identity/identity_constants.cc
index 8676090894f..fefac477308 100644
--- a/chromium/chrome/browser/extensions/api/identity/identity_constants.cc
+++ b/chromium/chrome/browser/extensions/api/identity/identity_constants.cc
@@ -13,6 +13,7 @@ const char kAuthFailure[] = "OAuth2 request failed: ";
const char kNoGrant[] = "OAuth2 not granted or revoked.";
const char kUserRejected[] = "The user did not approve access.";
const char kUserNotSignedIn[] = "The user is not signed in.";
+const char kBrowserSigninNotAllowed[] = "The user turned off browser signin";
const char kInteractionRequired[] = "User interaction required.";
const char kInvalidRedirect[] = "Did not redirect to the right URL.";
const char kOffTheRecord[] = "Identity API is disabled in incognito windows.";
diff --git a/chromium/chrome/browser/extensions/api/identity/identity_constants.h b/chromium/chrome/browser/extensions/api/identity/identity_constants.h
index 8fc01ff187d..e849ccd2222 100644
--- a/chromium/chrome/browser/extensions/api/identity/identity_constants.h
+++ b/chromium/chrome/browser/extensions/api/identity/identity_constants.h
@@ -14,6 +14,7 @@ extern const char kAuthFailure[];
extern const char kNoGrant[];
extern const char kUserRejected[];
extern const char kUserNotSignedIn[];
+extern const char kBrowserSigninNotAllowed[];
extern const char kInteractionRequired[];
extern const char kInvalidRedirect[];
extern const char kOffTheRecord[];
diff --git a/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc b/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
index 2549540f7f9..41b2cc15afb 100644
--- a/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
+++ b/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc
@@ -16,14 +16,16 @@
#include "chrome/browser/extensions/api/identity/identity_constants.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
-#include "chrome/browser/signin/chrome_signin_client_factory.h"
+#include "chrome/browser/signin/chrome_device_id_helper.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/common/extensions/api/identity.h"
+#include "components/prefs/pref_service.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/profile_management_switches.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
+#include "components/signin/core/browser/signin_pref_names.h"
#include "content/public/common/service_manager_connection.h"
#include "extensions/common/extension_l10n_util.h"
#include "google_apis/gaia/gaia_urls.h"
@@ -56,6 +58,10 @@ const char* const kPublicSessionAllowedOrigins[] = {
"chrome-extension://gbchcmhmhahfdphkhkmpfmihenigjmpp/"};
#endif
+bool IsBrowserSigninAllowed(Profile* profile) {
+ return profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed);
+}
+
} // namespace
IdentityGetAuthTokenFunction::IdentityGetAuthTokenFunction()
@@ -92,7 +98,8 @@ bool IdentityGetAuthTokenFunction::RunAsync() {
*params->details->interactive;
should_prompt_for_scopes_ = interactive_;
- should_prompt_for_signin_ = interactive_;
+ should_prompt_for_signin_ =
+ interactive_ && IsBrowserSigninAllowed(GetProfile());
const OAuth2Info& oauth2_info = OAuth2Info::GetOAuth2Info(extension());
@@ -203,7 +210,10 @@ void IdentityGetAuthTokenFunction::OnReceivedExtensionAccountInfo(
if (!account_state.has_refresh_token) {
if (!ShouldStartSigninFlow()) {
- CompleteFunctionWithError(identity_constants::kUserNotSignedIn);
+ CompleteFunctionWithError(
+ IsBrowserSigninAllowed(GetProfile())
+ ? identity_constants::kUserNotSignedIn
+ : identity_constants::kBrowserSigninNotAllowed);
return;
}
// Display a login prompt.
@@ -593,10 +603,10 @@ void IdentityGetAuthTokenFunction::OnGetAccessTokenComplete(
#if defined(OS_CHROMEOS)
void IdentityGetAuthTokenFunction::OnGetTokenSuccess(
const OAuth2TokenService::Request* request,
- const std::string& access_token,
- const base::Time& expiration_time) {
+ const OAuth2AccessTokenConsumer::TokenResponse& token_response) {
login_token_request_.reset();
- OnGetAccessTokenComplete(access_token, expiration_time,
+ OnGetAccessTokenComplete(token_response.access_token,
+ token_response.expiration_time,
GoogleServiceAuthError::AuthErrorNone());
}
@@ -684,7 +694,7 @@ void IdentityGetAuthTokenFunction::StartGaiaRequest(
const std::string& login_access_token) {
DCHECK(!login_access_token.empty());
mint_token_flow_.reset(CreateMintTokenFlow());
- mint_token_flow_->Start(GetProfile()->GetRequestContext(),
+ mint_token_flow_->Start(GetProfile()->GetURLLoaderFactory(),
login_access_token);
}
@@ -704,10 +714,8 @@ void IdentityGetAuthTokenFunction::ShowOAuthApprovalDialog(
}
OAuth2MintTokenFlow* IdentityGetAuthTokenFunction::CreateMintTokenFlow() {
- SigninClient* signin_client =
- ChromeSigninClientFactory::GetForProfile(GetProfile());
std::string signin_scoped_device_id =
- signin_client->GetSigninScopedDeviceId();
+ GetSigninScopedDeviceIdForProfile(GetProfile());
OAuth2MintTokenFlow* mint_token_flow = new OAuth2MintTokenFlow(
this,
OAuth2MintTokenFlow::Parameters(
diff --git a/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h b/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h
index ed99f975a37..ace71040bff 100644
--- a/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h
+++ b/chromium/chrome/browser/extensions/api/identity/identity_get_auth_token_function.h
@@ -73,9 +73,9 @@ class IdentityGetAuthTokenFunction : public ChromeAsyncExtensionFunction,
// OAuth2TokenService::Consumer.
#if defined(OS_CHROMEOS)
// OAuth2TokenService::Consumer implementation:
- void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
- const std::string& access_token,
- const base::Time& expiration_time) override;
+ void OnGetTokenSuccess(
+ const OAuth2TokenService::Request* request,
+ const OAuth2AccessTokenConsumer::TokenResponse& token_response) override;
void OnGetTokenFailure(const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) override;
#endif
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.cc b/chromium/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.cc
index 793a0a5d6b2..6779605e610 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/destroy_partitions_operation.cc
@@ -34,7 +34,7 @@ DestroyPartitionsOperation::~DestroyPartitionsOperation() {}
void DestroyPartitionsOperation::StartImpl() {
DCHECK(IsRunningInCorrectSequence());
- if (!base::CreateTemporaryFileInDir(temp_dir_.GetPath(), &image_path_)) {
+ if (!base::CreateTemporaryFileInDir(temp_dir_->GetPath(), &image_path_)) {
Error(error::kTempFileError);
return;
}
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc b/chromium/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc
index ab1999a5135..22830d6a2af 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/image_writer_utility_client_browsertest.cc
@@ -12,7 +12,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/sequenced_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/extensions/api/image_writer_private/operation.h"
#include "chrome/services/removable_storage_writer/public/mojom/removable_storage_writer.mojom.h"
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/operation.cc b/chromium/chrome/browser/extensions/api/image_writer_private/operation.cc
index 58739bb2437..125db2b83a5 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/operation.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/operation.cc
@@ -8,7 +8,7 @@
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
#include "chrome/browser/extensions/api/image_writer_private/operation_manager.h"
@@ -39,6 +39,7 @@ Operation::Operation(base::WeakPtr<OperationManager> manager,
#else
device_path_(device_path),
#endif
+ temp_dir_(std::make_unique<base::ScopedTempDir>()),
connector_(std::move(connector)),
stage_(image_writer_api::STAGE_UNKNOWN),
progress_(0),
@@ -50,6 +51,11 @@ Operation::Operation(base::WeakPtr<OperationManager> manager,
Operation::~Operation() {
// The connector_ is bound to the |task_runner_| and must be deleted there.
task_runner_->DeleteSoon(FROM_HERE, std::move(connector_));
+
+ // base::ScopedTempDir must be destroyed on a thread that allows blocking IO
+ // because it will try delete the directory if a call to Delete() hasn't been
+ // made or was unsuccessful.
+ task_runner_->DeleteSoon(FROM_HERE, std::move(temp_dir_));
}
void Operation::Cancel() {
@@ -81,9 +87,9 @@ void Operation::Start() {
DCHECK(IsRunningInCorrectSequence());
#if defined(OS_CHROMEOS)
if (download_folder_.empty() ||
- !temp_dir_.CreateUniqueTempDirUnderPath(download_folder_)) {
+ !temp_dir_->CreateUniqueTempDirUnderPath(download_folder_)) {
#else
- if (!temp_dir_.CreateUniqueTempDir()) {
+ if (!temp_dir_->CreateUniqueTempDir()) {
#endif
Error(error::kTempDirError);
return;
@@ -91,7 +97,7 @@ void Operation::Start() {
AddCleanUpFunction(
base::BindOnce(base::IgnoreResult(&base::ScopedTempDir::Delete),
- base::Unretained(&temp_dir_)));
+ base::Unretained(temp_dir_.get())));
StartImpl();
}
@@ -119,7 +125,7 @@ void Operation::Unzip(const base::Closure& continuation) {
base::Bind(&Operation::CompleteAndContinue, this, continuation),
base::Bind(&Operation::OnUnzipFailure, this),
base::Bind(&Operation::OnUnzipProgress, this));
- unzip_helper->Unzip(image_path_, temp_dir_.GetPath());
+ unzip_helper->Unzip(image_path_, temp_dir_->GetPath());
}
void Operation::Finish() {
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/operation.h b/chromium/chrome/browser/extensions/api/image_writer_private/operation.h
index f629f58d7e4..ba12212379a 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/operation.h
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/operation.h
@@ -16,12 +16,16 @@
#include "base/memory/ref_counted_memory.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
-#include "base/task_scheduler/task_traits.h"
+#include "base/task/task_traits.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/image_writer_private/image_writer_utility_client.h"
#include "chrome/common/extensions/api/image_writer_private.h"
#include "extensions/common/extension_id.h"
+#if defined(OS_CHROMEOS)
+#include "chromeos/disks/disk_mount_manager.h"
+#endif
+
namespace image_writer_api = extensions::api::image_writer_private;
namespace base {
@@ -155,7 +159,7 @@ class Operation : public base::RefCountedThreadSafe<Operation> {
base::FilePath device_path_;
// Temporary directory to store files as we go.
- base::ScopedTempDir temp_dir_;
+ std::unique_ptr<base::ScopedTempDir> temp_dir_;
private:
friend class base::RefCountedThreadSafe<Operation>;
@@ -183,7 +187,8 @@ class Operation : public base::RefCountedThreadSafe<Operation> {
// Unmounts all volumes on |device_path_|.
void UnmountVolumes(const base::Closure& continuation);
// Starts the write after unmounting.
- void UnmountVolumesCallback(const base::Closure& continuation, bool success);
+ void UnmountVolumesCallback(const base::Closure& continuation,
+ chromeos::MountError error_code);
// Starts the ImageBurner write. Note that target_path is the file path of
// the device where device_path has been a system device path.
void StartWriteOnUIThread(const std::string& target_path,
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc b/chromium/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc
index 56b833274df..6817c9db7f2 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/operation_chromeos.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/extensions/api/image_writer_private/operation.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/image_burner_client.h"
+#include "chromeos/disks/disk.h"
#include "chromeos/disks/disk_mount_manager.h"
#include "content/public/browser/browser_thread.h"
@@ -61,11 +62,11 @@ void Operation::UnmountVolumes(const base::Closure& continuation) {
}
void Operation::UnmountVolumesCallback(const base::Closure& continuation,
- bool success) {
+ chromeos::MountError error_code) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (!success) {
- LOG(ERROR) << "Volume unmounting failed.";
+ if (error_code != chromeos::MOUNT_ERROR_NONE) {
+ LOG(ERROR) << "Volume unmounting failed with error code " << error_code;
PostTask(base::Bind(&Operation::Error, this, error::kUnmountVolumesError));
return;
}
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/operation_manager.cc b/chromium/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
index f923cc582c0..037e29ae338 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/operation_manager.cc
@@ -86,11 +86,15 @@ void OperationManager::StartWriteFromUrl(
return;
}
+ network::mojom::URLLoaderFactoryPtrInfo url_loader_factory_info;
+ content::BrowserContext::GetDefaultStoragePartition(browser_context_)
+ ->GetURLLoaderFactoryForBrowserProcess()
+ ->Clone(mojo::MakeRequest(&url_loader_factory_info));
+
scoped_refptr<Operation> operation(new WriteFromUrlOperation(
weak_factory_.GetWeakPtr(), CreateConnector(), extension_id,
- content::BrowserContext::GetDefaultStoragePartition(browser_context_)
- ->GetURLRequestContext(),
- url, hash, device_path, GetAssociatedDownloadFolder()));
+ std::move(url_loader_factory_info), url, hash, device_path,
+ GetAssociatedDownloadFolder()));
operations_[extension_id] = operation;
operation->PostTask(base::BindOnce(&Operation::Start, operation));
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc b/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc
index c16b847be5a..a0f60c4059b 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h"
#include "base/lazy_instance.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_chromeos.cc b/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_chromeos.cc
index c3599770427..525557ccce8 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_chromeos.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/removable_storage_provider_chromeos.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "chrome/browser/extensions/api/image_writer_private/removable_storage_provider.h"
+
+#include "chromeos/disks/disk.h"
#include "chromeos/disks/disk_mount_manager.h"
namespace extensions {
@@ -10,6 +12,7 @@ namespace extensions {
const char kUnknownSDDiskModel[] = "SD Card";
const char kUnknownUSBDiskModel[] = "USB Drive";
+using chromeos::disks::Disk;
using chromeos::disks::DiskMountManager;
// The Chrome OS implementation takes advantage of the Chrome OS
@@ -26,7 +29,7 @@ RemovableStorageProvider::PopulateDeviceList() {
for (DiskMountManager::DiskMap::const_iterator iter = disks.begin();
iter != disks.end();
++iter) {
- const DiskMountManager::Disk& disk = *iter->second;
+ const Disk& disk = *iter->second;
if (disk.is_parent() && !disk.on_boot_device() && disk.has_media() &&
(disk.device_type() == chromeos::DEVICE_TYPE_USB ||
disk.device_type() == chromeos::DEVICE_TYPE_SD)) {
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.cc b/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.cc
index d8204d5ad57..f6d4020a22b 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.cc
@@ -9,7 +9,7 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
@@ -18,6 +18,7 @@
#if defined(OS_CHROMEOS)
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_image_burner_client.h"
+#include "chromeos/disks/disk.h"
#endif
namespace extensions {
@@ -73,9 +74,10 @@ FakeDiskMountManager::~FakeDiskMountManager() {}
void FakeDiskMountManager::UnmountDeviceRecursively(
const std::string& device_path,
- const UnmountDeviceRecursivelyCallbackType& callback) {
- base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
- base::BindOnce(callback, true));
+ UnmountDeviceRecursivelyCallbackType callback) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::BindOnce(std::move(callback), chromeos::MOUNT_ERROR_NONE));
}
#endif
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.h b/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.h
index 1031b57f7fa..aa0397989d1 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.h
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/test_utils.h
@@ -70,7 +70,7 @@ class FakeDiskMountManager : public chromeos::disks::MockDiskMountManager {
void UnmountDeviceRecursively(
const std::string& device_path,
- const UnmountDeviceRecursivelyCallbackType& callback) override;
+ UnmountDeviceRecursivelyCallbackType callback) override;
private:
DiskMap disks_;
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/unzip_helper.cc b/chromium/chrome/browser/extensions/api/image_writer_private/unzip_helper.cc
index dbca44a3e9d..41f1ecce153 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/unzip_helper.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/unzip_helper.cc
@@ -8,7 +8,7 @@
#include "base/files/file_util.h"
#include "base/single_thread_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
#include "third_party/zlib/google/zip_reader.h"
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc b/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
index cedfb9b5446..1a9629190e7 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
@@ -9,6 +9,8 @@
#include "content/public/browser/browser_thread.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_fetcher.h"
+#include "services/network/public/cpp/resource_response.h"
+#include "services/network/public/cpp/simple_url_loader.h"
#include "services/service_manager/public/cpp/connector.h"
namespace extensions {
@@ -20,7 +22,7 @@ WriteFromUrlOperation::WriteFromUrlOperation(
base::WeakPtr<OperationManager> manager,
std::unique_ptr<service_manager::Connector> connector,
const ExtensionId& extension_id,
- net::URLRequestContextGetter* request_context,
+ network::mojom::URLLoaderFactoryPtrInfo factory_info,
GURL url,
const std::string& hash,
const std::string& device_path,
@@ -30,7 +32,7 @@ WriteFromUrlOperation::WriteFromUrlOperation(
extension_id,
device_path,
download_folder),
- request_context_(request_context),
+ url_loader_factory_ptr_info_(std::move(factory_info)),
url_(url),
hash_(hash),
download_continuation_() {}
@@ -59,14 +61,14 @@ void WriteFromUrlOperation::GetDownloadTarget(base::OnceClosure continuation) {
}
if (url_.ExtractFileName().empty()) {
- if (!base::CreateTemporaryFileInDir(temp_dir_.GetPath(), &image_path_)) {
+ if (!base::CreateTemporaryFileInDir(temp_dir_->GetPath(), &image_path_)) {
Error(error::kTempFileError);
return;
}
} else {
base::FilePath file_name =
base::FilePath::FromUTF8Unsafe(url_.ExtractFileName());
- image_path_ = temp_dir_.GetPath().Append(file_name);
+ image_path_ = temp_dir_->GetPath().Append(file_name);
}
PostTask(std::move(continuation));
@@ -110,49 +112,53 @@ void WriteFromUrlOperation::Download(base::OnceClosure continuation) {
"Not implemented, considered not useful."
})");
- // Store the URL fetcher on this object so that it is destroyed before this
- // object is.
- url_fetcher_ = net::URLFetcher::Create(url_, net::URLFetcher::GET, this,
- traffic_annotation);
+ auto request = std::make_unique<network::ResourceRequest>();
+ request->url = GURL(url_);
+ simple_url_loader_ =
+ network::SimpleURLLoader::Create(std::move(request), traffic_annotation);
- url_fetcher_->SetRequestContext(request_context_);
- url_fetcher_->SaveResponseToFileAtPath(image_path_, task_runner());
+ simple_url_loader_->SetOnDownloadProgressCallback(base::BindRepeating(
+ &WriteFromUrlOperation::OnDataDownloaded, base::Unretained(this)));
+ simple_url_loader_->SetOnResponseStartedCallback(base::BindOnce(
+ &WriteFromUrlOperation::OnResponseStarted, base::Unretained(this)));
AddCleanUpFunction(
- base::BindOnce(&WriteFromUrlOperation::DestroyUrlFetcher, this));
+ base::BindOnce(&WriteFromUrlOperation::DestroySimpleURLLoader, this));
- url_fetcher_->Start();
+ network::mojom::URLLoaderFactoryPtr url_loader_factory_ptr;
+ url_loader_factory_ptr.Bind(std::move(url_loader_factory_ptr_info_));
+
+ simple_url_loader_->DownloadToFile(
+ url_loader_factory_ptr.get(),
+ base::BindOnce(&WriteFromUrlOperation::OnSimpleLoaderComplete,
+ base::Unretained(this)),
+ image_path_);
}
-void WriteFromUrlOperation::DestroyUrlFetcher() { url_fetcher_.reset(); }
+void WriteFromUrlOperation::DestroySimpleURLLoader() {
+ simple_url_loader_.reset();
+}
-void WriteFromUrlOperation::OnURLFetchUploadProgress(
- const net::URLFetcher* source,
- int64_t current,
- int64_t total) {
- // No-op
+void WriteFromUrlOperation::OnResponseStarted(
+ const GURL& final_url,
+ const network::ResourceResponseHead& response_head) {
+ total_response_bytes_ = response_head.content_length;
}
-void WriteFromUrlOperation::OnURLFetchDownloadProgress(
- const net::URLFetcher* source,
- int64_t current,
- int64_t total,
- int64_t current_network_bytes) {
+void WriteFromUrlOperation::OnDataDownloaded(uint64_t current) {
DCHECK(IsRunningInCorrectSequence());
- if (IsCancelled()) {
- url_fetcher_.reset(NULL);
- }
+ if (IsCancelled())
+ DestroySimpleURLLoader();
- int progress = (kProgressComplete * current) / total;
+ int progress = (kProgressComplete * current) / total_response_bytes_;
SetProgress(progress);
}
-void WriteFromUrlOperation::OnURLFetchComplete(const net::URLFetcher* source) {
+void WriteFromUrlOperation::OnSimpleLoaderComplete(base::FilePath file_path) {
DCHECK(IsRunningInCorrectSequence());
-
- if (source->GetStatus().is_success() && source->GetResponseCode() == 200) {
+ if (!file_path.empty()) {
SetProgress(kProgressComplete);
std::move(download_continuation_).Run();
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.h b/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.h
index b2c5a9cfa9b..757fc07ffb9 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.h
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.h
@@ -8,13 +8,13 @@
#include <stdint.h>
#include "chrome/browser/extensions/api/image_writer_private/operation.h"
-#include "net/url_request/url_fetcher_delegate.h"
+#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "url/gurl.h"
-namespace net {
-class URLFetcher;
-class URLRequestContextGetter;
-} // namespace net
+namespace network {
+struct ResourceResponseHead;
+class SimpleURLLoader;
+} // namespace network
namespace extensions {
namespace image_writer {
@@ -22,12 +22,12 @@ namespace image_writer {
class OperationManager;
// Encapsulates a write of an image accessed via URL.
-class WriteFromUrlOperation : public Operation, public net::URLFetcherDelegate {
+class WriteFromUrlOperation : public Operation {
public:
WriteFromUrlOperation(base::WeakPtr<OperationManager> manager,
std::unique_ptr<service_manager::Connector> connector,
const ExtensionId& extension_id,
- net::URLRequestContextGetter* request_context,
+ network::mojom::URLLoaderFactoryPtrInfo factory_info,
GURL url,
const std::string& hash,
const std::string& storage_unit_id,
@@ -52,33 +52,24 @@ class WriteFromUrlOperation : public Operation, public net::URLFetcherDelegate {
void VerifyDownload(base::OnceClosure continuation);
private:
- // Destroys the URLFetcher. The URLFetcher needs to be destroyed on the same
- // thread it was created on. The Operation may be deleted on the UI thread
- // and so we must first delete the URLFetcher on the FILE thread.
- void DestroyUrlFetcher();
-
- // URLFetcherDelegate implementation.
- void OnURLFetchComplete(const net::URLFetcher* source) override;
- void OnURLFetchDownloadProgress(const net::URLFetcher* source,
- int64_t current,
- int64_t total,
- int64_t current_network_bytes) override;
- void OnURLFetchUploadProgress(const net::URLFetcher* source,
- int64_t current,
- int64_t total) override;
-
+ void DestroySimpleURLLoader();
+ void OnResponseStarted(const GURL& final_url,
+ const network::ResourceResponseHead& response_head);
+ void OnDataDownloaded(uint64_t current);
+ void OnSimpleLoaderComplete(base::FilePath file_path);
void VerifyDownloadCompare(base::OnceClosure continuation,
const std::string& download_hash);
void VerifyDownloadComplete(base::OnceClosure continuation);
// Arguments
- net::URLRequestContextGetter* request_context_;
+ network::mojom::URLLoaderFactoryPtrInfo url_loader_factory_ptr_info_;
GURL url_;
const std::string hash_;
// Local state
- std::unique_ptr<net::URLFetcher> url_fetcher_;
+ std::unique_ptr<network::SimpleURLLoader> simple_url_loader_;
base::OnceClosure download_continuation_;
+ int total_response_bytes_ = -1;
};
} // namespace image_writer
diff --git a/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc b/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc
index c79d6998b8f..20f3c870603 100644
--- a/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/image_writer_private/write_from_url_operation_unittest.cc
@@ -5,11 +5,12 @@
#include "chrome/browser/extensions/api/image_writer_private/write_from_url_operation.h"
#include "base/run_loop.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
#include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/storage_partition.h"
#include "net/url_request/test_url_request_interceptor.h"
#include "services/service_manager/public/cpp/connector.h"
@@ -35,16 +36,17 @@ typedef net::LocalHostTestURLRequestInterceptor GetInterceptor;
// the current path to the image file.
class WriteFromUrlOperationForTest : public WriteFromUrlOperation {
public:
- WriteFromUrlOperationForTest(base::WeakPtr<OperationManager> manager,
- const ExtensionId& extension_id,
- net::URLRequestContextGetter* request_context,
- GURL url,
- const std::string& hash,
- const std::string& storage_unit_id)
+ WriteFromUrlOperationForTest(
+ base::WeakPtr<OperationManager> manager,
+ const ExtensionId& extension_id,
+ network::mojom::URLLoaderFactoryPtrInfo factory_info,
+ GURL url,
+ const std::string& hash,
+ const std::string& storage_unit_id)
: WriteFromUrlOperation(manager,
/*connector=*/nullptr,
extension_id,
- request_context,
+ std::move(factory_info),
url,
hash,
storage_unit_id,
@@ -99,7 +101,7 @@ class ImageWriterWriteFromUrlOperationTest : public ImageWriterUnitTestBase {
get_interceptor_.reset(new GetInterceptor(
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})));
get_interceptor_->SetResponse(GURL(kTestImageUrl),
test_utils_.GetImagePath());
@@ -112,10 +114,15 @@ class ImageWriterWriteFromUrlOperationTest : public ImageWriterUnitTestBase {
scoped_refptr<WriteFromUrlOperationForTest> CreateOperation(
const GURL& url,
const std::string& hash) {
+ network::mojom::URLLoaderFactoryPtrInfo url_loader_factory_ptr_info;
+ content::BrowserContext::GetDefaultStoragePartition(&test_profile_)
+ ->GetURLLoaderFactoryForBrowserProcess()
+ ->Clone(mojo::MakeRequest(&url_loader_factory_ptr_info));
+
scoped_refptr<WriteFromUrlOperationForTest> operation(
new WriteFromUrlOperationForTest(
manager_.AsWeakPtr(), kDummyExtensionId,
- test_profile_.GetRequestContext(), url, hash,
+ std::move(url_loader_factory_ptr_info), url, hash,
test_utils_.GetDevicePath().AsUTF8Unsafe()));
operation->Start();
return operation;
@@ -182,10 +189,6 @@ TEST_F(ImageWriterWriteFromUrlOperationTest, DownloadFile) {
EXPECT_CALL(
manager_,
- OnProgress(kDummyExtensionId, image_writer_api::STAGE_DOWNLOAD, _))
- .Times(AtLeast(1));
- EXPECT_CALL(
- manager_,
OnProgress(kDummyExtensionId, image_writer_api::STAGE_DOWNLOAD, 0))
.Times(AnyNumber());
EXPECT_CALL(
diff --git a/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.cc b/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.cc
index f4aedc8c0fa..c5f26972ffb 100644
--- a/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.cc
+++ b/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.cc
@@ -197,6 +197,11 @@ bool ImeObserver::HasListener(const std::string& event_name) const {
return extensions::EventRouter::Get(profile_)->HasEventListener(event_name);
}
+bool ImeObserver::ExtensionHasListener(const std::string& event_name) const {
+ return extensions::EventRouter::Get(profile_)->ExtensionHasEventListener(
+ extension_id_, event_name);
+}
+
std::string ImeObserver::ConvertInputContextType(
ui::IMEEngineHandlerInterface::InputContext input_context) {
std::string input_context_type = "text";
diff --git a/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.h
index ca9b9522dd9..78e9fce74fd 100644
--- a/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.h
+++ b/chromium/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -81,8 +81,12 @@ class ImeObserver : public input_method::InputMethodEngineBase::Observer {
bool ShouldForwardKeyEvent() const;
// Returns true if there are any listeners on the given event.
+ // TODO(https://crbug.com/835699): Merge this with |ExtensionHasListener|.
bool HasListener(const std::string& event_name) const;
+ // Returns true if the extension has any listeners on the given event.
+ bool ExtensionHasListener(const std::string& event_name) const;
+
// Functions used to convert InputContext struct to string
std::string ConvertInputContextType(
IMEEngineHandlerInterface::InputContext input_context);
diff --git a/chromium/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc b/chromium/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
index 7f26164f67f..b437fc65997 100644
--- a/chromium/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
+++ b/chromium/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
@@ -202,7 +202,7 @@ class ImeObserverChromeOS : public ui::ImeObserver {
// There is both a public and private OnFocus event. The private OnFocus
// event is only for ChromeOS and contains additional information about pen
// inputs. We ensure that we only trigger one OnFocus event.
- if (HasListener(input_method_private::OnFocus::kEventName) &&
+ if (ExtensionHasListener(input_method_private::OnFocus::kEventName) &&
keyboard::IsStylusVirtualKeyboardEnabled()) {
input_method_private::InputContext input_context;
input_context.context_id = context.id;
@@ -210,6 +210,8 @@ class ImeObserverChromeOS : public ui::ImeObserver {
ConvertInputContextType(context));
input_context.auto_correct = ConvertInputContextAutoCorrect(context);
input_context.auto_complete = ConvertInputContextAutoComplete(context);
+ input_context.auto_capitalize = (input_method_private::AutoCapitalizeType)
+ ConvertInputContextAutoCapitalize(context);
input_context.spell_check = ConvertInputContextSpellCheck(context);
input_context.should_do_learning = context.should_do_learning;
input_context.focus_reason = input_method_private::ParseFocusReason(
diff --git a/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc b/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
index 0a2368e6f81..19df4358af6 100644
--- a/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
@@ -532,7 +532,7 @@ LanguageSettingsPrivateGetTranslateTargetLanguageFunction::Run() {
Profile* profile = chrome_details_.GetProfile();
language::LanguageModel* language_model =
LanguageModelManagerFactory::GetForBrowserContext(profile)
- ->GetDefaultModel();
+ ->GetPrimaryModel();
return RespondNow(OneArgument(
std::make_unique<base::Value>(TranslateService::GetTargetLanguage(
profile->GetPrefs(), language_model))));
@@ -562,7 +562,9 @@ void PopulateInputMethodListFromDescriptors(
input_method.enabled.reset(new bool(true));
if (descriptor.options_page_url().is_valid())
input_method.has_options_page.reset(new bool(true));
- if (!allowed_ids.empty() && util->IsKeyboardLayout(input_method.id) &&
+ if (!allowed_ids.empty() &&
+ (util->IsKeyboardLayout(input_method.id) ||
+ chromeos::extension_ime_util::IsArcIME(input_method.id)) &&
allowed_ids.count(input_method.id) == 0) {
input_method.is_prohibited_by_policy.reset(new bool(true));
}
diff --git a/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc b/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
index f1057324374..634e75751ea 100644
--- a/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
+++ b/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.cc
@@ -32,6 +32,7 @@ LanguageSettingsPrivateDelegate::LanguageSettingsPrivateDelegate(
: custom_dictionary_(nullptr),
context_(context),
listening_spellcheck_(false),
+ listening_input_method_(false),
profile_added_(false) {
// Register with the event router so we know when renderers are listening to
// our events. We first check and see if there *is* an event router, because
@@ -45,6 +46,10 @@ LanguageSettingsPrivateDelegate::LanguageSettingsPrivateDelegate(
language_settings_private::OnSpellcheckDictionariesChanged::kEventName);
event_router->RegisterObserver(this,
language_settings_private::OnCustomDictionaryChanged::kEventName);
+ event_router->RegisterObserver(
+ this, language_settings_private::OnInputMethodAdded::kEventName);
+ event_router->RegisterObserver(
+ this, language_settings_private::OnInputMethodRemoved::kEventName);
// SpellcheckService cannot be created until Profile::DoFinalInit() has been
// called. http://crbug.com/171406
@@ -56,10 +61,14 @@ LanguageSettingsPrivateDelegate::LanguageSettingsPrivateDelegate(
GetPrefs());
StartOrStopListeningForSpellcheckChanges();
+#if defined(OS_CHROMEOS)
+ StartOrStopListeningForInputMethodChanges();
+#endif // defined(OS_CHROMEOS)
}
LanguageSettingsPrivateDelegate::~LanguageSettingsPrivateDelegate() {
DCHECK(!listening_spellcheck_);
+ DCHECK(!listening_input_method_);
pref_change_registrar_.RemoveAll();
notification_registrar_.RemoveAll();
}
@@ -101,6 +110,16 @@ void LanguageSettingsPrivateDelegate::Shutdown() {
RemoveDictionaryObservers();
listening_spellcheck_ = false;
}
+
+#if defined(OS_CHROMEOS)
+ if (listening_input_method_) {
+ auto* input_method_manager =
+ chromeos::input_method::InputMethodManager::Get();
+ if (input_method_manager)
+ input_method_manager->RemoveObserver(this);
+ listening_input_method_ = false;
+ }
+#endif // defined(OS_CHROMEOS)
}
void LanguageSettingsPrivateDelegate::OnListenerAdded(
@@ -111,13 +130,26 @@ void LanguageSettingsPrivateDelegate::OnListenerAdded(
details.event_name ==
language_settings_private::OnCustomDictionaryChanged::kEventName) {
StartOrStopListeningForSpellcheckChanges();
+ return;
+ }
+#if defined(OS_CHROMEOS)
+ if (details.event_name ==
+ language_settings_private::OnInputMethodAdded::kEventName ||
+ details.event_name ==
+ language_settings_private::OnInputMethodRemoved::kEventName) {
+ StartOrStopListeningForInputMethodChanges();
+ return;
}
+#endif // defined(OS_CHROMEOS)
}
void LanguageSettingsPrivateDelegate::OnListenerRemoved(
const EventListenerInfo& details) {
// Stop listening to events if there are no more listeners.
StartOrStopListeningForSpellcheckChanges();
+#if defined(OS_CHROMEOS)
+ StartOrStopListeningForInputMethodChanges();
+#endif // defined(OS_CHROMEOS)
}
void LanguageSettingsPrivateDelegate::Observe(
@@ -128,6 +160,37 @@ void LanguageSettingsPrivateDelegate::Observe(
StartOrStopListeningForSpellcheckChanges();
}
+#if defined(OS_CHROMEOS)
+void LanguageSettingsPrivateDelegate::InputMethodChanged(
+ chromeos::input_method::InputMethodManager* manager,
+ Profile* profile,
+ bool show_message) {
+ // Nothing to do.
+}
+
+void LanguageSettingsPrivateDelegate::OnInputMethodExtensionAdded(
+ const std::string& extension_id) {
+ std::unique_ptr<base::ListValue> args(
+ language_settings_private::OnInputMethodAdded::Create(extension_id));
+ std::unique_ptr<extensions::Event> extension_event(new extensions::Event(
+ events::LANGUAGE_SETTINGS_PRIVATE_ON_INPUT_METHOD_ADDED,
+ language_settings_private::OnInputMethodAdded::kEventName,
+ std::move(args)));
+ EventRouter::Get(context_)->BroadcastEvent(std::move(extension_event));
+}
+
+void LanguageSettingsPrivateDelegate::OnInputMethodExtensionRemoved(
+ const std::string& extension_id) {
+ std::unique_ptr<base::ListValue> args(
+ language_settings_private::OnInputMethodRemoved::Create(extension_id));
+ std::unique_ptr<extensions::Event> extension_event(new extensions::Event(
+ events::LANGUAGE_SETTINGS_PRIVATE_ON_INPUT_METHOD_REMOVED,
+ language_settings_private::OnInputMethodRemoved::kEventName,
+ std::move(args)));
+ EventRouter::Get(context_)->BroadcastEvent(std::move(extension_event));
+}
+#endif // defined(OS_CHROMEOS)
+
void LanguageSettingsPrivateDelegate::OnHunspellDictionaryInitialized(
const std::string& language) {
BroadcastDictionariesChangedEvent();
@@ -229,6 +292,29 @@ void LanguageSettingsPrivateDelegate::
listening_spellcheck_ = should_listen;
}
+#if defined(OS_CHROMEOS)
+void LanguageSettingsPrivateDelegate::
+ StartOrStopListeningForInputMethodChanges() {
+ EventRouter* event_router = EventRouter::Get(context_);
+ bool should_listen =
+ event_router->HasEventListener(
+ language_settings_private::OnInputMethodAdded::kEventName) ||
+ event_router->HasEventListener(
+ language_settings_private::OnInputMethodRemoved::kEventName);
+
+ auto* input_method_manager =
+ chromeos::input_method::InputMethodManager::Get();
+ if (input_method_manager) {
+ if (should_listen && !listening_input_method_)
+ input_method_manager->AddObserver(this);
+ else if (!should_listen && listening_input_method_)
+ input_method_manager->RemoveObserver(this);
+ }
+
+ listening_input_method_ = should_listen;
+}
+#endif // defined(OS_CHROMEOS)
+
void LanguageSettingsPrivateDelegate::RetryDownloadHunspellDictionary(
const std::string& language) {
for (const base::WeakPtr<SpellcheckHunspellDictionary> dictionary :
diff --git a/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h b/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h
index 873dec91a69..17098f43ce8 100644
--- a/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h
+++ b/chromium/chrome/browser/extensions/api/language_settings_private/language_settings_private_delegate.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETTINGS_PRIVATE_DELEGATE_H_
#define CHROME_BROWSER_EXTENSIONS_API_LANGUAGE_SETTINGS_PRIVATE_LANGUAGE_SETTINGS_PRIVATE_DELEGATE_H_
+#include <string>
#include <vector>
#include "base/macros.h"
@@ -18,6 +19,10 @@
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/event_router.h"
+#if defined(OS_CHROMEOS)
+#include "ui/base/ime/chromeos/input_method_manager.h"
+#endif
+
namespace content {
class BrowserContext;
}
@@ -30,6 +35,9 @@ class LanguageSettingsPrivateDelegate
: public KeyedService,
public EventRouter::Observer,
public content::NotificationObserver,
+#if defined(OS_CHROMEOS)
+ public chromeos::input_method::InputMethodManager::Observer,
+#endif // defined(OS_CHROMEOS)
public SpellcheckHunspellDictionary::Observer,
public SpellcheckCustomDictionary::Observer {
public:
@@ -60,6 +68,15 @@ class LanguageSettingsPrivateDelegate
void OnListenerAdded(const EventListenerInfo& details) override;
void OnListenerRemoved(const EventListenerInfo& details) override;
+#if defined(OS_CHROMEOS)
+ // chromeos::input_method::InputMethodManager::Observer implementation.
+ void InputMethodChanged(chromeos::input_method::InputMethodManager* manager,
+ Profile* profile,
+ bool show_message) override;
+ void OnInputMethodExtensionAdded(const std::string& extension_id) override;
+ void OnInputMethodExtensionRemoved(const std::string& extension_id) override;
+#endif // defined(OS_CHROMEOS)
+
// SpellcheckHunspellDictionary::Observer implementation.
void OnHunspellDictionaryInitialized(const std::string& language) override;
void OnHunspellDictionaryDownloadBegin(const std::string& language) override;
@@ -88,6 +105,13 @@ class LanguageSettingsPrivateDelegate
// any observers.
void StartOrStopListeningForSpellcheckChanges();
+#if defined(OS_CHROMEOS)
+ // If there are any JavaScript listeners registered for input method events,
+ // ensures we are registered for change notifications. Otherwise, unregisters
+ // any observers.
+ void StartOrStopListeningForInputMethodChanges();
+#endif // defined(OS_CHROMEOS)
+
// Handles the preference for which languages should be used for spellcheck
// by resetting the dictionaries and broadcasting an event.
void OnSpellcheckDictionariesChanged();
@@ -110,6 +134,8 @@ class LanguageSettingsPrivateDelegate
// True if there are observers listening for spellcheck events.
bool listening_spellcheck_;
+ // True if there are observers listening for input method events.
+ bool listening_input_method_;
// True if the profile has finished initializing.
bool profile_added_;
diff --git a/chromium/chrome/browser/extensions/api/management/management_browsertest.cc b/chromium/chrome/browser/extensions/api/management/management_browsertest.cc
index 870c2eb71cb..24da4131ac6 100644
--- a/chromium/chrome/browser/extensions/api/management/management_browsertest.cc
+++ b/chromium/chrome/browser/extensions/api/management/management_browsertest.cc
@@ -11,7 +11,8 @@
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
+#include "base/test/bind_test_util.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_management.h"
@@ -31,6 +32,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/url_loader_interceptor.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
@@ -343,18 +345,32 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, MAYBE_AutoUpdate) {
basedir.AppendASCII("v2"), temp_dir.GetPath().AppendASCII("v2.crx"),
pem_path, base::FilePath());
- // Note: This interceptor gets requests on the IO thread.
- net::LocalHostTestURLRequestInterceptor interceptor(
- BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
- base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
- base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}));
-
- interceptor.SetResponseIgnoreQuery(
- GURL("http://localhost/autoupdate/manifest"),
- basedir.AppendASCII("manifest_v2.xml"));
- interceptor.SetResponseIgnoreQuery(GURL("http://localhost/autoupdate/v2.crx"),
- v2_path);
+ content::URLLoaderInterceptor interceptor(base::BindLambdaForTesting(
+ [&](content::URLLoaderInterceptor::RequestParams* params) -> bool {
+ if (params->url_request.url.path() == "/autoupdate/v2.crx") {
+ content::URLLoaderInterceptor::WriteResponse(v2_path,
+ params->client.get());
+ return true;
+ }
+ if (params->url_request.url.path() == "/autoupdate/v3.crx") {
+ content::URLLoaderInterceptor::WriteResponse(
+ basedir.AppendASCII("v3.crx"), params->client.get());
+ return true;
+ }
+ if (params->url_request.url.path() == "/autoupdate/manifest") {
+ static bool first = true;
+ if (first) {
+ content::URLLoaderInterceptor::WriteResponse(
+ basedir.AppendASCII("manifest_v2.xml"), params->client.get());
+ first = false;
+ } else {
+ content::URLLoaderInterceptor::WriteResponse(
+ basedir.AppendASCII("manifest_v3.xml"), params->client.get());
+ }
+ return true;
+ }
+ return false;
+ }));
// Install version 1 of the extension.
ExtensionTestMessageListener listener1("v1 installed", false);
@@ -394,11 +410,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, MAYBE_AutoUpdate) {
// Now try doing an update to version 3, which has been incorrectly
// signed. This should fail.
- interceptor.SetResponseIgnoreQuery(
- GURL("http://localhost/autoupdate/manifest"),
- basedir.AppendASCII("manifest_v3.xml"));
- interceptor.SetResponseIgnoreQuery(GURL("http://localhost/autoupdate/v3.crx"),
- basedir.AppendASCII("v3.crx"));
extensions::ExtensionUpdater::CheckParams params2;
params2.callback = base::BindOnce(&NotificationListener::OnFinished,
@@ -447,18 +458,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest,
basedir.AppendASCII("v2"), temp_dir.GetPath().AppendASCII("v2.crx"),
pem_path, base::FilePath());
- // Note: This interceptor gets requests on the IO thread.
- net::LocalHostTestURLRequestInterceptor interceptor(
- BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
- base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
- base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}));
-
- interceptor.SetResponseIgnoreQuery(
- GURL("http://localhost/autoupdate/manifest"),
- basedir.AppendASCII("manifest_v2.xml"));
- interceptor.SetResponseIgnoreQuery(GURL("http://localhost/autoupdate/v2.crx"),
- v2_path);
+ content::URLLoaderInterceptor interceptor(base::BindLambdaForTesting(
+ [&](content::URLLoaderInterceptor::RequestParams* params) -> bool {
+ if (params->url_request.url.path() == "/autoupdate/manifest") {
+ content::URLLoaderInterceptor::WriteResponse(
+ basedir.AppendASCII("manifest_v2.xml"), params->client.get());
+ return true;
+ }
+ if (params->url_request.url.path() == "/autoupdate/v2.crx") {
+ content::URLLoaderInterceptor::WriteResponse(v2_path,
+ params->client.get());
+ return true;
+ }
+ return false;
+ }));
// Install version 1 of the extension.
ExtensionTestMessageListener listener1("v1 installed", false);
@@ -523,18 +536,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalUrlUpdate) {
basedir.AppendASCII("v2"), temp_dir.GetPath().AppendASCII("v2.crx"),
pem_path, base::FilePath());
- // Note: This interceptor gets requests on the IO thread.
- net::LocalHostTestURLRequestInterceptor interceptor(
- BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
- base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
- base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}));
-
- interceptor.SetResponseIgnoreQuery(
- GURL("http://localhost/autoupdate/manifest"),
- basedir.AppendASCII("manifest_v2.xml"));
- interceptor.SetResponseIgnoreQuery(GURL("http://localhost/autoupdate/v2.crx"),
- v2_path);
+ content::URLLoaderInterceptor interceptor(base::BindLambdaForTesting(
+ [&](content::URLLoaderInterceptor::RequestParams* params) -> bool {
+ if (params->url_request.url.path() == "/autoupdate/manifest") {
+ content::URLLoaderInterceptor::WriteResponse(
+ basedir.AppendASCII("manifest_v2.xml"), params->client.get());
+ return true;
+ }
+ if (params->url_request.url.path() == "/autoupdate/v2.crx") {
+ content::URLLoaderInterceptor::WriteResponse(v2_path,
+ params->client.get());
+ return true;
+ }
+ return false;
+ }));
ExtensionRegistry* registry = ExtensionRegistry::Get(browser()->profile());
const size_t size_before = registry->enabled_extensions().size();
@@ -630,18 +645,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalPolicyRefresh) {
basedir.AppendASCII("v2"), temp_dir.GetPath().AppendASCII("v2.crx"),
pem_path, base::FilePath());
- // Note: This interceptor gets requests on the IO thread.
- net::LocalHostTestURLRequestInterceptor interceptor(
- BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
- base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
- base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}));
-
- interceptor.SetResponseIgnoreQuery(
- GURL("http://localhost/autoupdate/manifest"),
- basedir.AppendASCII("manifest_v2.xml"));
- interceptor.SetResponseIgnoreQuery(GURL("http://localhost/autoupdate/v2.crx"),
- v2_path);
+ content::URLLoaderInterceptor interceptor(base::BindLambdaForTesting(
+ [&](content::URLLoaderInterceptor::RequestParams* params) -> bool {
+ if (params->url_request.url.path() == "/autoupdate/manifest") {
+ content::URLLoaderInterceptor::WriteResponse(
+ basedir.AppendASCII("manifest_v2.xml"), params->client.get());
+ return true;
+ }
+ if (params->url_request.url.path() == "/autoupdate/v2.crx") {
+ content::URLLoaderInterceptor::WriteResponse(v2_path,
+ params->client.get());
+ return true;
+ }
+ return false;
+ }));
ExtensionRegistry* registry = ExtensionRegistry::Get(browser()->profile());
const size_t size_before = registry->enabled_extensions().size();
@@ -722,18 +739,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest,
basedir.AppendASCII("v2"), temp_dir.GetPath().AppendASCII("v2.crx"),
pem_path, base::FilePath());
- // Note: This interceptor gets requests on the IO thread.
- net::LocalHostTestURLRequestInterceptor interceptor(
- BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
- base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
- base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}));
-
- interceptor.SetResponseIgnoreQuery(
- GURL("http://localhost/autoupdate/manifest"),
- basedir.AppendASCII("manifest_v2.xml"));
- interceptor.SetResponseIgnoreQuery(GURL("http://localhost/autoupdate/v2.crx"),
- v2_path);
+ content::URLLoaderInterceptor interceptor(base::BindLambdaForTesting(
+ [&](content::URLLoaderInterceptor::RequestParams* params) -> bool {
+ if (params->url_request.url.path() == "/autoupdate/manifest") {
+ content::URLLoaderInterceptor::WriteResponse(
+ basedir.AppendASCII("manifest_v2.xml"), params->client.get());
+ return true;
+ }
+ if (params->url_request.url.path() == "/autoupdate/v2.crx") {
+ content::URLLoaderInterceptor::WriteResponse(v2_path,
+ params->client.get());
+ return true;
+ }
+ return false;
+ }));
// Check that the policy is initially empty.
ASSERT_TRUE(extensions::ExtensionManagementFactory::GetForBrowserContext(
diff --git a/chromium/chrome/browser/extensions/api/mdns/mdns_api.cc b/chromium/chrome/browser/extensions/api/mdns/mdns_api.cc
index 2bf04ff08ba..e27d9f13054 100644
--- a/chromium/chrome/browser/extensions/api/mdns/mdns_api.cc
+++ b/chromium/chrome/browser/extensions/api/mdns/mdns_api.cc
@@ -74,7 +74,7 @@ void MDnsAPI::SetDnsSdRegistryForTesting(DnsSdRegistry* dns_sd_registry) {
void MDnsAPI::ForceDiscovery() {
DCHECK(thread_checker_.CalledOnValidThread());
DnsSdRegistry* registry = dns_sd_registry();
- return registry->ForceDiscovery();
+ return registry->ResetAndDiscover();
}
DnsSdRegistry* MDnsAPI::dns_sd_registry() {
diff --git a/chromium/chrome/browser/extensions/api/mdns/mdns_apitest.cc b/chromium/chrome/browser/extensions/api/mdns/mdns_apitest.cc
index 7751cefc276..495366644a2 100644
--- a/chromium/chrome/browser/extensions/api/mdns/mdns_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/mdns/mdns_apitest.cc
@@ -100,7 +100,7 @@ IN_PROC_BROWSER_TEST_F(MDnsAPITest, MAYBE_ForceDiscovery) {
EXPECT_CALL(*dns_sd_registry_, RegisterDnsSdListener(service_type)).Times(1);
EXPECT_CALL(*dns_sd_registry_, UnregisterDnsSdListener(service_type))
.Times(1);
- EXPECT_CALL(*dns_sd_registry_, ForceDiscovery()).Times(1);
+ EXPECT_CALL(*dns_sd_registry_, ResetAndDiscover()).Times(1);
EXPECT_CALL(*dns_sd_registry_,
RemoveObserver(A<DnsSdRegistry::DnsSdObserver*>()))
.Times(1);
diff --git a/chromium/chrome/browser/extensions/api/messaging/DEPS b/chromium/chrome/browser/extensions/api/messaging/DEPS
deleted file mode 100644
index 06590ef7e73..00000000000
--- a/chromium/chrome/browser/extensions/api/messaging/DEPS
+++ /dev/null
@@ -1,8 +0,0 @@
-specific_include_rules = {
- "native_message_host_chromeos.cc": [
- # TODO(erg): This allows us to switch between mus and classic ash/ozone as
- # targets. It should be removed when support for classic ash is removed;
- # which means that remoting never touches ozone.
- "+ui/ozone/public/ozone_platform.h",
- ]
-}
diff --git a/chromium/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc b/chromium/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc
index 3c9932703ad..fcc93f51bfa 100644
--- a/chromium/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc
+++ b/chromium/chrome/browser/extensions/api/messaging/native_message_host_chromeos.cc
@@ -12,12 +12,9 @@
#include "base/bind_helpers.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
-#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/macros.h"
#include "base/single_thread_task_runner.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/task_scheduler/task_traits.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -26,18 +23,10 @@
#include "extensions/common/constants.h"
#include "extensions/common/url_pattern.h"
#include "net/url_request/url_request_context_getter.h"
-#include "remoting/base/auto_thread_task_runner.h"
-#include "remoting/host/chromoting_host_context.h"
-#include "remoting/host/it2me/it2me_native_messaging_host.h"
-#include "remoting/host/policy_watcher.h"
-#include "ui/events/system_input_injector.h"
+#include "remoting/host/it2me/it2me_native_messaging_host_chromeos.h"
#include "ui/gfx/native_widget_types.h"
#include "url/gurl.h"
-#if defined(USE_OZONE)
-#include "ui/ozone/public/ozone_platform.h"
-#endif
-
namespace extensions {
namespace {
@@ -102,52 +91,14 @@ struct BuiltInHost {
std::unique_ptr<NativeMessageHost> (*create_function)();
};
-#if defined(USE_OZONE)
-class OzoneSystemInputInjectorAdaptor : public ui::SystemInputInjectorFactory {
- public:
- std::unique_ptr<ui::SystemInputInjector> CreateSystemInputInjector()
- override {
- return ui::OzonePlatform::GetInstance()->CreateSystemInputInjector();
- }
-};
-
-base::LazyInstance<OzoneSystemInputInjectorAdaptor>::Leaky
- g_ozone_system_input_injector_adaptor = LAZY_INSTANCE_INITIALIZER;
-#endif
-
-ui::SystemInputInjectorFactory* GetInputInjector() {
- ui::SystemInputInjectorFactory* system = ui::GetSystemInputInjectorFactory();
- if (system)
- return system;
-
-#if defined(USE_OZONE)
- return g_ozone_system_input_injector_adaptor.Pointer();
-#endif
-
- return nullptr;
-}
-
std::unique_ptr<NativeMessageHost> CreateIt2MeHost() {
- std::unique_ptr<remoting::It2MeHostFactory> host_factory(
- new remoting::It2MeHostFactory());
- std::unique_ptr<remoting::ChromotingHostContext> context =
- remoting::ChromotingHostContext::CreateForChromeOS(
- base::WrapRefCounted(g_browser_process->system_request_context()),
- content::BrowserThread::GetTaskRunnerForThread(
- content::BrowserThread::IO),
- content::BrowserThread::GetTaskRunnerForThread(
- content::BrowserThread::UI),
- base::CreateSingleThreadTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND}),
- GetInputInjector());
- std::unique_ptr<remoting::PolicyWatcher> policy_watcher =
- remoting::PolicyWatcher::CreateWithPolicyService(
- g_browser_process->policy_service());
- std::unique_ptr<NativeMessageHost> host(
- new remoting::It2MeNativeMessagingHost(
- /*needs_elevation=*/false, std::move(policy_watcher),
- std::move(context), std::move(host_factory)));
- return host;
+ return remoting::CreateIt2MeNativeMessagingHostForChromeOS(
+ g_browser_process->system_request_context(),
+ content::BrowserThread::GetTaskRunnerForThread(
+ content::BrowserThread::IO),
+ content::BrowserThread::GetTaskRunnerForThread(
+ content::BrowserThread::UI),
+ g_browser_process->policy_service());
}
// If you modify the list of allowed_origins, don't forget to update
diff --git a/chromium/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chromium/chrome/browser/extensions/api/messaging/native_message_process_host.cc
index 9b8591d4d4e..274257d18bf 100644
--- a/chromium/chrome/browser/extensions/api/messaging/native_message_process_host.cc
+++ b/chromium/chrome/browser/extensions/api/messaging/native_message_process_host.cc
@@ -12,7 +12,7 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/process/kill.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest.h"
#include "chrome/browser/extensions/api/messaging/native_process_launcher.h"
@@ -71,7 +71,7 @@ NativeMessageProcessHost::~NativeMessageProcessHost() {
// block, so we have to post a task on the blocking pool.
#if defined(OS_MACOSX)
base::PostTaskWithTraits(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&base::EnsureProcessTerminated, Passed(&process_)));
#else
base::EnsureProcessTerminated(std::move(process_));
@@ -298,8 +298,11 @@ void NativeMessageProcessHost::DoWrite() {
!current_write_buffer_->BytesRemaining()) {
if (write_queue_.empty())
return;
- current_write_buffer_ = new net::DrainableIOBuffer(
- write_queue_.front().get(), write_queue_.front()->size());
+ scoped_refptr<net::IOBufferWithSize> buffer =
+ std::move(write_queue_.front());
+ int buffer_size = buffer->size();
+ current_write_buffer_ = base::MakeRefCounted<net::DrainableIOBuffer>(
+ std::move(buffer), buffer_size);
write_queue_.pop();
}
diff --git a/chromium/chrome/browser/extensions/api/messaging/native_process_launcher.cc b/chromium/chrome/browser/extensions/api/messaging/native_process_launcher.cc
index 0d36259d062..eda727af052 100644
--- a/chromium/chrome/browser/extensions/api/messaging/native_process_launcher.cc
+++ b/chromium/chrome/browser/extensions/api/messaging/native_process_launcher.cc
@@ -15,7 +15,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/strings/stringprintf.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/api/messaging/native_messaging_host_manifest.h"
#include "chrome/common/chrome_paths.h"
diff --git a/chromium/chrome/browser/extensions/api/music_manager_private/device_id.h b/chromium/chrome/browser/extensions/api/music_manager_private/device_id.h
index 7a1cf5dafef..623a00b6d4b 100644
--- a/chromium/chrome/browser/extensions/api/music_manager_private/device_id.h
+++ b/chromium/chrome/browser/extensions/api/music_manager_private/device_id.h
@@ -10,7 +10,7 @@
#include <string>
#include "base/bind.h"
-#include "base/task_scheduler/task_traits.h"
+#include "base/task/task_traits.h"
namespace extensions {
namespace api {
diff --git a/chromium/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc b/chromium/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
index ddc0c9a1214..a31cba28ced 100644
--- a/chromium/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
+++ b/chromium/chrome/browser/extensions/api/music_manager_private/device_id_linux.cc
@@ -20,7 +20,7 @@
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chromium/chrome/browser/extensions/api/music_manager_private/device_id_mac.cc b/chromium/chrome/browser/extensions/api/music_manager_private/device_id_mac.cc
index 300e1bb2134..2081b232621 100644
--- a/chromium/chrome/browser/extensions/api/music_manager_private/device_id_mac.cc
+++ b/chromium/chrome/browser/extensions/api/music_manager_private/device_id_mac.cc
@@ -21,7 +21,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chromium/chrome/browser/extensions/api/music_manager_private/device_id_win.cc b/chromium/chrome/browser/extensions/api/music_manager_private/device_id_win.cc
index 2b49d9a9f79..151fa8fdf22 100644
--- a/chromium/chrome/browser/extensions/api/music_manager_private/device_id_win.cc
+++ b/chromium/chrome/browser/extensions/api/music_manager_private/device_id_win.cc
@@ -22,7 +22,7 @@
#include "base/scoped_native_library.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "base/win/windows_version.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chromium/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc b/chromium/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc
index 508de031a40..1c1d786f10c 100644
--- a/chromium/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc
+++ b/chromium/chrome/browser/extensions/api/networking_cast_private/chrome_networking_cast_private_delegate.cc
@@ -13,7 +13,7 @@
#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/extensions/api/networking_private/networking_private_credentials_getter.h"
#include "chrome/browser/extensions/api/networking_private/networking_private_crypto.h"
diff --git a/chromium/chrome/browser/extensions/api/networking_private/DEPS b/chromium/chrome/browser/extensions/api/networking_private/DEPS
index a070d53ba99..d6abddad069 100644
--- a/chromium/chrome/browser/extensions/api/networking_private/DEPS
+++ b/chromium/chrome/browser/extensions/api/networking_private/DEPS
@@ -1,5 +1,3 @@
include_rules = [
- "+components/onc",
- "+components/wifi",
"+dbus",
]
diff --git a/chromium/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc b/chromium/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
index 475010dec10..83532ae924b 100644
--- a/chromium/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc
@@ -220,10 +220,9 @@ class NetworkingPrivateChromeOSApiTest : public extensions::ExtensionApiTest {
// TODO(pneubeck): Remove the following hack, once the NetworkingPrivateAPI
// uses the ProfileHelper to obtain the userhash crbug/238623.
- const cryptohome::Identification login_user =
- cryptohome::Identification::FromString(
- user_manager::CanonicalizeUserID(command_line->GetSwitchValueNative(
- chromeos::switches::kLoginUser)));
+ cryptohome::AccountIdentifier login_user;
+ login_user.set_account_id(user_manager::CanonicalizeUserID(
+ command_line->GetSwitchValueNative(chromeos::switches::kLoginUser)));
const std::string sanitized_user =
CryptohomeClient::GetStubSanitizedUsername(login_user);
command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile,
@@ -236,7 +235,7 @@ class NetworkingPrivateChromeOSApiTest : public extensions::ExtensionApiTest {
CHECK(user);
std::string userhash;
DBusThreadManager::Get()->GetCryptohomeClient()->GetSanitizedUsername(
- cryptohome::Identification(user->GetAccountId()),
+ cryptohome::CreateAccountIdentifierFromAccountId(user->GetAccountId()),
base::BindOnce(
[](std::string* out, base::Optional<std::string> result) {
CHECK(result.has_value());
@@ -424,6 +423,9 @@ class NetworkingPrivateChromeOSApiTest : public extensions::ExtensionApiTest {
kWifi1ServicePath, shill::kConnectableProperty, base::Value(true));
service_test_->SetServiceProperty(kWifi1ServicePath, shill::kDeviceProperty,
base::Value(kWifiDevicePath));
+ service_test_->SetServiceProperty(
+ kWifi1ServicePath, shill::kTetheringProperty,
+ base::Value(shill::kTetheringNotDetectedState));
base::DictionaryValue static_ipconfig;
static_ipconfig.SetKey(shill::kAddressProperty, base::Value("1.2.3.4"));
service_test_->SetServiceProperty(
@@ -445,6 +447,9 @@ class NetworkingPrivateChromeOSApiTest : public extensions::ExtensionApiTest {
kWifi2ServicePath, shill::kSignalStrengthProperty, base::Value(80));
service_test_->SetServiceProperty(
kWifi2ServicePath, shill::kConnectableProperty, base::Value(true));
+ service_test_->SetServiceProperty(
+ kWifi2ServicePath, shill::kTetheringProperty,
+ base::Value(shill::kTetheringNotDetectedState));
AddService("stub_wimax", "wimax", shill::kTypeWimax, shill::kStateOnline);
service_test_->SetServiceProperty(
diff --git a/chromium/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_browsertest.cc b/chromium/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_browsertest.cc
index 9ab7402b18d..f01292fcec9 100644
--- a/chromium/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_browsertest.cc
+++ b/chromium/chrome/browser/extensions/api/networking_private/networking_private_credentials_getter_browsertest.cc
@@ -6,7 +6,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/run_loop.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/extensions/api/networking_private/networking_private_credentials_getter.h"
#include "chrome/services/wifi_util_win/public/mojom/wifi_credentials_getter.mojom.h"
#include "chrome/test/base/in_process_browser_test.h"
@@ -29,7 +29,7 @@ class NetworkingPrivateCredentialsGetterTest : public InProcessBrowserTest {
done_called_ = false;
base::PostTaskWithTraits(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&NetworkingPrivateCredentialsGetterTest::GetCredentials,
base::Unretained(this)));
run_loop.Run();
diff --git a/chromium/chrome/browser/extensions/api/notifications/notifications_api.cc b/chromium/chrome/browser/extensions/api/notifications/notifications_api.cc
index e62669225cc..66cfea4b410 100644
--- a/chromium/chrome/browser/extensions/api/notifications/notifications_api.cc
+++ b/chromium/chrome/browser/extensions/api/notifications/notifications_api.cc
@@ -152,7 +152,7 @@ bool NotificationBitmapToGfxImage(
return false;
// Ensure we have rgba data.
- std::vector<char>* rgba_data = notification_bitmap.data.get();
+ std::vector<uint8_t>* rgba_data = notification_bitmap.data.get();
if (!rgba_data)
return false;
@@ -172,7 +172,7 @@ bool NotificationBitmapToGfxImage(
return false;
uint32_t* pixels = bitmap.getAddr32(0, 0);
- const char* c_rgba_data = rgba_data->data();
+ const uint8_t* c_rgba_data = rgba_data->data();
for (size_t t = 0; t < rgba_area; ++t) {
// |c_rgba_data| is RGBA, pixels is ARGB.
@@ -287,6 +287,9 @@ bool NotificationsApiFunction::CreateNotification(
if (options->event_time.get())
optional_fields.timestamp = base::Time::FromJsTime(*options->event_time);
+ if (options->silent)
+ optional_fields.silent = *options->silent;
+
if (options->buttons.get()) {
// Currently we allow up to 2 buttons.
size_t number_of_buttons = options->buttons->size();
@@ -446,6 +449,9 @@ bool NotificationsApiFunction::UpdateNotification(
if (options->event_time)
notification->set_timestamp(base::Time::FromJsTime(*options->event_time));
+ if (options->silent)
+ notification->set_silent(*options->silent);
+
if (options->buttons) {
// Currently we allow up to 2 buttons.
size_t number_of_buttons = options->buttons->size();
diff --git a/chromium/chrome/browser/extensions/api/notifications/notifications_apitest.cc b/chromium/chrome/browser/extensions/api/notifications/notifications_apitest.cc
index 5a4c13177f1..d5974129a30 100644
--- a/chromium/chrome/browser/extensions/api/notifications/notifications_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/notifications/notifications_apitest.cc
@@ -292,6 +292,7 @@ IN_PROC_BROWSER_TEST_F(NotificationsApiTest, TestPartialUpdate) {
EXPECT_EQ(base::ASCIIToUTF16(kNewTitle), notification->title());
EXPECT_EQ(base::ASCIIToUTF16(kNewMessage), notification->message());
EXPECT_EQ(kNewPriority, notification->priority());
+ EXPECT_TRUE(notification->silent());
EXPECT_EQ(1u, notification->buttons().size());
EXPECT_EQ(base::ASCIIToUTF16(kButtonTitle), notification->buttons()[0].title);
}
diff --git a/chromium/chrome/browser/extensions/api/page_capture/page_capture_api.cc b/chromium/chrome/browser/extensions/api/page_capture/page_capture_api.cc
index c64ad578f6d..e328205b19c 100644
--- a/chromium/chrome/browser/extensions/api/page_capture/page_capture_api.cc
+++ b/chromium/chrome/browser/extensions/api/page_capture/page_capture_api.cc
@@ -10,7 +10,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/files/file_util.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_tab_util.h"
@@ -95,7 +95,7 @@ bool PageCaptureSaveAsMHTMLFunction::RunAsync() {
// time, we show the user a dialog where they can choose whether to allow the
// extension access to the API.
#if defined(OS_CHROMEOS)
- if (profiles::IsPublicSession()) {
+ if (profiles::ArePublicSessionRestrictionsEnabled()) {
WebContents* web_contents = GetWebContents();
if (!web_contents) {
ReturnFailure(kTabClosedError);
diff --git a/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc b/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
index 3cfa9e91a8b..2983149f56b 100644
--- a/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
+++ b/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
@@ -129,7 +129,7 @@ PlatformKeysInternalGetPublicKeyFunction::Run() {
api_pki::GetPublicKey::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
- const std::vector<char>& cert_der = params->certificate;
+ const std::vector<uint8_t>& cert_der = params->certificate;
if (cert_der.empty())
return RespondNow(Error(platform_keys::kErrorInvalidX509Cert));
// Allow UTF-8 inside PrintableStrings in client certificates. See
@@ -138,7 +138,8 @@ PlatformKeysInternalGetPublicKeyFunction::Run() {
options.printable_string_is_utf8 = true;
scoped_refptr<net::X509Certificate> cert_x509 =
net::X509Certificate::CreateFromBytesUnsafeOptions(
- cert_der.data(), cert_der.size(), options);
+ reinterpret_cast<const char*>(cert_der.data()), cert_der.size(),
+ options);
if (!cert_x509)
return RespondNow(Error(platform_keys::kErrorInvalidX509Cert));
@@ -163,8 +164,8 @@ PlatformKeysInternalGetPublicKeyFunction::Run() {
&algorithm.additional_properties);
return RespondNow(ArgumentList(api_pki::GetPublicKey::Results::Create(
- std::vector<char>(key_info.public_key_spki_der.begin(),
- key_info.public_key_spki_der.end()),
+ std::vector<uint8_t>(key_info.public_key_spki_der.begin(),
+ key_info.public_key_spki_der.end()),
algorithm)));
}
@@ -184,7 +185,7 @@ PlatformKeysInternalSelectClientCertificatesFunction::Run() {
DCHECK(service);
chromeos::platform_keys::ClientCertificateRequest request;
- for (const std::vector<char>& cert_authority :
+ for (const std::vector<uint8_t>& cert_authority :
params->details.request.certificate_authorities) {
request.certificate_authorities.push_back(
std::string(cert_authority.begin(), cert_authority.end()));
@@ -208,7 +209,7 @@ PlatformKeysInternalSelectClientCertificatesFunction::Run() {
std::unique_ptr<net::CertificateList> client_certs;
if (params->details.client_certs) {
client_certs.reset(new net::CertificateList);
- for (const std::vector<char>& client_cert_der :
+ for (const std::vector<uint8_t>& client_cert_der :
*params->details.client_certs) {
if (client_cert_der.empty())
return RespondNow(Error(platform_keys::kErrorInvalidX509Cert));
@@ -218,7 +219,8 @@ PlatformKeysInternalSelectClientCertificatesFunction::Run() {
options.printable_string_is_utf8 = true;
scoped_refptr<net::X509Certificate> client_cert_x509 =
net::X509Certificate::CreateFromBytesUnsafeOptions(
- client_cert_der.data(), client_cert_der.size(), options);
+ reinterpret_cast<const char*>(client_cert_der.data()),
+ client_cert_der.size(), options);
if (!client_cert_x509)
return RespondNow(Error(platform_keys::kErrorInvalidX509Cert));
client_certs->push_back(client_cert_x509);
@@ -344,7 +346,7 @@ void PlatformKeysInternalSignFunction::OnSigned(
if (error_message.empty())
Respond(ArgumentList(api_pki::Sign::Results::Create(
- std::vector<char>(signature.begin(), signature.end()))));
+ std::vector<uint8_t>(signature.begin(), signature.end()))));
else
Respond(Error(error_message));
}
diff --git a/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.cc b/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.cc
index 24934f6a747..c64afa4782c 100644
--- a/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.cc
+++ b/chromium/chrome/browser/extensions/api/platform_keys/platform_keys_test_base.cc
@@ -34,9 +34,6 @@
const char kAffiliationID[] = "some-affiliation-id";
const char kTestUserinfoToken[] = "fake-userinfo-token";
-using policy::affiliation_test_helper::kEnterpriseUserEmail;
-using policy::affiliation_test_helper::kEnterpriseUserGaiaId;
-
PlatformKeysTestBase::PlatformKeysTestBase(
SystemTokenStatus system_token_status,
EnrollmentStatus enrollment_status,
@@ -44,8 +41,9 @@ PlatformKeysTestBase::PlatformKeysTestBase(
: system_token_status_(system_token_status),
enrollment_status_(enrollment_status),
user_status_(user_status),
- account_id_(AccountId::FromUserEmailGaiaId(kEnterpriseUserEmail,
- kEnterpriseUserGaiaId)) {
+ account_id_(AccountId::FromUserEmailGaiaId(
+ policy::AffiliationTestHelper::kEnterpriseUserEmail,
+ policy::AffiliationTestHelper::kEnterpriseUserGaiaId)) {
// Command line should not be tweaked as if user is already logged in.
set_chromeos_user_ = false;
// We log in without running browser.
@@ -78,7 +76,7 @@ void PlatformKeysTestBase::SetUp() {
void PlatformKeysTestBase::SetUpCommandLine(base::CommandLine* command_line) {
extensions::ExtensionApiTest::SetUpCommandLine(command_line);
- policy::affiliation_test_helper::AppendCommandLineSwitchesForLoginManager(
+ policy::AffiliationTestHelper::AppendCommandLineSwitchesForLoginManager(
command_line);
const GURL gaia_url = gaia_https_forwarder_.GetURLForSSLHost(std::string());
@@ -99,21 +97,23 @@ void PlatformKeysTestBase::SetUpInProcessBrowserTestFixture() {
std::unique_ptr<chromeos::SessionManagerClient>(
fake_session_manager_client));
+ policy::AffiliationTestHelper affiliation_helper =
+ policy::AffiliationTestHelper::CreateForCloud(
+ fake_session_manager_client);
+
if (enrollment_status() == EnrollmentStatus::ENROLLED) {
std::set<std::string> device_affiliation_ids;
device_affiliation_ids.insert(kAffiliationID);
- policy::affiliation_test_helper::SetDeviceAffiliationID(
- &device_policy_test_helper_, fake_session_manager_client,
- device_affiliation_ids);
+ ASSERT_NO_FATAL_FAILURE(affiliation_helper.SetDeviceAffiliationIDs(
+ &device_policy_test_helper_, device_affiliation_ids));
}
if (user_status() == UserStatus::MANAGED_AFFILIATED_DOMAIN) {
std::set<std::string> user_affiliation_ids;
user_affiliation_ids.insert(kAffiliationID);
policy::UserPolicyBuilder user_policy;
- policy::affiliation_test_helper::SetUserAffiliationIDs(
- &user_policy, fake_session_manager_client, account_id_,
- user_affiliation_ids);
+ ASSERT_NO_FATAL_FAILURE(affiliation_helper.SetUserAffiliationIDs(
+ &user_policy, account_id_, user_affiliation_ids));
}
EXPECT_CALL(mock_policy_provider_, IsInitializationComplete(testing::_))
@@ -135,7 +135,7 @@ void PlatformKeysTestBase::SetUpOnMainThread() {
token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id();
token_info.token = kTestUserinfoToken;
token_info.email = account_id_.GetUserEmail();
- fake_gaia_.IssueOAuthToken(policy::affiliation_test_helper::kFakeRefreshToken,
+ fake_gaia_.IssueOAuthToken(policy::AffiliationTestHelper::kFakeRefreshToken,
token_info);
// On PRE_ test stage list of users is empty at this point. Then in the body
@@ -143,7 +143,7 @@ void PlatformKeysTestBase::SetUpOnMainThread() {
// after PRE_ test the list of user contains one kEnterpriseUser user.
// This user logs in.
if (!IsPreTest()) {
- policy::affiliation_test_helper::LoginUser(account_id_);
+ policy::AffiliationTestHelper::LoginUser(account_id_);
if (user_status() != UserStatus::UNMANAGED) {
policy::ProfilePolicyConnector* const connector =
@@ -183,7 +183,7 @@ void PlatformKeysTestBase::PrepareTestSystemSlotOnIO(
crypto::ScopedTestSystemNSSKeySlot* system_slot) {}
void PlatformKeysTestBase::RunPreTest() {
- policy::affiliation_test_helper::PreLoginUser(account_id_);
+ policy::AffiliationTestHelper::PreLoginUser(account_id_);
}
bool PlatformKeysTestBase::TestExtension(const std::string& page_url) {
diff --git a/chromium/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc b/chromium/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc
index e1e4d05bc8e..04e63f93299 100644
--- a/chromium/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc
+++ b/chromium/chrome/browser/extensions/api/platform_keys/verify_trust_api.cc
@@ -18,7 +18,6 @@
#include "net/cert/cert_verify_result.h"
#include "net/cert/x509_certificate.h"
#include "net/log/net_log_with_source.h"
-#include "net/ssl/ssl_config_service.h"
namespace extensions {
@@ -162,7 +161,8 @@ void VerifyTrustAPI::IOPart::Verify(std::unique_ptr<Params> params,
}
std::vector<base::StringPiece> der_cert_chain;
- for (const std::vector<char>& cert_der : details.server_certificate_chain) {
+ for (const std::vector<uint8_t>& cert_der :
+ details.server_certificate_chain) {
if (cert_der.empty()) {
callback.Run(platform_keys::kErrorInvalidX509Cert, 0, 0);
return;
@@ -197,10 +197,8 @@ void VerifyTrustAPI::IOPart::Verify(std::unique_ptr<Params> params,
const int return_value = verifier->Verify(
net::CertVerifier::RequestParams(std::move(cert_chain), details.hostname,
- flags, ocsp_response,
- net::CertificateList()),
- net::SSLConfigService::GetCRLSet().get(), verify_result_ptr,
- bound_callback, &request_state->request, *net_log);
+ flags, ocsp_response),
+ verify_result_ptr, bound_callback, &request_state->request, *net_log);
if (return_value != net::ERR_IO_PENDING) {
bound_callback.Run(return_value);
diff --git a/chromium/chrome/browser/extensions/api/preference/preference_api.cc b/chromium/chrome/browser/extensions/api/preference/preference_api.cc
index 5119a448e46..44cc6d7e252 100644
--- a/chromium/chrome/browser/extensions/api/preference/preference_api.cc
+++ b/chromium/chrome/browser/extensions/api/preference/preference_api.cc
@@ -25,7 +25,7 @@
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
-#include "components/autofill/core/common/autofill_pref_names.h"
+#include "components/autofill/core/common/autofill_prefs.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
@@ -94,7 +94,11 @@ const PrefMappingEntry kPrefMapping[] = {
APIPermission::kDataReductionProxy, APIPermission::kDataReductionProxy},
{"alternateErrorPagesEnabled", prefs::kAlternateErrorPagesEnabled,
APIPermission::kPrivacy, APIPermission::kPrivacy},
- {"autofillEnabled", autofill::prefs::kAutofillEnabled,
+ {"autofillEnabled", autofill::prefs::kAutofillEnabledDeprecated,
+ APIPermission::kPrivacy, APIPermission::kPrivacy},
+ {"autofillAddressEnabled", autofill::prefs::kAutofillProfileEnabled,
+ APIPermission::kPrivacy, APIPermission::kPrivacy},
+ {"autofillCreditCardEnabled", autofill::prefs::kAutofillCreditCardEnabled,
APIPermission::kPrivacy, APIPermission::kPrivacy},
{"hyperlinkAuditingEnabled", prefs::kEnableHyperlinkAuditing,
APIPermission::kPrivacy, APIPermission::kPrivacy},
@@ -782,9 +786,24 @@ ExtensionFunction::ResponseAction SetPreferenceFunction::Run() {
transformer->BrowserToExtensionPref(browser_pref_value.get()));
EXTENSION_FUNCTION_VALIDATE(extension_pref_value);
- PreferenceAPI::Get(browser_context())
- ->SetExtensionControlledPref(extension_id(), browser_pref, scope,
- browser_pref_value.release());
+ PreferenceAPI* preference_api = PreferenceAPI::Get(browser_context());
+
+ // Set the new Autofill prefs if the extension sets the deprecated pref in
+ // order to maintain backward compatibility in the extensions preference API.
+ // TODO(crbug.com/870328): Remove this once the deprecated pref is retired.
+ if (autofill::prefs::kAutofillEnabledDeprecated == browser_pref) {
+ // |SetExtensionControlledPref| takes ownership of the base::Value pointer.
+ preference_api->SetExtensionControlledPref(
+ extension_id(), autofill::prefs::kAutofillCreditCardEnabled, scope,
+ new base::Value(browser_pref_value->GetBool()));
+ preference_api->SetExtensionControlledPref(
+ extension_id(), autofill::prefs::kAutofillProfileEnabled, scope,
+ new base::Value(browser_pref_value->GetBool()));
+ }
+
+ preference_api->SetExtensionControlledPref(
+ extension_id(), browser_pref, scope, browser_pref_value.release());
+
return RespondNow(NoArguments());
}
diff --git a/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc b/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc
index 1c25420c612..9f9ea511da8 100644
--- a/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc
@@ -19,7 +19,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/ui_test_utils.h"
-#include "components/autofill/core/common/autofill_pref_names.h"
+#include "components/autofill/core/common/autofill_prefs.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/keep_alive_registry/keep_alive_types.h"
#include "components/keep_alive_registry/scoped_keep_alive.h"
@@ -46,7 +46,9 @@ class ExtensionPreferenceApiTest : public extensions::ExtensionApiTest {
ASSERT_TRUE(pref);
EXPECT_TRUE(pref->IsExtensionControlled());
EXPECT_TRUE(prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled));
- EXPECT_TRUE(prefs->GetBoolean(autofill::prefs::kAutofillEnabled));
+ EXPECT_TRUE(prefs->GetBoolean(autofill::prefs::kAutofillEnabledDeprecated));
+ EXPECT_TRUE(prefs->GetBoolean(autofill::prefs::kAutofillCreditCardEnabled));
+ EXPECT_TRUE(prefs->GetBoolean(autofill::prefs::kAutofillProfileEnabled));
EXPECT_FALSE(prefs->GetBoolean(prefs::kBlockThirdPartyCookies));
EXPECT_TRUE(prefs->GetBoolean(prefs::kEnableHyperlinkAuditing));
EXPECT_TRUE(prefs->GetBoolean(prefs::kEnableReferrers));
@@ -66,7 +68,11 @@ class ExtensionPreferenceApiTest : public extensions::ExtensionApiTest {
ASSERT_TRUE(pref);
EXPECT_FALSE(pref->IsExtensionControlled());
EXPECT_FALSE(prefs->GetBoolean(prefs::kAlternateErrorPagesEnabled));
- EXPECT_FALSE(prefs->GetBoolean(autofill::prefs::kAutofillEnabled));
+ EXPECT_FALSE(
+ prefs->GetBoolean(autofill::prefs::kAutofillEnabledDeprecated));
+ EXPECT_FALSE(
+ prefs->GetBoolean(autofill::prefs::kAutofillCreditCardEnabled));
+ EXPECT_FALSE(prefs->GetBoolean(autofill::prefs::kAutofillProfileEnabled));
EXPECT_TRUE(prefs->GetBoolean(prefs::kBlockThirdPartyCookies));
EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableHyperlinkAuditing));
EXPECT_FALSE(prefs->GetBoolean(prefs::kEnableReferrers));
@@ -117,7 +123,9 @@ class ExtensionPreferenceApiTest : public extensions::ExtensionApiTest {
IN_PROC_BROWSER_TEST_F(ExtensionPreferenceApiTest, MAYBE_Standard) {
PrefService* prefs = profile_->GetPrefs();
prefs->SetBoolean(prefs::kAlternateErrorPagesEnabled, false);
- prefs->SetBoolean(autofill::prefs::kAutofillEnabled, false);
+ prefs->SetBoolean(autofill::prefs::kAutofillEnabledDeprecated, false);
+ prefs->SetBoolean(autofill::prefs::kAutofillCreditCardEnabled, false);
+ prefs->SetBoolean(autofill::prefs::kAutofillProfileEnabled, false);
prefs->SetBoolean(prefs::kBlockThirdPartyCookies, true);
prefs->SetBoolean(prefs::kEnableHyperlinkAuditing, false);
prefs->SetBoolean(prefs::kEnableReferrers, false);
diff --git a/chromium/chrome/browser/extensions/api/processes/processes_api.cc b/chromium/chrome/browser/extensions/api/processes/processes_api.cc
index 1de247454bc..517c2595222 100644
--- a/chromium/chrome/browser/extensions/api/processes/processes_api.cc
+++ b/chromium/chrome/browser/extensions/api/processes/processes_api.cc
@@ -520,7 +520,7 @@ base::ProcessHandle ProcessesTerminateFunction::GetProcessHandleOnIO(
auto* host = content::BrowserChildProcessHost::FromID(child_process_host_id);
if (host)
- return host->GetData().handle;
+ return host->GetData().GetHandle();
return base::kNullProcessHandle;
}
diff --git a/chromium/chrome/browser/extensions/api/proxy/proxy_api.cc b/chromium/chrome/browser/extensions/api/proxy/proxy_api.cc
index 1faf2e10fa3..9bb8242b4e7 100644
--- a/chromium/chrome/browser/extensions/api/proxy/proxy_api.cc
+++ b/chromium/chrome/browser/extensions/api/proxy/proxy_api.cc
@@ -111,7 +111,7 @@ std::unique_ptr<base::Value> ProxyPrefTransformer::ExtensionToBrowserPref(
// chrome.proxy.settings.set(). Several of these strings will
// remain blank no respective values have been passed to set().
// If a values has been passed to set but could not be parsed, we bail
- // out and return NULL.
+ // out and return null.
ProxyPrefs::ProxyMode mode_enum;
bool pac_mandatory;
std::string pac_url;
@@ -144,9 +144,7 @@ std::unique_ptr<base::Value> ProxyPrefTransformer::BrowserToExtensionPref(
// This is a dictionary wrapper that exposes the proxy configuration stored in
// the browser preferences.
- ProxyConfigDictionary config(
- static_cast<const base::DictionaryValue*>(browser_pref)
- ->CreateDeepCopy());
+ ProxyConfigDictionary config(browser_pref->Clone());
ProxyPrefs::ProxyMode mode;
if (!config.GetMode(&mode)) {
diff --git a/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
index c3ad97eb799..153d46d923d 100644
--- a/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
+++ b/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
@@ -84,8 +84,10 @@ bool GetPacMandatoryFromExtensionPref(const base::DictionaryValue* proxy_config,
const base::DictionaryValue* pac_dict = NULL;
proxy_config->GetDictionary(proxy_api_constants::kProxyConfigPacScript,
&pac_dict);
- if (!pac_dict)
+ if (!pac_dict) {
+ *out = false;
return true;
+ }
bool mandatory_pac = false;
if (pac_dict->HasKey(proxy_api_constants::kProxyConfigPacScriptMandatory) &&
@@ -322,7 +324,7 @@ bool GetBypassListFromExtensionPref(const base::DictionaryValue* proxy_config,
return JoinUrlList(bypass_list, ",", out, error, bad_message);
}
-std::unique_ptr<base::DictionaryValue> CreateProxyConfigDict(
+std::unique_ptr<base::Value> CreateProxyConfigDict(
ProxyPrefs::ProxyMode mode_enum,
bool pac_mandatory,
const std::string& pac_url,
@@ -330,14 +332,13 @@ std::unique_ptr<base::DictionaryValue> CreateProxyConfigDict(
const std::string& proxy_rules_string,
const std::string& bypass_list,
std::string* error) {
- std::unique_ptr<base::DictionaryValue> result_proxy_config;
switch (mode_enum) {
case ProxyPrefs::MODE_DIRECT:
- result_proxy_config = ProxyConfigDictionary::CreateDirect();
- break;
+ return std::make_unique<base::Value>(
+ ProxyConfigDictionary::CreateDirect());
case ProxyPrefs::MODE_AUTO_DETECT:
- result_proxy_config = ProxyConfigDictionary::CreateAutoDetect();
- break;
+ return std::make_unique<base::Value>(
+ ProxyConfigDictionary::CreateAutoDetect());
case ProxyPrefs::MODE_PAC_SCRIPT: {
std::string url;
if (!pac_url.empty()) {
@@ -348,30 +349,30 @@ std::unique_ptr<base::DictionaryValue> CreateProxyConfigDict(
return nullptr;
}
} else {
- *error = "Proxy mode 'pac_script' requires a 'pacScript' field with "
- "either a 'url' field or a 'data' field.";
+ *error =
+ "Proxy mode 'pac_script' requires a 'pacScript' field with "
+ "either a 'url' field or a 'data' field.";
return nullptr;
}
- result_proxy_config =
- ProxyConfigDictionary::CreatePacScript(url, pac_mandatory);
- break;
+ return std::make_unique<base::Value>(
+ ProxyConfigDictionary::CreatePacScript(url, pac_mandatory));
}
case ProxyPrefs::MODE_FIXED_SERVERS: {
if (proxy_rules_string.empty()) {
*error = "Proxy mode 'fixed_servers' requires a 'rules' field.";
return nullptr;
}
- result_proxy_config = ProxyConfigDictionary::CreateFixedServers(
- proxy_rules_string, bypass_list);
- break;
+ return std::make_unique<base::Value>(
+ ProxyConfigDictionary::CreateFixedServers(proxy_rules_string,
+ bypass_list));
}
case ProxyPrefs::MODE_SYSTEM:
- result_proxy_config = ProxyConfigDictionary::CreateSystem();
- break;
+ return std::make_unique<base::Value>(
+ ProxyConfigDictionary::CreateSystem());
case ProxyPrefs::kModeCount:
NOTREACHED();
}
- return result_proxy_config;
+ return nullptr;
}
std::unique_ptr<base::DictionaryValue> CreateProxyRulesDict(
diff --git a/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.h b/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.h
index 43428988aa6..00da93813d5 100644
--- a/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.h
+++ b/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers.h
@@ -18,6 +18,7 @@ class ProxyConfigDictionary;
namespace base {
class DictionaryValue;
class ListValue;
+class Value;
}
namespace extensions {
@@ -43,6 +44,8 @@ bool CreatePACScriptFromDataURL(
//
// - If there are NO entries for the respective pieces of data, the functions
// return true.
+// The GetPacMandatoryFromExtensionPref() function sets |out| to false in this
+// case.
// - If there ARE entries and they could be parsed, the functions set |out|
// and return true.
// - If there are entries that could not be parsed, the functions set |error|
@@ -79,7 +82,7 @@ bool GetBypassListFromExtensionPref(const base::DictionaryValue* proxy_config,
// Creates and returns a ProxyConfig dictionary (as defined in the extension
// API) from the given parameters. Ownership is passed to the caller.
// Depending on the value of |mode_enum|, several of the strings may be empty.
-std::unique_ptr<base::DictionaryValue> CreateProxyConfigDict(
+std::unique_ptr<base::Value> CreateProxyConfigDict(
ProxyPrefs::ProxyMode mode_enum,
bool pac_mandatory,
const std::string& pac_url,
diff --git a/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc b/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc
index 85ff80162b4..93eee864b1e 100644
--- a/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc
@@ -225,47 +225,44 @@ TEST(ExtensionProxyApiHelpers, GetBypassListFromExtensionPref) {
TEST(ExtensionProxyApiHelpers, CreateProxyConfigDict) {
std::string error;
- std::unique_ptr<base::DictionaryValue> exp_direct =
- ProxyConfigDictionary::CreateDirect();
- std::unique_ptr<base::DictionaryValue> out_direct(CreateProxyConfigDict(
+ base::Value exp_direct = ProxyConfigDictionary::CreateDirect();
+ std::unique_ptr<base::Value> out_direct(CreateProxyConfigDict(
ProxyPrefs::MODE_DIRECT, false, std::string(), std::string(),
std::string(), std::string(), &error));
- EXPECT_EQ(*exp_direct, *out_direct);
+ EXPECT_EQ(exp_direct, *out_direct);
- std::unique_ptr<base::DictionaryValue> exp_auto =
- ProxyConfigDictionary::CreateAutoDetect();
- std::unique_ptr<base::DictionaryValue> out_auto(CreateProxyConfigDict(
+ base::Value exp_auto = ProxyConfigDictionary::CreateAutoDetect();
+ std::unique_ptr<base::Value> out_auto(CreateProxyConfigDict(
ProxyPrefs::MODE_AUTO_DETECT, false, std::string(), std::string(),
std::string(), std::string(), &error));
- EXPECT_EQ(*exp_auto, *out_auto);
+ EXPECT_EQ(exp_auto, *out_auto);
- std::unique_ptr<base::DictionaryValue> exp_pac_url =
+ base::Value exp_pac_url =
ProxyConfigDictionary::CreatePacScript(kSamplePacScriptUrl, false);
- std::unique_ptr<base::DictionaryValue> out_pac_url(CreateProxyConfigDict(
+ std::unique_ptr<base::Value> out_pac_url(CreateProxyConfigDict(
ProxyPrefs::MODE_PAC_SCRIPT, false, kSamplePacScriptUrl, std::string(),
std::string(), std::string(), &error));
- EXPECT_EQ(*exp_pac_url, *out_pac_url);
+ EXPECT_EQ(exp_pac_url, *out_pac_url);
- std::unique_ptr<base::DictionaryValue> exp_pac_data =
+ base::Value exp_pac_data =
ProxyConfigDictionary::CreatePacScript(kSamplePacScriptAsDataUrl, false);
- std::unique_ptr<base::DictionaryValue> out_pac_data(CreateProxyConfigDict(
+ std::unique_ptr<base::Value> out_pac_data(CreateProxyConfigDict(
ProxyPrefs::MODE_PAC_SCRIPT, false, std::string(), kSamplePacScript,
std::string(), std::string(), &error));
- EXPECT_EQ(*exp_pac_data, *out_pac_data);
+ EXPECT_EQ(exp_pac_data, *out_pac_data);
- std::unique_ptr<base::DictionaryValue> exp_fixed =
+ base::Value exp_fixed =
ProxyConfigDictionary::CreateFixedServers("foo:80", "localhost");
- std::unique_ptr<base::DictionaryValue> out_fixed(CreateProxyConfigDict(
+ std::unique_ptr<base::Value> out_fixed(CreateProxyConfigDict(
ProxyPrefs::MODE_FIXED_SERVERS, false, std::string(), std::string(),
"foo:80", "localhost", &error));
- EXPECT_EQ(*exp_fixed, *out_fixed);
+ EXPECT_EQ(exp_fixed, *out_fixed);
- std::unique_ptr<base::DictionaryValue> exp_system =
- ProxyConfigDictionary::CreateSystem();
- std::unique_ptr<base::DictionaryValue> out_system(CreateProxyConfigDict(
+ base::Value exp_system = ProxyConfigDictionary::CreateSystem();
+ std::unique_ptr<base::Value> out_system(CreateProxyConfigDict(
ProxyPrefs::MODE_SYSTEM, false, std::string(), std::string(),
std::string(), std::string(), &error));
- EXPECT_EQ(*exp_system, *out_system);
+ EXPECT_EQ(exp_system, *out_system);
// Neither of them should have set an error.
EXPECT_EQ(std::string(), error);
@@ -311,11 +308,9 @@ TEST(ExtensionProxyApiHelpers, JoinUrlList) {
// This tests CreateProxyServerDict as well.
TEST(ExtensionProxyApiHelpers, CreateProxyRulesDict) {
- std::unique_ptr<base::DictionaryValue> browser_pref(
- ProxyConfigDictionary::CreateFixedServers(
- "http=proxy1:80;https=proxy2:80;ftp=proxy3:80;socks=proxy4:80",
- "localhost"));
- ProxyConfigDictionary config(std::move(browser_pref));
+ ProxyConfigDictionary config(ProxyConfigDictionary::CreateFixedServers(
+ "http=proxy1:80;https=proxy2:80;ftp=proxy3:80;socks=proxy4:80",
+ "localhost"));
std::unique_ptr<base::DictionaryValue> extension_pref(
CreateProxyRulesDict(config));
ASSERT_TRUE(extension_pref.get());
@@ -338,12 +333,10 @@ TEST(ExtensionProxyApiHelpers, CreateProxyRulesDict) {
// Test multiple proxies per scheme -- expect that only the first is returned.
TEST(ExtensionProxyApiHelpers, CreateProxyRulesDictMultipleProxies) {
- std::unique_ptr<base::DictionaryValue> browser_pref(
- ProxyConfigDictionary::CreateFixedServers(
- "http=proxy1:80,default://;https=proxy2:80,proxy1:80;ftp=proxy3:80,"
- "https://proxy5:443;socks=proxy4:80,proxy1:80",
- "localhost"));
- ProxyConfigDictionary config(std::move(browser_pref));
+ ProxyConfigDictionary config(ProxyConfigDictionary::CreateFixedServers(
+ "http=proxy1:80,default://;https=proxy2:80,proxy1:80;ftp=proxy3:80,"
+ "https://proxy5:443;socks=proxy4:80,proxy1:80",
+ "localhost"));
std::unique_ptr<base::DictionaryValue> extension_pref(
CreateProxyRulesDict(config));
ASSERT_TRUE(extension_pref.get());
@@ -366,9 +359,8 @@ TEST(ExtensionProxyApiHelpers, CreateProxyRulesDictMultipleProxies) {
// Test if a PAC script URL is specified.
TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWithUrl) {
- std::unique_ptr<base::DictionaryValue> browser_pref(
+ ProxyConfigDictionary config(
ProxyConfigDictionary::CreatePacScript(kSamplePacScriptUrl, false));
- ProxyConfigDictionary config(std::move(browser_pref));
std::unique_ptr<base::DictionaryValue> extension_pref(
CreatePacScriptDict(config));
ASSERT_TRUE(extension_pref.get());
@@ -382,9 +374,8 @@ TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWithUrl) {
// Test if a PAC script is encoded in a data URL.
TEST(ExtensionProxyApiHelpers, CreatePacScriptDictWidthData) {
- std::unique_ptr<base::DictionaryValue> browser_pref(
+ ProxyConfigDictionary config(
ProxyConfigDictionary::CreatePacScript(kSamplePacScriptAsDataUrl, false));
- ProxyConfigDictionary config(std::move(browser_pref));
std::unique_ptr<base::DictionaryValue> extension_pref(
CreatePacScriptDict(config));
ASSERT_TRUE(extension_pref.get());
diff --git a/chromium/chrome/browser/extensions/api/proxy/proxy_apitest.cc b/chromium/chrome/browser/extensions/api/proxy/proxy_apitest.cc
index 981c9b2d1b2..2d954803cb0 100644
--- a/chromium/chrome/browser/extensions/api/proxy/proxy_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/proxy/proxy_apitest.cc
@@ -43,8 +43,7 @@ class ProxySettingsApiTest : public ExtensionApiTest {
EXPECT_TRUE(pref->IsExtensionControlled());
ProxyConfigDictionary dict(
- pref_service->GetDictionary(proxy_config::prefs::kProxy)
- ->CreateDeepCopy());
+ pref_service->GetDictionary(proxy_config::prefs::kProxy)->Clone());
ProxyPrefs::ProxyMode mode;
ASSERT_TRUE(dict.GetMode(&mode));
@@ -397,20 +396,10 @@ IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest,
pref_service);
}
-// This test sets proxy to an inavalid host "does.not.exist" and then fetches
-// a page from localhost, expecting an error since host is invalid.
-// On ChromeOS, localhost is by default bypassed, so the page from localhost
-// will be fetched successfully, resulting in no error. Hence this test
-// shouldn't run on ChromeOS.
-#if defined(OS_CHROMEOS)
-#define MAYBE_ProxyEventsInvalidProxy DISABLED_ProxyEventsInvalidProxy
-#else
-#define MAYBE_ProxyEventsInvalidProxy ProxyEventsInvalidProxy
-#endif // defined(OS_CHROMEOS)
-
-// Tests error events: invalid proxy
-IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, MAYBE_ProxyEventsInvalidProxy) {
- ASSERT_TRUE(StartEmbeddedTestServer());
+// This test sets the HTTP proxy to an unreachable host "does.not.exist" and
+// then attempts to fetch "example.test", expecting the listeners of
+// chrome.proxy.onProxyError to fire with ERR_PROXY_CONNECTION_FAILED.
+IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsInvalidProxy) {
ASSERT_TRUE(
RunExtensionSubtest("proxy/events", "invalid_proxy.html")) << message_;
}
@@ -421,4 +410,11 @@ IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsParseError) {
RunExtensionSubtest("proxy/events", "parse_error.html")) << message_;
}
+// Tests that chrome.proxy.onProxyError is NOT called in the case of a
+// non-proxy error.
+IN_PROC_BROWSER_TEST_F(ProxySettingsApiTest, ProxyEventsOtherError) {
+ ASSERT_TRUE(RunExtensionSubtest("proxy/events", "other_error.html"))
+ << message_;
+}
+
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/sessions/sessions_apitest.cc b/chromium/chrome/browser/extensions/api/sessions/sessions_apitest.cc
index 6b5dc75cc8a..20644c9da22 100644
--- a/chromium/chrome/browser/extensions/api/sessions/sessions_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/sessions/sessions_apitest.cc
@@ -268,7 +268,7 @@ void ExtensionSessionsTest::CreateSessionModels() {
std::unique_ptr<syncer::DataTypeActivationResponse> activation_response;
base::RunLoop loop;
ProfileSyncServiceFactory::GetForProfile(browser_->profile())
- ->GetSessionSyncControllerDelegateOnUIThread()
+ ->GetSessionSyncControllerDelegate()
->OnSyncStarting(
request, base::BindLambdaForTesting(
[&](std::unique_ptr<syncer::DataTypeActivationResponse>
diff --git a/chromium/chrome/browser/extensions/api/settings_private/generated_pref.h b/chromium/chrome/browser/extensions/api/settings_private/generated_pref.h
index a634903329b..3222055de56 100644
--- a/chromium/chrome/browser/extensions/api/settings_private/generated_pref.h
+++ b/chromium/chrome/browser/extensions/api/settings_private/generated_pref.h
@@ -63,7 +63,7 @@ class GeneratedPref {
void NotifyObservers(const std::string& pref_name);
private:
- base::ObserverList<Observer> observers_;
+ base::ObserverList<Observer>::Unchecked observers_;
DISALLOW_COPY_AND_ASSIGN(GeneratedPref);
};
diff --git a/chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc
index a64508aaa09..cda1e3351d1 100644
--- a/chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chromium/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chromeos/components/proximity_auth/proximity_auth_pref_names.h"
-#include "components/autofill/core/common/autofill_pref_names.h"
+#include "components/autofill/core/common/autofill_prefs.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/browsing_data/core/pref_names.h"
#include "components/component_updater/pref_names.h"
@@ -117,8 +117,6 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
// Miscellaneous
(*s_whitelist)[::prefs::kAlternateErrorPagesEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
- (*s_whitelist)[autofill::prefs::kAutofillEnabled] =
- settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[autofill::prefs::kAutofillProfileEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[autofill::prefs::kAutofillCreditCardEnabled] =
@@ -178,6 +176,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[drive::prefs::kDisableDrive] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
+#if defined(OS_CHROMEOS)
+ (*s_whitelist)[::prefs::kNetworkFileSharesAllowed] =
+ settings_api::PrefType::PREF_TYPE_BOOLEAN;
+#endif
// Printing settings.
(*s_whitelist)[::prefs::kLocalDiscoveryNotificationsEnabled] =
@@ -197,6 +199,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
(*s_whitelist)[password_manager::prefs::kCredentialsEnableAutosignin] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
+ // Privacy page
+ (*s_whitelist)[::prefs::kSigninAllowedOnNextStartup] =
+ settings_api::PrefType::PREF_TYPE_BOOLEAN;
+
// Sync and personalization page.
(*s_whitelist)[::prefs::kSafeBrowsingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
@@ -289,12 +295,12 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
// kEnableAutoScreenLock is read-only.
(*s_whitelist)[ash::prefs::kEnableAutoScreenLock] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
- (*s_whitelist)[::prefs::kEnableQuickUnlockFingerprint] =
- settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[proximity_auth::prefs::kEasyUnlockProximityThreshold] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[proximity_auth::prefs::kProximityAuthIsChromeOSLoginEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
+ (*s_whitelist)[ash::prefs::kMessageCenterLockScreenMode] =
+ settings_api::PrefType::PREF_TYPE_STRING;
// Accessibility.
(*s_whitelist)[ash::prefs::kAccessibilitySpokenFeedbackEnabled] =
@@ -363,6 +369,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[arc::prefs::kVoiceInteractionHotwordEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
+ (*s_whitelist)[arc::prefs::kVoiceInteractionNotificationEnabled] =
+ settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Misc.
(*s_whitelist)[::prefs::kUse24HourClock] =
@@ -461,6 +469,10 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapDiamondKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
+ (*s_whitelist)[::prefs::kLanguageRemapExternalCommandKeyTo] =
+ settings_api::PrefType::PREF_TYPE_NUMBER;
+ (*s_whitelist)[::prefs::kLanguageRemapExternalMetaKeyTo] =
+ settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageSendFunctionKeys] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kLanguageXkbAutoRepeatEnabled] =
@@ -470,10 +482,6 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
(*s_whitelist)[::prefs::kLanguageXkbAutoRepeatInterval] =
settings_api::PrefType::PREF_TYPE_NUMBER;
- // Multidevice settings.
- (*s_whitelist)[arc::prefs::kSmsConnectEnabled] =
- settings_api::PrefType::PREF_TYPE_BOOLEAN;
-
// Native Printing settings.
(*s_whitelist)[::prefs::kUserNativePrintersAllowed] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
diff --git a/chromium/chrome/browser/extensions/api/socket/combined_socket_unittest.cc b/chromium/chrome/browser/extensions/api/socket/combined_socket_unittest.cc
deleted file mode 100644
index 6feb6fe9361..00000000000
--- a/chromium/chrome/browser/extensions/api/socket/combined_socket_unittest.cc
+++ /dev/null
@@ -1,145 +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.
-
-#include <memory>
-
-#include "chrome/browser/extensions/api/socket/mock_tcp_client_socket.h"
-#include "extensions/browser/api/socket/socket.h"
-#include "extensions/browser/api/socket/tcp_socket.h"
-#include "extensions/browser/api/socket/tls_socket.h"
-#include "net/socket/stream_socket.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace extensions {
-
-const int kBufferLength = 10;
-
-template <typename T>
-std::unique_ptr<T> CreateTestSocket(
- std::unique_ptr<MockTCPClientSocket> stream);
-
-template <>
-std::unique_ptr<TCPSocket> CreateTestSocket(
- std::unique_ptr<MockTCPClientSocket> stream) {
- return std::make_unique<TCPSocket>(std::move(stream), "fake id",
- true /* is_connected */);
-}
-
-template <>
-std::unique_ptr<TLSSocket> CreateTestSocket(
- std::unique_ptr<MockTCPClientSocket> stream) {
- return std::make_unique<TLSSocket>(std::move(stream), "fake id");
-}
-
-class CombinedSocketTest : public testing::Test {
- public:
- CombinedSocketTest() : count_(0), io_buffer_(nullptr) {}
-
- // Strict test for synchronous (immediate) read behavior
- template <typename T>
- void TestRead() {
- net::IOBuffer* buffer = nullptr;
-
- std::unique_ptr<MockTCPClientSocket> stream(
- new testing::StrictMock<MockTCPClientSocket>());
- EXPECT_CALL(*stream, Read(testing::NotNull(), kBufferLength, testing::_))
- .WillOnce(DoAll(testing::SaveArg<0>(&buffer),
- testing::Return(kBufferLength)));
- EXPECT_CALL(*stream, Disconnect());
-
- std::unique_ptr<T> socket = CreateTestSocket<T>(std::move(stream));
- ReadCompletionCallback read_callback =
- base::Bind(&CombinedSocketTest::OnRead, base::Unretained(this));
- socket->Read(kBufferLength, read_callback);
- EXPECT_EQ(kBufferLength, count_);
- EXPECT_NE(nullptr, buffer);
- EXPECT_EQ(buffer, io_buffer_);
- }
-
- // Strict test for async read behavior (read returns PENDING)
- template <typename T>
- void TestReadPending() {
- net::IOBuffer* buffer = nullptr;
- net::CompletionCallback socket_cb;
-
- std::unique_ptr<MockTCPClientSocket> stream(
- new testing::StrictMock<MockTCPClientSocket>());
- EXPECT_CALL(*stream, Read(testing::NotNull(), kBufferLength, testing::_))
- .WillOnce(DoAll(testing::SaveArg<0>(&buffer),
- testing::SaveArg<2>(&socket_cb),
- testing::Return(net::ERR_IO_PENDING)));
- EXPECT_CALL(*stream, Disconnect());
-
- std::unique_ptr<T> socket = CreateTestSocket<T>(std::move(stream));
- ReadCompletionCallback read_callback =
- base::Bind(&CombinedSocketTest::OnRead, base::Unretained(this));
- socket->Read(kBufferLength, read_callback);
- EXPECT_EQ(0, count_);
- EXPECT_EQ(nullptr, io_buffer_);
- socket_cb.Run(kBufferLength);
- EXPECT_EQ(kBufferLength, count_);
- EXPECT_NE(nullptr, buffer);
- EXPECT_EQ(buffer, io_buffer_);
- }
-
- // Even if the socket is closed, it may still have data left to read.
- template <typename T>
- void TestReadAfterDisconnect() {
- net::IOBuffer* buffer = nullptr;
-
- std::unique_ptr<MockTCPClientSocket> stream(
- new testing::NiceMock<MockTCPClientSocket>());
- EXPECT_CALL(*stream, Read(testing::NotNull(), kBufferLength, testing::_))
- .WillOnce(DoAll(testing::SaveArg<0>(&buffer),
- testing::Return(kBufferLength)));
- ON_CALL(*stream, IsConnected()).WillByDefault(testing::Return(false));
- EXPECT_CALL(*stream, Disconnect());
-
- std::unique_ptr<T> socket = CreateTestSocket<T>(std::move(stream));
- ReadCompletionCallback read_callback =
- base::Bind(&CombinedSocketTest::OnRead, base::Unretained(this));
- socket->Read(kBufferLength, read_callback);
- EXPECT_EQ(kBufferLength, count_);
- EXPECT_NE(nullptr, buffer);
- EXPECT_EQ(buffer, io_buffer_);
- }
-
- void OnRead(int count,
- scoped_refptr<net::IOBuffer> io_buffer,
- bool socket_destroying) {
- count_ = count;
- io_buffer_ = io_buffer.get();
- }
-
- protected:
- int count_;
- net::IOBuffer* io_buffer_;
-};
-
-TEST_F(CombinedSocketTest, TlsRead) {
- TestRead<TLSSocket>();
-}
-
-TEST_F(CombinedSocketTest, TcpRead) {
- TestRead<TCPSocket>();
-}
-
-TEST_F(CombinedSocketTest, TlsReadPending) {
- TestReadPending<TLSSocket>();
-}
-
-TEST_F(CombinedSocketTest, TcpReadPending) {
- TestReadPending<TCPSocket>();
-}
-
-TEST_F(CombinedSocketTest, TlsReadAfterDisconnect) {
- TestReadAfterDisconnect<TLSSocket>();
-}
-
-TEST_F(CombinedSocketTest, TcpReadAfterDisconnect) {
- TestReadAfterDisconnect<TCPSocket>();
-}
-
-} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/socket/mock_tcp_client_socket.h b/chromium/chrome/browser/extensions/api/socket/mock_tcp_client_socket.h
deleted file mode 100644
index fddad102ac6..00000000000
--- a/chromium/chrome/browser/extensions/api/socket/mock_tcp_client_socket.h
+++ /dev/null
@@ -1,82 +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 CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_
-#define CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_
-
-#include "base/callback_helpers.h"
-#include "net/log/net_log_source.h"
-#include "net/log/net_log_with_source.h"
-#include "net/socket/tcp_client_socket.h"
-#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-namespace extensions {
-class MockTCPClientSocket : public net::TCPClientSocket {
- public:
- MockTCPClientSocket();
- ~MockTCPClientSocket() override;
-
- int Read(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback) override {
- return Read(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)));
- }
-
- int Write(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback,
- const net::NetworkTrafficAnnotationTag& tag) override {
- return Write(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)), tag);
- }
-
- int Connect(net::CompletionOnceCallback callback) override {
- return Connect(base::AdaptCallbackForRepeating(std::move(callback)));
- }
-
- MOCK_METHOD3(Read, int(net::IOBuffer*, int, const net::CompletionCallback&));
- MOCK_METHOD4(Write,
- int(net::IOBuffer*,
- int,
- const net::CompletionCallback&,
- const net::NetworkTrafficAnnotationTag&));
- MOCK_METHOD1(SetReceiveBufferSize, int(int32_t));
- MOCK_METHOD1(SetSendBufferSize, int(int32_t));
- MOCK_METHOD1(Connect, int(const net::CompletionCallback&));
- MOCK_METHOD0(Disconnect, void());
- MOCK_CONST_METHOD0(IsConnected, bool());
- MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
- MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*));
- MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*));
- MOCK_CONST_METHOD0(NetLog, const net::NetLogWithSource&());
- MOCK_CONST_METHOD0(WasEverUsed, bool());
- MOCK_CONST_METHOD0(UsingTCPFastOpen, bool());
- MOCK_CONST_METHOD0(NumBytesRead, int64_t());
- MOCK_CONST_METHOD0(GetConnectTimeMicros, base::TimeDelta());
- MOCK_CONST_METHOD0(WasAlpnNegotiated, bool());
- MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto());
- MOCK_METHOD1(GetSSLInfo, bool(net::SSLInfo*));
- MOCK_CONST_METHOD1(GetConnectionAttempts, void(net::ConnectionAttempts*));
- MOCK_METHOD0(ClearConnectionAttempts, void());
- MOCK_METHOD1(AddConnectionAttempts, void(const net::ConnectionAttempts&));
- MOCK_CONST_METHOD0(GetTotalReceivedBytes, int64_t());
-
- // Methods specific to MockTCPClientSocket
- MOCK_METHOD1(Bind, int(const net::IPEndPoint&));
- MOCK_METHOD2(SetKeepAlive, bool(bool, int));
- MOCK_METHOD1(SetNoDelay, bool(bool));
-};
-
-MockTCPClientSocket::MockTCPClientSocket()
- : TCPClientSocket(net::AddressList(),
- nullptr,
- nullptr,
- net::NetLogSource()) {}
-MockTCPClientSocket::~MockTCPClientSocket() {}
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_MOCK_TCP_CLIENT_SOCKET_H_
diff --git a/chromium/chrome/browser/extensions/api/socket/socket_apitest.cc b/chromium/chrome/browser/extensions/api/socket/socket_apitest.cc
index ae11686ed95..ee35b81809e 100644
--- a/chromium/chrome/browser/extensions/api/socket/socket_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/socket/socket_apitest.cc
@@ -9,8 +9,6 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/test/base/in_process_browser_test.h"
-#include "extensions/browser/api/dns/host_resolver_wrapper.h"
-#include "extensions/browser/api/dns/mock_host_resolver_creator.h"
#include "extensions/browser/api/socket/socket_api.h"
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
@@ -22,35 +20,15 @@ using extensions::ResultCatcher;
namespace {
-const char kHostname[] = "127.0.0.1";
+const char kHostname[] = "www.foo.com";
const int kPort = 8888;
class SocketApiTest : public extensions::ExtensionApiTest {
public:
- SocketApiTest()
- : resolver_event_(base::WaitableEvent::ResetPolicy::MANUAL,
- base::WaitableEvent::InitialState::NOT_SIGNALED),
- resolver_creator_(new extensions::MockHostResolverCreator()) {}
-
void SetUpOnMainThread() override {
extensions::ExtensionApiTest::SetUpOnMainThread();
- extensions::HostResolverWrapper::GetInstance()->SetHostResolverForTesting(
- resolver_creator_->CreateMockHostResolver());
- }
-
- void TearDownOnMainThread() override {
- extensions::HostResolverWrapper::GetInstance()->
- SetHostResolverForTesting(NULL);
- resolver_creator_->DeleteMockHostResolver();
+ host_resolver()->AddRule(kHostname, "127.0.0.1");
}
-
- private:
- base::WaitableEvent resolver_event_;
-
- // The MockHostResolver asserts that it's used on the same thread on which
- // it's created, which is actually a stronger rule than its real counterpart.
- // But that's fine; it's good practice.
- scoped_refptr<extensions::MockHostResolverCreator> resolver_creator_;
};
} // namespace
@@ -67,7 +45,7 @@ IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketUDPExtension) {
ASSERT_GT(port, 0);
// Test that sendTo() is properly resolving hostnames.
- host_port_pair.set_host("LOCALhost");
+ host_port_pair.set_host(kHostname);
ResultCatcher catcher;
catcher.RestrictToBrowserContext(browser()->profile());
@@ -115,7 +93,7 @@ IN_PROC_BROWSER_TEST_F(SocketApiTest, SocketTCPServerExtension) {
ExtensionTestMessageListener listener("info_please", true);
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("socket/api")));
EXPECT_TRUE(listener.WaitUntilSatisfied());
- listener.Reply(base::StringPrintf("tcp_server:%s:%d", kHostname, kPort));
+ listener.Reply(base::StringPrintf("tcp_server:127.0.0.1:%d", kPort));
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
}
diff --git a/chromium/chrome/browser/extensions/api/socket/tcp_socket_unittest.cc b/chromium/chrome/browser/extensions/api/socket/tcp_socket_unittest.cc
index 6351e3d6ca2..8fc0c4bfcca 100644
--- a/chromium/chrome/browser/extensions/api/socket/tcp_socket_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/socket/tcp_socket_unittest.cc
@@ -4,274 +4,719 @@
#include <memory>
-#include "base/callback_helpers.h"
#include "base/macros.h"
+#include "base/memory/scoped_refptr.h"
+#include "base/test/bind_test_util.h"
+#include "chrome/browser/extensions/extension_service_test_base.h"
+#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/test/test_storage_partition.h"
#include "extensions/browser/api/socket/tcp_socket.h"
#include "net/base/address_list.h"
#include "net/base/completion_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
-#include "net/base/rand_callback.h"
-#include "net/log/net_log_source.h"
-#include "net/socket/tcp_client_socket.h"
-#include "net/socket/tcp_server_socket.h"
+#include "net/base/test_completion_callback.h"
+#include "net/socket/socket_test_util.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-using testing::_;
-using testing::DoAll;
-using testing::Return;
-using testing::SaveArg;
+#include "net/url_request/url_request_test_util.h"
+#include "services/network/network_context.h"
+#include "services/network/public/mojom/network_context.mojom.h"
namespace extensions {
-class MockTCPSocket : public net::TCPClientSocket {
+namespace {
+
+const char kTestMsg[] = "abcdefghij";
+const int kTestMsgLength = strlen(kTestMsg);
+
+const char FAKE_ID[] = "abcdefghijklmnopqrst";
+
+class TCPSocketUnitTestBase : public extensions::ExtensionServiceTestBase {
public:
- explicit MockTCPSocket(const net::AddressList& address_list)
- : net::TCPClientSocket(address_list, NULL, NULL, net::NetLogSource()) {}
-
- int Read(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback) override {
- return Read(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)));
+ TCPSocketUnitTestBase()
+ : url_request_context_(true /* delay_initialization */) {}
+ ~TCPSocketUnitTestBase() override {}
+
+ std::unique_ptr<TCPSocket> CreateSocket() {
+ auto socket = std::make_unique<TCPSocket>(&profile_, FAKE_ID);
+ socket->SetStoragePartitionForTest(&partition_);
+ return socket;
}
- int Write(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback,
- const net::NetworkTrafficAnnotationTag& tag) override {
- return Write(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)), tag);
+ std::unique_ptr<TCPSocket> CreateAndConnectSocketWithAddress(
+ const net::IPEndPoint& ip_end_point) {
+ auto socket = CreateSocket();
+ net::AddressList address(ip_end_point);
+ net::TestCompletionCallback callback;
+ socket->Connect(address, callback.callback());
+ EXPECT_EQ(net::OK, callback.WaitForResult());
+ return socket;
}
- MOCK_METHOD3(Read, int(net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback));
- MOCK_METHOD4(Write,
- int(net::IOBuffer* buf,
- int buf_len,
- const net::CompletionCallback& callback,
- const net::NetworkTrafficAnnotationTag&));
- MOCK_METHOD2(SetKeepAlive, bool(bool enable, int delay));
- MOCK_METHOD1(SetNoDelay, bool(bool no_delay));
- bool IsConnected() const override {
- return true;
+ std::unique_ptr<TCPSocket> CreateAndConnectSocket() {
+ net::IPEndPoint ip_end_point(net::IPAddress::IPv4Localhost(), 1234);
+ return CreateAndConnectSocketWithAddress(ip_end_point);
}
- private:
- DISALLOW_COPY_AND_ASSIGN(MockTCPSocket);
-};
+ // Reads data from |socket| and compares it with |expected_data|.
+ void ReadData(Socket* socket, const std::string& expected_data) {
+ std::string received_data;
+ const int count = 512;
+ while (true) {
+ base::RunLoop run_loop;
+ int net_error = net::ERR_FAILED;
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_error = result;
+ EXPECT_FALSE(socket_destroying);
+ if (result > 0)
+ received_data.append(io_buffer->data(), result);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_error <= 0)
+ break;
+ }
+ EXPECT_EQ(expected_data, received_data);
+ }
-class MockTCPServerSocket : public net::TCPServerSocket {
- public:
- MockTCPServerSocket() : net::TCPServerSocket(NULL, net::NetLogSource()) {}
- MOCK_METHOD2(Listen, int(const net::IPEndPoint& address, int backlog));
- MOCK_METHOD2(Accept,
- int(std::unique_ptr<net::StreamSocket>* socket,
- const net::CompletionCallback& callback));
+ protected:
+ // extensions::ExtensionServiceTestBase implementation.
+ void SetUp() override { InitializeEmptyExtensionService(); }
+
+ void Initialize() {
+ url_request_context_.Init();
+ network_context_ = std::make_unique<network::NetworkContext>(
+ nullptr, mojo::MakeRequest(&network_context_ptr_),
+ &url_request_context_);
+ partition_.set_network_context(network_context_ptr_.get());
+ }
+
+ net::TestURLRequestContext url_request_context_;
private:
- DISALLOW_COPY_AND_ASSIGN(MockTCPServerSocket);
+ TestingProfile profile_;
+ content::TestStoragePartition partition_;
+ std::unique_ptr<network::NetworkContext> network_context_;
+ network::mojom::NetworkContextPtr network_context_ptr_;
};
-class CompleteHandler {
+} // namespace
+
+class TCPSocketUnitTest : public TCPSocketUnitTestBase,
+ public ::testing::WithParamInterface<net::IoMode> {
public:
- CompleteHandler() {}
- MOCK_METHOD1(OnComplete, void(int result_code));
- MOCK_METHOD3(OnReadComplete,
- void(int result_code,
- scoped_refptr<net::IOBuffer> io_buffer,
- bool socket_destroying));
-
- // MOCK_METHOD cannot mock a scoped_ptr argument.
- MOCK_METHOD2(OnAcceptMock, void(int, net::TCPClientSocket*));
- void OnAccept(int count, std::unique_ptr<net::TCPClientSocket> socket) {
- OnAcceptMock(count, socket.get());
+ TCPSocketUnitTest() : TCPSocketUnitTestBase() {
+ mock_client_socket_factory_.set_enable_read_if_ready(true);
+ url_request_context_.set_client_socket_factory(
+ &mock_client_socket_factory_);
+ Initialize();
+ }
+ ~TCPSocketUnitTest() override {}
+
+ net::MockClientSocketFactory* mock_client_socket_factory() {
+ return &mock_client_socket_factory_;
}
private:
- DISALLOW_COPY_AND_ASSIGN(CompleteHandler);
+ net::MockClientSocketFactory mock_client_socket_factory_;
};
-const char FAKE_ID[] = "abcdefghijklmnopqrst";
+INSTANTIATE_TEST_CASE_P(/* no prefix */,
+ TCPSocketUnitTest,
+ testing::Values(net::SYNCHRONOUS, net::ASYNC));
+
+TEST_F(TCPSocketUnitTest, SocketConnectError) {
+ net::IPEndPoint ip_end_point(net::IPAddress::IPv4Localhost(), 1234);
+ net::StaticSocketDataProvider data_provider((base::span<net::MockRead>()),
+ base::span<net::MockWrite>());
+ data_provider.set_connect_data(
+ net::MockConnect(net::ASYNC, net::ERR_FAILED, ip_end_point));
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateSocket();
+
+ net::AddressList address(ip_end_point);
+ net::TestCompletionCallback callback;
+ socket->Connect(address, callback.callback());
+ EXPECT_EQ(net::ERR_FAILED, callback.WaitForResult());
+}
+
+TEST_P(TCPSocketUnitTest, SocketConnectAfterDisconnect) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {net::MockRead(io_mode, net::OK)};
+ net::StaticSocketDataProvider data_provider1(kReads,
+ base::span<net::MockWrite>());
+ net::StaticSocketDataProvider data_provider2(kReads,
+ base::span<net::MockWrite>());
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider1);
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider2);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+ socket->Disconnect(false /* socket_destroying */);
+ net::TestCompletionCallback callback2;
+ net::IPEndPoint ip_end_point(net::IPAddress::IPv4Localhost(), 1234);
+ net::AddressList address(ip_end_point);
+ socket->Connect(address, callback2.callback());
+ EXPECT_EQ(net::OK, callback2.WaitForResult());
+
+ EXPECT_TRUE(data_provider1.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider1.AllWriteDataConsumed());
+ EXPECT_TRUE(data_provider2.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider2.AllWriteDataConsumed());
+}
+
+TEST_F(TCPSocketUnitTest, DestroyWhileReadPending) {
+ const net::MockRead kReads[] = {
+ net::MockRead(net::SYNCHRONOUS, net::ERR_IO_PENDING)};
+ net::StaticSocketDataProvider data_provider(kReads,
+ base::span<net::MockWrite>());
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ int net_result = net::ERR_FAILED;
+ base::RunLoop run_loop;
+ int count = 1;
+ // Read one byte, and it should be pending.
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_result = result;
+ // |socket_destroying| should correctly denote that this
+ // read callback is invoked through the destructor of
+ // TCPSocket.
+ EXPECT_TRUE(socket_destroying);
+ run_loop.Quit();
+ }));
+ // Destroy socket.
+ socket = nullptr;
+ // Wait for read callback.
+ run_loop.Run();
+ EXPECT_EQ(net::ERR_CONNECTION_CLOSED, net_result);
+}
-TEST(SocketTest, TestTCPSocketRead) {
- net::AddressList address_list;
- std::unique_ptr<MockTCPSocket> tcp_client_socket(
- new MockTCPSocket(address_list));
- CompleteHandler handler;
+TEST_P(TCPSocketUnitTest, Read) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(io_mode, kTestMsg, kTestMsgLength),
+ net::MockRead(io_mode, net::OK)};
+ net::StaticSocketDataProvider data_provider(kReads,
+ base::span<net::MockWrite>());
- EXPECT_CALL(*tcp_client_socket, Read(_, _, _))
- .Times(1);
- EXPECT_CALL(handler, OnReadComplete(_, _, _)).Times(1);
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ ReadData(socket.get(), kTestMsg);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+}
+
+// Tests the case where a message is split over two separate socket reads.
+TEST_P(TCPSocketUnitTest, SocketMultipleRead) {
+ const char kFirstHalfTestMsg[] = "abcde";
+ const char kSecondHalfTestMsg[] = "fghij";
+ EXPECT_EQ(kTestMsg, std::string(kFirstHalfTestMsg) + kSecondHalfTestMsg);
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(io_mode, kFirstHalfTestMsg, strlen(kFirstHalfTestMsg)),
+ net::MockRead(io_mode, kSecondHalfTestMsg, strlen(kSecondHalfTestMsg)),
+ net::MockRead(io_mode, net::OK)};
+ net::StaticSocketDataProvider data_provider(kReads,
+ base::span<net::MockWrite>());
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ ReadData(socket.get(), kTestMsg);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+}
+
+// Tests the case where read size is smaller than the actual message.
+TEST_P(TCPSocketUnitTest, SocketPartialRead) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(io_mode, kTestMsg, kTestMsgLength),
+ net::MockRead(io_mode, net::OK)};
+ net::StaticSocketDataProvider data_provider(kReads,
+ base::span<net::MockWrite>());
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ int count = 1;
+ std::string received_data;
+ while (true) {
+ int net_result = net::ERR_FAILED;
+ base::RunLoop run_loop;
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_result = result;
+ EXPECT_FALSE(socket_destroying);
+ if (result > 0)
+ received_data.append(io_buffer->data(), result);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_result <= 0)
+ break;
+ // Double the read size in the next iteration.
+ count *= 2;
+ }
+ EXPECT_EQ(kTestMsg, received_data);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+}
- std::unique_ptr<TCPSocket> socket(TCPSocket::CreateSocketForTesting(
- std::move(tcp_client_socket), FAKE_ID, true));
+TEST_P(TCPSocketUnitTest, ReadError) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(io_mode, kTestMsg, kTestMsgLength),
+ net::MockRead(io_mode, net::ERR_INSUFFICIENT_RESOURCES)};
+ net::StaticSocketDataProvider data_provider(kReads,
+ base::span<net::MockWrite>());
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
const int count = 512;
- socket->Read(count, base::Bind(&CompleteHandler::OnReadComplete,
- base::Unretained(&handler)));
+ int net_error = net::OK;
+ while (true) {
+ base::RunLoop run_loop;
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_error = result;
+ EXPECT_FALSE(socket_destroying);
+ if (result <= 0) {
+ EXPECT_FALSE(socket->IsConnected());
+ EXPECT_EQ(nullptr, io_buffer);
+ } else {
+ EXPECT_TRUE(socket->IsConnected());
+ }
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_error <= 0)
+ break;
+ }
+ // Note that TCPSocket only detects that receive pipe is broken and propagates
+ // it as 0 byte read. It doesn't know the specific net error code. To know the
+ // specific net error code, it needs to register itself as a
+ // network::mojom::SocketObserver. However, that gets tricky because of two
+ // separate mojo pipes.
+ EXPECT_EQ(0, net_error);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
}
-TEST(SocketTest, TestTCPSocketWrite) {
- net::AddressList address_list;
- std::unique_ptr<MockTCPSocket> tcp_client_socket(
- new MockTCPSocket(address_list));
- CompleteHandler handler;
-
- net::CompletionCallback callback;
- EXPECT_CALL(*tcp_client_socket, Write(_, _, _, _))
- .Times(2)
- .WillRepeatedly(testing::DoAll(SaveArg<2>(&callback), Return(128)));
- EXPECT_CALL(handler, OnComplete(_))
- .Times(1);
-
- std::unique_ptr<TCPSocket> socket(TCPSocket::CreateSocketForTesting(
- std::move(tcp_client_socket), FAKE_ID, true));
-
- scoped_refptr<net::IOBufferWithSize> io_buffer(
- new net::IOBufferWithSize(256));
- socket->Write(io_buffer.get(), io_buffer->size(),
- base::Bind(&CompleteHandler::OnComplete, base::Unretained(&handler)));
+TEST_P(TCPSocketUnitTest, Write) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(net::SYNCHRONOUS, net::ERR_IO_PENDING)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(io_mode, kTestMsg, kTestMsgLength)};
+
+ net::StaticSocketDataProvider data_provider(kReads, kWrites);
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ net::TestCompletionCallback write_callback;
+ socket->Write(io_buffer.get(), kTestMsgLength, write_callback.callback());
+ EXPECT_EQ(kTestMsgLength, write_callback.WaitForResult());
}
-TEST(SocketTest, TestTCPSocketBlockedWrite) {
- net::AddressList address_list;
- std::unique_ptr<MockTCPSocket> tcp_client_socket(
- new MockTCPSocket(address_list));
- CompleteHandler handler;
-
- net::CompletionCallback callback;
- EXPECT_CALL(*tcp_client_socket, Write(_, _, _, _))
- .Times(2)
- .WillRepeatedly(
- testing::DoAll(SaveArg<2>(&callback), Return(net::ERR_IO_PENDING)));
-
- std::unique_ptr<TCPSocket> socket(TCPSocket::CreateSocketForTesting(
- std::move(tcp_client_socket), FAKE_ID, true));
-
- scoped_refptr<net::IOBufferWithSize> io_buffer(new net::IOBufferWithSize(42));
- socket->Write(io_buffer.get(), io_buffer->size(),
- base::Bind(&CompleteHandler::OnComplete, base::Unretained(&handler)));
-
- // Good. Original call came back unable to complete. Now pretend the socket
- // finished, and confirm that we passed the error back.
- EXPECT_CALL(handler, OnComplete(42))
- .Times(1);
- callback.Run(40);
- callback.Run(2);
+// Tests the case where a message is split over two separate socket writes.
+TEST_P(TCPSocketUnitTest, MultipleWrite) {
+ const char kFirstHalfTestMsg[] = "abcde";
+ const char kSecondHalfTestMsg[] = "fghij";
+ EXPECT_EQ(kTestMsg, std::string(kFirstHalfTestMsg) + kSecondHalfTestMsg);
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(net::SYNCHRONOUS, net::ERR_IO_PENDING)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(io_mode, kFirstHalfTestMsg, strlen(kFirstHalfTestMsg)),
+ net::MockWrite(io_mode, kSecondHalfTestMsg, strlen(kSecondHalfTestMsg))};
+
+ net::StaticSocketDataProvider data_provider(kReads, kWrites);
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ int num_bytes_written = 0;
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ auto drainable_io_buffer = base::MakeRefCounted<net::DrainableIOBuffer>(
+ io_buffer.get(), kTestMsgLength);
+ while (num_bytes_written < kTestMsgLength) {
+ net::TestCompletionCallback write_callback;
+ socket->Write(drainable_io_buffer.get(), kTestMsgLength - num_bytes_written,
+ write_callback.callback());
+ int result = write_callback.WaitForResult();
+ ASSERT_GT(result, net::OK);
+ drainable_io_buffer->DidConsume(result);
+ num_bytes_written += result;
+ // Flushes the write.
+ base::RunLoop().RunUntilIdle();
+ }
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
}
-TEST(SocketTest, TestTCPSocketBlockedWriteReentry) {
- net::AddressList address_list;
- std::unique_ptr<MockTCPSocket> tcp_client_socket(
- new MockTCPSocket(address_list));
- CompleteHandler handlers[5];
-
- net::CompletionCallback callback;
- EXPECT_CALL(*tcp_client_socket, Write(_, _, _, _))
- .Times(5)
- .WillRepeatedly(
- testing::DoAll(SaveArg<2>(&callback), Return(net::ERR_IO_PENDING)));
-
- std::unique_ptr<TCPSocket> socket(TCPSocket::CreateSocketForTesting(
- std::move(tcp_client_socket), FAKE_ID, true));
-
- scoped_refptr<net::IOBufferWithSize> io_buffers[5];
- int i;
- for (i = 0; i < 5; i++) {
- io_buffers[i] = new net::IOBufferWithSize(128 + i * 50);
- scoped_refptr<net::IOBufferWithSize> io_buffer1(
- new net::IOBufferWithSize(42));
- socket->Write(io_buffers[i].get(), io_buffers[i]->size(),
- base::Bind(&CompleteHandler::OnComplete,
- base::Unretained(&handlers[i])));
-
- EXPECT_CALL(handlers[i], OnComplete(io_buffers[i]->size()))
- .Times(1);
+TEST_P(TCPSocketUnitTest, PartialWrite) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(net::SYNCHRONOUS, net::ERR_IO_PENDING)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(io_mode, "a", 1), net::MockWrite(io_mode, "bc", 2),
+ net::MockWrite(io_mode, "defg", 4), net::MockWrite(io_mode, "hij", 3)};
+
+ net::StaticSocketDataProvider data_provider(kReads, kWrites);
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ // Start with writing one byte, and double that in the next iteration.
+ int num_bytes_to_write = 1;
+ int num_bytes_written = 0;
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ auto drainable_io_buffer = base::MakeRefCounted<net::DrainableIOBuffer>(
+ io_buffer.get(), kTestMsgLength);
+ while (num_bytes_written < kTestMsgLength) {
+ net::TestCompletionCallback write_callback;
+ socket->Write(
+ drainable_io_buffer.get(),
+ std::max(kTestMsgLength - num_bytes_written, num_bytes_to_write),
+ write_callback.callback());
+ int result = write_callback.WaitForResult();
+ ASSERT_GT(result, net::OK);
+ drainable_io_buffer->DidConsume(result);
+ num_bytes_written += result;
+ num_bytes_to_write *= 2;
+ // Flushes the write.
+ base::RunLoop().RunUntilIdle();
}
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+}
- for (i = 0; i < 5; i++) {
- callback.Run(128 + i * 50);
+TEST_P(TCPSocketUnitTest, WriteError) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(net::SYNCHRONOUS, net::ERR_IO_PENDING)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(io_mode, net::ERR_INSUFFICIENT_RESOURCES)};
+
+ net::StaticSocketDataProvider data_provider(kReads, kWrites);
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+
+ // Mojo data pipe might buffer some write data, so continue writing until the
+ // write error is received.
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ int net_error = net::OK;
+ while (true) {
+ base::RunLoop run_loop;
+ socket->Write(io_buffer.get(), kTestMsgLength,
+ base::BindLambdaForTesting([&](int result) {
+ EXPECT_EQ(result > 0, socket->IsConnected());
+ net_error = result;
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_error <= 0)
+ break;
}
+ // Note that TCPSocket only detects that send pipe is broken and propagates
+ // it as a net::ERR_FAILED. It doesn't know the specific net error code. To do
+ // that, it needs to register itself as a network::mojom::SocketObserver.
+ EXPECT_EQ(net::ERR_FAILED, net_error);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
}
-TEST(SocketTest, TestTCPSocketSetNoDelay) {
- net::AddressList address_list;
- std::unique_ptr<MockTCPSocket> tcp_client_socket(
- new MockTCPSocket(address_list));
+namespace {
- bool no_delay = false;
- {
- testing::InSequence dummy;
- EXPECT_CALL(*tcp_client_socket, SetNoDelay(_))
- .WillOnce(testing::DoAll(SaveArg<0>(&no_delay), Return(true)));
- EXPECT_CALL(*tcp_client_socket, SetNoDelay(_))
- .WillOnce(testing::DoAll(SaveArg<0>(&no_delay), Return(false)));
+class ExtensionsMockClientSocket : public net::MockTCPClientSocket {
+ public:
+ ExtensionsMockClientSocket(net::SocketDataProvider* provider, bool success)
+ : MockTCPClientSocket(
+ net::AddressList(
+ net::IPEndPoint(net::IPAddress::IPv4Localhost(), 1234)),
+ nullptr /* netlog */,
+ provider),
+ success_(success) {
+ this->set_enable_read_if_ready(true);
}
+ ~ExtensionsMockClientSocket() override {}
- std::unique_ptr<TCPSocket> socket(
- TCPSocket::CreateSocketForTesting(std::move(tcp_client_socket), FAKE_ID));
+ bool SetNoDelay(bool no_delay) override { return success_; }
+ bool SetKeepAlive(bool enable, int delay) override { return success_; }
- EXPECT_FALSE(no_delay);
- int result = socket->SetNoDelay(true);
- EXPECT_TRUE(result);
- EXPECT_TRUE(no_delay);
+ private:
+ // Whether to return success for SetNoDelay() and SetKeepAlive().
+ const bool success_;
- result = socket->SetNoDelay(false);
- EXPECT_FALSE(result);
- EXPECT_FALSE(no_delay);
-}
+ DISALLOW_COPY_AND_ASSIGN(ExtensionsMockClientSocket);
+};
-TEST(SocketTest, TestTCPSocketSetKeepAlive) {
- net::AddressList address_list;
- std::unique_ptr<MockTCPSocket> tcp_client_socket(
- new MockTCPSocket(address_list));
+static const net::MockRead kMockReads[] = {net::MockRead(net::ASYNC, net::OK)};
- bool enable = false;
- int delay = 0;
- {
- testing::InSequence dummy;
- EXPECT_CALL(*tcp_client_socket, SetKeepAlive(_, _))
- .WillOnce(testing::DoAll(SaveArg<0>(&enable), SaveArg<1>(&delay),
- Return(true)));
- EXPECT_CALL(*tcp_client_socket, SetKeepAlive(_, _))
- .WillOnce(testing::DoAll(SaveArg<0>(&enable), SaveArg<1>(&delay),
- Return(false)));
+// A ClientSocketFactory to create sockets that simulate SetNoDelay and
+// SetKeepAlive success and failures.
+class TestSocketFactory : public net::ClientSocketFactory {
+ public:
+ explicit TestSocketFactory(bool success) : success_(success) {}
+ ~TestSocketFactory() override = default;
+
+ std::unique_ptr<net::DatagramClientSocket> CreateDatagramClientSocket(
+ net::DatagramSocket::BindType,
+ net::NetLog*,
+ const net::NetLogSource&) override {
+ NOTIMPLEMENTED();
+ return nullptr;
+ }
+ std::unique_ptr<net::TransportClientSocket> CreateTransportClientSocket(
+ const net::AddressList&,
+ std::unique_ptr<net::SocketPerformanceWatcher>,
+ net::NetLog*,
+ const net::NetLogSource&) override {
+ providers_.push_back(std::make_unique<net::StaticSocketDataProvider>(
+ kMockReads, base::span<net::MockWrite>()));
+ return std::make_unique<ExtensionsMockClientSocket>(providers_.back().get(),
+ success_);
+ }
+ std::unique_ptr<net::SSLClientSocket> CreateSSLClientSocket(
+ std::unique_ptr<net::ClientSocketHandle>,
+ const net::HostPortPair&,
+ const net::SSLConfig&,
+ const net::SSLClientSocketContext&) override {
+ NOTIMPLEMENTED();
+ return std::unique_ptr<net::SSLClientSocket>();
+ }
+ std::unique_ptr<net::ProxyClientSocket> CreateProxyClientSocket(
+ std::unique_ptr<net::ClientSocketHandle> transport_socket,
+ const std::string& user_agent,
+ const net::HostPortPair& endpoint,
+ net::HttpAuthController* http_auth_controller,
+ bool tunnel,
+ bool using_spdy,
+ net::NextProto negotiated_protocol,
+ bool is_https_proxy,
+ const net::NetworkTrafficAnnotationTag& traffic_annotation) override {
+ NOTIMPLEMENTED();
+ return nullptr;
+ }
+ void ClearSSLSessionCache() override { NOTIMPLEMENTED(); }
+
+ private:
+ std::vector<std::unique_ptr<net::StaticSocketDataProvider>> providers_;
+ // Whether to return success for net::TransportClientSocket::SetNoDelay() and
+ // SetKeepAlive().
+ const bool success_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestSocketFactory);
+};
+
+} // namespace
+
+class TCPSocketSettingsTest : public TCPSocketUnitTestBase,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ TCPSocketSettingsTest()
+ : TCPSocketUnitTestBase(), client_socket_factory_(GetParam()) {
+ url_request_context_.set_client_socket_factory(&client_socket_factory_);
+ Initialize();
}
+ ~TCPSocketSettingsTest() override {}
- std::unique_ptr<TCPSocket> socket(
- TCPSocket::CreateSocketForTesting(std::move(tcp_client_socket), FAKE_ID));
+ private:
+ TestSocketFactory client_socket_factory_;
+};
- EXPECT_FALSE(enable);
- int result = socket->SetKeepAlive(true, 4500);
- EXPECT_TRUE(result);
- EXPECT_TRUE(enable);
- EXPECT_EQ(4500, delay);
+INSTANTIATE_TEST_CASE_P(/* no prefix */,
+ TCPSocketSettingsTest,
+ testing::Bool());
- result = socket->SetKeepAlive(false, 0);
- EXPECT_FALSE(result);
- EXPECT_FALSE(enable);
- EXPECT_EQ(0, delay);
+TEST_P(TCPSocketSettingsTest, SetNoDelay) {
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+ bool expected_success = GetParam();
+ {
+ base::RunLoop run_loop;
+ socket->SetNoDelay(true, base::BindLambdaForTesting([&](bool success) {
+ EXPECT_EQ(expected_success, success);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ }
+
+ {
+ base::RunLoop run_loop;
+ socket->SetNoDelay(false, base::BindLambdaForTesting([&](bool success) {
+ EXPECT_EQ(expected_success, success);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ }
}
-TEST(SocketTest, TestTCPServerSocketListenAccept) {
- std::unique_ptr<MockTCPServerSocket> tcp_server_socket(
- new MockTCPServerSocket());
- CompleteHandler handler;
+TEST_P(TCPSocketSettingsTest, SetKeepAlive) {
+ std::unique_ptr<TCPSocket> socket = CreateAndConnectSocket();
+ bool expected_success = GetParam();
+ {
+ base::RunLoop run_loop;
+ socket->SetKeepAlive(true /* enable */, 123 /* delay */,
+ base::BindLambdaForTesting([&](bool success) {
+ EXPECT_EQ(expected_success, success);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ }
- EXPECT_CALL(*tcp_server_socket, Accept(_, _)).Times(1);
- EXPECT_CALL(*tcp_server_socket, Listen(_, _)).Times(1);
+ {
+ base::RunLoop run_loop;
+ socket->SetKeepAlive(false /* enable */, 123 /* delay */,
+ base::BindLambdaForTesting([&](bool success) {
+ EXPECT_EQ(expected_success, success);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ }
+}
+
+class TCPSocketServerTest : public TCPSocketUnitTestBase {
+ public:
+ TCPSocketServerTest() : TCPSocketUnitTestBase() { Initialize(); }
+ ~TCPSocketServerTest() override {}
- std::unique_ptr<TCPSocket> socket(TCPSocket::CreateServerSocketForTesting(
- std::move(tcp_server_socket), FAKE_ID));
+ private:
+ net::MockClientSocketFactory mock_client_socket_factory_;
+};
- EXPECT_CALL(handler, OnAcceptMock(_, _));
+TEST_F(TCPSocketServerTest, ListenAccept) {
+ // Create a server socket.
+ std::unique_ptr<TCPSocket> socket = CreateSocket();
+ net::TestCompletionCallback callback;
+ base::RunLoop run_loop;
+ socket->Listen(
+ "127.0.0.1", 0 /* port */, 1 /* backlog */,
+ base::BindLambdaForTesting([&](int result, const std::string& error_msg) {
+ EXPECT_EQ(net::OK, result);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ net::IPEndPoint server_addr;
+ EXPECT_TRUE(socket->GetLocalAddress(&server_addr));
+
+ base::RunLoop accept_run_loop;
+ net::IPEndPoint accept_client_addr;
+ socket->Accept(base::BindLambdaForTesting(
+ [&](int result, network::mojom::TCPConnectedSocketPtr accepted_socket,
+ const base::Optional<net::IPEndPoint>& remote_addr,
+ mojo::ScopedDataPipeConsumerHandle receive_handle,
+ mojo::ScopedDataPipeProducerHandle send_handle) {
+ EXPECT_EQ(net::OK, result);
+ accept_client_addr = remote_addr.value();
+ accept_run_loop.Quit();
+ }));
+
+ // Create a client socket to talk to the server socket.
+ auto client_socket = CreateAndConnectSocketWithAddress(server_addr);
+ accept_run_loop.Run();
+
+ net::IPEndPoint peer_addr;
+ EXPECT_TRUE(client_socket->GetPeerAddress(&peer_addr));
+ net::IPEndPoint client_addr;
+ EXPECT_TRUE(client_socket->GetLocalAddress(&client_addr));
+ EXPECT_EQ(server_addr, peer_addr);
+ EXPECT_EQ(client_addr, accept_client_addr);
+}
- std::string err_msg;
- EXPECT_EQ(net::OK, socket->Listen("127.0.0.1", 9999, 10, &err_msg));
- socket->Accept(base::Bind(&CompleteHandler::OnAccept,
- base::Unretained(&handler)));
+TEST_F(TCPSocketServerTest, ReadAndWrite) {
+ // Create a server socket.
+ std::unique_ptr<TCPSocket> socket = CreateSocket();
+ net::TestCompletionCallback callback;
+ base::RunLoop run_loop;
+ socket->Listen(
+ "127.0.0.1", 0 /* port */, 1 /* backlog */,
+ base::BindLambdaForTesting([&](int result, const std::string& error_msg) {
+ EXPECT_EQ(net::OK, result);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ net::IPEndPoint server_addr;
+ EXPECT_TRUE(socket->GetLocalAddress(&server_addr));
+
+ base::RunLoop accept_run_loop;
+ std::unique_ptr<TCPSocket> accepted_socket;
+
+ socket->Accept(base::BindLambdaForTesting(
+ [&](int result, network::mojom::TCPConnectedSocketPtr connected_socket,
+ const base::Optional<net::IPEndPoint>& remote_addr,
+ mojo::ScopedDataPipeConsumerHandle receive_handle,
+ mojo::ScopedDataPipeProducerHandle send_handle) {
+ EXPECT_EQ(net::OK, result);
+ accepted_socket = std::make_unique<TCPSocket>(
+ std::move(connected_socket), std::move(receive_handle),
+ std::move(send_handle), remote_addr, FAKE_ID);
+ accept_run_loop.Quit();
+ }));
+
+ // Create a client socket to talk to the server socket.
+ auto client_socket = CreateAndConnectSocketWithAddress(server_addr);
+ net::TestCompletionCallback connect_callback;
+ accept_run_loop.Run();
+
+ // Send data from the client to the server.
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ net::TestCompletionCallback write_callback;
+ client_socket->Write(io_buffer.get(), kTestMsgLength,
+ write_callback.callback());
+ EXPECT_EQ(kTestMsgLength, write_callback.WaitForResult());
+
+ std::string received_contents;
+ while (received_contents.size() < kTestMsgLength) {
+ base::RunLoop run_loop;
+ accepted_socket->Read(
+ kTestMsgLength,
+ base::BindLambdaForTesting([&](int result,
+ scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ ASSERT_GT(result, 0);
+ EXPECT_FALSE(socket_destroying);
+ received_contents.append(std::string(io_buffer->data(), result));
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ }
+ EXPECT_EQ(kTestMsg, received_contents);
+
+ // Send data from the server to the client.
+ net::TestCompletionCallback write_callback2;
+ accepted_socket->Write(io_buffer.get(), kTestMsgLength,
+ write_callback2.callback());
+ EXPECT_EQ(kTestMsgLength, write_callback2.WaitForResult());
+
+ std::string sent_contents;
+ while (sent_contents.size() < kTestMsgLength) {
+ base::RunLoop run_loop;
+ client_socket->Read(
+ kTestMsgLength,
+ base::BindLambdaForTesting([&](int result,
+ scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ ASSERT_GT(result, 0);
+ EXPECT_FALSE(socket_destroying);
+ sent_contents.append(std::string(io_buffer->data(), result));
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ }
+ EXPECT_EQ(kTestMsg, sent_contents);
}
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/socket/tls_socket_unittest.cc b/chromium/chrome/browser/extensions/api/socket/tls_socket_unittest.cc
index 678b630744e..16fa23874e7 100644
--- a/chromium/chrome/browser/extensions/api/socket/tls_socket_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/socket/tls_socket_unittest.cc
@@ -2,372 +2,488 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <stddef.h>
-#include <stdint.h>
-
#include <memory>
#include <utility>
-#include "base/callback_helpers.h"
-#include "base/containers/circular_deque.h"
#include "base/macros.h"
-#include "base/strings/string_piece.h"
+#include "base/test/bind_test_util.h"
+#include "chrome/browser/extensions/extension_service_test_base.h"
+#include "chrome/test/base/testing_profile.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/test/test_storage_partition.h"
#include "extensions/browser/api/socket/tls_socket.h"
#include "net/base/address_list.h"
#include "net/base/completion_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
-#include "net/base/rand_callback.h"
-#include "net/log/net_log_source.h"
-#include "net/log/net_log_with_source.h"
-#include "net/socket/next_proto.h"
-#include "net/socket/socket_tag.h"
-#include "net/socket/ssl_client_socket.h"
-#include "net/socket/tcp_client_socket.h"
-#include "net/traffic_annotation/network_traffic_annotation.h"
-#include "testing/gmock/include/gmock/gmock.h"
-
-using testing::_;
-using testing::DoAll;
-using testing::Invoke;
-using testing::Gt;
-using testing::Return;
-using testing::SaveArg;
-using testing::WithArgs;
-using base::StringPiece;
+#include "net/base/test_completion_callback.h"
+#include "net/socket/socket_test_util.h"
+#include "net/url_request/url_request_test_util.h"
+#include "services/network/network_context.h"
+#include "services/network/public/mojom/network_context.mojom.h"
namespace extensions {
-class MockSSLClientSocket : public net::SSLClientSocket {
+namespace {
+
+const char kTestMsg[] = "abcdefghij";
+const int kTestMsgLength = strlen(kTestMsg);
+
+const char FAKE_ID[] = "abcdefghijklmnopqrst";
+
+class TLSSocketTestBase : public extensions::ExtensionServiceTestBase {
public:
- MockSSLClientSocket() {}
- int Read(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback) override {
- return Read(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)));
+ TLSSocketTestBase() : url_request_context_(true) {}
+ ~TLSSocketTestBase() override {}
+
+ // Creates a TCP socket.
+ std::unique_ptr<TCPSocket> CreateTCPSocket() {
+ auto socket = std::make_unique<TCPSocket>(&profile_, FAKE_ID);
+ socket->SetStoragePartitionForTest(&partition_);
+ net::TestCompletionCallback connect_callback;
+ net::IPEndPoint ip_end_point(net::IPAddress::IPv4Localhost(), kPort);
+ socket->Connect(net::AddressList(ip_end_point),
+ connect_callback.callback());
+ if (net::OK != connect_callback.WaitForResult()) {
+ return nullptr;
+ }
+ return socket;
}
- int Write(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback,
- const net::NetworkTrafficAnnotationTag& tag) override {
- return Write(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)), tag);
+ // Create a TCP socket and upgrade it to TLS.
+ std::unique_ptr<TLSSocket> CreateSocket() {
+ auto socket = CreateTCPSocket();
+ if (!socket)
+ return nullptr;
+ base::RunLoop run_loop;
+ net::HostPortPair host_port_pair("example.com", kPort);
+ net::IPEndPoint local_addr;
+ net::IPEndPoint peer_addr;
+ if (!socket->GetLocalAddress(&local_addr) ||
+ !socket->GetPeerAddress(&peer_addr)) {
+ return nullptr;
+ }
+ std::unique_ptr<TLSSocket> tls_socket;
+ socket->UpgradeToTLS(
+ nullptr /* options */,
+ base::BindLambdaForTesting(
+ [&](int result, network::mojom::TLSClientSocketPtr tls_socket_ptr,
+ const net::IPEndPoint& local_addr,
+ const net::IPEndPoint& peer_addr,
+ mojo::ScopedDataPipeConsumerHandle receive_handle,
+ mojo::ScopedDataPipeProducerHandle send_handle) {
+ if (net::OK == result) {
+ tls_socket = std::make_unique<TLSSocket>(
+ std::move(tls_socket_ptr), local_addr, peer_addr,
+ std::move(receive_handle), std::move(send_handle), FAKE_ID);
+ }
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ return tls_socket;
}
- int Connect(net::CompletionOnceCallback callback) override {
- return Connect(base::AdaptCallbackForRepeating(std::move(callback)));
+ protected:
+ // extensions::ExtensionServiceTestBase implementation.
+ void SetUp() override { InitializeEmptyExtensionService(); }
+
+ void Initialize() {
+ url_request_context_.Init();
+ network_context_ = std::make_unique<network::NetworkContext>(
+ nullptr, mojo::MakeRequest(&network_context_ptr_),
+ &url_request_context_);
+ partition_.set_network_context(network_context_ptr_.get());
}
- MOCK_METHOD0(Disconnect, void());
- MOCK_METHOD3(Read,
- int(net::IOBuffer* buf,
- int buf_len,
- const net::CompletionCallback& callback));
- MOCK_METHOD4(Write,
- int(net::IOBuffer* buf,
- int buf_len,
- const net::CompletionCallback& callback,
- const net::NetworkTrafficAnnotationTag&));
- MOCK_METHOD1(SetReceiveBufferSize, int(int32_t));
- MOCK_METHOD1(SetSendBufferSize, int(int32_t));
- MOCK_METHOD1(Connect, int(const CompletionCallback&));
- MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
- MOCK_CONST_METHOD1(GetPeerAddress, int(net::IPEndPoint*));
- MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*));
- MOCK_CONST_METHOD0(NetLog, const net::NetLogWithSource&());
- MOCK_CONST_METHOD0(WasEverUsed, bool());
- MOCK_CONST_METHOD0(UsingTCPFastOpen, bool());
- MOCK_CONST_METHOD0(WasAlpnNegotiated, bool());
- MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto());
- MOCK_METHOD1(GetSSLInfo, bool(net::SSLInfo*));
- MOCK_CONST_METHOD1(GetConnectionAttempts, void(net::ConnectionAttempts*));
- MOCK_METHOD0(ClearConnectionAttempts, void());
- MOCK_METHOD1(AddConnectionAttempts, void(const net::ConnectionAttempts&));
- MOCK_CONST_METHOD0(GetTotalReceivedBytes, int64_t());
- MOCK_METHOD1(ApplySocketTag, void(const net::SocketTag&));
- MOCK_METHOD5(ExportKeyingMaterial,
- int(const StringPiece&,
- bool,
- const StringPiece&,
- unsigned char*,
- unsigned int));
- MOCK_CONST_METHOD1(GetSSLCertRequestInfo, void(net::SSLCertRequestInfo*));
- MOCK_CONST_METHOD0(GetUnverifiedServerCertificateChain,
- scoped_refptr<net::X509Certificate>());
- MOCK_CONST_METHOD0(GetChannelIDService, net::ChannelIDService*());
- MOCK_METHOD3(GetTokenBindingSignature,
- net::Error(crypto::ECPrivateKey*,
- net::TokenBindingType,
- std::vector<uint8_t>*));
- MOCK_CONST_METHOD0(GetChannelIDKey, crypto::ECPrivateKey*());
- bool IsConnected() const override { return true; }
+ net::TestURLRequestContext url_request_context_;
private:
- DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket);
+ static const int kPort = 1234;
+ TestingProfile profile_;
+ content::TestStoragePartition partition_;
+ std::unique_ptr<network::NetworkContext> network_context_;
+ network::mojom::NetworkContextPtr network_context_ptr_;
};
-class MockTCPSocket : public net::TCPClientSocket {
+} // namespace
+
+class TLSSocketTest : public TLSSocketTestBase,
+ public ::testing::WithParamInterface<net::IoMode> {
public:
- explicit MockTCPSocket(const net::AddressList& address_list)
- : net::TCPClientSocket(address_list, NULL, NULL, net::NetLogSource()) {}
-
- int Read(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback) override {
- return Read(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)));
+ TLSSocketTest() : TLSSocketTestBase() {
+ mock_client_socket_factory_.set_enable_read_if_ready(true);
+ url_request_context_.set_client_socket_factory(
+ &mock_client_socket_factory_);
+ Initialize();
}
+ ~TLSSocketTest() override {}
- int Write(net::IOBuffer* buffer,
- int bytes,
- net::CompletionOnceCallback callback,
- const net::NetworkTrafficAnnotationTag& tag) override {
- return Write(buffer, bytes,
- base::AdaptCallbackForRepeating(std::move(callback)), tag);
+ net::MockClientSocketFactory* mock_client_socket_factory() {
+ return &mock_client_socket_factory_;
}
- MOCK_METHOD3(Read,
- int(net::IOBuffer* buf,
- int buf_len,
- const net::CompletionCallback& callback));
- MOCK_METHOD4(Write,
- int(net::IOBuffer* buf,
- int buf_len,
- const net::CompletionCallback& callback,
- const net::NetworkTrafficAnnotationTag&));
- MOCK_METHOD2(SetKeepAlive, bool(bool enable, int delay));
- MOCK_METHOD1(SetNoDelay, bool(bool no_delay));
-
- bool IsConnected() const override { return true; }
-
private:
- DISALLOW_COPY_AND_ASSIGN(MockTCPSocket);
+ net::MockClientSocketFactory mock_client_socket_factory_;
};
-class CompleteHandler {
- public:
- CompleteHandler() {}
- MOCK_METHOD1(OnComplete, void(int result_code));
- MOCK_METHOD3(OnReadComplete,
- void(int result_code,
- scoped_refptr<net::IOBuffer> io_buffer,
- bool socket_destroying));
- MOCK_METHOD2(OnAccept, void(int, net::TCPClientSocket*));
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CompleteHandler);
-};
-
-class TLSSocketTest : public ::testing::Test {
- public:
- TLSSocketTest() {}
-
- void SetUp() override {
- net::AddressList address_list;
- // |ssl_socket_| is owned by |socket_|. TLSSocketTest keeps a pointer to
- // it to expect invocations from TLSSocket to |ssl_socket_|.
- std::unique_ptr<MockSSLClientSocket> ssl_sock(new MockSSLClientSocket);
- ssl_socket_ = ssl_sock.get();
- socket_.reset(new TLSSocket(std::move(ssl_sock), "test_extension_id"));
- EXPECT_CALL(*ssl_socket_, Disconnect()).Times(1);
- };
-
- void TearDown() override {
- ssl_socket_ = NULL;
- socket_.reset();
- };
-
- protected:
- MockSSLClientSocket* ssl_socket_;
- std::unique_ptr<TLSSocket> socket_;
-};
-
-// Verify that a Read() on TLSSocket will pass through into a Read() on
-// |ssl_socket_| and invoke its completion callback.
-TEST_F(TLSSocketTest, TestTLSSocketRead) {
- CompleteHandler handler;
-
- EXPECT_CALL(*ssl_socket_, Read(_, _, _)).Times(1);
- EXPECT_CALL(handler, OnReadComplete(_, _, _)).Times(1);
-
- const int count = 512;
- socket_->Read(
- count,
- base::Bind(&CompleteHandler::OnReadComplete, base::Unretained(&handler)));
+TEST_F(TLSSocketTest, DestroyWhileReadPending) {
+ const net::MockRead kReads[] = {net::MockRead(net::SYNCHRONOUS, net::OK, 1)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(net::ASYNC, kTestMsg, kTestMsgLength, 0)};
+ net::StaticSocketDataProvider data_provider(kReads, kWrites);
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ net::SSLSocketDataProvider ssl_socket(net::ASYNC, net::OK);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
+
+ std::unique_ptr<TLSSocket> socket = CreateSocket();
+
+ int net_result = net::ERR_FAILED;
+ base::RunLoop run_loop;
+ int count = 1;
+ // Read one byte, and it should be pending because it is blocked on the mock
+ // write.
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_result = result;
+ // |socket_destroying| should correctly denote that this
+ // read callback is invoked through the destructor of
+ // TLSSocket.
+ EXPECT_TRUE(socket_destroying);
+ run_loop.Quit();
+ }));
+ // Destroy socket.
+ socket = nullptr;
+ // Wait for read callback.
+ run_loop.Run();
+ EXPECT_EQ(net::ERR_CONNECTION_CLOSED, net_result);
}
-// Verify that a Write() on a TLSSocket will pass through to Write()
-// invocations on |ssl_socket_|, handling partial writes correctly, and calls
-// the completion callback correctly.
-TEST_F(TLSSocketTest, TestTLSSocketWrite) {
- CompleteHandler handler;
- net::CompletionCallback callback;
-
- EXPECT_CALL(*ssl_socket_, Write(_, _, _, _))
- .Times(2)
- .WillRepeatedly(DoAll(SaveArg<2>(&callback), Return(128)));
- EXPECT_CALL(handler, OnComplete(_)).Times(1);
-
- scoped_refptr<net::IOBufferWithSize> io_buffer(
- new net::IOBufferWithSize(256));
- socket_->Write(
- io_buffer.get(),
- io_buffer->size(),
- base::Bind(&CompleteHandler::OnComplete, base::Unretained(&handler)));
+// UpgradeToTLS() fails when there is a pending read.
+TEST_F(TLSSocketTest, UpgradeToTLSWhilePendingRead) {
+ const net::MockRead kReads[] = {
+ net::MockRead(net::ASYNC, net::ERR_IO_PENDING)};
+ net::StaticSocketDataProvider data_provider(kReads,
+ base::span<net::MockWrite>());
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ auto socket = CreateTCPSocket();
+ // This read will be pending when UpgradeToTLS() is called.
+ socket->Read(1 /* count */, base::DoNothing());
+ network::mojom::TLSClientSocketPtr tls_socket_ptr;
+ base::RunLoop run_loop;
+ socket->UpgradeToTLS(
+ nullptr /* options */,
+ base::BindLambdaForTesting(
+ [&](int result, network::mojom::TLSClientSocketPtr tls_socket_ptr,
+ const net::IPEndPoint& local_addr,
+ const net::IPEndPoint& peer_addr,
+ mojo::ScopedDataPipeConsumerHandle receive_handle,
+ mojo::ScopedDataPipeProducerHandle send_handle) {
+ EXPECT_EQ(net::ERR_FAILED, result);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
}
-// Simulate a blocked Write, and verify that, when simulating the Write going
-// through, the callback gets invoked.
-TEST_F(TLSSocketTest, TestTLSSocketBlockedWrite) {
- CompleteHandler handler;
- net::CompletionCallback callback;
-
- // Return ERR_IO_PENDING to say the Write()'s blocked. Save the |callback|
- // Write()'s passed.
- EXPECT_CALL(*ssl_socket_, Write(_, _, _, _))
- .Times(2)
- .WillRepeatedly(
- DoAll(SaveArg<2>(&callback), Return(net::ERR_IO_PENDING)));
-
- scoped_refptr<net::IOBufferWithSize> io_buffer(new net::IOBufferWithSize(42));
- socket_->Write(
- io_buffer.get(),
- io_buffer->size(),
- base::Bind(&CompleteHandler::OnComplete, base::Unretained(&handler)));
-
- // After the simulated asynchronous writes come back (via calls to
- // callback.Run()), hander's OnComplete() should get invoked with the total
- // amount written.
- EXPECT_CALL(handler, OnComplete(42)).Times(1);
- callback.Run(40);
- callback.Run(2);
+TEST_F(TLSSocketTest, UpgradeToTLSWithCustomOptions) {
+ // Mock data are not consumed. These are here so that net::StreamSocket::Read
+ // is always pending and blocked on the write. Otherwise, mock socket data
+ // will complains that there aren't any data to read.
+ const net::MockRead kReads[] = {
+ net::MockRead(net::ASYNC, kTestMsg, kTestMsgLength, 1),
+ net::MockRead(net::ASYNC, net::OK, 2)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(net::ASYNC, kTestMsg, kTestMsgLength, 0)};
+ net::SequencedSocketData data_provider(kReads, kWrites);
+ net::SSLSocketDataProvider ssl_socket(net::ASYNC, net::OK);
+ ssl_socket.expected_ssl_version_min = net::SSL_PROTOCOL_VERSION_TLS1_1;
+ ssl_socket.expected_ssl_version_max = net::SSL_PROTOCOL_VERSION_TLS1_2;
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
+
+ auto socket = CreateTCPSocket();
+ network::mojom::TLSClientSocketPtr tls_socket_ptr;
+ api::socket::SecureOptions options;
+ options.tls_version = std::make_unique<api::socket::TLSVersionConstraints>();
+ options.tls_version->min = std::make_unique<std::string>("tls1.1");
+ options.tls_version->max = std::make_unique<std::string>("tls1.2");
+ int net_error = net::ERR_FAILED;
+ base::RunLoop run_loop;
+ socket->UpgradeToTLS(
+ &options,
+ base::BindLambdaForTesting(
+ [&](int result, network::mojom::TLSClientSocketPtr tls_socket_ptr,
+ const net::IPEndPoint& local_addr,
+ const net::IPEndPoint& peer_addr,
+ mojo::ScopedDataPipeConsumerHandle receive_handle,
+ mojo::ScopedDataPipeProducerHandle send_handle) {
+ net_error = result;
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ EXPECT_EQ(net::OK, net_error);
+ EXPECT_TRUE(ssl_socket.ConnectDataConsumed());
}
-// Simulate multiple blocked Write()s.
-TEST_F(TLSSocketTest, TestTLSSocketBlockedWriteReentry) {
- const int kNumIOs = 5;
- CompleteHandler handlers[kNumIOs];
- net::CompletionCallback callback;
- scoped_refptr<net::IOBufferWithSize> io_buffers[kNumIOs];
-
- // The implementation of TLSSocket::Write() is inherited from
- // Socket::Write(), which implements an internal write queue that wraps
- // TLSSocket::WriteImpl(). Each call from TLSSocket::WriteImpl() will invoke
- // |ssl_socket_|'s Write() (mocked here). Save the |callback| (assume they
- // will all be equivalent), and return ERR_IO_PENDING, to indicate a blocked
- // request. The mocked SSLClientSocket::Write() will get one request per
- // TLSSocket::Write() request invoked on |socket_| below.
- EXPECT_CALL(*ssl_socket_, Write(_, _, _, _))
- .Times(kNumIOs)
- .WillRepeatedly(
- DoAll(SaveArg<2>(&callback), Return(net::ERR_IO_PENDING)));
-
- // Send out |kNuMIOs| requests, each with a different size.
- for (int i = 0; i < kNumIOs; i++) {
- io_buffers[i] = new net::IOBufferWithSize(128 + i * 50);
- socket_->Write(io_buffers[i].get(),
- io_buffers[i]->size(),
- base::Bind(&CompleteHandler::OnComplete,
- base::Unretained(&handlers[i])));
-
- // Set up expectations on all |kNumIOs| handlers.
- EXPECT_CALL(handlers[i], OnComplete(io_buffers[i]->size())).Times(1);
+INSTANTIATE_TEST_CASE_P(/* no prefix */,
+ TLSSocketTest,
+ testing::Values(net::SYNCHRONOUS, net::ASYNC));
+
+TEST_P(TLSSocketTest, ReadWrite) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(net::ASYNC, kTestMsg, kTestMsgLength, 1),
+ net::MockRead(io_mode, net::OK, 2)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(net::SYNCHRONOUS, kTestMsg, kTestMsgLength, 0)};
+ net::SequencedSocketData data_provider(kReads, kWrites);
+ net::SSLSocketDataProvider ssl_socket(io_mode, net::OK);
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
+ std::unique_ptr<TLSSocket> socket = CreateSocket();
+
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ net::TestCompletionCallback write_callback;
+ socket->Write(io_buffer.get(), kTestMsgLength, write_callback.callback());
+ EXPECT_EQ(kTestMsgLength, write_callback.WaitForResult());
+
+ std::string received_data;
+ int count = 512;
+ while (true) {
+ base::RunLoop run_loop;
+ int net_error = net::ERR_FAILED;
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_error = result;
+ EXPECT_FALSE(socket_destroying);
+ if (result > 0)
+ received_data.append(io_buffer->data(), result);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_error <= 0)
+ break;
}
+ EXPECT_EQ(kTestMsg, received_data);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+ EXPECT_TRUE(ssl_socket.ConnectDataConsumed());
+}
- // Finish each pending I/O. This should satisfy the expectations on the
- // handlers.
- for (int i = 0; i < kNumIOs; i++) {
- callback.Run(128 + i * 50);
+// Tests the case where read size is smaller than the actual message.
+TEST_P(TLSSocketTest, PartialRead) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(net::ASYNC, kTestMsg, kTestMsgLength, 1),
+ net::MockRead(io_mode, net::OK, 2)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(net::SYNCHRONOUS, kTestMsg, kTestMsgLength, 0)};
+ net::SequencedSocketData data_provider(kReads, kWrites);
+ net::SSLSocketDataProvider ssl_socket(io_mode, net::OK);
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
+ std::unique_ptr<TLSSocket> socket = CreateSocket();
+
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ net::TestCompletionCallback write_callback;
+ socket->Write(io_buffer.get(), kTestMsgLength, write_callback.callback());
+ EXPECT_EQ(kTestMsgLength, write_callback.WaitForResult());
+
+ int count = 1;
+ std::string received_data;
+ while (true) {
+ int net_result = net::ERR_FAILED;
+ base::RunLoop run_loop;
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_result = result;
+ EXPECT_FALSE(socket_destroying);
+ if (result > 0)
+ received_data.append(io_buffer->data(), result);
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_result <= 0)
+ break;
+ // Double the read size in the next iteration.
+ count *= 2;
}
+ EXPECT_EQ(kTestMsg, received_data);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+ EXPECT_TRUE(ssl_socket.ConnectDataConsumed());
}
-typedef std::pair<net::CompletionCallback, int> PendingCallback;
+TEST_P(TLSSocketTest, ReadError) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {
+ net::MockRead(net::ASYNC, net::ERR_INSUFFICIENT_RESOURCES, 1)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(net::SYNCHRONOUS, kTestMsg, kTestMsgLength, 0)};
+ net::SequencedSocketData data_provider(kReads, kWrites);
+ net::SSLSocketDataProvider ssl_socket(io_mode, net::OK);
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
-class CallbackList : public base::circular_deque<PendingCallback> {
- public:
- void append(const net::CompletionCallback& cb, int arg) {
- push_back(std::make_pair(cb, arg));
+ std::unique_ptr<TLSSocket> socket = CreateSocket();
+
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ net::TestCompletionCallback write_callback;
+ socket->Write(io_buffer.get(), kTestMsgLength, write_callback.callback());
+ EXPECT_EQ(kTestMsgLength, write_callback.WaitForResult());
+
+ const int count = 512;
+ int net_error = net::OK;
+ while (true) {
+ base::RunLoop run_loop;
+ socket->Read(count,
+ base::BindLambdaForTesting(
+ [&](int result, scoped_refptr<net::IOBuffer> io_buffer,
+ bool socket_destroying) {
+ net_error = result;
+ EXPECT_FALSE(socket_destroying);
+ if (result <= 0) {
+ EXPECT_FALSE(socket->IsConnected());
+ EXPECT_EQ(nullptr, io_buffer);
+ } else {
+ EXPECT_TRUE(socket->IsConnected());
+ }
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_error <= 0)
+ break;
}
-};
+ // Note that TLSSocket only detects that receive pipe is broken and propagates
+ // it as 0 byte read. It doesn't know the specific net error code. To know the
+ // specific net error code, it needs to register itself as a
+ // network::mojom::SocketObserver. However, that gets tricky because of two
+ // separate mojo pipes.
+ EXPECT_EQ(0, net_error);
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+ EXPECT_TRUE(ssl_socket.ConnectDataConsumed());
+}
-// Simulate Write()s above and below a SSLClientSocket size limit.
-TEST_F(TLSSocketTest, TestTLSSocketLargeWrites) {
- const int kSizeIncrement = 4096;
- const int kNumIncrements = 10;
- const int kFragmentIncrement = 4;
- const int kSizeLimit = kSizeIncrement * kFragmentIncrement;
- net::CompletionCallback callback;
- CompleteHandler handler;
- scoped_refptr<net::IOBufferWithSize> io_buffers[kNumIncrements];
- CallbackList pending_callbacks;
- size_t total_bytes_requested = 0;
- size_t total_bytes_written = 0;
-
- // Some implementations of SSLClientSocket may have write-size limits (e.g,
- // max 1 TLS record, which is 16k). This test mocks a size limit at
- // |kSizeIncrement| and calls Write() above and below that limit. It
- // simulates SSLClientSocket::Write() behavior in only writing up to the size
- // limit, requiring additional calls for the remaining data to be sent.
- // Socket::Write() (and supporting methods) execute the additional calls as
- // needed. This test verifies that this inherited implementation does
- // properly issue additional calls, and that the total amount returned from
- // all mocked SSLClientSocket::Write() calls is the same as originally
- // requested.
-
- // |ssl_socket_|'s Write() will write at most |kSizeLimit| bytes. The
- // inherited Socket::Write() will repeatedly call |ssl_socket_|'s Write()
- // until the entire original request is sent. Socket::Write() will queue any
- // additional write requests until the current request is complete. A
- // request is complete when the callback passed to Socket::WriteImpl() is
- // invoked with an argument equal to the original number of bytes requested
- // from Socket::Write(). If the callback is invoked with a smaller number,
- // Socket::WriteImpl() will get repeatedly invoked until the sum of the
- // callbacks' arguments is equal to the original requested amount.
- EXPECT_CALL(*ssl_socket_, Write(_, _, _, _))
- .WillRepeatedly(DoAll(
- WithArgs<2, 1>(Invoke(&pending_callbacks, &CallbackList::append)),
- Return(net::ERR_IO_PENDING)));
-
- // Observe what comes back from Socket::Write() here.
- EXPECT_CALL(handler, OnComplete(Gt(0))).Times(kNumIncrements);
-
- // Send out |kNumIncrements| requests, each with a different size. The
- // last request is the same size as the first, and the ones in the middle
- // are monotonically increasing from the first.
- for (int i = 0; i < kNumIncrements; i++) {
- const bool last = i == (kNumIncrements - 1);
- io_buffers[i] = new net::IOBufferWithSize(last ? kSizeIncrement
- : kSizeIncrement * (i + 1));
- total_bytes_requested += io_buffers[i]->size();
-
- // Invoke Socket::Write(). This will invoke |ssl_socket_|'s Write(), which
- // this test mocks out. That mocked Write() is in an asynchronous waiting
- // state until the passed callback (saved in the EXPECT_CALL for
- // |ssl_socket_|'s Write()) is invoked.
- socket_->Write(
- io_buffers[i].get(),
- io_buffers[i]->size(),
- base::Bind(&CompleteHandler::OnComplete, base::Unretained(&handler)));
+// Tests the case where a message is split over two separate socket writes.
+TEST_P(TLSSocketTest, MultipleWrite) {
+ const char kFirstHalfTestMsg[] = "abcde";
+ const char kSecondHalfTestMsg[] = "fghij";
+ EXPECT_EQ(kTestMsg, std::string(kFirstHalfTestMsg) + kSecondHalfTestMsg);
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {net::MockRead(net::ASYNC, net::OK, 2)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(io_mode, kFirstHalfTestMsg, strlen(kFirstHalfTestMsg), 0),
+ net::MockWrite(io_mode, kSecondHalfTestMsg, strlen(kSecondHalfTestMsg),
+ 1)};
+ net::SequencedSocketData data_provider(kReads, kWrites);
+ net::SSLSocketDataProvider ssl_socket(io_mode, net::OK);
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
+ std::unique_ptr<TLSSocket> socket = CreateSocket();
+
+ int num_bytes_written = 0;
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ auto drainable_io_buffer = base::MakeRefCounted<net::DrainableIOBuffer>(
+ io_buffer.get(), kTestMsgLength);
+ while (num_bytes_written < kTestMsgLength) {
+ net::TestCompletionCallback write_callback;
+ socket->Write(drainable_io_buffer.get(), kTestMsgLength - num_bytes_written,
+ write_callback.callback());
+ int result = write_callback.WaitForResult();
+ ASSERT_GT(result, net::OK);
+ drainable_io_buffer->DidConsume(result);
+ num_bytes_written += result;
+ // Flushes the write.
+ base::RunLoop().RunUntilIdle();
}
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+ EXPECT_TRUE(ssl_socket.ConnectDataConsumed());
+}
- // Invoke callbacks for pending I/Os. These can synchronously invoke more of
- // |ssl_socket_|'s Write() as needed. The callback checks how much is left
- // in the request, and then starts issuing any queued Socket::Write()
- // invocations.
- while (!pending_callbacks.empty()) {
- PendingCallback cb = pending_callbacks.front();
- pending_callbacks.pop_front();
-
- int amount_written_invocation = std::min(kSizeLimit, cb.second);
- total_bytes_written += amount_written_invocation;
- cb.first.Run(amount_written_invocation);
+TEST_P(TLSSocketTest, PartialWrite) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {net::MockRead(net::ASYNC, net::OK, 4)};
+ const net::MockWrite kWrites[] = {net::MockWrite(io_mode, "a", 1, 0),
+ net::MockWrite(io_mode, "bc", 2, 1),
+ net::MockWrite(io_mode, "defg", 4, 2),
+ net::MockWrite(io_mode, "hij", 3, 3)};
+
+ net::SequencedSocketData data_provider(kReads, kWrites);
+ net::SSLSocketDataProvider ssl_socket(io_mode, net::OK);
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ std::unique_ptr<TLSSocket> socket = CreateSocket();
+
+ // Start with writing one byte, and double that in the next iteration.
+ int num_bytes_to_write = 1;
+ int num_bytes_written = 0;
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ auto drainable_io_buffer = base::MakeRefCounted<net::DrainableIOBuffer>(
+ io_buffer.get(), kTestMsgLength);
+ while (num_bytes_written < kTestMsgLength) {
+ net::TestCompletionCallback write_callback;
+ socket->Write(
+ drainable_io_buffer.get(),
+ std::max(kTestMsgLength - num_bytes_written, num_bytes_to_write),
+ write_callback.callback());
+ int result = write_callback.WaitForResult();
+ ASSERT_GT(result, net::OK);
+ drainable_io_buffer->DidConsume(result);
+ num_bytes_written += result;
+ num_bytes_to_write *= 2;
+ // Flushes the write.
+ base::RunLoop().RunUntilIdle();
}
+ EXPECT_TRUE(data_provider.AllReadDataConsumed());
+ EXPECT_TRUE(data_provider.AllWriteDataConsumed());
+ EXPECT_TRUE(ssl_socket.ConnectDataConsumed());
+}
- ASSERT_EQ(total_bytes_requested, total_bytes_written)
- << "There should be exactly as many bytes written as originally "
- << "requested to Write().";
+TEST_P(TLSSocketTest, WriteError) {
+ net::IoMode io_mode = GetParam();
+ const net::MockRead kReads[] = {net::MockRead(net::ASYNC, net::OK, 1)};
+ const net::MockWrite kWrites[] = {
+ net::MockWrite(io_mode, net::ERR_INSUFFICIENT_RESOURCES, 0)};
+
+ net::SequencedSocketData data_provider(kReads, kWrites);
+ net::SSLSocketDataProvider ssl_socket(io_mode, net::OK);
+
+ mock_client_socket_factory()->AddSocketDataProvider(&data_provider);
+ mock_client_socket_factory()->AddSSLSocketDataProvider(&ssl_socket);
+ std::unique_ptr<TLSSocket> socket = CreateSocket();
+
+ // Mojo data pipe might buffer some write data, so continue writing until the
+ // write error is received.
+ auto io_buffer = base::MakeRefCounted<net::StringIOBuffer>(kTestMsg);
+ int net_error = net::OK;
+ while (true) {
+ base::RunLoop run_loop;
+ socket->Write(io_buffer.get(), kTestMsgLength,
+ base::BindLambdaForTesting([&](int result) {
+ if (result == net::ERR_FAILED)
+ EXPECT_FALSE(socket->IsConnected());
+ net_error = result;
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ if (net_error <= 0)
+ break;
+ }
+ // Note that TCPSocket only detects that send pipe is broken and propagates
+ // it as a net::ERR_FAILED. It doesn't know the specific net error code. To do
+ // that, it needs to register itself as a network::mojom::SocketObserver.
+ EXPECT_EQ(net::ERR_FAILED, net_error);
}
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/sync_file_system/DEPS b/chromium/chrome/browser/extensions/api/sync_file_system/DEPS
deleted file mode 100644
index 73bc109ad21..00000000000
--- a/chromium/chrome/browser/extensions/api/sync_file_system/DEPS
+++ /dev/null
@@ -1,5 +0,0 @@
-specific_include_rules = {
- "sync_file_system_browsertest\.cc": [
- "+components/drive"
- ],
-}
diff --git a/chromium/chrome/browser/extensions/api/sync_file_system/OWNERS b/chromium/chrome/browser/extensions/api/sync_file_system/OWNERS
index 9d970c731ce..89ed524015e 100644
--- a/chromium/chrome/browser/extensions/api/sync_file_system/OWNERS
+++ b/chromium/chrome/browser/extensions/api/sync_file_system/OWNERS
@@ -1,4 +1,5 @@
kinuko@chromium.org
+pwnall@chromium.org
tzik@chromium.org
# TEAM: storage-dev@chromium.org
diff --git a/chromium/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc b/chromium/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc
index 383b5c631be..233bfca0c7b 100644
--- a/chromium/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc
+++ b/chromium/chrome/browser/extensions/api/sync_file_system/sync_file_system_browsertest.cc
@@ -9,7 +9,7 @@
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/sequenced_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chrome/browser/apps/platform_apps/app_browsertest_util.h"
@@ -106,7 +106,7 @@ class SyncFileSystemTest : public extensions::PlatformAppBrowserTest,
// drive::FakeDriveService::ChangeObserver override.
void OnNewChangeAvailable() override {
- sync_engine()->OnNotificationReceived();
+ sync_engine()->OnNotificationTimerFired();
}
SyncFileSystemService* sync_file_system_service() {
diff --git a/chromium/chrome/browser/extensions/api/system_private/system_private_api.cc b/chromium/chrome/browser/extensions/api/system_private/system_private_api.cc
index 132abe1537a..bc91204ef8c 100644
--- a/chromium/chrome/browser/extensions/api/system_private/system_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/system_private/system_private_api.cc
@@ -22,7 +22,7 @@
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/update_engine_client.h"
#else
-#include "chrome/browser/upgrade_detector.h"
+#include "chrome/browser/upgrade_detector/upgrade_detector.h"
#endif
namespace {
diff --git a/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc b/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
deleted file mode 100644
index 6706c0fab95..00000000000
--- a/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.cc
+++ /dev/null
@@ -1,422 +0,0 @@
-// Copyright 2015 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/extensions/api/tab_capture/offscreen_tab.h"
-
-#include <algorithm>
-#include <utility>
-#include <vector>
-
-#include "base/bind.h"
-#include "base/macros.h"
-#include "base/stl_util.h"
-#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
-#include "chrome/browser/media/router/presentation/presentation_navigation_policy.h"
-#include "chrome/browser/media/router/presentation/receiver_presentation_service_delegate_impl.h" // nogncheck
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/web_contents_sizer.h"
-#include "content/public/browser/keyboard_event_processing_result.h"
-#include "content/public/browser/navigation_handle.h"
-#include "content/public/browser/render_widget_host_view.h"
-#include "content/public/browser/web_contents.h"
-#include "extensions/browser/extension_host.h"
-#include "extensions/browser/process_manager.h"
-#include "third_party/blink/public/web/web_presentation_receiver_flags.h"
-
-using content::WebContents;
-
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::OffscreenTabsOwner);
-
-namespace {
-
-// Upper limit on the number of simultaneous off-screen tabs per extension
-// instance.
-const int kMaxOffscreenTabsPerExtension = 4;
-
-// Time intervals used by the logic that detects when the capture of an
-// offscreen tab has stopped, to automatically tear it down and free resources.
-const int kMaxSecondsToWaitForCapture = 60;
-const int kPollIntervalInSeconds = 1;
-
-} // namespace
-
-namespace extensions {
-
-OffscreenTabsOwner::OffscreenTabsOwner(WebContents* extension_web_contents)
- : extension_web_contents_(extension_web_contents) {
- DCHECK(extension_web_contents_);
-}
-
-OffscreenTabsOwner::~OffscreenTabsOwner() {}
-
-// static
-OffscreenTabsOwner* OffscreenTabsOwner::Get(
- content::WebContents* extension_web_contents) {
- // CreateForWebContents() really means "create if not exists."
- CreateForWebContents(extension_web_contents);
- return FromWebContents(extension_web_contents);
-}
-
-OffscreenTab* OffscreenTabsOwner::OpenNewTab(
- const GURL& start_url,
- const gfx::Size& initial_size,
- const std::string& optional_presentation_id) {
- if (tabs_.size() >= kMaxOffscreenTabsPerExtension)
- return nullptr; // Maximum number of offscreen tabs reached.
-
- // OffscreenTab cannot be created with MakeUnique<OffscreenTab> since the
- // constructor is protected. So create it separately, and then move it to
- // |tabs_| below.
- std::unique_ptr<OffscreenTab> offscreen_tab(new OffscreenTab(this));
- tabs_.push_back(std::move(offscreen_tab));
- tabs_.back()->Start(start_url, initial_size, optional_presentation_id);
- return tabs_.back().get();
-}
-
-void OffscreenTabsOwner::DestroyTab(OffscreenTab* tab) {
- for (std::vector<std::unique_ptr<OffscreenTab>>::iterator iter =
- tabs_.begin();
- iter != tabs_.end(); ++iter) {
- if (iter->get() == tab) {
- tabs_.erase(iter);
- break;
- }
- }
-}
-
-OffscreenTab::OffscreenTab(OffscreenTabsOwner* owner)
- : owner_(owner),
- otr_profile_registration_(
- IndependentOTRProfileManager::GetInstance()
- ->CreateFromOriginalProfile(
- Profile::FromBrowserContext(
- owner->extension_web_contents()->GetBrowserContext()),
- base::BindOnce(&OffscreenTab::DieIfOriginalProfileDestroyed,
- base::Unretained(this)))),
- content_capture_was_detected_(false),
- navigation_policy_(
- std::make_unique<media_router::DefaultNavigationPolicy>()) {
- DCHECK(otr_profile_registration_->profile());
-}
-
-OffscreenTab::~OffscreenTab() {
- DVLOG(1) << "Destroying OffscreenTab for start_url=" << start_url_.spec();
-}
-
-void OffscreenTab::Start(const GURL& start_url,
- const gfx::Size& initial_size,
- const std::string& optional_presentation_id) {
- DCHECK(start_time_.is_null());
- start_url_ = start_url;
- DVLOG(1) << "Starting OffscreenTab with initial size of "
- << initial_size.ToString() << " for start_url=" << start_url_.spec();
-
- // Create the WebContents to contain the off-screen tab's page.
- WebContents::CreateParams params(otr_profile_registration_->profile());
- if (!optional_presentation_id.empty())
- params.starting_sandbox_flags = blink::kPresentationReceiverSandboxFlags;
-
- offscreen_tab_web_contents_ = WebContents::Create(params);
- offscreen_tab_web_contents_->SetDelegate(this);
- WebContentsObserver::Observe(offscreen_tab_web_contents_.get());
-
- // Set initial size, if specified.
- if (!initial_size.IsEmpty())
- ResizeWebContents(offscreen_tab_web_contents_.get(),
- gfx::Rect(initial_size));
-
- // Mute audio output. When tab capture starts, the audio will be
- // automatically unmuted, but will be captured into the MediaStream.
- offscreen_tab_web_contents_->SetAudioMuted(true);
-
- if (!optional_presentation_id.empty()) {
- // This offscreen tab is a presentation created through the Presentation
- // API. https://www.w3.org/TR/presentation-api/
- //
- // Create a ReceiverPresentationServiceDelegateImpl associated with the
- // offscreen tab's WebContents. The new instance will set up the necessary
- // infrastructure to allow controlling pages the ability to connect to the
- // offscreen tab.
- DVLOG(1) << "Register with ReceiverPresentationServiceDelegateImpl, "
- << "presentation_id=" << optional_presentation_id;
- media_router::ReceiverPresentationServiceDelegateImpl::CreateForWebContents(
- offscreen_tab_web_contents_.get(), optional_presentation_id);
-
- // Presentations are not allowed to perform top-level navigations after
- // initial load. This is enforced through sandboxing flags, but we also
- // enforce it here.
- navigation_policy_ =
- std::make_unique<media_router::PresentationNavigationPolicy>();
- }
-
- // Navigate to the initial URL.
- content::NavigationController::LoadURLParams load_params(start_url_);
- load_params.should_replace_current_entry = true;
- load_params.should_clear_history_list = true;
- offscreen_tab_web_contents_->GetController().LoadURLWithParams(load_params);
-
- start_time_ = base::TimeTicks::Now();
- DieIfContentCaptureEnded();
-}
-
-void OffscreenTab::Close() {
- if (offscreen_tab_web_contents_)
- offscreen_tab_web_contents_->ClosePage();
-}
-
-void OffscreenTab::CloseContents(WebContents* source) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), source);
- // Javascript in the page called window.close().
- DVLOG(1) << "OffscreenTab for start_url=" << start_url_.spec() << " will die";
- owner_->DestroyTab(this);
- // |this| is no longer valid.
-}
-
-bool OffscreenTab::ShouldSuppressDialogs(WebContents* source) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), source);
- // Suppress all because there is no possible direct user interaction with
- // dialogs.
- // TODO(crbug.com/734191): This does not suppress window.print().
- return true;
-}
-
-bool OffscreenTab::ShouldFocusLocationBarByDefault(WebContents* source) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), source);
- // Indicate the location bar should be focused instead of the page, even
- // though there is no location bar. This will prevent the page from
- // automatically receiving input focus, which should never occur since there
- // is not supposed to be any direct user interaction.
- return true;
-}
-
-bool OffscreenTab::ShouldFocusPageAfterCrash() {
- // Never focus the page. Not even after a crash.
- return false;
-}
-
-void OffscreenTab::CanDownload(const GURL& url,
- const std::string& request_method,
- const base::Callback<void(bool)>& callback) {
- // Offscreen tab pages are not allowed to download files.
- callback.Run(false);
-}
-
-bool OffscreenTab::HandleContextMenu(const content::ContextMenuParams& params) {
- // Context menus should never be shown. Do nothing, but indicate the context
- // menu was shown so that default implementation in libcontent does not
- // attempt to do so on its own.
- return true;
-}
-
-content::KeyboardEventProcessingResult OffscreenTab::PreHandleKeyboardEvent(
- WebContents* source,
- const content::NativeWebKeyboardEvent& event) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), source);
- // Intercept and silence all keyboard events before they can be sent to the
- // renderer.
- return content::KeyboardEventProcessingResult::HANDLED;
-}
-
-bool OffscreenTab::PreHandleGestureEvent(WebContents* source,
- const blink::WebGestureEvent& event) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), source);
- // Intercept and silence all gesture events before they can be sent to the
- // renderer.
- return true;
-}
-
-bool OffscreenTab::CanDragEnter(
- WebContents* source,
- const content::DropData& data,
- blink::WebDragOperationsMask operations_allowed) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), source);
- // Halt all drag attempts onto the page since there should be no direct user
- // interaction with it.
- return false;
-}
-
-bool OffscreenTab::ShouldCreateWebContents(
- content::WebContents* web_contents,
- content::RenderFrameHost* opener,
- content::SiteInstance* source_site_instance,
- int32_t route_id,
- int32_t main_frame_route_id,
- int32_t main_frame_widget_route_id,
- content::mojom::WindowContainerType window_container_type,
- const GURL& opener_url,
- const std::string& frame_name,
- const GURL& target_url,
- const std::string& partition_id,
- content::SessionStorageNamespace* session_storage_namespace) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), web_contents);
- // Disallow creating separate WebContentses. The WebContents implementation
- // uses this to spawn new windows/tabs, which is also not allowed for
- // offscreen tabs.
- return false;
-}
-
-bool OffscreenTab::EmbedsFullscreenWidget() const {
- // OffscreenTab will manage fullscreen widgets.
- return true;
-}
-
-void OffscreenTab::EnterFullscreenModeForTab(
- WebContents* contents,
- const GURL& origin,
- const blink::WebFullscreenOptions& options) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), contents);
-
- if (in_fullscreen_mode())
- return;
-
- non_fullscreen_size_ =
- contents->GetRenderWidgetHostView()->GetViewBounds().size();
- if (contents->IsBeingCaptured() && !contents->GetPreferredSize().IsEmpty())
- ResizeWebContents(contents, gfx::Rect(contents->GetPreferredSize()));
-}
-
-void OffscreenTab::ExitFullscreenModeForTab(WebContents* contents) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), contents);
-
- if (!in_fullscreen_mode())
- return;
-
- ResizeWebContents(contents, gfx::Rect(non_fullscreen_size_));
- non_fullscreen_size_ = gfx::Size();
-}
-
-bool OffscreenTab::IsFullscreenForTabOrPending(
- const WebContents* contents) const {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), contents);
- return in_fullscreen_mode();
-}
-
-blink::WebDisplayMode OffscreenTab::GetDisplayMode(
- const WebContents* contents) const {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), contents);
- return in_fullscreen_mode() ? blink::kWebDisplayModeFullscreen
- : blink::kWebDisplayModeBrowser;
-}
-
-void OffscreenTab::RequestMediaAccessPermission(
- WebContents* contents,
- const content::MediaStreamRequest& request,
- content::MediaResponseCallback callback) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(), contents);
-
- // This method is being called to check whether an extension is permitted to
- // capture the page. Verify that the request is being made by the extension
- // that spawned this OffscreenTab.
-
- // Find the extension ID associated with the extension background page's
- // WebContents.
- content::BrowserContext* const extension_browser_context =
- owner_->extension_web_contents()->GetBrowserContext();
- const extensions::Extension* const extension =
- ProcessManager::Get(extension_browser_context)->
- GetExtensionForWebContents(owner_->extension_web_contents());
- const std::string extension_id = extension ? extension->id() : "";
- LOG_IF(DFATAL, extension_id.empty())
- << "Extension that started this OffscreenTab was not found.";
-
- // If verified, allow any tab capture audio/video devices that were requested.
- extensions::TabCaptureRegistry* const tab_capture_registry =
- extensions::TabCaptureRegistry::Get(extension_browser_context);
- content::MediaStreamDevices devices;
- if (tab_capture_registry && tab_capture_registry->VerifyRequest(
- request.render_process_id,
- request.render_frame_id,
- extension_id)) {
- if (request.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE) {
- devices.push_back(content::MediaStreamDevice(
- content::MEDIA_TAB_AUDIO_CAPTURE, std::string(), std::string()));
- }
- if (request.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) {
- devices.push_back(content::MediaStreamDevice(
- content::MEDIA_TAB_VIDEO_CAPTURE, std::string(), std::string()));
- }
- }
-
- DVLOG(2) << "Allowing " << devices.size()
- << " capture devices for OffscreenTab content.";
-
- std::move(callback).Run(devices,
- devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE
- : content::MEDIA_DEVICE_OK,
- std::unique_ptr<content::MediaStreamUI>(nullptr));
-}
-
-bool OffscreenTab::CheckMediaAccessPermission(
- content::RenderFrameHost* render_frame_host,
- const GURL& security_origin,
- content::MediaStreamType type) {
- DCHECK_EQ(offscreen_tab_web_contents_.get(),
- content::WebContents::FromRenderFrameHost(render_frame_host));
- return type == content::MEDIA_TAB_AUDIO_CAPTURE ||
- type == content::MEDIA_TAB_VIDEO_CAPTURE;
-}
-
-void OffscreenTab::DidShowFullscreenWidget() {
- if (!offscreen_tab_web_contents_->IsBeingCaptured() ||
- offscreen_tab_web_contents_->GetPreferredSize().IsEmpty())
- return; // Do nothing, since no preferred size is specified.
- content::RenderWidgetHostView* const current_fs_view =
- offscreen_tab_web_contents_->GetFullscreenRenderWidgetHostView();
- if (current_fs_view)
- current_fs_view->SetSize(offscreen_tab_web_contents_->GetPreferredSize());
-}
-
-void OffscreenTab::DidStartNavigation(
- content::NavigationHandle* navigation_handle) {
- DCHECK(offscreen_tab_web_contents_.get());
- if (!navigation_policy_->AllowNavigation(navigation_handle)) {
- DVLOG(2) << "Closing because NavigationPolicy disallowed "
- << "StartNavigation to " << navigation_handle->GetURL().spec();
- Close();
- }
-}
-
-void OffscreenTab::DieIfContentCaptureEnded() {
- DCHECK(offscreen_tab_web_contents_.get());
-
- if (content_capture_was_detected_) {
- if (!offscreen_tab_web_contents_->IsBeingCaptured()) {
- DVLOG(2) << "Capture of OffscreenTab content has stopped for start_url="
- << start_url_.spec();
- owner_->DestroyTab(this);
- return; // |this| is no longer valid.
- } else {
- DVLOG(3) << "Capture of OffscreenTab content continues for start_url="
- << start_url_.spec();
- }
- } else if (offscreen_tab_web_contents_->IsBeingCaptured()) {
- DVLOG(2) << "Capture of OffscreenTab content has started for start_url="
- << start_url_.spec();
- content_capture_was_detected_ = true;
- } else if (base::TimeTicks::Now() - start_time_ >
- base::TimeDelta::FromSeconds(kMaxSecondsToWaitForCapture)) {
- // More than a minute has elapsed since this OffscreenTab was started and
- // content capture still hasn't started. As a safety precaution, assume
- // that content capture is never going to start and die to free up
- // resources.
- LOG(WARNING) << "Capture of OffscreenTab content did not start "
- "within timeout for start_url=" << start_url_.spec();
- owner_->DestroyTab(this);
- return; // |this| is no longer valid.
- }
-
- // Schedule the timer to check again in a second.
- capture_poll_timer_.Start(
- FROM_HERE,
- base::TimeDelta::FromSeconds(kPollIntervalInSeconds),
- base::Bind(&OffscreenTab::DieIfContentCaptureEnded,
- base::Unretained(this)));
-}
-
-void OffscreenTab::DieIfOriginalProfileDestroyed(Profile* profile) {
- DCHECK(profile == otr_profile_registration_->profile());
- owner_->DestroyTab(this);
-}
-
-} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.h b/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.h
deleted file mode 100644
index 93e51b9fc51..00000000000
--- a/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tab.h
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright 2015 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_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_
-#define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_
-
-#include <stdint.h>
-
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "base/macros.h"
-#include "base/time/time.h"
-#include "base/timer/timer.h"
-#include "chrome/browser/media/router/presentation/independent_otr_profile_manager.h"
-#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_contents_user_data.h"
-#include "ui/gfx/geometry/size.h"
-
-namespace media_router {
-class NavigationPolicy;
-} // namespace media_router
-
-namespace extensions {
-
-class OffscreenTab; // Forward declaration. See below.
-
-// Creates, owns, and manages all OffscreenTab instances created by the same
-// extension background page. When the extension background page's WebContents
-// is about to be destroyed, its associated OffscreenTabsOwner and all of its
-// OffscreenTab instances are destroyed.
-//
-// Usage:
-//
-// OffscreenTabsOwner::Get(extension_contents)
-// ->OpenNewTab(start_url, size, std::string());
-//
-// This class operates exclusively on the UI thread and so is not thread-safe.
-class OffscreenTabsOwner
- : public content::WebContentsUserData<OffscreenTabsOwner> {
- public:
- ~OffscreenTabsOwner() final;
-
- // Returns the OffscreenTabsOwner instance associated with the given extension
- // background page's WebContents. Never returns nullptr.
- static OffscreenTabsOwner* Get(content::WebContents* extension_web_contents);
-
- // Instantiate a new offscreen tab and navigate it to |start_url|. The new
- // tab's main frame will start out with the given |initial_size| in DIP
- // coordinates. If too many offscreen tabs are already running, nothing
- // happens and nullptr is returned.
- //
- // If |optional_presentation_id| is non-empty, the offscreen tab is registered
- // for use by the Media Router (chrome/browser/media/router/...) as the
- // receiving browsing context for the W3C Presentation API.
- OffscreenTab* OpenNewTab(const GURL& start_url,
- const gfx::Size& initial_size,
- const std::string& optional_presentation_id);
-
- protected:
- friend class OffscreenTab;
-
- // Accessor to the extension background page's WebContents.
- content::WebContents* extension_web_contents() const {
- return extension_web_contents_;
- }
-
- // Shuts down and destroys the |tab|.
- void DestroyTab(OffscreenTab* tab);
-
- private:
- friend class content::WebContentsUserData<OffscreenTabsOwner>;
-
- explicit OffscreenTabsOwner(content::WebContents* extension_web_contents);
-
- content::WebContents* const extension_web_contents_;
- std::vector<std::unique_ptr<OffscreenTab>> tabs_;
-
- DISALLOW_COPY_AND_ASSIGN(OffscreenTabsOwner);
-};
-
-// Owns and controls a sandboxed WebContents instance hosting the rendering
-// engine for an offscreen tab. Since the offscreen tab does not interact with
-// the user in any direct way, the WebContents is not attached to any Browser
-// window/UI, and any input and focusing capabilities are blocked.
-//
-// OffscreenTab is instantiated by OffscreenTabsOwner. An instance is shut down
-// one of three ways:
-//
-// 1. When WebContents::IsBeingCaptured() returns false, indicating there are
-// no more consumers of its captured content (e.g., when all MediaStreams
-// have been closed). OffscreenTab will auto-detect this case and
-// self-destruct.
-// 2. By the renderer, where the WebContents implementation will invoke the
-// WebContentsDelegate::CloseContents() override. This occurs, for
-// example, when a page calls window.close().
-// 3. Automatically, when the extension background page's WebContents is
-// destroyed.
-//
-// This class operates exclusively on the UI thread and so is not thread-safe.
-class OffscreenTab : protected content::WebContentsDelegate,
- protected content::WebContentsObserver {
- public:
- ~OffscreenTab() final;
-
- // The WebContents instance hosting the rendering engine for this
- // OffscreenTab.
- content::WebContents* web_contents() const {
- return offscreen_tab_web_contents_.get();
- }
-
- protected:
- friend class OffscreenTabsOwner;
-
- explicit OffscreenTab(OffscreenTabsOwner* owner);
-
- // Creates the WebContents instance containing the offscreen tab's page,
- // configures it for offscreen rendering at the given |initial_size|, and
- // navigates it to |start_url|. This is invoked once by OffscreenTabsOwner
- // just after construction.
- void Start(const GURL& start_url,
- const gfx::Size& initial_size,
- const std::string& optional_presentation_id);
-
- // Closes the underlying WebContents.
- void Close();
-
- // content::WebContentsDelegate overrides to provide the desired behaviors.
- void CloseContents(content::WebContents* source) final;
- bool ShouldSuppressDialogs(content::WebContents* source) final;
- bool ShouldFocusLocationBarByDefault(content::WebContents* source) final;
- bool ShouldFocusPageAfterCrash() final;
- void CanDownload(const GURL& url,
- const std::string& request_method,
- const base::Callback<void(bool)>& callback) final;
- bool HandleContextMenu(const content::ContextMenuParams& params) final;
- content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
- content::WebContents* source,
- const content::NativeWebKeyboardEvent& event) final;
- bool PreHandleGestureEvent(content::WebContents* source,
- const blink::WebGestureEvent& event) final;
- bool CanDragEnter(content::WebContents* source,
- const content::DropData& data,
- blink::WebDragOperationsMask operations_allowed) final;
- bool ShouldCreateWebContents(
- content::WebContents* web_contents,
- content::RenderFrameHost* opener,
- content::SiteInstance* source_site_instance,
- int32_t route_id,
- int32_t main_frame_route_id,
- int32_t main_frame_widget_route_id,
- content::mojom::WindowContainerType window_container_type,
- const GURL& opener_url,
- const std::string& frame_name,
- const GURL& target_url,
- const std::string& partition_id,
- content::SessionStorageNamespace* session_storage_namespace) final;
- bool EmbedsFullscreenWidget() const final;
- void EnterFullscreenModeForTab(
- content::WebContents* contents,
- const GURL& origin,
- const blink::WebFullscreenOptions& options) final;
- void ExitFullscreenModeForTab(content::WebContents* contents) final;
- bool IsFullscreenForTabOrPending(
- const content::WebContents* contents) const final;
- blink::WebDisplayMode GetDisplayMode(
- const content::WebContents* contents) const final;
- void RequestMediaAccessPermission(
- content::WebContents* contents,
- const content::MediaStreamRequest& request,
- content::MediaResponseCallback callback) final;
- bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host,
- const GURL& security_origin,
- content::MediaStreamType type) final;
-
- // content::WebContentsObserver overrides
- void DidShowFullscreenWidget() final;
- void DidStartNavigation(content::NavigationHandle* navigation_handle) final;
-
- private:
- bool in_fullscreen_mode() const { return !non_fullscreen_size_.IsEmpty(); }
-
- // Called by |capture_poll_timer_| to automatically destroy this OffscreenTab
- // when the capturer count returns to zero.
- void DieIfContentCaptureEnded();
-
- // Called if the profile that our OTR profile is based on is being destroyed
- // and |this| therefore needs to be destroyed also.
- void DieIfOriginalProfileDestroyed(Profile* profile);
-
- OffscreenTabsOwner* const owner_;
-
- // The initial navigation URL, which may or may not match the current URL if
- // page-initiated navigations have occurred.
- GURL start_url_;
-
- // A non-shared off-the-record profile based on the profile of the extension
- // background page.
- const std::unique_ptr<IndependentOTRProfileManager::OTRProfileRegistration>
- otr_profile_registration_;
-
- // The WebContents containing the off-screen tab's page.
- std::unique_ptr<content::WebContents> offscreen_tab_web_contents_;
-
- // The time at which Start() finished creating |offscreen_tab_web_contents_|.
- base::TimeTicks start_time_;
-
- // Set to the original size of the renderer just before entering fullscreen
- // mode. When not in fullscreen mode, this is an empty size.
- gfx::Size non_fullscreen_size_;
-
- // Poll timer to monitor the capturer count on |offscreen_tab_web_contents_|.
- // When the capturer count returns to zero, this OffscreenTab is automatically
- // destroyed.
- //
- // TODO(miu): Add a method to WebContentsObserver to report capturer count
- // changes and get rid of this polling-based approach.
- // http://crbug.com/540965
- base::OneShotTimer capture_poll_timer_;
-
- // This is false until after the Start() method is called, and capture of the
- // |offscreen_tab_web_contents_| is first detected.
- bool content_capture_was_detected_;
-
- // Object consulted to determine which offscreen tab navigations are allowed.
- std::unique_ptr<media_router::NavigationPolicy> navigation_policy_;
-
- DISALLOW_COPY_AND_ASSIGN(OffscreenTab);
-};
-
-} // namespace extensions
-
-#endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TAB_H_
diff --git a/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.cc b/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.cc
new file mode 100644
index 00000000000..202e849c408
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.cc
@@ -0,0 +1,114 @@
+// Copyright 2015 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/extensions/api/tab_capture/offscreen_tabs_owner.h"
+
+#include <algorithm>
+#include <utility>
+#include <vector>
+
+#include "base/bind.h"
+#include "base/stl_util.h"
+#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
+#include "chrome/browser/profiles/profile.h"
+#include "content/public/browser/web_contents.h"
+#include "extensions/browser/extension_host.h"
+#include "extensions/browser/process_manager.h"
+
+using content::WebContents;
+
+namespace {
+
+// Upper limit on the number of simultaneous off-screen tabs per extension
+// instance.
+const int kMaxOffscreenTabsPerExtension = 4;
+
+} // namespace
+
+namespace extensions {
+
+OffscreenTabsOwner::OffscreenTabsOwner(WebContents* extension_web_contents)
+ : extension_web_contents_(extension_web_contents) {
+ DCHECK(extension_web_contents_);
+}
+
+OffscreenTabsOwner::~OffscreenTabsOwner() {}
+
+// static
+OffscreenTabsOwner* OffscreenTabsOwner::Get(
+ content::WebContents* extension_web_contents) {
+ // CreateForWebContents() really means "create if not exists."
+ CreateForWebContents(extension_web_contents);
+ return FromWebContents(extension_web_contents);
+}
+
+OffscreenTab* OffscreenTabsOwner::OpenNewTab(
+ const GURL& start_url,
+ const gfx::Size& initial_size,
+ const std::string& optional_presentation_id) {
+ if (tabs_.size() >= kMaxOffscreenTabsPerExtension)
+ return nullptr; // Maximum number of offscreen tabs reached.
+
+ tabs_.emplace_back(std::make_unique<OffscreenTab>(
+ this, extension_web_contents_->GetBrowserContext()));
+ tabs_.back()->Start(start_url, initial_size, optional_presentation_id);
+ return tabs_.back().get();
+}
+
+void OffscreenTabsOwner::RequestMediaAccessPermission(
+ const content::MediaStreamRequest& request,
+ content::MediaResponseCallback callback) {
+ // This method is being called to check whether an extension is permitted to
+ // capture the page. Verify that the request is being made by the extension
+ // that spawned this OffscreenTab.
+
+ // Find the extension ID associated with the extension background page's
+ // WebContents.
+ content::BrowserContext* const extension_browser_context =
+ extension_web_contents_->GetBrowserContext();
+ const extensions::Extension* const extension =
+ ProcessManager::Get(extension_browser_context)
+ ->GetExtensionForWebContents(extension_web_contents_);
+ const std::string extension_id = extension ? extension->id() : "";
+ LOG_IF(DFATAL, extension_id.empty())
+ << "Extension that started this OffscreenTab was not found.";
+
+ // If verified, allow any tab capture audio/video devices that were requested.
+ extensions::TabCaptureRegistry* const tab_capture_registry =
+ extensions::TabCaptureRegistry::Get(extension_browser_context);
+ content::MediaStreamDevices devices;
+ if (tab_capture_registry &&
+ tab_capture_registry->VerifyRequest(
+ request.render_process_id, request.render_frame_id, extension_id)) {
+ if (request.audio_type == content::MEDIA_GUM_TAB_AUDIO_CAPTURE) {
+ devices.push_back(content::MediaStreamDevice(
+ content::MEDIA_GUM_TAB_AUDIO_CAPTURE, std::string(), std::string()));
+ }
+ if (request.video_type == content::MEDIA_GUM_TAB_VIDEO_CAPTURE) {
+ devices.push_back(content::MediaStreamDevice(
+ content::MEDIA_GUM_TAB_VIDEO_CAPTURE, std::string(), std::string()));
+ }
+ }
+
+ DVLOG(2) << "Allowing " << devices.size()
+ << " capture devices for OffscreenTab content.";
+
+ std::move(callback).Run(devices,
+ devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE
+ : content::MEDIA_DEVICE_OK,
+ nullptr);
+}
+
+void OffscreenTabsOwner::DestroyTab(OffscreenTab* tab) {
+ for (std::vector<std::unique_ptr<OffscreenTab>>::iterator iter =
+ tabs_.begin();
+ iter != tabs_.end(); ++iter) {
+ if (iter->get() == tab) {
+ tabs_.erase(iter);
+ break;
+ }
+ }
+}
+
+} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.h b/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.h
new file mode 100644
index 00000000000..badea71d804
--- /dev/null
+++ b/chromium/chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.h
@@ -0,0 +1,75 @@
+// Copyright 2015 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_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TABS_OWNER_H_
+#define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TABS_OWNER_H_
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "base/macros.h"
+#include "chrome/browser/media/offscreen_tab.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "ui/gfx/geometry/size.h"
+
+class OffscreenTab;
+
+namespace extensions {
+
+// Creates, owns, and manages all OffscreenTab instances created by the same
+// extension background page. When the extension background page's WebContents
+// is about to be destroyed, its associated OffscreenTabsOwner and all of its
+// OffscreenTab instances are destroyed.
+//
+// Usage:
+//
+// OffscreenTabsOwner::Get(extension_contents)
+// ->OpenNewTab(start_url, size, std::string());
+//
+// This class operates exclusively on the UI thread and so is not thread-safe.
+class OffscreenTabsOwner final
+ : public OffscreenTab::Owner,
+ public content::WebContentsUserData<OffscreenTabsOwner> {
+ public:
+ ~OffscreenTabsOwner() final;
+
+ // Returns the OffscreenTabsOwner instance associated with the given extension
+ // background page's WebContents. Never returns nullptr.
+ static OffscreenTabsOwner* Get(content::WebContents* extension_web_contents);
+
+ // Instantiate a new offscreen tab and navigate it to |start_url|. The new
+ // tab's main frame will start out with the given |initial_size| in DIP
+ // coordinates. If too many offscreen tabs are already running, nothing
+ // happens and nullptr is returned.
+ //
+ // If |optional_presentation_id| is non-empty, the offscreen tab is registered
+ // for use by the Media Router (chrome/browser/media/router/...) as the
+ // receiving browsing context for the W3C Presentation API.
+ OffscreenTab* OpenNewTab(const GURL& start_url,
+ const gfx::Size& initial_size,
+ const std::string& optional_presentation_id);
+
+ private:
+ friend class content::WebContentsUserData<OffscreenTabsOwner>;
+
+ explicit OffscreenTabsOwner(content::WebContents* extension_web_contents);
+
+ // OffscreenTab::Owner implementation.
+ void RequestMediaAccessPermission(
+ const content::MediaStreamRequest& request,
+ content::MediaResponseCallback callback) override;
+ void DestroyTab(OffscreenTab* tab) override;
+
+ content::WebContents* const extension_web_contents_;
+ std::vector<std::unique_ptr<OffscreenTab>> tabs_;
+
+ DISALLOW_COPY_AND_ASSIGN(OffscreenTabsOwner);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_OFFSCREEN_TABS_OWNER_H_
diff --git a/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc b/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
index 529970f3025..7ea18093f69 100644
--- a/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
+++ b/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_api.cc
@@ -18,7 +18,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
-#include "chrome/browser/extensions/api/tab_capture/offscreen_tab.h"
+#include "chrome/browser/extensions/api/tab_capture/offscreen_tabs_owner.h"
#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
@@ -26,6 +26,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
+#include "content/public/browser/desktop_media_id.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
@@ -35,6 +36,8 @@
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
+using content::DesktopMediaID;
+using content::WebContentsMediaCaptureId;
using extensions::api::tab_capture::MediaStreamConstraint;
namespace TabCapture = extensions::api::tab_capture;
@@ -116,21 +119,7 @@ void FilterDeprecatedGoogConstraints(TabCapture::CaptureOptions* options) {
}
}
-// Add Chrome-specific source identifiers to the MediaStreamConstraints objects
-// in |options| to provide references to the |target_contents| to be captured.
-void AddMediaStreamSourceConstraints(content::WebContents* target_contents,
- TabCapture::CaptureOptions* options) {
- DCHECK(options);
- DCHECK(target_contents);
-
- MediaStreamConstraint* constraints_to_modify[2] = { nullptr, nullptr };
-
- if (options->audio && *options->audio) {
- if (!options->audio_constraints)
- options->audio_constraints.reset(new MediaStreamConstraint);
- constraints_to_modify[0] = options->audio_constraints.get();
- }
-
+bool GetAutoThrottlingFromOptions(TabCapture::CaptureOptions* options) {
bool enable_auto_throttling = false;
if (options->video && *options->video) {
if (options->video_constraints) {
@@ -146,21 +135,45 @@ void AddMediaStreamSourceConstraints(content::WebContents* target_contents,
// Remove the key from the properties to avoid an "unrecognized
// constraint" error in the renderer.
props.RemoveWithoutPathExpansion(kEnableAutoThrottlingKey, nullptr);
- } else {
- options->video_constraints.reset(new MediaStreamConstraint);
}
- constraints_to_modify[1] = options->video_constraints.get();
}
- // Format the device ID that references the target tab.
- content::RenderFrameHost* const main_frame = target_contents->GetMainFrame();
- // TODO(miu): We should instead use a "randomly generated device ID" scheme,
- // like that employed by the desktop capture API. http://crbug.com/163100
- const std::string device_id = base::StringPrintf(
- "web-contents-media-stream://%i:%i%s",
- main_frame->GetProcess()->GetID(),
- main_frame->GetRoutingID(),
- enable_auto_throttling ? "?throttling=auto" : "");
+ return enable_auto_throttling;
+}
+
+DesktopMediaID BuildDesktopMediaID(content::WebContents* target_contents,
+ TabCapture::CaptureOptions* options) {
+ content::RenderFrameHost* const target_frame =
+ target_contents->GetMainFrame();
+ DesktopMediaID source(
+ DesktopMediaID::TYPE_WEB_CONTENTS, DesktopMediaID::kNullId,
+ WebContentsMediaCaptureId(target_frame->GetProcess()->GetID(),
+ target_frame->GetRoutingID(),
+ GetAutoThrottlingFromOptions(options), false));
+ return source;
+}
+
+// Add Chrome-specific source identifiers to the MediaStreamConstraints objects
+// in |options| to provide references to the |target_contents| to be captured.
+void AddMediaStreamSourceConstraints(content::WebContents* target_contents,
+ TabCapture::CaptureOptions* options,
+ const std::string& device_id) {
+ DCHECK(options);
+ DCHECK(target_contents);
+
+ MediaStreamConstraint* constraints_to_modify[2] = {nullptr, nullptr};
+
+ if (options->audio && *options->audio) {
+ if (!options->audio_constraints)
+ options->audio_constraints.reset(new MediaStreamConstraint);
+ constraints_to_modify[0] = options->audio_constraints.get();
+ }
+
+ if (options->video && *options->video) {
+ if (!options->video_constraints)
+ options->video_constraints.reset(new MediaStreamConstraint);
+ constraints_to_modify[1] = options->video_constraints.get();
+ }
// Append chrome specific tab constraints.
for (MediaStreamConstraint* msc : constraints_to_modify) {
@@ -217,14 +230,21 @@ ExtensionFunction::ResponseAction TabCaptureCaptureFunction::Run() {
if (!OptionsSpecifyAudioOrVideo(params->options))
return RespondNow(Error(kNoAudioOrVideo));
+ DesktopMediaID source =
+ BuildDesktopMediaID(target_contents, &params->options);
+ content::WebContents* const extension_web_contents = GetSenderWebContents();
+ EXTENSION_FUNCTION_VALIDATE(extension_web_contents);
TabCaptureRegistry* registry = TabCaptureRegistry::Get(browser_context());
- if (!registry->AddRequest(target_contents, extension_id, false)) {
+ std::string device_id = registry->AddRequest(
+ target_contents, extension_id, false, extension()->url(), source,
+ extension()->name(), extension_web_contents);
+ if (device_id.empty()) {
// TODO(miu): Allow multiple consumers of single tab capture.
// http://crbug.com/535336
return RespondNow(Error(kCapturingSameTab));
}
FilterDeprecatedGoogConstraints(&params->options);
- AddMediaStreamSourceConstraints(target_contents, &params->options);
+ AddMediaStreamSourceConstraints(target_contents, &params->options, device_id);
// At this point, everything is set up in the browser process. It's now up to
// the custom JS bindings in the extension's render process to request a
@@ -283,15 +303,21 @@ ExtensionFunction::ResponseAction TabCaptureCaptureOffscreenTabFunction::Run() {
if (!offscreen_tab)
return RespondNow(Error(kTooManyOffscreenTabs));
- if (!TabCaptureRegistry::Get(browser_context())->AddRequest(
- offscreen_tab->web_contents(), extension()->id(), true)) {
+ content::WebContents* target_contents = offscreen_tab->web_contents();
+ const std::string& extension_id = extension()->id();
+ DesktopMediaID source =
+ BuildDesktopMediaID(target_contents, &params->options);
+ TabCaptureRegistry* registry = TabCaptureRegistry::Get(browser_context());
+ std::string device_id = registry->AddRequest(
+ target_contents, extension_id, true, extension()->url(), source,
+ extension()->name(), extension_web_contents);
+ if (device_id.empty()) {
// TODO(miu): Allow multiple consumers of single tab capture.
// http://crbug.com/535336
return RespondNow(Error(kCapturingSameOffscreenTab));
}
FilterDeprecatedGoogConstraints(&params->options);
- AddMediaStreamSourceConstraints(offscreen_tab->web_contents(),
- &params->options);
+ AddMediaStreamSourceConstraints(target_contents, &params->options, device_id);
// At this point, everything is set up in the browser process. It's now up to
// the custom JS bindings in the extension's render process to complete the
diff --git a/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc b/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
index c8a4493a740..52b033eb2cb 100644
--- a/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
+++ b/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc
@@ -13,7 +13,9 @@
#include "chrome/browser/sessions/session_tab_helper.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/desktop_streams_registry.h"
#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "extensions/browser/event_router.h"
@@ -138,8 +140,9 @@ class TabCaptureRegistry::LiveRequest : public content::WebContentsObserver {
#if defined(USE_AURA)
window_agent_(target_contents->GetNativeView()),
#endif
- render_process_id_(-1),
- render_frame_id_(-1) {
+ render_process_id_(
+ target_contents->GetMainFrame()->GetProcess()->GetID()),
+ render_frame_id_(target_contents->GetMainFrame()->GetRoutingID()) {
DCHECK(web_contents());
DCHECK(registry_);
}
@@ -165,17 +168,8 @@ class TabCaptureRegistry::LiveRequest : public content::WebContentsObserver {
is_verified_ = true;
}
- // TODO(miu): See TODO(miu) in VerifyRequest() below.
- void SetOriginallyTargettedRenderFrameID(int render_process_id,
- int render_frame_id) {
- DCHECK_GT(render_frame_id, 0);
- DCHECK_EQ(render_frame_id_, -1); // Setting ID only once.
- render_process_id_ = render_process_id;
- render_frame_id_ = render_frame_id;
- }
-
- bool WasOriginallyTargettingRenderFrameID(int render_process_id,
- int render_frame_id) const {
+ bool WasTargettingRenderFrameID(int render_process_id,
+ int render_frame_id) const {
return render_process_id_ == render_process_id &&
render_frame_id_ == render_frame_id;
}
@@ -298,16 +292,22 @@ void TabCaptureRegistry::OnExtensionUnloaded(
}
}
-bool TabCaptureRegistry::AddRequest(content::WebContents* target_contents,
- const std::string& extension_id,
- bool is_anonymous) {
+std::string TabCaptureRegistry::AddRequest(
+ content::WebContents* target_contents,
+ const std::string& extension_id,
+ bool is_anonymous,
+ const GURL& origin,
+ content::DesktopMediaID source,
+ const std::string& extension_name,
+ content::WebContents* caller_contents) {
+ std::string device_id;
LiveRequest* const request = FindRequest(target_contents);
// Currently, we do not allow multiple active captures for same tab.
if (request != NULL) {
if (request->capture_state() == tab_capture::TAB_CAPTURE_STATE_PENDING ||
request->capture_state() == tab_capture::TAB_CAPTURE_STATE_ACTIVE) {
- return false;
+ return device_id;
} else {
// Delete the request before creating its replacement (below).
KillRequest(request);
@@ -316,7 +316,15 @@ bool TabCaptureRegistry::AddRequest(content::WebContents* target_contents,
requests_.push_back(std::make_unique<LiveRequest>(
target_contents, extension_id, is_anonymous, this));
- return true;
+
+ content::RenderFrameHost* const main_frame = caller_contents->GetMainFrame();
+ if (main_frame) {
+ device_id = content::DesktopStreamsRegistry::GetInstance()->RegisterStream(
+ main_frame->GetProcess()->GetID(), main_frame->GetRoutingID(), origin,
+ source, extension_name, content::kRegistryStreamTypeTab);
+ }
+
+ return device_id;
}
bool TabCaptureRegistry::VerifyRequest(
@@ -325,56 +333,35 @@ bool TabCaptureRegistry::VerifyRequest(
const std::string& extension_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- LiveRequest* const request = FindRequest(
- content::WebContents::FromRenderFrameHost(
- content::RenderFrameHost::FromID(
- render_process_id, render_frame_id)));
- if (!request)
+ LiveRequest* const request = FindRequest(render_process_id, render_frame_id);
+ if (!request) {
return false; // Unknown RenderFrameHost ID, or frame has gone away.
+ }
- // TODO(miu): We should probably also verify the origin URL, like the desktop
- // capture API. http://crbug.com/163100
if (request->is_verified() ||
request->extension_id() != extension_id ||
(request->capture_state() != tab_capture::TAB_CAPTURE_STATE_NONE &&
request->capture_state() != tab_capture::TAB_CAPTURE_STATE_PENDING))
return false;
- // TODO(miu): The RenderFrameHost IDs should be set when LiveRequest is
- // constructed, but ExtensionFunction does not yet support use of
- // render_frame_host() to determine the exact RenderFrameHost for the call to
- // AddRequest() above. Fix tab_capture_api.cc, and then fix this ugly hack.
- // http://crbug.com/304341
- request->SetOriginallyTargettedRenderFrameID(
- render_process_id, render_frame_id);
-
request->SetIsVerified();
return true;
}
void TabCaptureRegistry::OnRequestUpdate(
- int original_target_render_process_id,
- int original_target_render_frame_id,
+ int target_render_process_id,
+ int target_render_frame_id,
content::MediaStreamType stream_type,
const content::MediaRequestState new_state) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (stream_type != content::MEDIA_TAB_VIDEO_CAPTURE &&
- stream_type != content::MEDIA_TAB_AUDIO_CAPTURE) {
+ if (stream_type != content::MEDIA_GUM_TAB_VIDEO_CAPTURE &&
+ stream_type != content::MEDIA_GUM_TAB_AUDIO_CAPTURE) {
return;
}
- LiveRequest* request = FindRequest(original_target_render_process_id,
- original_target_render_frame_id);
+ LiveRequest* request =
+ FindRequest(target_render_process_id, target_render_frame_id);
if (!request) {
- // Fall-back: Search again using WebContents since this method may have been
- // called before VerifyRequest() set the RenderFrameHost ID. If the
- // RenderFrameHost has gone away, that's okay since the upcoming call to
- // VerifyRequest() will fail, and that means the tracking of request updates
- // doesn't matter anymore.
- request = FindRequest(content::WebContents::FromRenderFrameHost(
- content::RenderFrameHost::FromID(original_target_render_process_id,
- original_target_render_frame_id)));
- if (!request)
return; // Stale or invalid request update.
}
@@ -444,12 +431,11 @@ TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest(
}
TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest(
- int original_target_render_process_id,
- int original_target_render_frame_id) const {
+ int target_render_process_id,
+ int target_render_frame_id) const {
for (const std::unique_ptr<LiveRequest>& request : requests_) {
- if (request->WasOriginallyTargettingRenderFrameID(
- original_target_render_process_id,
- original_target_render_frame_id)) {
+ if (request->WasTargettingRenderFrameID(target_render_process_id,
+ target_render_frame_id)) {
return request.get();
}
}
diff --git a/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h b/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h
index 4d4abd65d1e..80b2b7e361a 100644
--- a/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h
+++ b/chromium/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h
@@ -13,6 +13,7 @@
#include "base/scoped_observer.h"
#include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
#include "chrome/common/extensions/api/tab_capture.h"
+#include "content/public/browser/desktop_media_id.h"
#include "content/public/browser/media_request_state.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/extension_registry_observer.h"
@@ -47,18 +48,23 @@ class TabCaptureRegistry : public BrowserContextKeyedAPI,
base::ListValue* list_of_capture_info) const;
// Add a tab capture request to the registry when a stream is requested
- // through the API. |target_contents| refers to the WebContents associated
- // with the tab to be captured. |extension_id| refers to the Extension
- // initiating the request. |is_anonymous| is true if GetCapturedTabs() should
- // not list the captured tab, and no status change events should be dispatched
- // for it.
- //
- // TODO(miu): This is broken in that it's possible for a later WebContents
- // instance to have the same pointer value as a previously-destroyed one. To
- // be fixed while working on http://crbug.com/163100.
- bool AddRequest(content::WebContents* target_contents,
- const std::string& extension_id,
- bool is_anonymous);
+ // through the API and create a randomly generated device id after user
+ // initiated access to |source| for the |origin|. If capture is already
+ // taking place for the same tab, this operation fails and returns an
+ // empty string.
+ // |target_contents|: the WebContents associated with the tab to be captured.
+ // |extension_id|: the Extension initiating the request.
+ // |is_anonymous| is true if GetCapturedTabs() should not list the captured
+ // tab, and no status change events should be dispatched for it.
+ // |caller_contents|: the WebContents associated with the tab/extension that
+ // starts the capture.
+ std::string AddRequest(content::WebContents* target_contents,
+ const std::string& extension_id,
+ bool is_anonymous,
+ const GURL& origin,
+ content::DesktopMediaID source,
+ const std::string& extension_name,
+ content::WebContents* caller_contents);
// Called by MediaStreamDevicesController to verify the request before
// creating the stream. |render_process_id| and |render_frame_id| are used to
@@ -91,8 +97,8 @@ class TabCaptureRegistry : public BrowserContextKeyedAPI,
UnloadedExtensionReason reason) override;
// MediaCaptureDevicesDispatcher::Observer implementation.
- void OnRequestUpdate(int original_target_render_process_id,
- int original_target_render_frame_id,
+ void OnRequestUpdate(int target_render_process_id,
+ int target_render_frame_id,
content::MediaStreamType stream_type,
const content::MediaRequestState state) override;
@@ -102,8 +108,8 @@ class TabCaptureRegistry : public BrowserContextKeyedAPI,
// Look-up a LiveRequest associated with the given |target_contents| (or
// the originally targetted RenderFrameHost), if any.
LiveRequest* FindRequest(const content::WebContents* target_contents) const;
- LiveRequest* FindRequest(int original_target_render_process_id,
- int original_target_render_frame_id) const;
+ LiveRequest* FindRequest(int target_render_process_id,
+ int target_render_frame_id) const;
// Removes the |request| from |requests_|, thus causing its destruction.
void KillRequest(LiveRequest* request);
diff --git a/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc b/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc
index 6dbd04f2fb0..e5dbcdc147d 100644
--- a/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chromium/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -53,7 +53,7 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/tabs/tab_utils.h"
#include "chrome/browser/ui/window_sizer/window_sizer.h"
-#include "chrome/browser/web_applications/extensions/web_app_extension_helpers.h"
+#include "chrome/browser/web_applications/components/web_app_helpers.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/tabs.h"
#include "chrome/common/extensions/api/windows.h"
@@ -280,7 +280,7 @@ void SetLockedFullscreenState(Browser* browser, bool locked) {
// Disallow screenshots in locked fullscreen mode.
// TODO(isandrk, 816900): ChromeScreenshotGrabber isn't implemented in Mash
// yet, remove this conditional when it becomes available.
- if (features::IsAshInBrowserProcess())
+ if (!features::IsMultiProcessMash())
ChromeScreenshotGrabber::Get()->set_screenshots_allowed(!locked);
// Reset the clipboard and kill dev tools when entering or exiting locked
@@ -593,7 +593,7 @@ ExtensionFunction::ResponseAction WindowsCreateFunction::Run() {
create_params.initial_bounds = window_bounds;
} else {
create_params = Browser::CreateParams::CreateForApp(
- web_app::GenerateApplicationNameFromExtensionId(extension_id),
+ web_app::GenerateApplicationNameFromAppId(extension_id),
false /* trusted_source */, window_bounds, window_profile,
user_gesture());
}
diff --git a/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc b/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc
index 43d4ab78ab9..a2c3f3ab41d 100644
--- a/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc
+++ b/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.cc
@@ -63,6 +63,23 @@ bool WillDispatchTabUpdatedEvent(
return true;
}
+bool WillDispatchTabCreatedEvent(WebContents* contents,
+ bool active,
+ content::BrowserContext* context,
+ const Extension* extension,
+ Event* event,
+ const base::DictionaryValue* listener_filter) {
+ event->event_args->Clear();
+ std::unique_ptr<base::DictionaryValue> tab_value =
+ ExtensionTabUtil::CreateTabObject(contents, ExtensionTabUtil::kScrubTab,
+ extension)
+ ->ToValue();
+ tab_value->SetBoolean(tabs_constants::kSelectedKey, active);
+ tab_value->SetBoolean(tabs_constants::kActiveKey, active);
+ event->event_args->Append(std::move(tab_value));
+ return true;
+}
+
} // namespace
TabsEventRouter::TabEntry::TabEntry(TabsEventRouter* router,
@@ -155,74 +172,143 @@ bool TabsEventRouter::ShouldTrackBrowser(Browser* browser) {
ExtensionTabUtil::BrowserSupportsTabs(browser);
}
-void TabsEventRouter::RegisterForTabNotifications(WebContents* contents) {
- favicon_scoped_observer_.Add(
- favicon::ContentFaviconDriver::FromWebContents(contents));
+void TabsEventRouter::OnBrowserSetLastActive(Browser* browser) {
+ TabsWindowsAPI* tabs_window_api = TabsWindowsAPI::Get(profile_);
+ if (tabs_window_api) {
+ tabs_window_api->windows_event_router()->OnActiveWindowChanged(
+ browser ? browser->extension_window_controller() : NULL);
+ }
+}
- ZoomController::FromWebContents(contents)->AddObserver(this);
+void TabsEventRouter::OnTabStripModelChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) {
+ switch (change.type()) {
+ case TabStripModelChange::kInserted: {
+ for (const auto& delta : change.deltas()) {
+ DispatchTabInsertedAt(tab_strip_model, delta.insert.contents,
+ delta.insert.index,
+ selection.new_contents == delta.insert.contents);
+ }
+ break;
+ }
+ case TabStripModelChange::kRemoved: {
+ for (const auto& delta : change.deltas()) {
+ if (delta.remove.will_be_deleted)
+ DispatchTabClosingAt(tab_strip_model, delta.remove.contents,
+ delta.remove.index);
+
+ DispatchTabDetachedAt(delta.remove.contents, delta.remove.index,
+ selection.old_contents == delta.remove.contents);
+ }
+ break;
+ }
+ case TabStripModelChange::kMoved: {
+ for (const auto& delta : change.deltas()) {
+ DispatchTabMoved(delta.move.contents, delta.move.from_index,
+ delta.move.to_index);
+ }
+ break;
+ }
+ case TabStripModelChange::kReplaced: {
+ for (const auto& delta : change.deltas()) {
+ DispatchTabReplacedAt(delta.replace.old_contents,
+ delta.replace.new_contents, delta.replace.index);
+ }
+ break;
+ }
+ case TabStripModelChange::kSelectionOnly:
+ break;
+ }
- int tab_id = ExtensionTabUtil::GetTabId(contents);
- DCHECK(tab_entries_.find(tab_id) == tab_entries_.end());
- tab_entries_[tab_id] = std::make_unique<TabEntry>(this, contents);
+ if (tab_strip_model->empty())
+ return;
+
+ if (selection.active_tab_changed()) {
+ DispatchActiveTabChanged(selection.old_contents, selection.new_contents,
+ selection.new_model.active(), selection.reason);
+ }
+
+ if (selection.selection_changed()) {
+ DispatchTabSelectionChanged(tab_strip_model, selection.old_model);
+ }
}
-void TabsEventRouter::UnregisterForTabNotifications(WebContents* contents) {
- favicon_scoped_observer_.Remove(
- favicon::ContentFaviconDriver::FromWebContents(contents));
+void TabsEventRouter::TabChangedAt(WebContents* contents,
+ int index,
+ TabChangeType change_type) {
+ TabEntry* entry = GetTabEntry(contents);
+ // TabClosingAt() may have already removed the entry for |contents| even
+ // though the tab has not yet been detached.
+ if (entry)
+ TabUpdated(entry, entry->UpdateLoadState());
+}
- ZoomController::FromWebContents(contents)->RemoveObserver(this);
+void TabsEventRouter::TabPinnedStateChanged(TabStripModel* tab_strip_model,
+ WebContents* contents,
+ int index) {
+ std::set<std::string> changed_property_names;
+ changed_property_names.insert(tabs_constants::kPinnedKey);
+ DispatchTabUpdatedEvent(contents, std::move(changed_property_names));
+}
- int tab_id = ExtensionTabUtil::GetTabId(contents);
- int removed_count = tab_entries_.erase(tab_id);
- DCHECK_GT(removed_count, 0);
+void TabsEventRouter::OnZoomChanged(
+ const ZoomController::ZoomChangedEventData& data) {
+ DCHECK(data.web_contents);
+ int tab_id = ExtensionTabUtil::GetTabId(data.web_contents);
+ if (tab_id < 0)
+ return;
+
+ // Prepare the zoom change information.
+ api::tabs::OnZoomChange::ZoomChangeInfo zoom_change_info;
+ zoom_change_info.tab_id = tab_id;
+ zoom_change_info.old_zoom_factor =
+ content::ZoomLevelToZoomFactor(data.old_zoom_level);
+ zoom_change_info.new_zoom_factor =
+ content::ZoomLevelToZoomFactor(data.new_zoom_level);
+ ZoomModeToZoomSettings(data.zoom_mode, &zoom_change_info.zoom_settings);
+
+ // Dispatch the |onZoomChange| event.
+ Profile* profile =
+ Profile::FromBrowserContext(data.web_contents->GetBrowserContext());
+ DispatchEvent(profile, events::TABS_ON_ZOOM_CHANGE,
+ api::tabs::OnZoomChange::kEventName,
+ api::tabs::OnZoomChange::Create(zoom_change_info),
+ EventRouter::USER_GESTURE_UNKNOWN);
}
-void TabsEventRouter::OnBrowserSetLastActive(Browser* browser) {
- TabsWindowsAPI* tabs_window_api = TabsWindowsAPI::Get(profile_);
- if (tabs_window_api) {
- tabs_window_api->windows_event_router()->OnActiveWindowChanged(
- browser ? browser->extension_window_controller() : NULL);
+void TabsEventRouter::OnFaviconUpdated(
+ favicon::FaviconDriver* favicon_driver,
+ NotificationIconType notification_icon_type,
+ const GURL& icon_url,
+ bool icon_url_changed,
+ const gfx::Image& image) {
+ if (notification_icon_type == NON_TOUCH_16_DIP && icon_url_changed) {
+ favicon::ContentFaviconDriver* content_favicon_driver =
+ static_cast<favicon::ContentFaviconDriver*>(favicon_driver);
+ FaviconUrlUpdated(content_favicon_driver->web_contents());
}
}
-static bool WillDispatchTabCreatedEvent(
- WebContents* contents,
- bool active,
- content::BrowserContext* context,
- const Extension* extension,
- Event* event,
- const base::DictionaryValue* listener_filter) {
- event->event_args->Clear();
- std::unique_ptr<base::DictionaryValue> tab_value =
- ExtensionTabUtil::CreateTabObject(contents, ExtensionTabUtil::kScrubTab,
- extension)
- ->ToValue();
- tab_value->SetBoolean(tabs_constants::kSelectedKey, active);
- tab_value->SetBoolean(tabs_constants::kActiveKey, active);
- event->event_args->Append(std::move(tab_value));
- return true;
+void TabsEventRouter::OnDiscardedStateChange(WebContents* contents,
+ bool is_discarded) {
+ std::set<std::string> changed_property_names;
+ changed_property_names.insert(tabs_constants::kDiscardedKey);
+ DispatchTabUpdatedEvent(contents, std::move(changed_property_names));
}
-void TabsEventRouter::TabCreatedAt(WebContents* contents,
- int index,
- bool active) {
- Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
- std::unique_ptr<base::ListValue> args(new base::ListValue);
- auto event = std::make_unique<Event>(events::TABS_ON_CREATED,
- api::tabs::OnCreated::kEventName,
- std::move(args), profile);
- event->user_gesture = EventRouter::USER_GESTURE_NOT_ENABLED;
- event->will_dispatch_callback =
- base::Bind(&WillDispatchTabCreatedEvent, contents, active);
- EventRouter::Get(profile)->BroadcastEvent(std::move(event));
-
- RegisterForTabNotifications(contents);
+void TabsEventRouter::OnAutoDiscardableStateChange(WebContents* contents,
+ bool is_auto_discardable) {
+ std::set<std::string> changed_property_names;
+ changed_property_names.insert(tabs_constants::kAutoDiscardableKey);
+ DispatchTabUpdatedEvent(contents, std::move(changed_property_names));
}
-void TabsEventRouter::TabInsertedAt(TabStripModel* tab_strip_model,
- WebContents* contents,
- int index,
- bool active) {
+void TabsEventRouter::DispatchTabInsertedAt(TabStripModel* tab_strip_model,
+ WebContents* contents,
+ int index,
+ bool active) {
if (!GetTabEntry(contents)) {
// We've never seen this tab, send create event as long as we're not in the
// constructor.
@@ -252,9 +338,33 @@ void TabsEventRouter::TabInsertedAt(TabStripModel* tab_strip_model,
EventRouter::USER_GESTURE_UNKNOWN);
}
-void TabsEventRouter::TabDetachedAt(WebContents* contents,
- int index,
- bool was_active) {
+void TabsEventRouter::DispatchTabClosingAt(TabStripModel* tab_strip_model,
+ WebContents* contents,
+ int index) {
+ int tab_id = ExtensionTabUtil::GetTabId(contents);
+
+ std::unique_ptr<base::ListValue> args(new base::ListValue);
+ args->AppendInteger(tab_id);
+
+ std::unique_ptr<base::DictionaryValue> object_args(
+ new base::DictionaryValue());
+ object_args->SetInteger(tabs_constants::kWindowIdKey,
+ ExtensionTabUtil::GetWindowIdOfTab(contents));
+ object_args->SetBoolean(tabs_constants::kWindowClosing,
+ tab_strip_model->closing_all());
+ args->Append(std::move(object_args));
+
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
+ DispatchEvent(profile, events::TABS_ON_REMOVED,
+ api::tabs::OnRemoved::kEventName, std::move(args),
+ EventRouter::USER_GESTURE_UNKNOWN);
+
+ UnregisterForTabNotifications(contents);
+}
+
+void TabsEventRouter::DispatchTabDetachedAt(WebContents* contents,
+ int index,
+ bool was_active) {
if (!GetTabEntry(contents)) {
// The tab was removed. Don't send detach event.
return;
@@ -278,34 +388,10 @@ void TabsEventRouter::TabDetachedAt(WebContents* contents,
EventRouter::USER_GESTURE_UNKNOWN);
}
-void TabsEventRouter::TabClosingAt(TabStripModel* tab_strip_model,
- WebContents* contents,
- int index) {
- int tab_id = ExtensionTabUtil::GetTabId(contents);
-
- std::unique_ptr<base::ListValue> args(new base::ListValue);
- args->AppendInteger(tab_id);
-
- std::unique_ptr<base::DictionaryValue> object_args(
- new base::DictionaryValue());
- object_args->SetInteger(tabs_constants::kWindowIdKey,
- ExtensionTabUtil::GetWindowIdOfTab(contents));
- object_args->SetBoolean(tabs_constants::kWindowClosing,
- tab_strip_model->closing_all());
- args->Append(std::move(object_args));
-
- Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
- DispatchEvent(profile, events::TABS_ON_REMOVED,
- api::tabs::OnRemoved::kEventName, std::move(args),
- EventRouter::USER_GESTURE_UNKNOWN);
-
- UnregisterForTabNotifications(contents);
-}
-
-void TabsEventRouter::ActiveTabChanged(WebContents* old_contents,
- WebContents* new_contents,
- int index,
- int reason) {
+void TabsEventRouter::DispatchActiveTabChanged(WebContents* old_contents,
+ WebContents* new_contents,
+ int index,
+ int reason) {
auto args = std::make_unique<base::ListValue>();
int tab_id = ExtensionTabUtil::GetTabId(new_contents);
args->AppendInteger(tab_id);
@@ -340,7 +426,7 @@ void TabsEventRouter::ActiveTabChanged(WebContents* old_contents,
std::move(on_activated_args), gesture);
}
-void TabsEventRouter::TabSelectionChanged(
+void TabsEventRouter::DispatchTabSelectionChanged(
TabStripModel* tab_strip_model,
const ui::ListSelectionModel& old_model) {
ui::ListSelectionModel::SelectedIndices new_selection =
@@ -378,9 +464,9 @@ void TabsEventRouter::TabSelectionChanged(
EventRouter::USER_GESTURE_UNKNOWN);
}
-void TabsEventRouter::TabMoved(WebContents* contents,
- int from_index,
- int to_index) {
+void TabsEventRouter::DispatchTabMoved(WebContents* contents,
+ int from_index,
+ int to_index) {
std::unique_ptr<base::ListValue> args(new base::ListValue);
args->AppendInteger(ExtensionTabUtil::GetTabId(contents));
@@ -400,6 +486,43 @@ void TabsEventRouter::TabMoved(WebContents* contents,
std::move(args), EventRouter::USER_GESTURE_UNKNOWN);
}
+void TabsEventRouter::DispatchTabReplacedAt(WebContents* old_contents,
+ WebContents* new_contents,
+ int index) {
+ // Notify listeners that the next tabs closing or being added are due to
+ // WebContents being swapped.
+ const int new_tab_id = ExtensionTabUtil::GetTabId(new_contents);
+ const int old_tab_id = ExtensionTabUtil::GetTabId(old_contents);
+ std::unique_ptr<base::ListValue> args(new base::ListValue);
+ args->AppendInteger(new_tab_id);
+ args->AppendInteger(old_tab_id);
+
+ DispatchEvent(Profile::FromBrowserContext(new_contents->GetBrowserContext()),
+ events::TABS_ON_REPLACED, api::tabs::OnReplaced::kEventName,
+ std::move(args), EventRouter::USER_GESTURE_UNKNOWN);
+
+ UnregisterForTabNotifications(old_contents);
+
+ if (!GetTabEntry(new_contents))
+ RegisterForTabNotifications(new_contents);
+}
+
+void TabsEventRouter::TabCreatedAt(WebContents* contents,
+ int index,
+ bool active) {
+ Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
+ std::unique_ptr<base::ListValue> args(new base::ListValue);
+ auto event = std::make_unique<Event>(events::TABS_ON_CREATED,
+ api::tabs::OnCreated::kEventName,
+ std::move(args), profile);
+ event->user_gesture = EventRouter::USER_GESTURE_NOT_ENABLED;
+ event->will_dispatch_callback =
+ base::Bind(&WillDispatchTabCreatedEvent, contents, active);
+ EventRouter::Get(profile)->BroadcastEvent(std::move(event));
+
+ RegisterForTabNotifications(contents);
+}
+
void TabsEventRouter::TabUpdated(TabEntry* entry,
std::set<std::string> changed_property_names) {
auto* audible_helper =
@@ -476,103 +599,32 @@ void TabsEventRouter::DispatchTabUpdatedEvent(
EventRouter::Get(profile)->BroadcastEvent(std::move(event));
}
-TabsEventRouter::TabEntry* TabsEventRouter::GetTabEntry(WebContents* contents) {
- const auto it = tab_entries_.find(ExtensionTabUtil::GetTabId(contents));
-
- return it == tab_entries_.end() ? nullptr : it->second.get();
-}
-
-void TabsEventRouter::TabChangedAt(WebContents* contents,
- int index,
- TabChangeType change_type) {
- TabEntry* entry = GetTabEntry(contents);
- // TabClosingAt() may have already removed the entry for |contents| even
- // though the tab has not yet been detached.
- if (entry)
- TabUpdated(entry, entry->UpdateLoadState());
-}
-
-void TabsEventRouter::TabReplacedAt(TabStripModel* tab_strip_model,
- WebContents* old_contents,
- WebContents* new_contents,
- int index) {
- // Notify listeners that the next tabs closing or being added are due to
- // WebContents being swapped.
- const int new_tab_id = ExtensionTabUtil::GetTabId(new_contents);
- const int old_tab_id = ExtensionTabUtil::GetTabId(old_contents);
- std::unique_ptr<base::ListValue> args(new base::ListValue);
- args->AppendInteger(new_tab_id);
- args->AppendInteger(old_tab_id);
-
- DispatchEvent(Profile::FromBrowserContext(new_contents->GetBrowserContext()),
- events::TABS_ON_REPLACED, api::tabs::OnReplaced::kEventName,
- std::move(args), EventRouter::USER_GESTURE_UNKNOWN);
-
- UnregisterForTabNotifications(old_contents);
+void TabsEventRouter::RegisterForTabNotifications(WebContents* contents) {
+ favicon_scoped_observer_.Add(
+ favicon::ContentFaviconDriver::FromWebContents(contents));
- if (!GetTabEntry(new_contents))
- RegisterForTabNotifications(new_contents);
-}
+ ZoomController::FromWebContents(contents)->AddObserver(this);
-void TabsEventRouter::TabPinnedStateChanged(TabStripModel* tab_strip_model,
- WebContents* contents,
- int index) {
- std::set<std::string> changed_property_names;
- changed_property_names.insert(tabs_constants::kPinnedKey);
- DispatchTabUpdatedEvent(contents, std::move(changed_property_names));
+ int tab_id = ExtensionTabUtil::GetTabId(contents);
+ DCHECK(tab_entries_.find(tab_id) == tab_entries_.end());
+ tab_entries_[tab_id] = std::make_unique<TabEntry>(this, contents);
}
-void TabsEventRouter::OnZoomChanged(
- const ZoomController::ZoomChangedEventData& data) {
- DCHECK(data.web_contents);
- int tab_id = ExtensionTabUtil::GetTabId(data.web_contents);
- if (tab_id < 0)
- return;
-
- // Prepare the zoom change information.
- api::tabs::OnZoomChange::ZoomChangeInfo zoom_change_info;
- zoom_change_info.tab_id = tab_id;
- zoom_change_info.old_zoom_factor =
- content::ZoomLevelToZoomFactor(data.old_zoom_level);
- zoom_change_info.new_zoom_factor =
- content::ZoomLevelToZoomFactor(data.new_zoom_level);
- ZoomModeToZoomSettings(data.zoom_mode,
- &zoom_change_info.zoom_settings);
+void TabsEventRouter::UnregisterForTabNotifications(WebContents* contents) {
+ favicon_scoped_observer_.Remove(
+ favicon::ContentFaviconDriver::FromWebContents(contents));
- // Dispatch the |onZoomChange| event.
- Profile* profile = Profile::FromBrowserContext(
- data.web_contents->GetBrowserContext());
- DispatchEvent(profile, events::TABS_ON_ZOOM_CHANGE,
- api::tabs::OnZoomChange::kEventName,
- api::tabs::OnZoomChange::Create(zoom_change_info),
- EventRouter::USER_GESTURE_UNKNOWN);
-}
+ ZoomController::FromWebContents(contents)->RemoveObserver(this);
-void TabsEventRouter::OnFaviconUpdated(
- favicon::FaviconDriver* favicon_driver,
- NotificationIconType notification_icon_type,
- const GURL& icon_url,
- bool icon_url_changed,
- const gfx::Image& image) {
- if (notification_icon_type == NON_TOUCH_16_DIP && icon_url_changed) {
- favicon::ContentFaviconDriver* content_favicon_driver =
- static_cast<favicon::ContentFaviconDriver*>(favicon_driver);
- FaviconUrlUpdated(content_favicon_driver->web_contents());
- }
+ int tab_id = ExtensionTabUtil::GetTabId(contents);
+ int removed_count = tab_entries_.erase(tab_id);
+ DCHECK_GT(removed_count, 0);
}
-void TabsEventRouter::OnDiscardedStateChange(WebContents* contents,
- bool is_discarded) {
- std::set<std::string> changed_property_names;
- changed_property_names.insert(tabs_constants::kDiscardedKey);
- DispatchTabUpdatedEvent(contents, std::move(changed_property_names));
-}
+TabsEventRouter::TabEntry* TabsEventRouter::GetTabEntry(WebContents* contents) {
+ const auto it = tab_entries_.find(ExtensionTabUtil::GetTabId(contents));
-void TabsEventRouter::OnAutoDiscardableStateChange(WebContents* contents,
- bool is_auto_discardable) {
- std::set<std::string> changed_property_names;
- changed_property_names.insert(tabs_constants::kAutoDiscardableKey);
- DispatchTabUpdatedEvent(contents, std::move(changed_property_names));
+ return it == tab_entries_.end() ? nullptr : it->second.get();
}
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.h b/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.h
index d0b11d82c81..a7796a93f9d 100644
--- a/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.h
+++ b/chromium/chrome/browser/extensions/api/tabs/tabs_event_router.h
@@ -54,32 +54,14 @@ class TabsEventRouter : public TabStripModelObserver,
void OnBrowserSetLastActive(Browser* browser) override;
// TabStripModelObserver:
- void TabInsertedAt(TabStripModel* tab_strip_model,
- content::WebContents* contents,
- int index,
- bool active) override;
- void TabClosingAt(TabStripModel* tab_strip_model,
- content::WebContents* contents,
- int index) override;
- void TabDetachedAt(content::WebContents* contents,
- int index,
- bool was_active) override;
- void ActiveTabChanged(content::WebContents* old_contents,
- content::WebContents* new_contents,
- int index,
- int reason) override;
- void TabSelectionChanged(TabStripModel* tab_strip_model,
- const ui::ListSelectionModel& old_model) override;
- void TabMoved(content::WebContents* contents,
- int from_index,
- int to_index) override;
+ void OnTabStripModelChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) override;
+
void TabChangedAt(content::WebContents* contents,
int index,
TabChangeType change_type) override;
- void TabReplacedAt(TabStripModel* tab_strip_model,
- content::WebContents* old_contents,
- content::WebContents* new_contents,
- int index) override;
void TabPinnedStateChanged(TabStripModel* tab_strip_model,
content::WebContents* contents,
int index) override;
@@ -102,7 +84,32 @@ class TabsEventRouter : public TabStripModelObserver,
bool is_auto_discardable) override;
private:
- // "Synthetic" event. Called from TabInsertedAt if new tab is detected.
+ // Methods called from OnTabStripModelChanged.
+ void DispatchTabInsertedAt(TabStripModel* tab_strip_model,
+ content::WebContents* contents,
+ int index,
+ bool active);
+ void DispatchTabClosingAt(TabStripModel* tab_strip_model,
+ content::WebContents* contents,
+ int index);
+ void DispatchTabDetachedAt(content::WebContents* contents,
+ int index,
+ bool was_active);
+ void DispatchActiveTabChanged(content::WebContents* old_contents,
+ content::WebContents* new_contents,
+ int index,
+ int reason);
+ void DispatchTabSelectionChanged(TabStripModel* tab_strip_model,
+ const ui::ListSelectionModel& old_model);
+ void DispatchTabMoved(content::WebContents* contents,
+ int from_index,
+ int to_index);
+ void DispatchTabReplacedAt(content::WebContents* old_contents,
+ content::WebContents* new_contents,
+ int index);
+
+ // "Synthetic" event. Called from DispatchTabInsertedAt if new tab is
+ // detected.
void TabCreatedAt(content::WebContents* contents, int index, bool active);
// Internal processing of tab updated events. Intended to be called when
@@ -123,12 +130,6 @@ class TabsEventRouter : public TabStripModelObserver,
std::unique_ptr<base::ListValue> args,
EventRouter::UserGestureState user_gesture);
- void DispatchEventsAcrossIncognito(
- Profile* profile,
- const std::string& event_name,
- std::unique_ptr<base::ListValue> event_args,
- std::unique_ptr<base::ListValue> cross_incognito_args);
-
// Packages |changed_property_names| as a tab updated event for the tab
// |contents| and dispatches the event to the extension.
void DispatchTabUpdatedEvent(
diff --git a/chromium/chrome/browser/extensions/api/terminal/terminal_private_api.cc b/chromium/chrome/browser/extensions/api/terminal/terminal_private_api.cc
index 6a0a795e8bb..b550c6a0e6e 100644
--- a/chromium/chrome/browser/extensions/api/terminal/terminal_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/terminal/terminal_private_api.cc
@@ -12,7 +12,7 @@
#include "base/command_line.h"
#include "base/json/json_writer.h"
#include "base/sys_info.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h"
#include "chrome/browser/extensions/extension_service.h"
diff --git a/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
index 7c5099fbe81..c546379bcd8 100644
--- a/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
+++ b/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
@@ -33,8 +33,6 @@
namespace GetFrame = extensions::api::web_navigation::GetFrame;
namespace GetAllFrames = extensions::api::web_navigation::GetAllFrames;
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::WebNavigationTabObserver);
-
namespace extensions {
namespace web_navigation = api::web_navigation;
@@ -90,25 +88,32 @@ bool WebNavigationEventRouter::ShouldTrackBrowser(Browser* browser) {
return profile_->IsSameProfile(browser->profile());
}
-void WebNavigationEventRouter::TabReplacedAt(
+void WebNavigationEventRouter::OnTabStripModelChanged(
TabStripModel* tab_strip_model,
- content::WebContents* old_contents,
- content::WebContents* new_contents,
- int index) {
- WebNavigationTabObserver* tab_observer =
- WebNavigationTabObserver::Get(old_contents);
- if (!tab_observer) {
- // If you hit this DCHECK(), please add reproduction steps to
- // http://crbug.com/109464.
- DCHECK(GetViewType(old_contents) != VIEW_TYPE_TAB_CONTENTS);
- return;
- }
- if (!FrameNavigationState::IsValidUrl(old_contents->GetURL()) ||
- !FrameNavigationState::IsValidUrl(new_contents->GetURL()))
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) {
+ if (change.type() != TabStripModelChange::kReplaced)
return;
- web_navigation_api_helpers::DispatchOnTabReplaced(old_contents, profile_,
- new_contents);
+ for (const auto& delta : change.deltas()) {
+ content::WebContents* old_contents = delta.replace.old_contents;
+ content::WebContents* new_contents = delta.replace.new_contents;
+
+ WebNavigationTabObserver* tab_observer =
+ WebNavigationTabObserver::Get(old_contents);
+ if (!tab_observer) {
+ // If you hit this DCHECK(), please add reproduction steps to
+ // http://crbug.com/109464.
+ DCHECK(GetViewType(old_contents) != VIEW_TYPE_TAB_CONTENTS);
+ continue;
+ }
+ if (!FrameNavigationState::IsValidUrl(old_contents->GetURL()) ||
+ !FrameNavigationState::IsValidUrl(new_contents->GetURL()))
+ continue;
+
+ web_navigation_api_helpers::DispatchOnTabReplaced(old_contents, profile_,
+ new_contents);
+ }
}
void WebNavigationEventRouter::Observe(
@@ -388,10 +393,14 @@ void WebNavigationTabObserver::DidOpenRequestedURL(
if (!router)
return;
- router->RecordNewWebContents(web_contents(),
- source_render_frame_host->GetProcess()->GetID(),
- source_render_frame_host->GetRoutingID(), url,
- new_contents, renderer_initiated);
+ TabStripModel* ignored_tab_strip_model = nullptr;
+ int ignored_tab_index = -1;
+ bool new_contents_is_present_in_tabstrip = ExtensionTabUtil::GetTabStripModel(
+ new_contents, &ignored_tab_strip_model, &ignored_tab_index);
+ router->RecordNewWebContents(
+ web_contents(), source_render_frame_host->GetProcess()->GetID(),
+ source_render_frame_host->GetRoutingID(), url, new_contents,
+ !new_contents_is_present_in_tabstrip);
}
void WebNavigationTabObserver::WebContentsDestroyed() {
diff --git a/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.h b/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
index 1b4b6645194..30e90fc1077 100644
--- a/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
+++ b/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
@@ -148,10 +148,10 @@ class WebNavigationEventRouter : public TabStripModelObserver,
bool ShouldTrackBrowser(Browser* browser) override;
// TabStripModelObserver implementation.
- void TabReplacedAt(TabStripModel* tab_strip_model,
- content::WebContents* old_contents,
- content::WebContents* new_contents,
- int index) override;
+ void OnTabStripModelChanged(
+ TabStripModel* tab_strip_model,
+ const TabStripModelChange& change,
+ const TabStripSelectionChange& selection) override;
// content::NotificationObserver implementation.
void Observe(int type,
diff --git a/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
index 45bae3a8d76..06d2a2591bf 100644
--- a/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
@@ -218,9 +218,16 @@ IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, Api) {
ASSERT_TRUE(RunExtensionTest("webnavigation/api")) << message_;
}
-IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, GetFrame) {
+// Flaky on Windows. See http://crbug.com/874782
+#if defined(OS_WIN)
+#define MAYBE_GetFrame DISABLED_GetFrame
+#else
+#define MAYBE_GetFrame GetFrame
+#endif
+IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, MAYBE_GetFrame) {
ASSERT_TRUE(RunExtensionTest("webnavigation/getFrame")) << message_;
}
+#undef MAYBE_GetFrame
IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, ClientRedirect) {
ASSERT_TRUE(RunExtensionTest("webnavigation/clientRedirect"))
@@ -246,9 +253,18 @@ IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, Download) {
}
IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, ServerRedirectSingleProcess) {
- // TODO(lukasza): https://crbug.com/671734: Investigate why this test fails
- // with --site-per-process.
- if (content::AreAllSitesIsolatedForTesting())
+ // TODO(lukasza): https://crbug.com/671734: In the long-term, //chrome-layer
+ // tests should only be run with site-per-process - remove the early return
+ // below when fixing https://crbug.com/870761 and removing the
+ // not_site_per_process_browser_tests step.
+ //
+ // This test has its expectations in
+ // serverRedirectSingleProcess/test_serverRedirectSingleProcess.js. The
+ // expectations include exact |processId| ("exact" meaning that one cannot use
+ // a wildcard - the verification is done via chrome.test.checkDeepEq).
+ // Inclusion of |processId| means that the expectation change in
+ // site-per-process mode.
+ if (!content::AreAllSitesIsolatedForTesting())
return;
ASSERT_TRUE(StartEmbeddedTestServer());
@@ -346,7 +362,16 @@ IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, MAYBE_UserAction) {
GURL url = extension->GetResourceURL(
"a.html?" + base::IntToString(embedded_test_server()->port()));
+ // Register an observer for the navigation in the subframe, so the test
+ // can wait until it is fully complete. Otherwise the context menu
+ // navigation is non-deterministic on which process it will get associated
+ // with, leading to test flakiness.
+ content::TestNavigationManager nav_manager(
+ tab, embedded_test_server()->GetURL(
+ "/extensions/api_test/webnavigation/userAction/subframe.html"));
ui_test_utils::NavigateToURL(browser(), url);
+ nav_manager.WaitForNavigationFinished();
+ EXPECT_TRUE(nav_manager.was_successful());
// This corresponds to "Open link in new tab".
content::ContextMenuParams params;
diff --git a/chromium/chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.cc b/chromium/chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.cc
index 547d704e804..f9b9e4ac4cb 100644
--- a/chromium/chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.cc
+++ b/chromium/chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.cc
@@ -43,6 +43,21 @@ void NotifyWebRequestWithheldOnUI(int render_process_id,
if (!extension)
return;
+ // If the extension doesn't request access to the tab, return. The user
+ // invoking the extension on a site grants access to the tab's origin if
+ // and only if the extension requested it; without requesting the tab,
+ // clicking on the extension won't grant access to the resource.
+ // https://crbug.com/891586.
+ // TODO(https://157736): We can remove this if extensions require host
+ // permissions to the initiator, since then we'll never get into this type
+ // of circumstance (the request would be blocked, rather than withheld).
+ if (!extension->permissions_data()
+ ->withheld_permissions()
+ .explicit_hosts()
+ .MatchesURL(rfh->GetLastCommittedURL())) {
+ return;
+ }
+
runner->OnWebRequestBlocked(extension);
}
diff --git a/chromium/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chromium/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
index ec0e9ea2710..566f1087400 100644
--- a/chromium/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
+++ b/chromium/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
@@ -46,7 +46,6 @@
#include "extensions/browser/api/web_request/web_request_api.h"
#include "extensions/browser/api/web_request/web_request_api_constants.h"
#include "extensions/browser/api/web_request/web_request_api_helpers.h"
-#include "extensions/browser/warning_set.h"
#include "extensions/common/api/web_request.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/features/feature.h"
@@ -116,12 +115,14 @@ static void EventHandledOnIOThread(
}
// Returns whether |warnings| contains an extension for |extension_id|.
-bool HasWarning(const WarningSet& warnings,
- const std::string& extension_id) {
- for (WarningSet::const_iterator i = warnings.begin();
- i != warnings.end(); ++i) {
- if (i->extension_id() == extension_id)
+bool HasIgnoredAction(const helpers::IgnoredActions& ignored_actions,
+ const std::string& extension_id,
+ web_request::IgnoredActionType action_type) {
+ for (const auto& ignored_action : ignored_actions) {
+ if (ignored_action.extension_id == extension_id &&
+ ignored_action.action_type == action_type) {
return true;
+ }
}
return false;
}
@@ -228,8 +229,6 @@ class ExtensionWebRequestTest : public testing::Test {
protected:
void SetUp() override {
ASSERT_TRUE(profile_manager_.SetUp());
- ChromeNetworkDelegate::InitializePrefsOnUIThread(
- nullptr, nullptr, nullptr, profile_.GetTestingPrefService());
network_delegate_.reset(new ChromeNetworkDelegate(event_router_.get()));
network_delegate_->set_profile(&profile_);
network_delegate_->set_cookie_settings(
@@ -1121,8 +1120,6 @@ class ExtensionWebRequestHeaderModificationTest
protected:
void SetUp() override {
ASSERT_TRUE(profile_manager_.SetUp());
- ChromeNetworkDelegate::InitializePrefsOnUIThread(
- nullptr, nullptr, nullptr, profile_.GetTestingPrefService());
network_delegate_.reset(new ChromeNetworkDelegate(event_router_.get()));
network_delegate_->set_profile(&profile_);
network_delegate_->set_cookie_settings(
@@ -1543,14 +1540,14 @@ TEST(ExtensionWebRequestHelpersTest, TestCalculateOnBeforeSendHeadersDelta) {
const bool cancel = true;
std::string value;
net::HttpRequestHeaders old_headers;
- old_headers.AddHeadersFromString("key1: value1\r\n"
- "key2: value2\r\n");
+ old_headers.SetHeader("key1", "value1");
+ old_headers.SetHeader("key2", "value2");
// Test adding a header.
net::HttpRequestHeaders new_headers_added;
- new_headers_added.AddHeadersFromString("key1: value1\r\n"
- "key3: value3\r\n"
- "key2: value2\r\n");
+ new_headers_added.SetHeader("key1", "value1");
+ new_headers_added.SetHeader("key3", "value3");
+ new_headers_added.SetHeader("key2", "value2");
std::unique_ptr<EventResponseDelta> delta_added(
CalculateOnBeforeSendHeadersDelta("extid", base::Time::Now(), cancel,
&old_headers, &new_headers_added));
@@ -1561,7 +1558,7 @@ TEST(ExtensionWebRequestHelpersTest, TestCalculateOnBeforeSendHeadersDelta) {
// Test deleting a header.
net::HttpRequestHeaders new_headers_deleted;
- new_headers_deleted.AddHeadersFromString("key1: value1\r\n");
+ new_headers_deleted.SetHeader("key1", "value1");
std::unique_ptr<EventResponseDelta> delta_deleted(
CalculateOnBeforeSendHeadersDelta("extid", base::Time::Now(), cancel,
&old_headers, &new_headers_deleted));
@@ -1571,8 +1568,8 @@ TEST(ExtensionWebRequestHelpersTest, TestCalculateOnBeforeSendHeadersDelta) {
// Test modifying a header.
net::HttpRequestHeaders new_headers_modified;
- new_headers_modified.AddHeadersFromString("key1: value1\r\n"
- "key2: value3\r\n");
+ new_headers_modified.SetHeader("key1", "value1");
+ new_headers_modified.SetHeader("key2", "value3");
std::unique_ptr<EventResponseDelta> delta_modified(
CalculateOnBeforeSendHeadersDelta("extid", base::Time::Now(), cancel,
&old_headers, &new_headers_modified));
@@ -1586,9 +1583,9 @@ TEST(ExtensionWebRequestHelpersTest, TestCalculateOnBeforeSendHeadersDelta) {
// value) pair with a key that existed before. This is incorrect
// usage of the API that shall be handled gracefully.
net::HttpRequestHeaders new_headers_modified2;
- new_headers_modified2.AddHeadersFromString("key1: value1\r\n"
- "key2: value2\r\n"
- "key2: value3\r\n");
+ new_headers_modified2.SetHeader("key1", "value1");
+ new_headers_modified2.SetHeader("key2", "value2");
+ new_headers_modified2.SetHeader("key2", "value3");
std::unique_ptr<EventResponseDelta> delta_modified2(
CalculateOnBeforeSendHeadersDelta("extid", base::Time::Now(), cancel,
&old_headers, &new_headers_modified));
@@ -1712,7 +1709,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeCancelOfResponses) {
TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
EventResponseDeltas deltas;
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
GURL effective_new_url;
// No redirect
@@ -1720,7 +1717,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
new EventResponseDelta("extid0", base::Time::FromInternalValue(0)));
deltas.push_back(d0);
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_TRUE(effective_new_url.is_empty());
// Single redirect.
@@ -1732,9 +1729,9 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_1, effective_new_url);
- EXPECT_TRUE(warning_set.empty());
+ EXPECT_TRUE(ignored_actions.empty());
EXPECT_EQ(1u, logger.log_size());
// Ignored redirect (due to precedence).
@@ -1744,13 +1741,14 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
d2->new_url = GURL(new_url_2);
deltas.push_back(d2);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_1, effective_new_url);
- EXPECT_EQ(1u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(1u, ignored_actions.size());
+ EXPECT_TRUE(HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_REDIRECT));
EXPECT_EQ(2u, logger.log_size());
// Overriding redirect.
@@ -1760,14 +1758,16 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
d3->new_url = GURL(new_url_3);
deltas.push_back(d3);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_3, effective_new_url);
- EXPECT_EQ(2u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid1"));
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(2u, ignored_actions.size());
+ EXPECT_TRUE(HasIgnoredAction(ignored_actions, "extid1",
+ web_request::IGNORED_ACTION_TYPE_REDIRECT));
+ EXPECT_TRUE(HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_REDIRECT));
EXPECT_EQ(3u, logger.log_size());
// Check that identical redirects don't cause a conflict.
@@ -1776,14 +1776,16 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
d4->new_url = GURL(new_url_3);
deltas.push_back(d4);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_3, effective_new_url);
- EXPECT_EQ(2u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid1"));
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(2u, ignored_actions.size());
+ EXPECT_TRUE(HasIgnoredAction(ignored_actions, "extid1",
+ web_request::IGNORED_ACTION_TYPE_REDIRECT));
+ EXPECT_TRUE(HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_REDIRECT));
EXPECT_EQ(4u, logger.log_size());
}
@@ -1792,7 +1794,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses) {
TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
EventResponseDeltas deltas;
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
GURL effective_new_url;
// Single redirect.
@@ -1802,7 +1804,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
d0->new_url = GURL(new_url_0);
deltas.push_back(d0);
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_0, effective_new_url);
// Cancel request by redirecting to a data:// URL. This shall override
@@ -1813,12 +1815,12 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
d1->new_url = GURL(new_url_1);
deltas.push_back(d1);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_1, effective_new_url);
- EXPECT_TRUE(warning_set.empty());
+ EXPECT_TRUE(ignored_actions.empty());
EXPECT_EQ(1u, logger.log_size());
// Cancel request by redirecting to the same data:// URL. This shall
@@ -1829,13 +1831,13 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
d2->new_url = GURL(new_url_2);
deltas.push_back(d2);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_1, effective_new_url);
- EXPECT_TRUE(warning_set.empty());
+ EXPECT_TRUE(ignored_actions.empty());
EXPECT_EQ(2u, logger.log_size());
// Cancel redirect by redirecting to a different data:// URL. This needs
@@ -1846,13 +1848,14 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
d3->new_url = GURL(new_url_3);
deltas.push_back(d3);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_1, effective_new_url);
- EXPECT_EQ(1u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid3"));
+ EXPECT_EQ(1u, ignored_actions.size());
+ EXPECT_TRUE(HasIgnoredAction(ignored_actions, "extid3",
+ web_request::IGNORED_ACTION_TYPE_REDIRECT));
EXPECT_EQ(3u, logger.log_size());
}
@@ -1861,7 +1864,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses2) {
TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses3) {
EventResponseDeltas deltas;
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
GURL effective_new_url;
// Single redirect.
@@ -1871,7 +1874,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses3) {
d0->new_url = GURL(new_url_0);
deltas.push_back(d0);
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_0, effective_new_url);
// Cancel request by redirecting to about:blank. This shall override
@@ -1882,12 +1885,12 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses3) {
d1->new_url = GURL(new_url_1);
deltas.push_back(d1);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
MergeOnBeforeRequestResponses(GURL(kExampleUrl), deltas, &effective_new_url,
- &warning_set, &logger);
+ &ignored_actions, &logger);
EXPECT_EQ(new_url_1, effective_new_url);
- EXPECT_TRUE(warning_set.empty());
+ EXPECT_TRUE(ignored_actions.empty());
EXPECT_EQ(1u, logger.log_size());
}
@@ -1895,7 +1898,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses3) {
TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses4) {
EventResponseDeltas deltas;
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
GURL effective_new_url;
// Single redirect.
@@ -1904,7 +1907,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeRequestResponses4) {
delta->new_url = GURL("http://foo.com");
deltas.push_back(delta);
MergeOnBeforeRequestResponses(GURL("ws://example.com"), deltas,
- &effective_new_url, &warning_set, &logger);
+ &effective_new_url, &ignored_actions, &logger);
EXPECT_EQ(GURL(), effective_new_url);
}
@@ -1913,7 +1916,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
base_headers.SetHeader("key1", "value 1");
base_headers.SetHeader("key2", "value 2");
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
std::string header_value;
EventResponseDeltas deltas;
@@ -1924,13 +1927,13 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
bool request_headers_modified0;
net::HttpRequestHeaders headers0;
headers0.MergeFrom(base_headers);
- MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers0, &warning_set,
+ MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers0, &ignored_actions,
&logger, &request_headers_modified0);
ASSERT_TRUE(headers0.GetHeader("key1", &header_value));
EXPECT_EQ("value 1", header_value);
ASSERT_TRUE(headers0.GetHeader("key2", &header_value));
EXPECT_EQ("value 2", header_value);
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(0u, logger.log_size());
EXPECT_FALSE(request_headers_modified0);
@@ -1942,19 +1945,19 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
d1->modified_request_headers.SetHeader("key3", "value 3");
deltas.push_back(d1);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
bool request_headers_modified1;
net::HttpRequestHeaders headers1;
headers1.MergeFrom(base_headers);
- MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers1, &warning_set,
+ MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers1, &ignored_actions,
&logger, &request_headers_modified1);
EXPECT_FALSE(headers1.HasHeader("key1"));
ASSERT_TRUE(headers1.GetHeader("key2", &header_value));
EXPECT_EQ("value 3", header_value);
ASSERT_TRUE(headers1.GetHeader("key3", &header_value));
EXPECT_EQ("value 3", header_value);
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(1u, logger.log_size());
EXPECT_TRUE(request_headers_modified1);
@@ -1967,12 +1970,12 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
d2->modified_request_headers.SetHeader("key4", "value 4");
deltas.push_back(d2);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
bool request_headers_modified2;
net::HttpRequestHeaders headers2;
headers2.MergeFrom(base_headers);
- MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers2, &warning_set,
+ MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers2, &ignored_actions,
&logger, &request_headers_modified2);
EXPECT_FALSE(headers2.HasHeader("key1"));
ASSERT_TRUE(headers2.GetHeader("key2", &header_value));
@@ -1980,8 +1983,10 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
ASSERT_TRUE(headers2.GetHeader("key3", &header_value));
EXPECT_EQ("value 3", header_value);
EXPECT_FALSE(headers2.HasHeader("key4"));
- EXPECT_EQ(1u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(1u, ignored_actions.size());
+ EXPECT_TRUE(
+ HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_REQUEST_HEADERS));
EXPECT_EQ(2u, logger.log_size());
EXPECT_TRUE(request_headers_modified2);
@@ -1994,12 +1999,12 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
d3->modified_request_headers.SetHeader("key5", "value 5");
deltas.push_back(d3);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
bool request_headers_modified3;
net::HttpRequestHeaders headers3;
headers3.MergeFrom(base_headers);
- MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers3, &warning_set,
+ MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers3, &ignored_actions,
&logger, &request_headers_modified3);
EXPECT_FALSE(headers3.HasHeader("key1"));
ASSERT_TRUE(headers3.GetHeader("key2", &header_value));
@@ -2008,8 +2013,10 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
EXPECT_EQ("value 3", header_value);
ASSERT_TRUE(headers3.GetHeader("key5", &header_value));
EXPECT_EQ("value 5", header_value);
- EXPECT_EQ(1u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(1u, ignored_actions.size());
+ EXPECT_TRUE(
+ HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_REQUEST_HEADERS));
EXPECT_EQ(3u, logger.log_size());
EXPECT_TRUE(request_headers_modified3);
}
@@ -2017,10 +2024,10 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnBeforeSendHeadersResponses) {
TEST(ExtensionWebRequestHelpersTest,
TestMergeOnBeforeSendHeadersResponses_Cookies) {
net::HttpRequestHeaders base_headers;
- base_headers.AddHeaderFromString(
- "Cookie: name=value; name2=value2; name3=\"value3\"");
+ base_headers.SetHeader("Cookie",
+ "name=value; name2=value2; name3=\"value3\"");
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
std::string header_value;
EventResponseDeltas deltas;
@@ -2066,13 +2073,13 @@ TEST(ExtensionWebRequestHelpersTest,
bool request_headers_modified1;
net::HttpRequestHeaders headers1;
headers1.MergeFrom(base_headers);
- warning_set.clear();
- MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers1, &warning_set,
+ ignored_actions.clear();
+ MergeOnBeforeSendHeadersResponses(GURL(), deltas, &headers1, &ignored_actions,
&logger, &request_headers_modified1);
EXPECT_TRUE(headers1.HasHeader("Cookie"));
ASSERT_TRUE(headers1.GetHeader("Cookie", &header_value));
EXPECT_EQ("name=new value; name2=new value; name4=\"value 4\"", header_value);
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(0u, logger.log_size());
EXPECT_FALSE(request_headers_modified1);
}
@@ -2106,7 +2113,6 @@ std::string GetCookieExpirationDate(int delta_secs) {
TEST(ExtensionWebRequestHelpersTest,
TestMergeCookiesInOnHeadersReceivedResponses) {
TestLogger logger;
- WarningSet warning_set;
std::string header_value;
EventResponseDeltas deltas;
@@ -2140,10 +2146,9 @@ TEST(ExtensionWebRequestHelpersTest,
new EventResponseDelta("extid0", base::Time::FromInternalValue(3000)));
deltas.push_back(d0);
scoped_refptr<net::HttpResponseHeaders> new_headers0;
- MergeCookiesInOnHeadersReceivedResponses(
- GURL(), deltas, base_headers.get(), &new_headers0, &warning_set, &logger);
+ MergeCookiesInOnHeadersReceivedResponses(GURL(), deltas, base_headers.get(),
+ &new_headers0, &logger);
EXPECT_FALSE(new_headers0.get());
- EXPECT_EQ(0u, warning_set.size());
EXPECT_EQ(0u, logger.log_size());
linked_ptr<ResponseCookieModification> add_cookie =
@@ -2308,9 +2313,8 @@ TEST(ExtensionWebRequestHelpersTest,
net::HttpUtil::AssembleRawHeaders(
base_headers_string.c_str(), base_headers_string.size())));
scoped_refptr<net::HttpResponseHeaders> new_headers1;
- warning_set.clear();
- MergeCookiesInOnHeadersReceivedResponses(
- GURL(), deltas, headers1.get(), &new_headers1, &warning_set, &logger);
+ MergeCookiesInOnHeadersReceivedResponses(GURL(), deltas, headers1.get(),
+ &new_headers1, &logger);
EXPECT_TRUE(new_headers1->HasHeader("Foo"));
size_t iter = 0;
@@ -2334,13 +2338,12 @@ TEST(ExtensionWebRequestHelpersTest,
while (new_headers1->EnumerateHeader(&iter, "Set-Cookie", &cookie_string))
actual_cookies.insert(cookie_string);
EXPECT_EQ(expected_cookies, actual_cookies);
- EXPECT_EQ(0u, warning_set.size());
EXPECT_EQ(0u, logger.log_size());
}
TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
std::string header_value;
EventResponseDeltas deltas;
@@ -2363,11 +2366,11 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
GURL allowed_unsafe_redirect_url0;
MergeOnHeadersReceivedResponses(GURL(kExampleUrl), deltas, base_headers.get(),
&new_headers0, &allowed_unsafe_redirect_url0,
- &warning_set, &logger,
+ &ignored_actions, &logger,
&response_headers_modified0);
EXPECT_FALSE(new_headers0.get());
EXPECT_TRUE(allowed_unsafe_redirect_url0.is_empty());
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(0u, logger.log_size());
EXPECT_FALSE(response_headers_modified0);
@@ -2378,14 +2381,14 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
d1->added_response_headers.push_back(ResponseHeader("Key2", "Value3"));
deltas.push_back(d1);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
bool response_headers_modified1;
scoped_refptr<net::HttpResponseHeaders> new_headers1;
GURL allowed_unsafe_redirect_url1;
MergeOnHeadersReceivedResponses(GURL(kExampleUrl), deltas, base_headers.get(),
&new_headers1, &allowed_unsafe_redirect_url1,
- &warning_set, &logger,
+ &ignored_actions, &logger,
&response_headers_modified1);
ASSERT_TRUE(new_headers1.get());
EXPECT_TRUE(allowed_unsafe_redirect_url1.is_empty());
@@ -2399,7 +2402,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
actual1.insert(std::pair<std::string, std::string>(name, value));
}
EXPECT_EQ(expected1, actual1);
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(1u, logger.log_size());
EXPECT_TRUE(response_headers_modified1);
@@ -2412,14 +2415,14 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
d2->added_response_headers.push_back(ResponseHeader("Key2", "Value4"));
deltas.push_back(d2);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
bool response_headers_modified2;
scoped_refptr<net::HttpResponseHeaders> new_headers2;
GURL allowed_unsafe_redirect_url2;
MergeOnHeadersReceivedResponses(GURL(kExampleUrl), deltas, base_headers.get(),
&new_headers2, &allowed_unsafe_redirect_url2,
- &warning_set, &logger,
+ &ignored_actions, &logger,
&response_headers_modified2);
ASSERT_TRUE(new_headers2.get());
EXPECT_TRUE(allowed_unsafe_redirect_url2.is_empty());
@@ -2429,8 +2432,10 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
actual2.insert(std::pair<std::string, std::string>(name, value));
}
EXPECT_EQ(expected1, actual2);
- EXPECT_EQ(1u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(1u, ignored_actions.size());
+ EXPECT_TRUE(
+ HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_RESPONSE_HEADERS));
EXPECT_EQ(2u, logger.log_size());
EXPECT_TRUE(response_headers_modified2);
}
@@ -2439,7 +2444,7 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnHeadersReceivedResponses) {
TEST(ExtensionWebRequestHelpersTest,
TestMergeOnHeadersReceivedResponsesDeletion) {
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
std::string header_value;
EventResponseDeltas deltas;
@@ -2464,7 +2469,7 @@ TEST(ExtensionWebRequestHelpersTest,
GURL allowed_unsafe_redirect_url1;
MergeOnHeadersReceivedResponses(GURL(kExampleUrl), deltas, base_headers.get(),
&new_headers1, &allowed_unsafe_redirect_url1,
- &warning_set, &logger,
+ &ignored_actions, &logger,
&response_headers_modified1);
ASSERT_TRUE(new_headers1.get());
EXPECT_TRUE(allowed_unsafe_redirect_url1.is_empty());
@@ -2480,7 +2485,7 @@ TEST(ExtensionWebRequestHelpersTest,
actual1.insert(std::pair<std::string, std::string>(name, value));
}
EXPECT_EQ(expected1, actual1);
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(1u, logger.log_size());
EXPECT_TRUE(response_headers_modified1);
}
@@ -2492,7 +2497,7 @@ TEST(ExtensionWebRequestHelpersTest,
TestMergeOnHeadersReceivedResponsesRedirect) {
EventResponseDeltas deltas;
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
char base_headers_string[] =
"HTTP/1.0 200 OK\r\n"
@@ -2510,11 +2515,11 @@ TEST(ExtensionWebRequestHelpersTest,
GURL allowed_unsafe_redirect_url0;
MergeOnHeadersReceivedResponses(GURL(kExampleUrl), deltas, base_headers.get(),
&new_headers0, &allowed_unsafe_redirect_url0,
- &warning_set, &logger,
+ &ignored_actions, &logger,
&response_headers_modified0);
EXPECT_FALSE(new_headers0.get());
EXPECT_TRUE(allowed_unsafe_redirect_url0.is_empty());
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(0u, logger.log_size());
EXPECT_FALSE(response_headers_modified0);
@@ -2532,20 +2537,20 @@ TEST(ExtensionWebRequestHelpersTest,
GURL allowed_unsafe_redirect_url1;
MergeOnHeadersReceivedResponses(GURL(kExampleUrl), deltas, base_headers.get(),
&new_headers1, &allowed_unsafe_redirect_url1,
- &warning_set, &logger,
+ &ignored_actions, &logger,
&response_headers_modified1);
EXPECT_TRUE(new_headers1.get());
EXPECT_TRUE(new_headers1->HasHeaderValue("Location", new_url_1.spec()));
EXPECT_EQ(new_url_1, allowed_unsafe_redirect_url1);
- EXPECT_TRUE(warning_set.empty());
+ EXPECT_TRUE(ignored_actions.empty());
EXPECT_EQ(1u, logger.log_size());
EXPECT_FALSE(response_headers_modified1);
}
TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) {
TestLogger logger;
- WarningSet warning_set;
+ helpers::IgnoredActions ignored_actions;
EventResponseDeltas deltas;
base::string16 username = base::ASCIIToUTF16("foo");
base::string16 password = base::ASCIIToUTF16("bar");
@@ -2557,10 +2562,10 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) {
deltas.push_back(d0);
net::AuthCredentials auth0;
bool credentials_set =
- MergeOnAuthRequiredResponses(deltas, &auth0, &warning_set, &logger);
+ MergeOnAuthRequiredResponses(deltas, &auth0, &ignored_actions, &logger);
EXPECT_FALSE(credentials_set);
EXPECT_TRUE(auth0.Empty());
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(0u, logger.log_size());
// Check that we can set AuthCredentials.
@@ -2569,16 +2574,16 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) {
d1->auth_credentials.reset(new net::AuthCredentials(username, password));
deltas.push_back(d1);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
net::AuthCredentials auth1;
credentials_set =
- MergeOnAuthRequiredResponses(deltas, &auth1, &warning_set, &logger);
+ MergeOnAuthRequiredResponses(deltas, &auth1, &ignored_actions, &logger);
EXPECT_TRUE(credentials_set);
EXPECT_FALSE(auth1.Empty());
EXPECT_EQ(username, auth1.username());
EXPECT_EQ(password, auth1.password());
- EXPECT_EQ(0u, warning_set.size());
+ EXPECT_EQ(0u, ignored_actions.size());
EXPECT_EQ(1u, logger.log_size());
// Check that we set AuthCredentials only once.
@@ -2587,17 +2592,19 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) {
d2->auth_credentials.reset(new net::AuthCredentials(username, password2));
deltas.push_back(d2);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
net::AuthCredentials auth2;
credentials_set =
- MergeOnAuthRequiredResponses(deltas, &auth2, &warning_set, &logger);
+ MergeOnAuthRequiredResponses(deltas, &auth2, &ignored_actions, &logger);
EXPECT_TRUE(credentials_set);
EXPECT_FALSE(auth2.Empty());
EXPECT_EQ(username, auth1.username());
EXPECT_EQ(password, auth1.password());
- EXPECT_EQ(1u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(1u, ignored_actions.size());
+ EXPECT_TRUE(
+ HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_AUTH_CREDENTIALS));
EXPECT_EQ(2u, logger.log_size());
// Check that we can set identical AuthCredentials twice without causing
@@ -2607,17 +2614,19 @@ TEST(ExtensionWebRequestHelpersTest, TestMergeOnAuthRequiredResponses) {
d3->auth_credentials.reset(new net::AuthCredentials(username, password));
deltas.push_back(d3);
deltas.sort(&InDecreasingExtensionInstallationTimeOrder);
- warning_set.clear();
+ ignored_actions.clear();
logger.clear();
net::AuthCredentials auth3;
credentials_set =
- MergeOnAuthRequiredResponses(deltas, &auth3, &warning_set, &logger);
+ MergeOnAuthRequiredResponses(deltas, &auth3, &ignored_actions, &logger);
EXPECT_TRUE(credentials_set);
EXPECT_FALSE(auth3.Empty());
EXPECT_EQ(username, auth1.username());
EXPECT_EQ(password, auth1.password());
- EXPECT_EQ(1u, warning_set.size());
- EXPECT_TRUE(HasWarning(warning_set, "extid2"));
+ EXPECT_EQ(1u, ignored_actions.size());
+ EXPECT_TRUE(
+ HasIgnoredAction(ignored_actions, "extid2",
+ web_request::IGNORED_ACTION_TYPE_AUTH_CREDENTIALS));
EXPECT_EQ(3u, logger.log_size());
}
diff --git a/chromium/chrome/browser/extensions/api/web_request/web_request_apitest.cc b/chromium/chrome/browser/extensions/api/web_request/web_request_apitest.cc
index 3b61cddcfb3..34dab4c0c64 100644
--- a/chromium/chrome/browser/extensions/api/web_request/web_request_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -15,12 +15,15 @@
#include "base/synchronization/lock.h"
#include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
+#include "base/time/time.h"
+#include "base/time/time_override.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/devtools/url_constants.h"
#include "chrome/browser/extensions/active_tab_permission_granter.h"
+#include "chrome/browser/extensions/api/extension_action/test_extension_action_api_observer.h"
#include "chrome/browser/extensions/extension_action_runner.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -31,6 +34,8 @@
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_destroyer.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_loader.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_service.h"
#include "chrome/browser/search/one_google_bar/one_google_bar_service_factory.h"
@@ -47,7 +52,7 @@
#include "chrome/test/base/search_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "chromeos/login/scoped_test_public_session_login_state.h"
-#include "components/google/core/browser/google_switches.h"
+#include "components/google/core/common/google_switches.h"
#include "components/prefs/pref_service.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/proxy_config/proxy_config_pref_names.h"
@@ -58,6 +63,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/storage_partition.h"
@@ -68,6 +74,7 @@
#include "content/public/test/url_loader_interceptor.h"
#include "extensions/browser/api/web_request/web_request_api.h"
#include "extensions/browser/blocked_action_type.h"
+#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/extension_features.h"
@@ -89,6 +96,7 @@
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
+#include "services/network/test/test_url_loader_client.h"
#include "third_party/blink/public/platform/web_input_event.h"
#if defined(OS_CHROMEOS)
@@ -268,16 +276,36 @@ class ExtensionWebRequestApiTest : public ExtensionApiTest {
const char* expected_content_regular_window,
const char* exptected_content_incognito_window);
- // TODO(https://crbug.com/857577): remove this hack. When an unrelated
- // browser issued request (typically from GaiaAuthFetcher) has run, it causes
- // the StoragePartitionImpl to create and cache a URLLoaderFactory without the
- // web request proxying. This resets it so one with the web request proxying
- // is created the next time a request is made.
- void ResetStoragePartitionURLLoaderFactory() {
- base::RunLoop().RunUntilIdle();
+ network::mojom::URLLoaderFactoryPtr CreateURLLoaderFactory() {
+ network::mojom::URLLoaderFactoryParamsPtr params =
+ network::mojom::URLLoaderFactoryParams::New();
+ params->process_id = network::mojom::kBrowserProcessId;
+ params->is_corb_enabled = false;
+ network::mojom::URLLoaderFactoryPtr loader_factory;
content::BrowserContext::GetDefaultStoragePartition(profile())
- ->ResetURLLoaderFactoryForBrowserProcessForTesting();
+ ->GetNetworkContext()
+ ->CreateURLLoaderFactory(mojo::MakeRequest(&loader_factory),
+ std::move(params));
+ return loader_factory;
}
+
+ void InstallWebRequestExtension(const std::string& name) {
+ constexpr char kManifest[] = R"({
+ "name": "%s",
+ "version": "1",
+ "manifest_version": 2,
+ "permissions": [
+ "webRequest"
+ ]
+ })";
+ auto dir = std::make_unique<TestExtensionDir>();
+ dir->WriteManifest(base::StringPrintf(kManifest, name.c_str()));
+ LoadExtension(dir->UnpackedPath());
+ test_dirs_.push_back(std::move(dir));
+ }
+
+ private:
+ std::vector<std::unique_ptr<TestExtensionDir>> test_dirs_;
};
class DevToolsFrontendInWebRequestApiTest : public ExtensionApiTest {
@@ -493,8 +521,53 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
#endif
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, MAYBE_WebRequestBlocking) {
ASSERT_TRUE(StartEmbeddedTestServer());
- ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_blocking.html")) <<
- message_;
+ ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_blocking.html"))
+ << message_;
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
+ WebRequestBlockingSetCookieHeader) {
+ ASSERT_TRUE(StartEmbeddedTestServer());
+ ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_blocking_cookie.html"))
+ << message_;
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestRedirects) {
+ ASSERT_TRUE(StartEmbeddedTestServer());
+ ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_redirects.html"))
+ << message_;
+}
+
+// Tests that redirects from secure to insecure don't send the referrer header.
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
+ WebRequestRedirectsToInsecure) {
+ ASSERT_TRUE(StartEmbeddedTestServer());
+ GURL insecure_destination =
+ embedded_test_server()->GetURL("/extensions/test_file.html");
+ net::EmbeddedTestServer https_test_server(
+ net::EmbeddedTestServer::TYPE_HTTPS);
+ https_test_server.ServeFilesFromDirectory(test_data_dir_);
+ ASSERT_TRUE(https_test_server.Start());
+
+ GURL url = https_test_server.GetURL("/webrequest/simulate_click.html");
+
+ base::ListValue custom_args;
+ custom_args.AppendString(url.spec());
+ custom_args.AppendString(insecure_destination.spec());
+
+ std::string config_string;
+ base::JSONWriter::Write(custom_args, &config_string);
+ ASSERT_TRUE(RunExtensionSubtestWithArg(
+ "webrequest", "test_redirects_from_secure.html", config_string.c_str()))
+ << message_;
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
+ WebRequestSubresourceRedirects) {
+ ASSERT_TRUE(StartEmbeddedTestServer());
+ ASSERT_TRUE(
+ RunExtensionSubtest("webrequest", "test_subresource_redirects.html"))
+ << message_;
}
// Fails often on Windows dbg bots. http://crbug.com/177163
@@ -555,7 +628,12 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
MAYBE_WebRequestDeclarative2) {
ASSERT_TRUE(StartEmbeddedTestServer());
- ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_declarative2.html"))
+ const char* network_service_arg =
+ base::FeatureList::IsEnabled(network::features::kNetworkService)
+ ? "NetworkServiceEnabled"
+ : "NetworkServiceDisabled";
+ ASSERT_TRUE(RunExtensionSubtestWithArg("webrequest", "test_declarative2.html",
+ network_service_arg))
<< message_;
}
@@ -897,14 +975,22 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
// frames, this shouldn't show up as a blocked action.
EXPECT_EQ(BLOCKED_ACTION_NONE, runner->GetBlockedActions(extension));
- // If we revoke the extension's tab permissions, it should no longer receive
- // webRequest events.
+ // Revoke the extension's tab permissions.
ActiveTabPermissionGranter* granter =
TabHelper::FromWebContents(web_contents)->active_tab_permission_granter();
ASSERT_TRUE(granter);
granter->RevokeForTesting();
base::RunLoop().RunUntilIdle();
+
+ // The extension should no longer receive webRequest events since they are
+ // withheld. The extension icon should get updated to show the wants-to-run
+ // badge UI.
+ TestExtensionActionAPIObserver action_updated_waiter(profile(),
+ extension->id());
PerformXhrInFrame(main_frame, kHost, port, kXhrPath);
+ action_updated_waiter.Wait();
+ EXPECT_EQ(web_contents, action_updated_waiter.last_web_contents());
+
EXPECT_EQ(xhr_count,
GetWebRequestCountFromBackgroundPage(extension, profile()));
EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension));
@@ -963,6 +1049,75 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
HasSeenWebRequestInBackgroundPage(extension, profile(), kCrossSiteHost));
}
+// Tests behavior when an extension has withheld access to a request's URL, but
+// not the initiator's (tab's) URL. Regression test for
+// https://crbug.com/891586.
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
+ WithheldHostPermissionsForCrossOriginWithoutInitiator) {
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ extensions::features::kRuntimeHostPermissions);
+
+ content::SetupCrossSiteRedirector(embedded_test_server());
+ ASSERT_TRUE(embedded_test_server()->Start());
+
+ // TODO(devlin): This is essentially copied from the webrequest_activetab
+ // API test extension, but has different permissions. Maybe it's worth having
+ // all tests use a common pattern?
+ TestExtensionDir test_dir;
+ test_dir.WriteManifest(
+ R"({
+ "name": "Web Request Withheld Hosts",
+ "manifest_version": 2,
+ "version": "0.1",
+ "background": { "scripts": ["background.js"] },
+ "permissions": ["*://b.com:*/*", "webRequest"]
+ })");
+ test_dir.WriteFile(FILE_PATH_LITERAL("background.js"),
+ R"(window.webRequestCount = 0;
+ window.requestedHostnames = [];
+
+ chrome.webRequest.onBeforeRequest.addListener(function(details) {
+ ++window.webRequestCount;
+ window.requestedHostnames.push((new URL(details.url)).hostname);
+ }, {urls:['<all_urls>']});
+ chrome.test.sendMessage('ready');)");
+
+ // Load an extension that registers a listener for webRequest events, and
+ // wait until it's initialized.
+ ExtensionTestMessageListener listener("ready", false);
+ const Extension* extension = LoadExtension(test_dir.UnpackedPath());
+ ASSERT_TRUE(extension) << message_;
+ ScriptingPermissionsModifier(profile(), base::WrapRefCounted(extension))
+ .SetWithholdHostPermissions(true);
+ EXPECT_TRUE(listener.WaitUntilSatisfied());
+
+ // Navigate to example.com, which has a cross-site script to b.com.
+ ui_test_utils::NavigateToURL(
+ browser(), embedded_test_server()->GetURL(
+ "example.com", "/extensions/cross_site_script.html"));
+
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ ExtensionActionRunner* runner =
+ ExtensionActionRunner::GetForWebContents(web_contents);
+ ASSERT_TRUE(runner);
+
+ // Even though the extension has access to b.com, it shouldn't show that it
+ // wants to run, because example.com is not a requested host.
+ EXPECT_EQ(BLOCKED_ACTION_NONE, runner->GetBlockedActions(extension));
+ EXPECT_FALSE(
+ HasSeenWebRequestInBackgroundPage(extension, profile(), "b.com"));
+
+ // Navigating to b.com (so that the script is hosted on the same origin as
+ // the WebContents) should show the extension wants to run.
+ ui_test_utils::NavigateToURL(
+ browser(), embedded_test_server()->GetURL(
+ "b.com", "/extensions/cross_site_script.html"));
+ EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension));
+}
+
// Verify that requests to clientsX.google.com are protected properly.
// First test requests from a standard renderer and then a request from the
// browser process.
@@ -1039,9 +1194,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
EXPECT_EQ(200, loader->ResponseInfo()->headers->response_code());
};
- // TODO(https://crbug.com/857577): remove this call.
- ResetStoragePartitionURLLoaderFactory();
-
// Now perform a request to "client1.google.com" from the browser process.
// This should *not* be visible to the WebRequest API. We should still have
// only seen the single render-initiated request from the first half of the
@@ -1075,7 +1227,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
// affecting requests.
PrefService* pref_service = browser()->profile()->GetPrefs();
pref_service->Set(proxy_config::prefs::kProxy,
- *ProxyConfigDictionary::CreatePacScript(
+ ProxyConfigDictionary::CreatePacScript(
embedded_test_server()->GetURL("/self.pac").spec(),
true /* pac_mandatory */));
// Flush the proxy configuration change over the Mojo pipe to avoid any races.
@@ -1238,6 +1390,33 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebSocketRequestOnWorker) {
<< message_;
}
+// Tests the WebRequestProxyingWebSocket does not crash when there is a
+// connection error before AddChannelRequest is called. Regression test for
+// http://crbug.com/878574.
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
+ WebSocketConnectionErrorBeforeChannelRequest) {
+ if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
+ return;
+
+ InstallWebRequestExtension("extension");
+
+ network::mojom::WebSocketPtr web_socket;
+ network::mojom::WebSocketRequest request = mojo::MakeRequest(&web_socket);
+ network::mojom::AuthenticationHandlerPtr auth_handler;
+ content::RenderFrameHost* host =
+ browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame();
+ extensions::BrowserContextKeyedAPIFactory<extensions::WebRequestAPI>::Get(
+ profile())
+ ->MaybeProxyWebSocket(host, &request, &auth_handler);
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->GetNetworkContext()
+ ->CreateWebSocket(std::move(request), network::mojom::kBrowserProcessId,
+ host->GetProcess()->GetID(),
+ url::Origin::Create(GURL("http://example.com")),
+ std::move(auth_handler));
+ web_socket.reset();
+}
+
// Test behavior when intercepting requests from a browser-initiated url fetch.
IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
WebRequestURLLoaderInterception) {
@@ -1362,9 +1541,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
}
};
- // TODO(https://crbug.com/857577): remove this call.
- ResetStoragePartitionURLLoaderFactory();
-
// Next, try a series of requests through URLRequestFetchers (rather than a
// renderer).
auto* url_loader_factory =
@@ -1452,6 +1628,80 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, MinimumAccessInitiator) {
}
}
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
+ WebRequestApiClearsBindingOnFirstListener) {
+ if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
+ return;
+
+ auto loader_factory = CreateURLLoaderFactory();
+ bool has_connection_error = false;
+ loader_factory.set_connection_error_handler(
+ base::BindLambdaForTesting([&]() { has_connection_error = true; }));
+
+ InstallWebRequestExtension("extension1");
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
+ EXPECT_TRUE(has_connection_error);
+
+ // The second time there should be no connection error.
+ loader_factory = CreateURLLoaderFactory();
+ has_connection_error = false;
+ loader_factory.set_connection_error_handler(
+ base::BindLambdaForTesting([&]() { has_connection_error = true; }));
+ InstallWebRequestExtension("extension2");
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
+ EXPECT_FALSE(has_connection_error);
+}
+
+// Regression test for http://crbug.com/878366.
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest,
+ WebRequestApiDoesNotCrashOnErrorAfterProfileDestroyed) {
+ if (!base::FeatureList::IsEnabled(network::features::kNetworkService))
+ return;
+
+ ASSERT_TRUE(StartEmbeddedTestServer());
+
+ // Create a profile that will be destroyed later.
+ base::ScopedAllowBlockingForTesting allow_blocking;
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ Profile* tmp_profile = Profile::CreateProfile(
+ profile_manager->user_data_dir().AppendASCII("profile"), nullptr,
+ Profile::CreateMode::CREATE_MODE_SYNCHRONOUS);
+
+ // Create a WebRequestAPI instance that we can control the lifetime of.
+ auto api = std::make_unique<WebRequestAPI>(tmp_profile);
+ // Make sure we are proxying for |tmp_profile|.
+ api->ForceProxyForTesting();
+ content::BrowserContext::GetDefaultStoragePartition(tmp_profile)
+ ->FlushNetworkInterfaceForTesting();
+
+ network::mojom::URLLoaderFactoryPtr factory;
+ auto request = mojo::MakeRequest(&factory);
+ EXPECT_TRUE(api->MaybeProxyURLLoaderFactory(nullptr, false, &request));
+ auto params = network::mojom::URLLoaderFactoryParams::New();
+ params->process_id = 0;
+ content::BrowserContext::GetDefaultStoragePartition(tmp_profile)
+ ->GetNetworkContext()
+ ->CreateURLLoaderFactory(std::move(request), std::move(params));
+
+ network::TestURLLoaderClient client;
+ network::mojom::URLLoaderPtr loader;
+ network::ResourceRequest resource_request;
+ resource_request.url = embedded_test_server()->GetURL("/hung");
+ factory->CreateLoaderAndStart(
+ mojo::MakeRequest(&loader), 0, 0, network::mojom::kURLLoadOptionNone,
+ resource_request, client.CreateInterfacePtr(),
+ net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS));
+
+ // Destroy profile, unbind client to cause a connection error, and delete the
+ // WebRequestAPI. This will cause the connection error that will reach the
+ // proxy before the ProxySet shutdown code runs on the IO thread.
+ ProfileDestroyer::DestroyProfileWhenAppropriate(tmp_profile);
+ client.Unbind();
+ api.reset();
+}
+
// Test fixture which sets a custom NTP Page.
class NTPInterceptionWebRequestAPITest : public ExtensionApiTest {
public:
@@ -1491,6 +1741,9 @@ IN_PROC_BROWSER_TEST_F(NTPInterceptionWebRequestAPITest,
LoadExtension(test_data_dir_.AppendASCII("extension"));
ASSERT_TRUE(extension);
EXPECT_TRUE(listener.WaitUntilSatisfied());
+ // Wait for webRequest listeners to be set up.
+ content::BrowserContext::GetDefaultStoragePartition(profile())
+ ->FlushNetworkInterfaceForTesting();
// Have the extension listen for requests to |fake_ntp_script.js|.
listener.Reply(https_test_server()->GetURL("/fake_ntp_script.js").spec());
@@ -1552,9 +1805,7 @@ class LocalNTPInterceptionWebRequestAPITest
base::Unretained(this)));
ASSERT_TRUE(https_test_server_.InitializeAndListen());
ExtensionApiTest::SetUp();
- feature_list_.InitWithFeatures(
- {::features::kUseGoogleLocalNtp, ::features::kOneGoogleBarOnLocalNtp},
- {});
+ feature_list_.InitWithFeatures({::features::kUseGoogleLocalNtp}, {});
}
void SetUpCommandLine(base::CommandLine* command_line) override {
ExtensionApiTest::SetUpCommandLine(command_line);
@@ -1891,4 +2142,110 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTestWithManagementPolicy,
EXPECT_EQ(0, GetWebRequestCountFromBackgroundPage(extension, profile()));
}
+// A test fixture which mocks the Time::Now() function to ensure that the
+// default clock returns monotonically increasing time.
+class ExtensionWebRequestMockedClockTest : public ExtensionWebRequestApiTest {
+ public:
+ ExtensionWebRequestMockedClockTest()
+ : scoped_time_clock_override_(&ExtensionWebRequestMockedClockTest::Now,
+ nullptr,
+ nullptr) {}
+
+ private:
+ static base::Time Now() {
+ static base::Time now_time = base::Time::UnixEpoch();
+ now_time += base::TimeDelta::FromMilliseconds(1);
+ return now_time;
+ }
+
+ base::subtle::ScopedTimeClockOverrides scoped_time_clock_override_;
+ DISALLOW_COPY_AND_ASSIGN(ExtensionWebRequestMockedClockTest);
+};
+
+// Tests that we correctly dispatch the OnActionIgnored event on an extension
+// if the extension's proposed redirect is ignored.
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestMockedClockTest,
+ OnActionIgnored_Redirect) {
+ ASSERT_TRUE(StartEmbeddedTestServer());
+
+ // Load the two extensions. They redirect "google.com" main-frame urls to
+ // the corresponding "example.com and "foo.com" urls.
+ base::FilePath test_dir =
+ test_data_dir_.AppendASCII("webrequest/on_action_ignored");
+
+ // Load the first extension.
+ ExtensionTestMessageListener ready_1_listener("ready_1",
+ false /*will_reply*/);
+ const Extension* extension_1 =
+ LoadExtension(test_dir.AppendASCII("extension_1"));
+ ASSERT_TRUE(extension_1);
+ ASSERT_TRUE(ready_1_listener.WaitUntilSatisfied());
+ const std::string extension_id_1 = extension_1->id();
+
+ // Load the second extension.
+ ExtensionTestMessageListener ready_2_listener("ready_2",
+ false /*will_reply*/);
+ const Extension* extension_2 =
+ LoadExtension(test_dir.AppendASCII("extension_2"));
+ ASSERT_TRUE(extension_2);
+ ASSERT_TRUE(ready_2_listener.WaitUntilSatisfied());
+ const std::string extension_id_2 = extension_2->id();
+
+ const ExtensionPrefs* prefs = ExtensionPrefs::Get(profile());
+ EXPECT_LT(prefs->GetInstallTime(extension_id_1),
+ prefs->GetInstallTime(extension_id_2));
+
+ // The extensions will notify the browser if their proposed redirect was
+ // successful or not.
+ ExtensionTestMessageListener redirect_ignored_listener("redirect_ignored",
+ false /*will_reply*/);
+ ExtensionTestMessageListener redirect_successful_listener(
+ "redirect_successful", false /*will_reply*/);
+
+ const GURL url = embedded_test_server()->GetURL("google.com", "/simple.html");
+ const GURL expected_redirect_url_1 =
+ embedded_test_server()->GetURL("example.com", "/simple.html");
+ const GURL expected_redirect_url_2 =
+ embedded_test_server()->GetURL("foo.com", "/simple.html");
+
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(web_contents);
+
+ // The second extension is the latest installed, hence it's redirect url
+ // should take precedence.
+ EXPECT_EQ(expected_redirect_url_2, web_contents->GetLastCommittedURL());
+ EXPECT_TRUE(redirect_ignored_listener.WaitUntilSatisfied());
+ EXPECT_EQ(extension_id_1,
+ redirect_ignored_listener.extension_id_for_message());
+ EXPECT_TRUE(redirect_successful_listener.WaitUntilSatisfied());
+ EXPECT_EQ(extension_id_2,
+ redirect_successful_listener.extension_id_for_message());
+
+ // Now let |extension_1| be installed after |extension_2|. For an unpacked
+ // extension, reloading is equivalent to a reinstall.
+ ready_1_listener.Reset();
+ ReloadExtension(extension_id_1);
+ ASSERT_TRUE(ready_1_listener.WaitUntilSatisfied());
+
+ EXPECT_LT(prefs->GetInstallTime(extension_id_2),
+ prefs->GetInstallTime(extension_id_1));
+
+ redirect_ignored_listener.Reset();
+ redirect_successful_listener.Reset();
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ // The first extension is the latest installed, hence it's redirect url
+ // should take precedence.
+ EXPECT_EQ(expected_redirect_url_1, web_contents->GetLastCommittedURL());
+ EXPECT_TRUE(redirect_ignored_listener.WaitUntilSatisfied());
+ EXPECT_EQ(extension_id_2,
+ redirect_ignored_listener.extension_id_for_message());
+ EXPECT_TRUE(redirect_successful_listener.WaitUntilSatisfied());
+ EXPECT_EQ(extension_id_1,
+ redirect_successful_listener.extension_id_for_message());
+}
+
} // namespace extensions
diff --git a/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc b/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc
index 0bb5252379c..64673d94b64 100644
--- a/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc
+++ b/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.cc
@@ -578,7 +578,7 @@ bool WebrtcLoggingPrivateStartEventLoggingFunction::RunAsync() {
BrowserThread::UI, FROM_HERE,
base::BindOnce(&WebRtcLoggingHandlerHost::StartEventLogging,
webrtc_logging_handler_host, params->peer_connection_id,
- params->max_log_size_bytes, callback));
+ params->max_log_size_bytes, params->web_app_id, callback));
return true;
}
diff --git a/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc b/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc
index 086ddfa4c0a..ec714ee3042 100644
--- a/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_apitest.cc
@@ -13,19 +13,23 @@
#include "base/strings/stringprintf.h"
#include "base/test/scoped_command_line.h"
#include "base/test/scoped_feature_list.h"
+#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/browser/extensions/extension_tab_util.h"
+#include "chrome/browser/media/webrtc/webrtc_event_log_manager.h"
#include "chrome/browser/media/webrtc/webrtc_event_log_manager_common.h"
#include "chrome/browser/media/webrtc/webrtc_log_uploader.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
+#include "components/policy/core/browser/browser_policy_connector.h"
+#include "components/policy/core/common/mock_configuration_policy_provider.h"
+#include "components/policy/policy_constants.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/webrtc_event_logger.h"
#include "content/public/test/test_utils.h"
#include "extensions/common/extension_builder.h"
#include "third_party/zlib/google/compression_utils.h"
@@ -34,16 +38,26 @@ using compression::GzipUncompress;
using extensions::Extension;
using extensions::WebrtcLoggingPrivateDiscardFunction;
using extensions::WebrtcLoggingPrivateSetMetaDataFunction;
+using extensions::WebrtcLoggingPrivateStartAudioDebugRecordingsFunction;
+using extensions::WebrtcLoggingPrivateStartEventLoggingFunction;
using extensions::WebrtcLoggingPrivateStartFunction;
using extensions::WebrtcLoggingPrivateStartRtpDumpFunction;
+using extensions::WebrtcLoggingPrivateStopAudioDebugRecordingsFunction;
using extensions::WebrtcLoggingPrivateStopFunction;
using extensions::WebrtcLoggingPrivateStopRtpDumpFunction;
using extensions::WebrtcLoggingPrivateStoreFunction;
using extensions::WebrtcLoggingPrivateUploadFunction;
using extensions::WebrtcLoggingPrivateUploadStoredFunction;
-using extensions::WebrtcLoggingPrivateStartAudioDebugRecordingsFunction;
-using extensions::WebrtcLoggingPrivateStopAudioDebugRecordingsFunction;
-using extensions::WebrtcLoggingPrivateStartEventLoggingFunction;
+using webrtc_event_logging::kMaxRemoteLogFileSizeBytes;
+using webrtc_event_logging::kStartRemoteLoggingFailureAlreadyLogging;
+using webrtc_event_logging::kStartRemoteLoggingFailureFeatureDisabled;
+using webrtc_event_logging::kStartRemoteLoggingFailureMaxSizeTooLarge;
+using webrtc_event_logging::kStartRemoteLoggingFailureMaxSizeTooSmall;
+using webrtc_event_logging::
+ kStartRemoteLoggingFailureUnknownOrInactivePeerConnection;
+using webrtc_event_logging::kStartRemoteLoggingFailureUnlimitedSizeDisallowed;
+using webrtc_event_logging::kWebRtcEventLogManagerUnlimitedFileSize;
+using webrtc_event_logging::WebRtcEventLogManager;
namespace utils = extension_function_test_utils;
@@ -53,6 +67,8 @@ static const char kTestLoggingSessionIdKey[] = "app_session_id";
static const char kTestLoggingSessionIdValue[] = "0123456789abcdef";
static const char kTestLoggingUrl[] = "dummy url string";
+constexpr int kWebAppId = 15; // Arbitrary.
+
std::string ParamsToString(const base::ListValue& parameters) {
std::string parameter_string;
EXPECT_TRUE(base::JSONWriter::Write(parameters, &parameter_string));
@@ -76,7 +92,6 @@ void InitializeTestMetaData(base::ListValue* parameters) {
class WebrtcLoggingPrivateApiTest : public extensions::ExtensionApiTest {
protected:
void SetUp() override {
- scoped_feature_list_.InitAndEnableFeature(features::kWebRtcRemoteEventLog);
extensions::ExtensionApiTest::SetUp();
extension_ = extensions::ExtensionBuilder("Test").Build();
}
@@ -310,6 +325,7 @@ class WebrtcLoggingPrivateApiTest : public extensions::ExtensionApiTest {
// TODO(crbug.com/829419): Return success/failure of the executed function.
void StartEventLogging(const std::string& peerConnectionId,
int maxLogSizeBytes,
+ int webAppId,
bool expect_success,
const std::string& expected_error = std::string()) {
DCHECK_EQ(expect_success, expected_error.empty());
@@ -318,6 +334,7 @@ class WebrtcLoggingPrivateApiTest : public extensions::ExtensionApiTest {
AppendTabIdAndUrl(&params);
params.AppendString(peerConnectionId);
params.AppendInteger(maxLogSizeBytes);
+ params.AppendInteger(webAppId);
if (expect_success) {
scoped_refptr<WebrtcLoggingPrivateStartEventLoggingFunction> function(
@@ -346,7 +363,7 @@ class WebrtcLoggingPrivateApiTest : public extensions::ExtensionApiTest {
}
void SetUpPeerConnection(const std::string& peer_connection_id) {
- auto* manager = content::WebRtcEventLogger::Get();
+ auto* manager = WebRtcEventLogManager::GetInstance();
auto* rph = web_contents()->GetRenderViewHost()->GetProcess();
const int render_process_id = rph->GetID();
@@ -361,30 +378,6 @@ class WebrtcLoggingPrivateApiTest : public extensions::ExtensionApiTest {
scoped_refptr<Extension> extension_;
};
-class WebrtcLoggingPrivateApiTestDisabledRemoteLogging
- : public WebrtcLoggingPrivateApiTest {
- protected:
- void SetUp() override {
- scoped_feature_list_.InitAndDisableFeature(features::kWebRtcRemoteEventLog);
- extensions::ExtensionApiTest::SetUp();
- extension_ = extensions::ExtensionBuilder("Test").Build();
- }
-};
-
-class WebrtcLoggingPrivateApiTestInIncognitoMode
- : public WebrtcLoggingPrivateApiTest {
- protected:
- Browser* GetBrowser() override {
- if (!browser_) {
- browser_ = CreateIncognitoBrowser();
- }
- return browser_;
- }
-
- private:
- Browser* browser_{nullptr}; // Does not own the object.
-};
-
// Helper class to temporarily tell the uploader to save the multipart buffer to
// a test string instead of uploading.
class ScopedOverrideUploadBuffer {
@@ -644,52 +637,143 @@ IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
ASSERT_TRUE(StartAudioDebugRecordings(1));
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
- StartEventLoggingForKnownPeerConnectionSucceeds) {
+#if !defined(OS_ANDROID)
+
+// Fixture for various tests over StartEventLogging. Intended to be sub-classed
+// to test different scenarios.
+class WebrtcLoggingPrivateApiStartEventLoggingTestBase
+ : public WebrtcLoggingPrivateApiTest {
+ public:
+ ~WebrtcLoggingPrivateApiStartEventLoggingTestBase() override = default;
+
+ protected:
+ void SetUp() override {
+ SetUpFeatures();
+ WebrtcLoggingPrivateApiTest::SetUp();
+ }
+
+ void SetUpFeatures() {
+ std::vector<base::Feature> enabled;
+ std::vector<base::Feature> disabled;
+
+ if (WebRtcEventLogCollectionFeature()) {
+ enabled.push_back(features::kWebRtcRemoteEventLog);
+ } else {
+ disabled.push_back(features::kWebRtcRemoteEventLog);
+ }
+
+ enabled.push_back(features::kWebRtcRemoteEventLogGzipped);
+
+ scoped_feature_list_.InitWithFeatures(enabled, disabled);
+ }
+
+ void SetUpInProcessBrowserTestFixture() override {
+ EXPECT_CALL(provider_, IsInitializationComplete(testing::_))
+ .WillRepeatedly(testing::Return(true));
+
+ policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_);
+ policy::PolicyMap values;
+
+ values.Set(policy::key::kWebRtcEventLogCollectionAllowed,
+ policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
+ policy::POLICY_SOURCE_ENTERPRISE_DEFAULT,
+ std::make_unique<base::Value>(WebRtcEventLogCollectionPolicy()),
+ nullptr);
+
+ provider_.UpdateChromePolicy(values);
+ }
+
+ // Whether the test should have WebRTC remote-bound event logging generally
+ // enabled (default behavior), or disabled (Finch kill-switch engaged).
+ virtual bool WebRtcEventLogCollectionFeature() const = 0;
+
+ // Whether the test should simulate running on a user profile which
+ // has the kWebRtcEventLogCollectionAllowed policy configured or not.
+ virtual bool WebRtcEventLogCollectionPolicy() const = 0;
+
+ private:
+ policy::MockConfigurationPolicyProvider provider_;
+};
+
+// Test StartEventLogging's behavior when the feature is active (kill-switch
+// from Finch *not* engaged, working in a profile where the policy is
+// configured).
+class WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled
+ : public WebrtcLoggingPrivateApiStartEventLoggingTestBase {
+ public:
+ ~WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled()
+ override = default;
+
+ bool WebRtcEventLogCollectionFeature() const override { return true; }
+
+ bool WebRtcEventLogCollectionPolicy() const override { return true; }
+};
+
+// Also covers StartEventLoggingForLegalWebAppIdSucceeds scenario.
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingForKnownPeerConnectionSucceeds) {
const std::string peer_connection_id = "id";
SetUpPeerConnection(peer_connection_id);
const int max_size_bytes = kMaxRemoteLogFileSizeBytes;
constexpr bool expect_success = true;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success);
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
- StartEventLoggingWithUnlimitedSizeFails) {
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingWithUnlimitedSizeFails) {
const std::string peer_connection_id = "id";
SetUpPeerConnection(peer_connection_id);
const int max_size_bytes = kWebRtcEventLogManagerUnlimitedFileSize;
constexpr bool expect_success = false;
const std::string error_message =
kStartRemoteLoggingFailureUnlimitedSizeDisallowed;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success,
- error_message);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success, error_message);
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
- StartEventLoggingWithExcessiveMaxSizeFails) {
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingWithTooSmallMaxSize) {
+ const std::string peer_connection_id = "id";
+ SetUpPeerConnection(peer_connection_id);
+ const int max_size_bytes = 1;
+ constexpr bool expect_success = false;
+ const std::string error_message = kStartRemoteLoggingFailureMaxSizeTooSmall;
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success, error_message);
+}
+
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingWithExcessiveMaxSizeFails) {
const std::string peer_connection_id = "id";
SetUpPeerConnection(peer_connection_id);
const int max_size_bytes = kMaxRemoteLogFileSizeBytes + 1;
constexpr bool expect_success = false;
const std::string error_message = kStartRemoteLoggingFailureMaxSizeTooLarge;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success,
- error_message);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success, error_message);
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
- StartEventLoggingForNeverAddedPeerConnectionFails) {
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingForNeverAddedPeerConnectionFails) {
// Note that manager->PeerConnectionAdded() is not called.
const std::string peer_connection_id = "id";
const int max_size_bytes = kMaxRemoteLogFileSizeBytes;
constexpr bool expect_success = false;
const std::string error_message =
kStartRemoteLoggingFailureUnknownOrInactivePeerConnection;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success,
- error_message);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success, error_message);
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
- StartEventLoggingForWrongPeerConnectionIdFails) {
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingForWrongPeerConnectionIdFails) {
const std::string peer_connection_id_1 = "id1";
const std::string peer_connection_id_2 = "id2";
@@ -698,12 +782,13 @@ IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
constexpr bool expect_success = false;
const std::string error_message =
kStartRemoteLoggingFailureUnknownOrInactivePeerConnection;
- StartEventLogging(peer_connection_id_2, max_size_bytes, expect_success,
- error_message);
+ StartEventLogging(peer_connection_id_2, max_size_bytes, kWebAppId,
+ expect_success, error_message);
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
- StartEventLoggingForAlreadyLoggedPeerConnectionFails) {
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingForAlreadyLoggedPeerConnectionFails) {
const std::string peer_connection_id = "id";
SetUpPeerConnection(peer_connection_id);
@@ -712,36 +797,127 @@ IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTest,
// First call succeeds.
{
constexpr bool expect_success = true;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success);
}
// Second call fails.
{
constexpr bool expect_success = false;
const std::string error_message = kStartRemoteLoggingFailureAlreadyLogging;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success,
- error_message);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success, error_message);
}
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTestDisabledRemoteLogging,
- StartEventLoggingFails) {
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingForTooLowWebAppIdFails) {
+ const std::string peer_connection_id = "id";
+ SetUpPeerConnection(peer_connection_id);
+ const int max_size_bytes = kMaxRemoteLogFileSizeBytes;
+ const size_t web_app_id =
+ webrtc_event_logging::kMinWebRtcEventLogWebAppId - 1;
+ ASSERT_LT(web_app_id, webrtc_event_logging::kMinWebRtcEventLogWebAppId);
+ constexpr bool expect_success = false;
+ const std::string error_message =
+ webrtc_event_logging::kStartRemoteLoggingFailureIllegalWebAppId;
+ StartEventLogging(peer_connection_id, max_size_bytes, web_app_id,
+ expect_success, error_message);
+}
+
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureAndPolicyEnabled,
+ StartEventLoggingForTooHighWebAppIdFails) {
+ const std::string peer_connection_id = "id";
+ SetUpPeerConnection(peer_connection_id);
+ const int max_size_bytes = kMaxRemoteLogFileSizeBytes;
+ const size_t web_app_id =
+ webrtc_event_logging::kMaxWebRtcEventLogWebAppId + 1;
+ ASSERT_GT(web_app_id, webrtc_event_logging::kMaxWebRtcEventLogWebAppId);
+ constexpr bool expect_success = false;
+ const std::string error_message =
+ webrtc_event_logging::kStartRemoteLoggingFailureIllegalWebAppId;
+ StartEventLogging(peer_connection_id, max_size_bytes, web_app_id,
+ expect_success, error_message);
+}
+
+// Testing with either the feature or the policy disabled (not both).
+class WebrtcLoggingPrivateApiStartEventLoggingTestFeatureOrPolicyDisabled
+ : public WebrtcLoggingPrivateApiStartEventLoggingTestBase,
+ public ::testing::WithParamInterface<bool> {
+ public:
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureOrPolicyDisabled()
+ : feature_enabled_(GetParam()), policy_enabled_(!feature_enabled_) {}
+
+ ~WebrtcLoggingPrivateApiStartEventLoggingTestFeatureOrPolicyDisabled()
+ override = default;
+
+ protected:
+ bool WebRtcEventLogCollectionFeature() const override {
+ return feature_enabled_;
+ }
+
+ bool WebRtcEventLogCollectionPolicy() const override {
+ return policy_enabled_;
+ }
+
+ private:
+ const bool feature_enabled_;
+ const bool policy_enabled_;
+};
+
+IN_PROC_BROWSER_TEST_P(
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureOrPolicyDisabled,
+ StartEventLoggingFails) {
const std::string peer_connection_id = "id";
SetUpPeerConnection(peer_connection_id);
const int max_size_bytes = kMaxRemoteLogFileSizeBytes;
constexpr bool expect_success = false;
const std::string error_message = kStartRemoteLoggingFailureFeatureDisabled;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success,
- error_message);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success, error_message);
}
-IN_PROC_BROWSER_TEST_F(WebrtcLoggingPrivateApiTestInIncognitoMode,
- StartEventLoggingFails) {
+INSTANTIATE_TEST_CASE_P(
+ FeatureEnabled,
+ WebrtcLoggingPrivateApiStartEventLoggingTestFeatureOrPolicyDisabled,
+ ::testing::Bool());
+
+// Make sure that, even if both the feature and the policy enable remote-bound
+// event logging, it will be blocked for incognito sessions.
+class WebrtcLoggingPrivateApiStartEventLoggingTestInIncognitoMode
+ : public WebrtcLoggingPrivateApiStartEventLoggingTestBase {
+ public:
+ ~WebrtcLoggingPrivateApiStartEventLoggingTestInIncognitoMode() override =
+ default;
+
+ protected:
+ Browser* GetBrowser() override {
+ if (!browser_) {
+ browser_ = CreateIncognitoBrowser();
+ }
+ return browser_;
+ }
+
+ bool WebRtcEventLogCollectionFeature() const override { return true; }
+
+ bool WebRtcEventLogCollectionPolicy() const override { return true; }
+
+ private:
+ Browser* browser_{nullptr}; // Does not own the object.
+};
+
+IN_PROC_BROWSER_TEST_F(
+ WebrtcLoggingPrivateApiStartEventLoggingTestInIncognitoMode,
+ StartEventLoggingFails) {
const std::string peer_connection_id = "id";
SetUpPeerConnection(peer_connection_id);
const int max_size_bytes = kMaxRemoteLogFileSizeBytes;
constexpr bool expect_success = false;
const std::string error_message = kStartRemoteLoggingFailureFeatureDisabled;
- StartEventLogging(peer_connection_id, max_size_bytes, expect_success,
- error_message);
+ StartEventLogging(peer_connection_id, max_size_bytes, kWebAppId,
+ expect_success, error_message);
}
+
+#endif // !defined(OS_ANDROID)
diff --git a/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_browsertest.cc b/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_browsertest.cc
index 264e9c2a469..aa5ee121352 100644
--- a/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_browsertest.cc
+++ b/chromium/chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_browsertest.cc
@@ -8,7 +8,7 @@
#include "build/build_config.h"
#include "chrome/browser/apps/platform_apps/app_browsertest_util.h"
#include "chrome/common/chrome_switches.h"
-#include "components/webrtc_logging/browser/log_list.h"
+#include "components/webrtc_logging/browser/text_log_list.h"
class WebrtcLoggingPrivateApiBrowserTest
: public extensions::PlatformAppBrowserTest {
@@ -17,8 +17,8 @@ class WebrtcLoggingPrivateApiBrowserTest
~WebrtcLoggingPrivateApiBrowserTest() override = default;
base::FilePath webrtc_logs_path() {
- return webrtc_logging::LogList::GetWebRtcLogDirectoryForBrowserContextPath(
- profile()->GetPath());
+ return webrtc_logging::TextLogList::
+ GetWebRtcLogDirectoryForBrowserContextPath(profile()->GetPath());
}
private:
diff --git a/chromium/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chromium/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
index 4819cef550e..e1ecf590919 100644
--- a/chromium/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
@@ -28,7 +28,9 @@
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/test/browser_test_utils.h"
+#include "content/public/test/test_navigation_observer.h"
#include "extensions/browser/api/management/management_api.h"
#include "extensions/browser/extension_dialog_auto_confirm.h"
#include "extensions/browser/extension_system.h"
@@ -187,34 +189,52 @@ class ExtensionWebstorePrivateApiTest : public ExtensionApiTest {
};
// Test cases for webstore origin frame blocking.
-// TODO(mkwst): Disabled until new X-Frame-Options behavior rolls into
-// Chromium, see crbug.com/226018.
IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest,
- DISABLED_FrameWebstorePageBlocked) {
- base::string16 expected_title = base::UTF8ToUTF16("PASS: about:blank");
- base::string16 failure_title = base::UTF8ToUTF16("FAIL");
- content::TitleWatcher watcher(GetWebContents(), expected_title);
- watcher.AlsoWaitForTitle(failure_title);
+ FrameWebstorePageBlocked) {
GURL url = embedded_test_server()->GetURL(
"/extensions/api_test/webstore_private/noframe.html");
+ content::WebContents* web_contents = GetWebContents();
ui_test_utils::NavigateToURL(browser(), url);
- base::string16 final_title = watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, final_title);
+
+ // Try to load the same URL, but with the current Chrome web store origin in
+ // an iframe (i.e. http://www.example.com)
+ content::TestNavigationObserver observer(web_contents);
+ ASSERT_TRUE(content::ExecuteScript(web_contents, "dropFrame()"));
+ WaitForLoadStop(web_contents);
+ content::RenderFrameHost* subframe =
+ content::ChildFrameAt(web_contents->GetMainFrame(), 0);
+ ASSERT_TRUE(subframe);
+
+ // The subframe load should fail due to XFO.
+ GURL iframe_url = embedded_test_server()->GetURL(
+ "www.example.com", "/extensions/api_test/webstore_private/noframe.html");
+ EXPECT_EQ(iframe_url, subframe->GetLastCommittedURL());
+ EXPECT_FALSE(observer.last_navigation_succeeded());
+ EXPECT_EQ(net::ERR_BLOCKED_BY_RESPONSE, observer.last_net_error_code());
}
-// TODO(mkwst): Disabled until new X-Frame-Options behavior rolls into
-// Chromium, see crbug.com/226018.
-IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest,
- DISABLED_FrameErrorPageBlocked) {
- base::string16 expected_title = base::UTF8ToUTF16("PASS: about:blank");
- base::string16 failure_title = base::UTF8ToUTF16("FAIL");
- content::TitleWatcher watcher(GetWebContents(), expected_title);
- watcher.AlsoWaitForTitle(failure_title);
+IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, FrameErrorPageBlocked) {
GURL url = embedded_test_server()->GetURL(
"/extensions/api_test/webstore_private/noframe2.html");
+ content::WebContents* web_contents = GetWebContents();
ui_test_utils::NavigateToURL(browser(), url);
- base::string16 final_title = watcher.WaitAndGetTitle();
- EXPECT_EQ(expected_title, final_title);
+
+ // Try to load the same URL, but with the current Chrome web store origin in
+ // an iframe (i.e. http://www.example.com)
+ content::TestNavigationObserver observer(web_contents);
+ ASSERT_TRUE(content::ExecuteScript(web_contents, "dropFrame()"));
+ WaitForLoadStop(web_contents);
+ content::RenderFrameHost* subframe =
+ content::ChildFrameAt(web_contents->GetMainFrame(), 0);
+ ASSERT_TRUE(subframe);
+
+ // The subframe load should fail due to XFO.
+ GURL iframe_url = embedded_test_server()->GetURL(
+ "www.example.com",
+ "/nonesuch/extensions/api_test/webstore_private/noframe2.html ");
+ EXPECT_EQ(iframe_url, subframe->GetLastCommittedURL());
+ EXPECT_FALSE(observer.last_navigation_succeeded());
+ EXPECT_EQ(net::ERR_BLOCKED_BY_RESPONSE, observer.last_net_error_code());
}
// Test cases where the user accepts the install confirmation dialog.
@@ -351,24 +371,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTest, EmptyCrx) {
}
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
-
-class ExtensionWebstorePrivateApiTestSupervised
- : public ExtensionWebstorePrivateApiTest {
- public:
- void SetUpCommandLine(base::CommandLine* command_line) override {
- ExtensionWebstorePrivateApiTest::SetUpCommandLine(command_line);
- command_line->AppendSwitchASCII(switches::kSupervisedUserId, "not_empty");
- }
-};
-
-// Tests that extension installation is blocked for supervised users.
-// Note: This will have to be updated if we enable SU-initiated installs.
-IN_PROC_BROWSER_TEST_F(ExtensionWebstorePrivateApiTestSupervised,
- InstallBlocked) {
- ASSERT_TRUE(
- RunInstallTest("begin_install_fail_supervised.html", "extension.crx"));
-}
-
class ExtensionWebstorePrivateApiTestChild
: public ExtensionWebstorePrivateApiTest {
public:
diff --git a/chromium/chrome/browser/media/media_engagement_score_details.mojom b/chromium/chrome/browser/media/media_engagement_score_details.mojom
index 514b81fca4f..db54921ee8a 100644
--- a/chromium/chrome/browser/media/media_engagement_score_details.mojom
+++ b/chromium/chrome/browser/media/media_engagement_score_details.mojom
@@ -26,6 +26,10 @@ struct MediaEngagementScoreDetails {
// How many time the score changed `is_high` status.
int32 high_score_changes;
+
+ // Details of the components which make up |media_playbacks|.
+ int32 audio_context_playbacks;
+ int32 media_element_playbacks;
};
struct MediaEngagementConfig {
@@ -42,6 +46,9 @@ struct MediaEngagementConfig {
bool feature_record_data;
bool feature_bypass_autoplay;
bool feature_preload_data;
+ bool feature_autoplay_sound_settings;
+ bool pref_unified_autoplay;
+ bool has_custom_autoplay_policy;
string autoplay_policy;
// The current version of any preloaded component.
diff --git a/chromium/chrome/browser/media/router/BUILD.gn b/chromium/chrome/browser/media/router/BUILD.gn
index 880e6ae455e..4774e72960b 100644
--- a/chromium/chrome/browser/media/router/BUILD.gn
+++ b/chromium/chrome/browser/media/router/BUILD.gn
@@ -14,6 +14,7 @@ static_library("router") {
"//components/keyed_service/core",
"//content/public/browser",
"//content/public/common",
+ "//crypto",
"//net",
"//third_party/icu",
"//url",
@@ -54,7 +55,6 @@ static_library("router") {
"presentation/presentation_service_delegate_observers.h",
"presentation/receiver_presentation_service_delegate_impl.cc",
"presentation/receiver_presentation_service_delegate_impl.h",
- "presentation/render_frame_host_id.h",
"route_message_observer.cc",
"route_message_observer.h",
"route_message_util.cc",
@@ -69,6 +69,8 @@ static_library("router") {
"//ui/base:ui_features",
]
sources += [
+ "data_decoder_util.cc",
+ "data_decoder_util.h",
"event_page_request_manager.cc",
"event_page_request_manager.h",
"event_page_request_manager_factory.cc",
@@ -93,6 +95,8 @@ static_library("router") {
"providers/cast/cast_app_availability_tracker.h",
"providers/cast/cast_app_discovery_service.cc",
"providers/cast/cast_app_discovery_service.h",
+ "providers/cast/cast_internal_message_util.cc",
+ "providers/cast/cast_internal_message_util.h",
"providers/cast/cast_media_route_provider.cc",
"providers/cast/cast_media_route_provider.h",
"providers/cast/cast_media_route_provider_metrics.cc",
@@ -109,6 +113,8 @@ static_library("router") {
"providers/dial/dial_internal_message_util.h",
"providers/dial/dial_media_route_provider.cc",
"providers/dial/dial_media_route_provider.h",
+ "providers/dial/dial_media_route_provider_metrics.cc",
+ "providers/dial/dial_media_route_provider_metrics.h",
"providers/extension/extension_media_route_provider_proxy.cc",
"providers/extension/extension_media_route_provider_proxy.h",
"providers/wired_display/wired_display_media_route_provider.cc",
diff --git a/chromium/chrome/browser/media/router/discovery/BUILD.gn b/chromium/chrome/browser/media/router/discovery/BUILD.gn
index d4cb50ef8f4..ef7a335a6d3 100644
--- a/chromium/chrome/browser/media/router/discovery/BUILD.gn
+++ b/chromium/chrome/browser/media/router/discovery/BUILD.gn
@@ -17,6 +17,7 @@ static_library("discovery") {
"//components/version_info",
"//content/public/browser",
"//content/public/common",
+ "//services/network/public/cpp",
]
sources = [
"dial/device_description_fetcher.cc",
diff --git a/chromium/chrome/browser/media/webrtc/desktop_streams_registry.cc b/chromium/chrome/browser/media/webrtc/desktop_streams_registry.cc
deleted file mode 100644
index 3b2794f5b64..00000000000
--- a/chromium/chrome/browser/media/webrtc/desktop_streams_registry.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/media/webrtc/desktop_streams_registry.h"
-
-#include "base/base64.h"
-#include "base/location.h"
-#include "base/macros.h"
-#include "base/time/time.h"
-#include "content/public/browser/browser_thread.h"
-#include "crypto/random.h"
-
-namespace {
-
-const int kStreamIdLengthBytes = 16;
-
-const int kApprovedStreamTimeToLiveSeconds = 10;
-
-std::string GenerateRandomStreamId() {
- char buffer[kStreamIdLengthBytes];
- crypto::RandBytes(buffer, arraysize(buffer));
- std::string result;
- base::Base64Encode(base::StringPiece(buffer, arraysize(buffer)),
- &result);
- return result;
-}
-
-} // namespace
-
-DesktopStreamsRegistry::DesktopStreamsRegistry() {}
-DesktopStreamsRegistry::~DesktopStreamsRegistry() {}
-
-std::string DesktopStreamsRegistry::RegisterStream(
- int render_process_id,
- int render_frame_id,
- const GURL& origin,
- const content::DesktopMediaID& source,
- const std::string& extension_name) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- std::string id = GenerateRandomStreamId();
- DCHECK(approved_streams_.find(id) == approved_streams_.end());
- ApprovedDesktopMediaStream& stream = approved_streams_[id];
- stream.render_process_id = render_process_id;
- stream.render_frame_id = render_frame_id;
- stream.origin = origin;
- stream.source = source;
- stream.extension_name = extension_name;
-
- content::BrowserThread::PostDelayedTask(
- content::BrowserThread::UI, FROM_HERE,
- base::BindOnce(&DesktopStreamsRegistry::CleanupStream,
- base::Unretained(this), id),
- base::TimeDelta::FromSeconds(kApprovedStreamTimeToLiveSeconds));
-
- return id;
-}
-
-content::DesktopMediaID DesktopStreamsRegistry::RequestMediaForStreamId(
- const std::string& id,
- int render_process_id,
- int render_frame_id,
- const GURL& origin,
- std::string* extension_name) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-
- StreamsMap::iterator it = approved_streams_.find(id);
-
- // Verify that if there is a request with the specified ID it was created for
- // the same origin and the same renderer.
- if (it == approved_streams_.end() ||
- render_process_id != it->second.render_process_id ||
- render_frame_id != it->second.render_frame_id ||
- origin != it->second.origin) {
- return content::DesktopMediaID();
- }
-
- content::DesktopMediaID result = it->second.source;
- *extension_name = it->second.extension_name;
- approved_streams_.erase(it);
- return result;
-}
-
-void DesktopStreamsRegistry::CleanupStream(const std::string& id) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- approved_streams_.erase(id);
-}
-
-DesktopStreamsRegistry::ApprovedDesktopMediaStream::ApprovedDesktopMediaStream()
- : render_process_id(-1), render_frame_id(-1) {}
diff --git a/chromium/chrome/browser/media/webrtc/desktop_streams_registry.h b/chromium/chrome/browser/media/webrtc/desktop_streams_registry.h
deleted file mode 100644
index e8b9aa0095b..00000000000
--- a/chromium/chrome/browser/media/webrtc/desktop_streams_registry.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_STREAMS_REGISTRY_H_
-#define CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_STREAMS_REGISTRY_H_
-
-#include <map>
-#include <string>
-
-#include "base/macros.h"
-#include "chrome/browser/media/webrtc/desktop_media_list.h"
-#include "url/gurl.h"
-
-// DesktopStreamsRegistry is used to store accepted desktop media streams for
-// Desktop Capture API. Single instance of this class is created per browser in
-// MediaCaptureDevicesDispatcher.
-class DesktopStreamsRegistry {
- public:
- DesktopStreamsRegistry();
- ~DesktopStreamsRegistry();
-
- // Adds new stream to the registry. Called by the implementation of
- // desktopCapture.chooseDesktopMedia() API after user has approved access to
- // |source| for the |origin|. Returns identifier of the new stream.
- // |render_frame_id| refers to the RenderFrame requesting the stream.
- std::string RegisterStream(int render_process_id,
- int render_frame_id,
- const GURL& origin,
- const content::DesktopMediaID& source,
- const std::string& extension_name);
-
- // Validates stream identifier specified in getUserMedia(). Returns null
- // DesktopMediaID if the specified |id| is invalid, i.e. wasn't generated
- // using RegisterStream() or if it was generated for a different
- // RenderFrame/origin. Otherwise returns ID of the source and removes it from
- // the registry.
- content::DesktopMediaID RequestMediaForStreamId(const std::string& id,
- int render_process_id,
- int render_frame_id,
- const GURL& origin,
- std::string* extension_name);
-
- private:
- // Type used to store list of accepted desktop media streams.
- struct ApprovedDesktopMediaStream {
- ApprovedDesktopMediaStream();
-
- int render_process_id;
- int render_frame_id;
- GURL origin;
- content::DesktopMediaID source;
- std::string extension_name;
- };
- typedef std::map<std::string, ApprovedDesktopMediaStream> StreamsMap;
-
- // Helper function that removes an expired stream from the registry.
- void CleanupStream(const std::string& id);
-
- StreamsMap approved_streams_;
-
- DISALLOW_COPY_AND_ASSIGN(DesktopStreamsRegistry);
-};
-
-#endif // CHROME_BROWSER_MEDIA_WEBRTC_DESKTOP_STREAMS_REGISTRY_H_
diff --git a/chromium/chrome/browser/printing/cloud_print/DEPS b/chromium/chrome/browser/printing/cloud_print/DEPS
new file mode 100644
index 00000000000..0c3c5cebb7b
--- /dev/null
+++ b/chromium/chrome/browser/printing/cloud_print/DEPS
@@ -0,0 +1,5 @@
+specific_include_rules = {
+ ".*test\.cc": [
+ "+services/network/network_context.h",
+ ]
+}
diff --git a/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc b/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
index 7419f6422a2..7190c49f2b3 100644
--- a/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
+++ b/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <memory>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -18,30 +19,34 @@
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
-#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/service_process/service_process_control.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
-#include "printing/backend/print_backend.h"
+#include "extensions/browser/extension_file_task_runner.h"
using content::BrowserThread;
namespace {
-void ForwardGetPrintersResult(
- const CloudPrintProxyService::PrintersCallback& callback,
- const std::vector<std::string>& printers) {
+void ForwardGetPrintersResult(CloudPrintProxyService::PrintersCallback callback,
+ const std::vector<std::string>& printers) {
UMA_HISTOGRAM_ENUMERATION("CloudPrint.ServiceEvents",
ServiceProcessControl::SERVICE_PRINTERS_REPLY,
ServiceProcessControl::SERVICE_EVENT_MAX);
UMA_HISTOGRAM_COUNTS_10000("CloudPrint.AvailablePrinters", printers.size());
- callback.Run(printers);
+ std::move(callback).Run(printers);
+}
+
+std::string ReadCloudPrintSetupProxyList(const base::FilePath& path) {
+ std::string printers_json;
+ base::ReadFileToString(path, &printers_json);
+ return printers_json;
}
} // namespace
@@ -134,41 +139,34 @@ bool CloudPrintProxyService::ApplyCloudPrintConnectorPolicy() {
return true;
}
-void CloudPrintProxyService::GetPrinters(const PrintersCallback& callback) {
+void CloudPrintProxyService::GetPrinters(PrintersCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- if (!profile_->GetPrefs()->GetBoolean(prefs::kCloudPrintProxyEnabled))
+ if (!profile_->GetPrefs()->GetBoolean(prefs::kCloudPrintProxyEnabled)) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::BindOnce(std::move(callback), std::vector<std::string>()));
return;
+ }
base::FilePath list_path(
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kCloudPrintSetupProxy));
- if (!list_path.empty()) {
- std::string printers_json;
- base::ReadFileToString(list_path, &printers_json);
- std::unique_ptr<base::Value> value = base::JSONReader::Read(printers_json);
- base::ListValue* list = NULL;
- std::vector<std::string> printers;
- if (value && value->GetAsList(&list) && list) {
- for (size_t i = 0; i < list->GetSize(); ++i) {
- std::string printer;
- if (list->GetString(i, &printer))
- printers.push_back(printer);
- }
- }
- UMA_HISTOGRAM_COUNTS_10000("CloudPrint.AvailablePrintersList",
- printers.size());
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::BindOnce(callback, printers));
- } else {
+ if (list_path.empty()) {
InvokeServiceTask(
- base::Bind(&CloudPrintProxyService::GetCloudPrintProxyPrinters,
- weak_factory_.GetWeakPtr(),
- callback));
+ base::BindOnce(&CloudPrintProxyService::GetCloudPrintProxyPrinters,
+ weak_factory_.GetWeakPtr(), std::move(callback)));
+ return;
}
+
+ base::PostTaskAndReplyWithResult(
+ extensions::GetExtensionFileTaskRunner().get(), FROM_HERE,
+ base::BindOnce(&ReadCloudPrintSetupProxyList, list_path),
+ base::BindOnce(&CloudPrintProxyService::OnReadCloudPrintSetupProxyList,
+ weak_factory_.GetWeakPtr(), std::move(callback)));
}
void CloudPrintProxyService::GetCloudPrintProxyPrinters(
- const PrintersCallback& callback) {
+ PrintersCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
UMA_HISTOGRAM_ENUMERATION("CloudPrint.ServiceEvents",
ServiceProcessControl::SERVICE_PRINTERS_REQUEST,
@@ -176,7 +174,7 @@ void CloudPrintProxyService::GetCloudPrintProxyPrinters(
ServiceProcessControl* process_control = GetServiceProcessControl();
DCHECK(process_control->IsConnected());
GetCloudPrintProxy().GetPrinters(
- base::BindOnce(&ForwardGetPrintersResult, callback));
+ base::BindOnce(&ForwardGetPrintersResult, std::move(callback)));
}
void CloudPrintProxyService::RefreshCloudPrintProxyStatus() {
@@ -241,3 +239,21 @@ cloud_print::mojom::CloudPrint& CloudPrintProxyService::GetCloudPrintProxy() {
}
return *cloud_print_proxy_;
}
+
+void CloudPrintProxyService::OnReadCloudPrintSetupProxyList(
+ PrintersCallback callback,
+ const std::string& printers_json) {
+ std::unique_ptr<base::Value> list_value =
+ base::ListValue::From(base::JSONReader::Read(printers_json));
+ std::vector<std::string> printers;
+ if (list_value) {
+ for (const auto& element : list_value->GetList()) {
+ if (element.is_string())
+ printers.push_back(element.GetString());
+ }
+ }
+ UMA_HISTOGRAM_COUNTS_10000("CloudPrint.AvailablePrintersList",
+ printers.size());
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::BindOnce(std::move(callback), printers));
+}
diff --git a/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h b/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h
index 93f7db25eff..6a31220cd34 100644
--- a/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h
+++ b/chromium/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h
@@ -33,15 +33,15 @@ class CloudPrintProxyService : public KeyedService {
explicit CloudPrintProxyService(Profile* profile);
~CloudPrintProxyService() override;
- typedef base::Callback<void(const std::vector<std::string>&)>
- PrintersCallback;
+ using PrintersCallback =
+ base::OnceCallback<void(const std::vector<std::string>&)>;
// Initializes the object. This should be called every time an object of this
// class is constructed.
void Initialize();
// Returns list of printer names available for registration.
- void GetPrinters(const PrintersCallback& callback);
+ void GetPrinters(PrintersCallback callback);
// Enables/disables cloud printing for the user
virtual void EnableForUserWithRobot(const std::string& robot_auth_code,
@@ -54,7 +54,7 @@ class CloudPrintProxyService : public KeyedService {
// update the browser prefs.
void RefreshStatusFromService();
- std::string proxy_id() const { return proxy_id_; }
+ const std::string& proxy_id() const { return proxy_id_; }
private:
// NotificationDelegate implementation for the token expired notification.
@@ -62,7 +62,7 @@ class CloudPrintProxyService : public KeyedService {
friend class TokenExpiredNotificationDelegate;
// Methods that send an IPC to the service.
- void GetCloudPrintProxyPrinters(const PrintersCallback& callback);
+ void GetCloudPrintProxyPrinters(PrintersCallback callback);
void RefreshCloudPrintProxyStatus();
void EnableCloudPrintProxyWithRobot(const std::string& robot_auth_code,
const std::string& robot_email,
@@ -89,7 +89,10 @@ class CloudPrintProxyService : public KeyedService {
// Virtual for testing.
virtual ServiceProcessControl* GetServiceProcessControl();
- Profile* profile_;
+ void OnReadCloudPrintSetupProxyList(PrintersCallback callback,
+ const std::string& printers_json);
+
+ Profile* const profile_;
std::string proxy_id_;
// For watching for connector policy changes.
diff --git a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.cc b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.cc
index 1a6e88631e3..fbc83d00a1d 100644
--- a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.cc
+++ b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/printing/cloud_print/gcd_constants.h"
#include "chrome/common/cloud_print/cloud_print_constants.h"
#include "components/cloud_devices/common/cloud_devices_urls.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace cloud_print {
@@ -17,10 +18,9 @@ GCDApiFlow::Request::~Request() {
}
std::unique_ptr<GCDApiFlow> GCDApiFlow::Create(
- net::URLRequestContextGetter* request_context,
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
identity::IdentityManager* identity_manager) {
- return std::unique_ptr<GCDApiFlow>(
- new GCDApiFlowImpl(request_context, identity_manager));
+ return std::make_unique<GCDApiFlowImpl>(url_loader_factory, identity_manager);
}
GCDApiFlow::GCDApiFlow() {
diff --git a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.h b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.h
index 1d1fff0b9a8..3961f35dde6 100644
--- a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.h
+++ b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow.h
@@ -7,12 +7,14 @@
#include <memory>
#include <string>
+#include <vector>
+#include "base/bind.h"
+#include "base/callback.h"
#include "base/macros.h"
+#include "base/memory/scoped_refptr.h"
#include "google_apis/gaia/oauth2_token_service.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
-#include "net/url_request/url_fetcher.h"
-#include "net/url_request/url_request_context_getter.h"
namespace base {
class DictionaryValue;
@@ -22,6 +24,10 @@ namespace identity {
class IdentityManager;
}
+namespace network {
+class SharedURLLoaderFactory;
+}
+
namespace cloud_print {
// API flow for communicating with cloud print and cloud devices.
@@ -71,7 +77,7 @@ class GCDApiFlow {
virtual ~GCDApiFlow();
static std::unique_ptr<GCDApiFlow> Create(
- net::URLRequestContextGetter* request_context,
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
identity::IdentityManager* identity_manager);
virtual void Start(std::unique_ptr<Request> request) = 0;
diff --git a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc
index d078544f759..0bb46574a8e 100644
--- a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc
+++ b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.cc
@@ -8,6 +8,7 @@
#include <memory>
#include <utility>
+#include <vector>
#include "base/json/json_reader.h"
#include "base/strings/string_number_conversions.h"
@@ -24,6 +25,9 @@
#include "net/url_request/url_request_status.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "services/identity/public/cpp/primary_account_access_token_fetcher.h"
+#include "services/network/public/cpp/resource_request.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
+#include "services/network/public/cpp/simple_url_loader.h"
using net::DefineNetworkTrafficAnnotation;
@@ -31,7 +35,13 @@ namespace cloud_print {
namespace {
-const char kCloudPrintOAuthHeaderFormat[] = "Authorization: Bearer %s";
+const char kCloudPrintOAuthHeaderKey[] = "Authorization";
+const char kCloudPrintOAuthHeaderValueFormat[] = "Bearer %s";
+constexpr size_t kMaxContentSize = 1 * 1024 * 1024;
+
+const std::string GetOAuthHeaderValue(const std::string& token) {
+ return base::StringPrintf(kCloudPrintOAuthHeaderValueFormat, token.c_str());
+}
net::NetworkTrafficAnnotationTag GetNetworkTrafficAnnotation(
GCDApiFlow::Request::NetworkTrafficAnnotation type) {
@@ -79,12 +89,14 @@ net::NetworkTrafficAnnotationTag GetNetworkTrafficAnnotation(
} // namespace
-GCDApiFlowImpl::GCDApiFlowImpl(net::URLRequestContextGetter* request_context,
- identity::IdentityManager* identity_manager)
- : request_context_(request_context), identity_manager_(identity_manager) {}
+GCDApiFlowImpl::GCDApiFlowImpl(
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
+ identity::IdentityManager* identity_manager)
+ : url_loader_factory_(url_loader_factory),
+ identity_manager_(identity_manager),
+ weak_factory_(this) {}
-GCDApiFlowImpl::~GCDApiFlowImpl() {
-}
+GCDApiFlowImpl::~GCDApiFlowImpl() {}
void GCDApiFlowImpl::Start(std::unique_ptr<Request> request) {
request_ = std::move(request);
@@ -108,51 +120,54 @@ void GCDApiFlowImpl::OnAccessTokenFetchComplete(
return;
}
- CreateRequest();
+ auto request = std::make_unique<network::ResourceRequest>();
+ request->url = request_->GetURL();
- std::string authorization_header = base::StringPrintf(
- kCloudPrintOAuthHeaderFormat, access_token_info.token.c_str());
+ request->load_flags =
+ net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES;
- url_fetcher_->AddExtraRequestHeader(authorization_header);
- url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
- net::LOAD_DO_NOT_SEND_COOKIES);
- url_fetcher_->Start();
-}
-
-void GCDApiFlowImpl::CreateRequest() {
- url_fetcher_ = net::URLFetcher::Create(
- request_->GetURL(), net::URLFetcher::GET, this,
- GetNetworkTrafficAnnotation(request_->GetNetworkTrafficAnnotationType()));
- url_fetcher_->SetRequestContext(request_context_.get());
+ request->headers.SetHeader(kCloudPrintOAuthHeaderKey,
+ GetOAuthHeaderValue(access_token_info.token));
std::vector<std::string> extra_headers = request_->GetExtraRequestHeaders();
for (const std::string& header : extra_headers)
- url_fetcher_->AddExtraRequestHeader(header);
+ request->headers.AddHeaderFromString(header);
- data_use_measurement::DataUseUserData::AttachToFetcher(
- url_fetcher_.get(), data_use_measurement::DataUseUserData::CLOUD_PRINT);
-}
+ // TODO(https://crbug.com/808498): Re-add data use measurement once
+ // SimpleURLLoader supports it.
+ // ID=data_use_measurement::DataUseUserData::CLOUD_PRINT
+
+ url_loader_ = network::SimpleURLLoader::Create(
+ std::move(request),
+ GetNetworkTrafficAnnotation(request_->GetNetworkTrafficAnnotationType()));
-void GCDApiFlowImpl::OnURLFetchComplete(const net::URLFetcher* source) {
- // TODO(noamsml): Error logging.
+ url_loader_->SetAllowHttpErrorResults(true);
+
+ url_loader_->DownloadToString(
+ url_loader_factory_.get(),
+ base::BindOnce(&GCDApiFlowImpl::OnDownloadedToString,
+ weak_factory_.GetWeakPtr()),
+ kMaxContentSize);
+}
- // TODO(noamsml): Extract this and PrivetURLFetcher::OnURLFetchComplete into
- // one helper method.
- std::string response_str;
+void GCDApiFlowImpl::OnDownloadedToString(
+ std::unique_ptr<std::string> response_body) {
+ const network::ResourceResponseHead* response_info =
+ url_loader_->ResponseInfo();
- if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS ||
- !source->GetResponseAsString(&response_str)) {
+ if (url_loader_->NetError() != net::OK || !response_info) {
request_->OnGCDApiFlowError(ERROR_NETWORK);
return;
}
- if (source->GetResponseCode() != net::HTTP_OK) {
+ if (response_info->headers &&
+ response_info->headers->response_code() != net::HTTP_OK) {
request_->OnGCDApiFlowError(ERROR_HTTP_CODE);
return;
}
base::JSONReader reader;
- std::unique_ptr<const base::Value> value(reader.Read(response_str));
+ std::unique_ptr<const base::Value> value(reader.Read(*response_body));
const base::DictionaryValue* dictionary_value = NULL;
if (!value || !value->GetAsDictionary(&dictionary_value)) {
diff --git a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.h b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.h
index d578ceb115d..34bddebae51 100644
--- a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.h
+++ b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_impl.h
@@ -6,44 +6,46 @@
#define CHROME_BROWSER_PRINTING_CLOUD_PRINT_GCD_API_FLOW_IMPL_H_
#include <memory>
+#include <string>
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/printing/cloud_print/gcd_api_flow.h"
-#include "net/url_request/url_fetcher.h"
-#include "net/url_request/url_fetcher_delegate.h"
#include "services/identity/public/cpp/access_token_info.h"
namespace identity {
class PrimaryAccountAccessTokenFetcher;
}
+namespace network {
+class SimpleURLLoader;
+class SharedURLLoaderFactory;
+} // namespace network
class GoogleServiceAuthError;
namespace cloud_print {
-class GCDApiFlowImpl : public GCDApiFlow, public net::URLFetcherDelegate {
+class GCDApiFlowImpl : public GCDApiFlow {
public:
// Create an OAuth2-based confirmation.
- GCDApiFlowImpl(net::URLRequestContextGetter* request_context,
- identity::IdentityManager* identity_manager);
+ GCDApiFlowImpl(
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
+ identity::IdentityManager* identity_manager);
~GCDApiFlowImpl() override;
// GCDApiFlow implementation:
void Start(std::unique_ptr<Request> request) override;
- // net::URLFetcherDelegate implementation:
- void OnURLFetchComplete(const net::URLFetcher* source) override;
-
void OnAccessTokenFetchComplete(GoogleServiceAuthError error,
identity::AccessTokenInfo access_token_info);
-
private:
- void CreateRequest();
+ void OnDownloadedToString(std::unique_ptr<std::string> response_body);
- std::unique_ptr<net::URLFetcher> url_fetcher_;
+ std::unique_ptr<network::SimpleURLLoader> url_loader_;
std::unique_ptr<identity::PrimaryAccountAccessTokenFetcher> token_fetcher_;
- scoped_refptr<net::URLRequestContextGetter> request_context_;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
identity::IdentityManager* identity_manager_;
std::unique_ptr<Request> request_;
+ base::WeakPtrFactory<GCDApiFlowImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(GCDApiFlowImpl);
};
diff --git a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_unittest.cc b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_unittest.cc
index 65586571062..84d5ddc5313 100644
--- a/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_unittest.cc
+++ b/chromium/chrome/browser/printing/cloud_print/gcd_api_flow_unittest.cc
@@ -5,9 +5,13 @@
#include "chrome/browser/printing/cloud_print/gcd_api_flow.h"
#include <memory>
+#include <set>
#include <utility>
#include "base/bind.h"
+#include "base/run_loop.h"
+#include "base/stl_util.h"
+#include "base/test/bind_test_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "chrome/browser/printing/cloud_print/gcd_api_flow_impl.h"
@@ -16,19 +20,24 @@
#include "net/base/host_port_pair.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
-#include "net/url_request/test_url_fetcher_factory.h"
-#include "net/url_request/url_request_test_util.h"
#include "services/identity/public/cpp/identity_test_environment.h"
+#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
+#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using testing::_;
+using testing::Invoke;
using testing::Return;
+using testing::WithArgs;
namespace cloud_print {
namespace {
+const char kConfirmRequest[] =
+ "https://www.google.com/cloudprint/confirm?token=SomeToken";
+
const char kSampleConfirmResponse[] = "{}";
const char kFailedConfirmResponseBadJson[] = "[]";
@@ -47,8 +56,9 @@ class MockDelegate : public CloudPrintApiFlowRequest {
class GCDApiFlowTest : public testing::Test {
public:
GCDApiFlowTest()
- : request_context_(new net::TestURLRequestContextGetter(
- base::ThreadTaskRunnerHandle::Get())) {}
+ : test_shared_url_loader_factory_(
+ base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
+ &test_url_loader_factory_)) {}
~GCDApiFlowTest() override {}
@@ -62,45 +72,49 @@ class GCDApiFlowTest : public testing::Test {
.WillRepeatedly(Return(
GURL("https://www.google.com/cloudprint/confirm?token=SomeToken")));
gcd_flow_ = std::make_unique<GCDApiFlowImpl>(
- request_context_.get(), identity_test_environment_.identity_manager());
+ test_shared_url_loader_factory_.get(),
+ identity_test_environment_.identity_manager());
gcd_flow_->Start(std::move(delegate));
}
- identity::IdentityTestEnvironment identity_test_environment_;
- content::TestBrowserThreadBundle test_browser_thread_bundle_;
- scoped_refptr<net::TestURLRequestContextGetter> request_context_;
- net::TestURLFetcherFactory fetcher_factory_;
+ network::TestURLLoaderFactory test_url_loader_factory_;
std::unique_ptr<GCDApiFlowImpl> gcd_flow_;
MockDelegate* mock_delegate_;
+
+ private:
+ identity::IdentityTestEnvironment identity_test_environment_;
+ content::TestBrowserThreadBundle test_browser_thread_bundle_;
+ scoped_refptr<network::WeakWrapperSharedURLLoaderFactory>
+ test_shared_url_loader_factory_;
};
TEST_F(GCDApiFlowTest, SuccessOAuth2) {
+ std::set<GURL> requested_urls;
+ test_url_loader_factory_.SetInterceptor(
+ base::BindLambdaForTesting([&](const network::ResourceRequest& request) {
+ requested_urls.insert(request.url);
+ std::string oauth_header;
+ EXPECT_TRUE(request.headers.GetHeader("Authorization", &oauth_header));
+ EXPECT_EQ("Bearer SomeToken", oauth_header);
+
+ std::string proxy;
+ EXPECT_TRUE(request.headers.GetHeader("X-Cloudprint-Proxy", &proxy));
+ EXPECT_EQ("Chrome", proxy);
+ }));
+
gcd_flow_->OnAccessTokenFetchComplete(
GoogleServiceAuthError::AuthErrorNone(),
identity::AccessTokenInfo(
"SomeToken", base::Time::Now() + base::TimeDelta::FromHours(1)));
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- EXPECT_EQ(GURL("https://www.google.com/cloudprint/confirm?token=SomeToken"),
- fetcher->GetOriginalURL());
+ EXPECT_TRUE(base::ContainsKey(requested_urls, GURL(kConfirmRequest)));
- net::HttpRequestHeaders headers;
- fetcher->GetExtraRequestHeaders(&headers);
- std::string oauth_header;
- std::string proxy;
- EXPECT_TRUE(headers.GetHeader("Authorization", &oauth_header));
- EXPECT_EQ("Bearer SomeToken", oauth_header);
- EXPECT_TRUE(headers.GetHeader("X-Cloudprint-Proxy", &proxy));
- EXPECT_EQ("Chrome", proxy);
+ test_url_loader_factory_.AddResponse(kConfirmRequest, kSampleConfirmResponse);
- fetcher->SetResponseString(kSampleConfirmResponse);
- fetcher->set_status(
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK));
- fetcher->set_response_code(200);
-
- EXPECT_CALL(*mock_delegate_, OnGCDApiFlowComplete(_));
-
- fetcher->delegate()->OnURLFetchComplete(fetcher);
+ base::RunLoop run_loop;
+ EXPECT_CALL(*mock_delegate_, OnGCDApiFlowComplete(_))
+ .WillOnce(testing::InvokeWithoutArgs([&]() { run_loop.Quit(); }));
+ run_loop.Run();
}
TEST_F(GCDApiFlowTest, BadToken) {
@@ -111,24 +125,25 @@ TEST_F(GCDApiFlowTest, BadToken) {
}
TEST_F(GCDApiFlowTest, BadJson) {
+ std::set<GURL> requested_urls;
+ test_url_loader_factory_.SetInterceptor(
+ base::BindLambdaForTesting([&](const network::ResourceRequest& request) {
+ requested_urls.insert(request.url);
+ }));
+
gcd_flow_->OnAccessTokenFetchComplete(
GoogleServiceAuthError::AuthErrorNone(),
identity::AccessTokenInfo(
"SomeToken", base::Time::Now() + base::TimeDelta::FromHours(1)));
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
-
- EXPECT_EQ(GURL("https://www.google.com/cloudprint/confirm?token=SomeToken"),
- fetcher->GetOriginalURL());
-
- fetcher->SetResponseString(kFailedConfirmResponseBadJson);
- fetcher->set_status(
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK));
- fetcher->set_response_code(200);
+ EXPECT_TRUE(base::ContainsKey(requested_urls, GURL(kConfirmRequest)));
+ test_url_loader_factory_.AddResponse(kConfirmRequest,
+ kFailedConfirmResponseBadJson);
+ base::RunLoop run_loop;
EXPECT_CALL(*mock_delegate_,
- OnGCDApiFlowError(GCDApiFlow::ERROR_MALFORMED_RESPONSE));
-
- fetcher->delegate()->OnURLFetchComplete(fetcher);
+ OnGCDApiFlowError(GCDApiFlow::ERROR_MALFORMED_RESPONSE))
+ .WillOnce(testing::InvokeWithoutArgs([&]() { run_loop.Quit(); }));
+ run_loop.Run();
}
} // namespace
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http.h b/chromium/chrome/browser/printing/cloud_print/privet_http.h
index a17dc32074e..c40c506ff93 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http.h
@@ -9,7 +9,7 @@
#include <string>
#include "base/callback.h"
-#include "chrome/browser/printing/cloud_print/privet_url_fetcher.h"
+#include "chrome/browser/printing/cloud_print/privet_url_loader.h"
#include "net/base/host_port_pair.h"
namespace base {
@@ -54,14 +54,14 @@ class PrivetHTTPClient {
virtual std::unique_ptr<PrivetJSONOperation> CreateInfoOperation(
const PrivetJSONOperation::ResultCallback& callback) = 0;
- // Creates a URL fetcher for PrivetV1.
- virtual std::unique_ptr<PrivetURLFetcher> CreateURLFetcher(
+ // Creates a URL loader for PrivetV1.
+ virtual std::unique_ptr<PrivetURLLoader> CreateURLLoader(
const GURL& url,
- net::URLFetcher::RequestType request_type,
- PrivetURLFetcher::Delegate* delegate) = 0;
+ const std::string& http_method,
+ PrivetURLLoader::Delegate* delegate) = 0;
virtual void RefreshPrivetToken(
- PrivetURLFetcher::TokenCallback token_callback) = 0;
+ PrivetURLLoader::TokenCallback token_callback) = 0;
};
class PrivetDataReadOperation {
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.cc b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.cc
index 39ad39027ff..968fb332a58 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.cc
@@ -8,15 +8,16 @@
#include "base/memory/ptr_util.h"
#include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace cloud_print {
// static
std::unique_ptr<PrivetHTTPAsynchronousFactory>
PrivetHTTPAsynchronousFactory::CreateInstance(
- net::URLRequestContextGetter* request_context) {
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) {
return base::WrapUnique<PrivetHTTPAsynchronousFactory>(
- new PrivetHTTPAsynchronousFactoryImpl(request_context));
+ new PrivetHTTPAsynchronousFactoryImpl(url_loader_factory));
}
} // namespace cloud_print
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h
index abbf4958f27..a8817315514 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h
@@ -9,10 +9,14 @@
#include <string>
#include "base/callback.h"
+#include "base/memory/ref_counted.h"
namespace net {
class HostPortPair;
-class URLRequestContextGetter;
+}
+
+namespace network {
+class SharedURLLoaderFactory;
}
namespace cloud_print {
@@ -41,7 +45,7 @@ class PrivetHTTPAsynchronousFactory {
virtual ~PrivetHTTPAsynchronousFactory() {}
static std::unique_ptr<PrivetHTTPAsynchronousFactory> CreateInstance(
- net::URLRequestContextGetter* request_context);
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory);
virtual std::unique_ptr<PrivetHTTPResolution> CreatePrivetHTTP(
const std::string& service_name) = 0;
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc
index 7b0a2dd58e1..e726a492dbd 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc
@@ -5,36 +5,37 @@
#include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h"
#include <memory>
+#include <utility>
+#include "base/bind.h"
#include "chrome/browser/local_discovery/endpoint_resolver.h"
#include "chrome/browser/printing/cloud_print/privet_http_impl.h"
+#include "net/base/ip_endpoint.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace cloud_print {
PrivetHTTPAsynchronousFactoryImpl::PrivetHTTPAsynchronousFactoryImpl(
- net::URLRequestContextGetter* request_context)
- : request_context_(request_context) {
-}
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
+ : url_loader_factory_(url_loader_factory) {}
-PrivetHTTPAsynchronousFactoryImpl::~PrivetHTTPAsynchronousFactoryImpl() {
-}
+PrivetHTTPAsynchronousFactoryImpl::~PrivetHTTPAsynchronousFactoryImpl() {}
std::unique_ptr<PrivetHTTPResolution>
PrivetHTTPAsynchronousFactoryImpl::CreatePrivetHTTP(
const std::string& service_name) {
- return std::unique_ptr<PrivetHTTPResolution>(
- new ResolutionImpl(service_name, request_context_.get()));
+ return std::make_unique<ResolutionImpl>(service_name, url_loader_factory_);
}
PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolutionImpl(
const std::string& service_name,
- net::URLRequestContextGetter* request_context)
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
: name_(service_name),
- request_context_(request_context),
- endpoint_resolver_(new local_discovery::EndpointResolver()) {}
+ url_loader_factory_(url_loader_factory),
+ endpoint_resolver_(
+ std::make_unique<local_discovery::EndpointResolver>()) {}
-PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::~ResolutionImpl() {
-}
+PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::~ResolutionImpl() {}
const std::string&
PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::GetName() {
@@ -63,8 +64,8 @@ void PrivetHTTPAsynchronousFactoryImpl::ResolutionImpl::ResolveComplete(
return callback.Run(std::unique_ptr<PrivetHTTPClient>());
net::HostPortPair new_address = net::HostPortPair::FromIPEndPoint(endpoint);
- callback.Run(std::unique_ptr<PrivetHTTPClient>(
- new PrivetHTTPClientImpl(name_, new_address, request_context_.get())));
+ callback.Run(std::make_unique<PrivetHTTPClientImpl>(name_, new_address,
+ url_loader_factory_));
}
} // namespace cloud_print
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h
index 96c436288f9..51aad0dcaad 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h
@@ -6,8 +6,10 @@
#define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_HTTP_ASYNCHRONOUS_FACTORY_IMPL_H_
#include <memory>
+#include <string>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "chrome/browser/printing/cloud_print/privet_http.h"
#include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h"
@@ -15,12 +17,16 @@ namespace local_discovery {
class EndpointResolver;
}
+namespace network {
+class SharedURLLoaderFactory;
+}
+
namespace cloud_print {
class PrivetHTTPAsynchronousFactoryImpl : public PrivetHTTPAsynchronousFactory {
public:
explicit PrivetHTTPAsynchronousFactoryImpl(
- net::URLRequestContextGetter* request_context);
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory);
~PrivetHTTPAsynchronousFactoryImpl() override;
std::unique_ptr<PrivetHTTPResolution> CreatePrivetHTTP(
@@ -29,8 +35,9 @@ class PrivetHTTPAsynchronousFactoryImpl : public PrivetHTTPAsynchronousFactory {
private:
class ResolutionImpl : public PrivetHTTPResolution {
public:
- ResolutionImpl(const std::string& service_name,
- net::URLRequestContextGetter* request_context);
+ ResolutionImpl(
+ const std::string& service_name,
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory);
~ResolutionImpl() override;
void Start(const ResultCallback& callback) override;
@@ -44,13 +51,13 @@ class PrivetHTTPAsynchronousFactoryImpl : public PrivetHTTPAsynchronousFactory {
void ResolveComplete(const ResultCallback& callback,
const net::IPEndPoint& endpoint);
std::string name_;
- scoped_refptr<net::URLRequestContextGetter> request_context_;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
std::unique_ptr<local_discovery::EndpointResolver> endpoint_resolver_;
DISALLOW_COPY_AND_ASSIGN(ResolutionImpl);
};
- scoped_refptr<net::URLRequestContextGetter> request_context_;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
DISALLOW_COPY_AND_ASSIGN(PrivetHTTPAsynchronousFactoryImpl);
};
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http_impl.cc b/chromium/chrome/browser/printing/cloud_print/privet_http_impl.cc
index caacea829aa..056d2c8b589 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http_impl.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http_impl.cc
@@ -26,6 +26,7 @@
#include "net/base/url_util.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "printing/buildflags/buildflags.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "url/gurl.h"
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -100,13 +101,13 @@ PrivetInfoOperationImpl::~PrivetInfoOperationImpl() {
}
void PrivetInfoOperationImpl::Start() {
- url_fetcher_ = privet_client_->CreateURLFetcher(
- CreatePrivetURL(kPrivetInfoPath), net::URLFetcher::GET, this);
+ url_loader_ = privet_client_->CreateURLLoader(
+ CreatePrivetURL(kPrivetInfoPath), "GET", this);
- url_fetcher_->DoNotRetryOnTransientError();
- url_fetcher_->SendEmptyPrivetToken();
+ url_loader_->DoNotRetryOnTransientError();
+ url_loader_->SendEmptyPrivetToken();
- url_fetcher_->Start();
+ url_loader_->Start();
}
PrivetHTTPClient* PrivetInfoOperationImpl::GetHTTPClient() {
@@ -114,7 +115,7 @@ PrivetHTTPClient* PrivetInfoOperationImpl::GetHTTPClient() {
}
void PrivetInfoOperationImpl::OnError(int response_code,
- PrivetURLFetcher::ErrorType error) {
+ PrivetURLLoader::ErrorType error) {
callback_.Run(nullptr);
}
@@ -124,6 +125,21 @@ void PrivetInfoOperationImpl::OnParsedJson(int response_code,
callback_.Run(&value);
}
+// static
+bool PrivetRegisterOperationImpl::run_tasks_immediately_for_testing_ = false;
+
+PrivetRegisterOperationImpl::RunTasksImmediatelyForTesting::
+ RunTasksImmediatelyForTesting() {
+ DCHECK(!run_tasks_immediately_for_testing_);
+ run_tasks_immediately_for_testing_ = true;
+}
+
+PrivetRegisterOperationImpl::RunTasksImmediatelyForTesting::
+ ~RunTasksImmediatelyForTesting() {
+ DCHECK(run_tasks_immediately_for_testing_);
+ run_tasks_immediately_for_testing_ = false;
+}
+
PrivetRegisterOperationImpl::PrivetRegisterOperationImpl(
PrivetHTTPClient* privet_client,
const std::string& user,
@@ -141,16 +157,19 @@ void PrivetRegisterOperationImpl::Start() {
}
void PrivetRegisterOperationImpl::Cancel() {
- url_fetcher_.reset();
+ url_loader_.reset();
if (!ongoing_)
return;
+ int delay_seconds =
+ run_tasks_immediately_for_testing_ ? 0 : kPrivetCancelationTimeoutSeconds;
+
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::BindOnce(&PrivetRegisterOperationImpl::Cancelation::Cleanup,
base::Owned(new Cancelation(privet_client_, user_))),
- base::TimeDelta::FromSeconds(kPrivetCancelationTimeoutSeconds));
+ base::TimeDelta::FromSeconds(delay_seconds));
ongoing_ = false;
}
@@ -165,19 +184,19 @@ PrivetHTTPClient* PrivetRegisterOperationImpl::GetHTTPClient() {
}
void PrivetRegisterOperationImpl::OnError(int response_code,
- PrivetURLFetcher::ErrorType error) {
+ PrivetURLLoader::ErrorType error) {
ongoing_ = false;
int visible_http_code = -1;
FailureReason reason = FAILURE_NETWORK;
- if (error == PrivetURLFetcher::RESPONSE_CODE_ERROR) {
+ if (error == PrivetURLLoader::RESPONSE_CODE_ERROR) {
visible_http_code = response_code;
reason = FAILURE_HTTP_ERROR;
- } else if (error == PrivetURLFetcher::JSON_PARSE_ERROR) {
+ } else if (error == PrivetURLLoader::JSON_PARSE_ERROR) {
reason = FAILURE_MALFORMED_RESPONSE;
- } else if (error == PrivetURLFetcher::TOKEN_ERROR) {
+ } else if (error == PrivetURLLoader::TOKEN_ERROR) {
reason = FAILURE_TOKEN;
- } else if (error == PrivetURLFetcher::UNKNOWN_ERROR) {
+ } else if (error == PrivetURLLoader::UNKNOWN_ERROR) {
reason = FAILURE_UNKNOWN;
}
@@ -205,15 +224,15 @@ void PrivetRegisterOperationImpl::OnParsedJson(
}
void PrivetRegisterOperationImpl::OnNeedPrivetToken(
- PrivetURLFetcher::TokenCallback callback) {
+ PrivetURLLoader::TokenCallback callback) {
privet_client_->RefreshPrivetToken(std::move(callback));
}
void PrivetRegisterOperationImpl::SendRequest(const std::string& action) {
current_action_ = action;
- url_fetcher_ = privet_client_->CreateURLFetcher(
- CreatePrivetRegisterURL(action, user_), net::URLFetcher::POST, this);
- url_fetcher_->Start();
+ url_loader_ = privet_client_->CreateURLLoader(
+ CreatePrivetRegisterURL(action, user_), "POST", this);
+ url_loader_->Start();
}
void PrivetRegisterOperationImpl::StartResponse(
@@ -227,12 +246,12 @@ void PrivetRegisterOperationImpl::StartResponse(
void PrivetRegisterOperationImpl::GetClaimTokenResponse(
const base::DictionaryValue& value) {
- std::string claimUrl;
- std::string claimToken;
- bool got_url = value.GetString(kPrivetKeyClaimURL, &claimUrl);
- bool got_token = value.GetString(kPrivetKeyClaimToken, &claimToken);
+ std::string claim_url;
+ std::string claim_token;
+ bool got_url = value.GetString(kPrivetKeyClaimURL, &claim_url);
+ bool got_token = value.GetString(kPrivetKeyClaimToken, &claim_token);
if (got_url || got_token) {
- delegate_->OnPrivetRegisterClaimToken(this, claimToken, GURL(claimUrl));
+ delegate_->OnPrivetRegisterClaimToken(this, claim_token, GURL(claim_url));
} else {
delegate_->OnPrivetRegisterError(this, current_action_,
FAILURE_MALFORMED_RESPONSE, -1, nullptr);
@@ -292,12 +311,10 @@ void PrivetRegisterOperationImpl::StartInfoOperation() {
PrivetRegisterOperationImpl::Cancelation::Cancelation(
PrivetHTTPClient* privet_client,
const std::string& user) {
- url_fetcher_ =
- privet_client->CreateURLFetcher(
- CreatePrivetRegisterURL(kPrivetActionCancel, user),
- net::URLFetcher::POST, this);
- url_fetcher_->DoNotRetryOnTransientError();
- url_fetcher_->Start();
+ url_loader_ = privet_client->CreateURLLoader(
+ CreatePrivetRegisterURL(kPrivetActionCancel, user), "POST", this);
+ url_loader_->DoNotRetryOnTransientError();
+ url_loader_->Start();
}
PrivetRegisterOperationImpl::Cancelation::~Cancelation() {
@@ -305,7 +322,7 @@ PrivetRegisterOperationImpl::Cancelation::~Cancelation() {
void PrivetRegisterOperationImpl::Cancelation::OnError(
int response_code,
- PrivetURLFetcher::ErrorType error) {}
+ PrivetURLLoader::ErrorType error) {}
void PrivetRegisterOperationImpl::Cancelation::OnParsedJson(
int response_code,
@@ -332,10 +349,10 @@ PrivetJSONOperationImpl::~PrivetJSONOperationImpl() {
}
void PrivetJSONOperationImpl::Start() {
- url_fetcher_ = privet_client_->CreateURLFetcher(
- CreatePrivetParamURL(path_, query_params_), net::URLFetcher::GET, this);
- url_fetcher_->DoNotRetryOnTransientError();
- url_fetcher_->Start();
+ url_loader_ = privet_client_->CreateURLLoader(
+ CreatePrivetParamURL(path_, query_params_), "GET", this);
+ url_loader_->DoNotRetryOnTransientError();
+ url_loader_->Start();
}
PrivetHTTPClient* PrivetJSONOperationImpl::GetHTTPClient() {
@@ -343,7 +360,7 @@ PrivetHTTPClient* PrivetJSONOperationImpl::GetHTTPClient() {
}
void PrivetJSONOperationImpl::OnError(int response_code,
- PrivetURLFetcher::ErrorType error) {
+ PrivetURLLoader::ErrorType error) {
callback_.Run(nullptr);
}
@@ -354,11 +371,26 @@ void PrivetJSONOperationImpl::OnParsedJson(int response_code,
}
void PrivetJSONOperationImpl::OnNeedPrivetToken(
- PrivetURLFetcher::TokenCallback callback) {
+ PrivetURLLoader::TokenCallback callback) {
privet_client_->RefreshPrivetToken(std::move(callback));
}
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+// static
+bool PrivetLocalPrintOperationImpl::run_tasks_immediately_for_testing_ = false;
+
+PrivetLocalPrintOperationImpl::RunTasksImmediatelyForTesting::
+ RunTasksImmediatelyForTesting() {
+ DCHECK(!run_tasks_immediately_for_testing_);
+ run_tasks_immediately_for_testing_ = true;
+}
+
+PrivetLocalPrintOperationImpl::RunTasksImmediatelyForTesting::
+ ~RunTasksImmediatelyForTesting() {
+ DCHECK(run_tasks_immediately_for_testing_);
+ run_tasks_immediately_for_testing_ = false;
+}
+
PrivetLocalPrintOperationImpl::PrivetLocalPrintOperationImpl(
PrivetHTTPClient* privet_client,
PrivetLocalPrintOperation::Delegate* delegate)
@@ -438,11 +470,11 @@ void PrivetLocalPrintOperationImpl::DoCreatejob() {
base::BindOnce(&PrivetLocalPrintOperationImpl::OnCreatejobResponse,
weak_factory_.GetWeakPtr());
- url_fetcher_ = privet_client_->CreateURLFetcher(
- CreatePrivetURL(kPrivetCreatejobPath), net::URLFetcher::POST, this);
- url_fetcher_->SetUploadData(kContentTypeJSON, ticket_.ToString());
+ url_loader_ = privet_client_->CreateURLLoader(
+ CreatePrivetURL(kPrivetCreatejobPath), "POST", this);
+ url_loader_->SetUploadData(kContentTypeJSON, ticket_.ToString());
- url_fetcher_->Start();
+ url_loader_->Start();
}
void PrivetLocalPrintOperationImpl::DoSubmitdoc() {
@@ -478,14 +510,13 @@ void PrivetLocalPrintOperationImpl::DoSubmitdoc() {
jobid_);
}
- url_fetcher_ =
- privet_client_->CreateURLFetcher(url, net::URLFetcher::POST, this);
+ url_loader_ = privet_client_->CreateURLLoader(url, "POST", this);
std::string data_str(reinterpret_cast<const char*>(data_->front()),
data_->size());
- url_fetcher_->SetUploadData(
+ url_loader_->SetUploadData(
use_pdf_ ? kPrivetContentTypePDF : kPrivetContentTypePWGRaster, data_str);
- url_fetcher_->Start();
+ url_loader_->Start();
}
void PrivetLocalPrintOperationImpl::StartPrinting() {
@@ -531,7 +562,10 @@ void PrivetLocalPrintOperationImpl::OnSubmitdocResponse(
double random_scaling_factor =
1 + base::RandDouble() * kPrivetMaximumTimeRandomAddition;
- timeout = std::max(static_cast<int>(timeout * random_scaling_factor),
+ timeout =
+ run_tasks_immediately_for_testing_
+ ? 0
+ : std::max(static_cast<int>(timeout * random_scaling_factor),
kPrivetMinimumTimeout);
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
@@ -585,7 +619,7 @@ PrivetHTTPClient* PrivetLocalPrintOperationImpl::GetHTTPClient() {
}
void PrivetLocalPrintOperationImpl::OnError(int response_code,
- PrivetURLFetcher::ErrorType error) {
+ PrivetURLLoader::ErrorType error) {
delegate_->OnPrivetPrintingError(this, -1);
}
@@ -598,7 +632,7 @@ void PrivetLocalPrintOperationImpl::OnParsedJson(
}
void PrivetLocalPrintOperationImpl::OnNeedPrivetToken(
- PrivetURLFetcher::TokenCallback callback) {
+ PrivetURLLoader::TokenCallback callback) {
privet_client_->RefreshPrivetToken(std::move(callback));
}
@@ -643,8 +677,12 @@ void PrivetLocalPrintOperationImpl::SetPwgRasterConverterForTesting(
PrivetHTTPClientImpl::PrivetHTTPClientImpl(
const std::string& name,
const net::HostPortPair& host_port,
- const scoped_refptr<net::URLRequestContextGetter>& context_getter)
- : name_(name), context_getter_(context_getter), host_port_(host_port) {}
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
+ : name_(name),
+ url_loader_factory_(url_loader_factory),
+ host_port_(host_port) {
+ DCHECK(url_loader_factory_);
+}
PrivetHTTPClientImpl::~PrivetHTTPClientImpl() {
}
@@ -658,10 +696,10 @@ std::unique_ptr<PrivetJSONOperation> PrivetHTTPClientImpl::CreateInfoOperation(
return std::make_unique<PrivetInfoOperationImpl>(this, callback);
}
-std::unique_ptr<PrivetURLFetcher> PrivetHTTPClientImpl::CreateURLFetcher(
+std::unique_ptr<PrivetURLLoader> PrivetHTTPClientImpl::CreateURLLoader(
const GURL& url,
- net::URLFetcher::RequestType request_type,
- PrivetURLFetcher::Delegate* delegate) {
+ const std::string& request_type,
+ PrivetURLLoader::Delegate* delegate) {
GURL::Replacements replacements;
std::string host = host_port_.HostForURL();
replacements.SetHostStr(host);
@@ -693,13 +731,13 @@ std::unique_ptr<PrivetURLFetcher> PrivetHTTPClientImpl::CreateURLFetcher(
policy_exception_justification:
"Not implemented, it's good to do so."
})");
- return std::make_unique<PrivetURLFetcher>(url.ReplaceComponents(replacements),
- request_type, context_getter_,
- traffic_annotation, delegate);
+ return std::make_unique<PrivetURLLoader>(url.ReplaceComponents(replacements),
+ request_type, url_loader_factory_,
+ traffic_annotation, delegate);
}
void PrivetHTTPClientImpl::RefreshPrivetToken(
- PrivetURLFetcher::TokenCallback callback) {
+ PrivetURLLoader::TokenCallback callback) {
token_callbacks_.push_back(std::move(callback));
if (info_operation_)
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http_impl.h b/chromium/chrome/browser/printing/cloud_print/privet_http_impl.h
index 432a94a8bc5..f6657f2b353 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http_impl.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http_impl.h
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/printing/cloud_print/privet_http.h"
+#include "chrome/browser/printing/cloud_print/privet_url_loader.h"
#include "components/cloud_devices/common/cloud_device_description.h"
#include "printing/buildflags/buildflags.h"
#include "ui/gfx/geometry/size.h"
@@ -23,12 +24,16 @@ namespace base {
class RefCountedMemory;
}
+namespace network {
+class SharedURLLoaderFactory;
+}
+
namespace cloud_print {
class PrivetHTTPClient;
class PrivetInfoOperationImpl : public PrivetJSONOperation,
- public PrivetURLFetcher::Delegate {
+ public PrivetURLLoader::Delegate {
public:
PrivetInfoOperationImpl(PrivetHTTPClient* privet_client,
const PrivetJSONOperation::ResultCallback& callback);
@@ -38,8 +43,8 @@ class PrivetInfoOperationImpl : public PrivetJSONOperation,
void Start() override;
PrivetHTTPClient* GetHTTPClient() override;
- // PrivetURLFetcher::Delegate:
- void OnError(int response_code, PrivetURLFetcher::ErrorType error) override;
+ // PrivetURLLoader::Delegate:
+ void OnError(int response_code, PrivetURLLoader::ErrorType error) override;
void OnParsedJson(int response_code,
const base::DictionaryValue& value,
bool has_error) override;
@@ -47,12 +52,12 @@ class PrivetInfoOperationImpl : public PrivetJSONOperation,
private:
PrivetHTTPClient* const privet_client_;
PrivetJSONOperation::ResultCallback callback_;
- std::unique_ptr<PrivetURLFetcher> url_fetcher_;
+ std::unique_ptr<PrivetURLLoader> url_loader_;
};
class PrivetRegisterOperationImpl
: public PrivetRegisterOperation,
- public PrivetURLFetcher::Delegate,
+ public PrivetURLLoader::Delegate,
public base::SupportsWeakPtr<PrivetRegisterOperationImpl> {
public:
PrivetRegisterOperationImpl(PrivetHTTPClient* privet_client,
@@ -66,21 +71,28 @@ class PrivetRegisterOperationImpl
void CompleteRegistration() override;
PrivetHTTPClient* GetHTTPClient() override;
- // PrivetURLFetcher::Delegate:
- void OnError(int response_code, PrivetURLFetcher::ErrorType error) override;
+ // PrivetURLLoader::Delegate:
+ void OnError(int response_code, PrivetURLLoader::ErrorType error) override;
void OnParsedJson(int response_code,
const base::DictionaryValue& value,
bool has_error) override;
- void OnNeedPrivetToken(PrivetURLFetcher::TokenCallback callback) override;
+ void OnNeedPrivetToken(PrivetURLLoader::TokenCallback callback) override;
+
+ // Used in test to skip delays when posting tasks for cancellation.
+ class RunTasksImmediatelyForTesting final {
+ public:
+ RunTasksImmediatelyForTesting();
+ ~RunTasksImmediatelyForTesting();
+ };
private:
- class Cancelation : public PrivetURLFetcher::Delegate {
+ class Cancelation : public PrivetURLLoader::Delegate {
public:
Cancelation(PrivetHTTPClient* privet_client, const std::string& user);
~Cancelation() override;
- // PrivetURLFetcher::Delegate:
- void OnError(int response_code, PrivetURLFetcher::ErrorType error) override;
+ // PrivetURLLoader::Delegate:
+ void OnError(int response_code, PrivetURLLoader::ErrorType error) override;
void OnParsedJson(int response_code,
const base::DictionaryValue& value,
bool has_error) override;
@@ -88,7 +100,7 @@ class PrivetRegisterOperationImpl
void Cleanup();
private:
- std::unique_ptr<PrivetURLFetcher> url_fetcher_;
+ std::unique_ptr<PrivetURLLoader> url_loader_;
};
// Arguments is JSON value from request.
@@ -106,7 +118,7 @@ class PrivetRegisterOperationImpl
const std::string user_;
std::string current_action_;
- std::unique_ptr<PrivetURLFetcher> url_fetcher_;
+ std::unique_ptr<PrivetURLLoader> url_loader_;
PrivetRegisterOperation::Delegate* const delegate_;
PrivetHTTPClient* const privet_client_;
ResponseHandler next_response_handler_;
@@ -116,10 +128,12 @@ class PrivetRegisterOperationImpl
std::unique_ptr<PrivetJSONOperation> info_operation_;
std::string expected_id_;
+
+ static bool run_tasks_immediately_for_testing_;
};
class PrivetJSONOperationImpl : public PrivetJSONOperation,
- public PrivetURLFetcher::Delegate {
+ public PrivetURLLoader::Delegate {
public:
PrivetJSONOperationImpl(PrivetHTTPClient* privet_client,
const std::string& path,
@@ -131,12 +145,12 @@ class PrivetJSONOperationImpl : public PrivetJSONOperation,
void Start() override;
PrivetHTTPClient* GetHTTPClient() override;
- // PrivetURLFetcher::Delegate:
- void OnError(int response_code, PrivetURLFetcher::ErrorType error) override;
+ // PrivetURLLoader::Delegate:
+ void OnError(int response_code, PrivetURLLoader::ErrorType error) override;
void OnParsedJson(int response_code,
const base::DictionaryValue& value,
bool has_error) override;
- void OnNeedPrivetToken(PrivetURLFetcher::TokenCallback callback) override;
+ void OnNeedPrivetToken(PrivetURLLoader::TokenCallback callback) override;
private:
PrivetHTTPClient* const privet_client_;
@@ -144,13 +158,12 @@ class PrivetJSONOperationImpl : public PrivetJSONOperation,
const std::string query_params_;
PrivetJSONOperation::ResultCallback callback_;
- std::unique_ptr<PrivetURLFetcher> url_fetcher_;
+ std::unique_ptr<PrivetURLLoader> url_loader_;
};
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
-class PrivetLocalPrintOperationImpl
- : public PrivetLocalPrintOperation,
- public PrivetURLFetcher::Delegate {
+class PrivetLocalPrintOperationImpl : public PrivetLocalPrintOperation,
+ public PrivetURLLoader::Delegate {
public:
PrivetLocalPrintOperationImpl(PrivetHTTPClient* privet_client,
PrivetLocalPrintOperation::Delegate* delegate);
@@ -169,12 +182,19 @@ class PrivetLocalPrintOperationImpl
override;
PrivetHTTPClient* GetHTTPClient() override;
- // PrivetURLFetcher::Delegate:
- void OnError(int response_code, PrivetURLFetcher::ErrorType error) override;
+ // PrivetURLLoader::Delegate:
+ void OnError(int response_code, PrivetURLLoader::ErrorType error) override;
void OnParsedJson(int response_code,
const base::DictionaryValue& value,
bool has_error) override;
- void OnNeedPrivetToken(PrivetURLFetcher::TokenCallback callback) override;
+ void OnNeedPrivetToken(PrivetURLLoader::TokenCallback callback) override;
+
+ // Used in test to skip delays when posting tasks for cancellation.
+ class RunTasksImmediatelyForTesting final {
+ public:
+ RunTasksImmediatelyForTesting();
+ ~RunTasksImmediatelyForTesting();
+ };
private:
using ResponseCallback =
@@ -217,11 +237,13 @@ class PrivetLocalPrintOperationImpl
int invalid_job_retries_ = 0;
- std::unique_ptr<PrivetURLFetcher> url_fetcher_;
+ std::unique_ptr<PrivetURLLoader> url_loader_;
std::unique_ptr<PrivetJSONOperation> info_operation_;
std::unique_ptr<printing::PwgRasterConverter> pwg_raster_converter_;
base::WeakPtrFactory<PrivetLocalPrintOperationImpl> weak_factory_;
+
+ static bool run_tasks_immediately_for_testing_;
};
#endif // ENABLE_PRINT_PREVIEW
@@ -230,27 +252,27 @@ class PrivetHTTPClientImpl : public PrivetHTTPClient {
PrivetHTTPClientImpl(
const std::string& name,
const net::HostPortPair& host_port,
- const scoped_refptr<net::URLRequestContextGetter>& context_getter);
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory);
~PrivetHTTPClientImpl() override;
// PrivetHTTPClient:
const std::string& GetName() override;
std::unique_ptr<PrivetJSONOperation> CreateInfoOperation(
const PrivetJSONOperation::ResultCallback& callback) override;
- std::unique_ptr<PrivetURLFetcher> CreateURLFetcher(
+ std::unique_ptr<PrivetURLLoader> CreateURLLoader(
const GURL& url,
- net::URLFetcher::RequestType request_type,
- PrivetURLFetcher::Delegate* delegate) override;
+ const std::string& request_type,
+ PrivetURLLoader::Delegate* delegate) override;
void RefreshPrivetToken(
- PrivetURLFetcher::TokenCallback token_callback) override;
+ PrivetURLLoader::TokenCallback token_callback) override;
private:
- using TokenCallbackVector = std::vector<PrivetURLFetcher::TokenCallback>;
+ using TokenCallbackVector = std::vector<PrivetURLLoader::TokenCallback>;
void OnPrivetInfoDone(const base::DictionaryValue* value);
const std::string name_;
- scoped_refptr<net::URLRequestContextGetter> context_getter_;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
const net::HostPortPair host_port_;
std::unique_ptr<PrivetJSONOperation> info_operation_;
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_http_unittest.cc b/chromium/chrome/browser/printing/cloud_print/privet_http_unittest.cc
index 71fc872ab85..40c5529382b 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_http_unittest.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_http_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/printing/cloud_print/privet_http.h"
+#include <map>
#include <memory>
#include <utility>
#include <vector>
@@ -11,17 +12,21 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/location.h"
+#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/bind_test_util.h"
#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/printing/cloud_print/privet_http_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
-#include "net/url_request/test_url_fetcher_factory.h"
-#include "net/url_request/url_request_test_util.h"
#include "printing/buildflags/buildflags.h"
+#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
+#include "services/network/test/test_shared_url_loader_factory.h"
+#include "services/network/test/test_url_loader_factory.h"
+#include "services/network/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -34,13 +39,14 @@ namespace cloud_print {
namespace {
+using content::BrowserThread;
+using net::EmbeddedTestServer;
+using testing::Mock;
using testing::NiceMock;
using testing::StrictMock;
using testing::TestWithParam;
using testing::ValuesIn;
-
-using content::BrowserThread;
-using net::EmbeddedTestServer;
+using testing::_;
const char kSampleInfoResponse[] =
R"({
@@ -199,7 +205,7 @@ const char kSampleErrorResponsePrinterBusy[] =
const char kSampleInvalidDocumentTypeResponse[] =
R"({ "error" : "invalid_document_type" })";
-const char kSampleCreatejobResponse[] = R"({ "job_id": "1234" })";
+const char kSampleCreateJobResponse[] = R"({ "job_id": "1234" })";
const char kSampleCapabilitiesResponseWithAnyMimetype[] =
R"({
@@ -254,7 +260,7 @@ const char kSampleCJTMono[] =
const char* const kTestParams[] = {"8.8.4.4", "2001:4860:4860::8888"};
-// Return the representation of the given JSON that would be outputted by
+// Returns the representation of the given JSON that would be outputted by
// JSONWriter. This ensures the same JSON values are represented by the same
// string.
std::string NormalizeJson(const std::string& json) {
@@ -265,32 +271,38 @@ std::string NormalizeJson(const std::string& json) {
return result;
}
-class MockTestURLFetcherFactoryDelegate
- : public net::TestURLFetcher::DelegateForTests {
- public:
- // Callback issued correspondingly to the call to the |Start()| method.
- MOCK_METHOD1(OnRequestStart, void(int fetcher_id));
-
- // Callback issued correspondingly to the call to |AppendChunkToUpload|.
- // Uploaded chunks can be retrieved with the |upload_chunks()| getter.
- MOCK_METHOD1(OnChunkUpload, void(int fetcher_id));
-
- // Callback issued correspondingly to the destructor.
- MOCK_METHOD1(OnRequestEnd, void(int fetcher_id));
-};
-
class PrivetHTTPTest : public TestWithParam<const char*> {
public:
- PrivetHTTPTest() {
- PrivetURLFetcher::ResetTokenMapForTest();
-
- request_context_ = base::MakeRefCounted<net::TestURLRequestContextGetter>(
- base::ThreadTaskRunnerHandle::Get());
- privet_client_ = PrivetV1HTTPClient::CreateDefault(
- std::make_unique<PrivetHTTPClientImpl>(
- "sampleDevice._privet._tcp.local",
- net::HostPortPair(GetParam(), 6006), request_context_.get()));
- fetcher_factory_.SetDelegateForTests(&fetcher_delegate_);
+ PrivetHTTPTest()
+ : kInfoURL(GetUrl("/privet/info")),
+ kRegisterStartURL(
+ GetUrl("/privet/register?action=start&user=example%40google.com")),
+ kRegisterGetTokenURL(GetUrl(
+ "/privet/register?action=getClaimToken&user=example%40google.com")),
+ kRegisterCompleteURL(GetUrl(
+ "/privet/register?action=complete&user=example%40google.com")),
+ kCapabilitiesURL(GetUrl("/privet/capabilities")),
+ kSubmitDocURL(GetUrl("/privet/printer/"
+ "submitdoc?client_name=Chrome&user_name=sample%"
+ "40gmail.com&job_name=Sample+job+name")),
+ kSubmitDocWithJobIDURL(
+ GetUrl("/privet/printer/"
+ "submitdoc?client_name=Chrome&user_name=sample%40gmail.com&"
+ "job_name=Sample+job+name&job_id=1234")),
+ kCreateJobURL(GetUrl("/privet/printer/createjob")),
+ test_shared_url_loader_factory_(
+ base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
+ &test_url_loader_factory_)) {
+ PrivetURLLoader::ResetTokenMapForTest();
+
+ auto privet_http_client_impl = std::make_unique<PrivetHTTPClientImpl>(
+ "sampleDevice._privet._tcp.local", net::HostPortPair(GetParam(), 6006),
+ test_shared_url_loader_factory_);
+ privet_client_ =
+ PrivetV1HTTPClient::CreateDefault(std::move(privet_http_client_impl));
+
+ test_url_loader_factory_.SetInterceptor(base::BindRepeating(
+ &PrivetHTTPTest::InterceptURL, base::Unretained(this)));
}
GURL GetUrl(const std::string& path) const {
@@ -300,101 +312,62 @@ class PrivetHTTPTest : public TestWithParam<const char*> {
return GURL("http://" + host + ":6006" + path);
}
- bool SuccessfulResponseToURL(const GURL& url,
- const std::string& response) {
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- if (!fetcher) {
- ADD_FAILURE();
- return false;
- }
-
- EXPECT_EQ(url, fetcher->GetOriginalURL());
- if (url != fetcher->GetOriginalURL())
- return false;
-
- fetcher->SetResponseString(response);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
- fetcher->delegate()->OnURLFetchComplete(fetcher);
- return true;
+ protected:
+ void InterceptURL(const network::ResourceRequest& request) {
+ url_to_resource_requests_[request.url].push_back(request);
}
- bool SuccessfulResponseToURLAndData(const GURL& url,
- const std::string& data,
- const std::string& response) {
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- if (!fetcher) {
- ADD_FAILURE();
- return false;
- }
-
- EXPECT_EQ(url, fetcher->GetOriginalURL());
-
- EXPECT_EQ(data, fetcher->upload_data());
- if (data != fetcher->upload_data())
- return false;
-
- return SuccessfulResponseToURL(url, response);
+ bool SuccessfulResponse(const GURL& request_url,
+ std::string content,
+ net::HttpStatusCode http_status = net::HTTP_OK) {
+ return test_url_loader_factory_.SimulateResponseForPendingRequest(
+ request_url, network::URLLoaderCompletionStatus(net::OK),
+ network::CreateResourceResponseHead(http_status), content);
}
- bool SuccessfulResponseToURLAndJSONData(const GURL& url,
- const std::string& data,
- const std::string& response) {
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- if (!fetcher) {
- ADD_FAILURE();
- return false;
- }
-
- EXPECT_EQ(url, fetcher->GetOriginalURL());
-
- std::string normalized_data = NormalizeJson(data);
- std::string normalized_upload_data = NormalizeJson(fetcher->upload_data());
- EXPECT_EQ(normalized_data, normalized_upload_data);
- if (normalized_data != normalized_upload_data)
- return false;
-
- return SuccessfulResponseToURL(url, response);
+ std::string GetUploadDataAsNormalizedJSON(const GURL& url) {
+ std::string data = GetUploadData(url);
+ if (data.empty())
+ return data;
+ return NormalizeJson(data);
}
- bool SuccessfulResponseToURLAndFileData(const GURL& url,
- const std::string& file_data,
- const std::string& response) {
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- if (!fetcher) {
- ADD_FAILURE();
- return false;
- }
-
- EXPECT_EQ(url, fetcher->GetOriginalURL());
-
- EXPECT_EQ(file_data, fetcher->upload_data());
- if (file_data != fetcher->upload_data())
- return false;
-
- return SuccessfulResponseToURL(url, response);
- }
+ std::string GetUploadData(const GURL& url) {
+ auto it = url_to_resource_requests_.find(url);
+ if (it == url_to_resource_requests_.end())
+ return std::string();
+ const std::vector<network::ResourceRequest>& resource_requests = it->second;
+ DCHECK(!resource_requests.empty());
+ const network::ResourceRequest& resource_request = resource_requests[0];
+ if (!resource_request.request_body ||
+ resource_request.request_body->elements()->empty())
+ return std::string();
- void RunFor(base::TimeDelta time_period) {
- base::CancelableCallback<void()> callback(base::Bind(
- &PrivetHTTPTest::Stop, base::Unretained(this)));
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, callback.callback(), time_period);
+ const network::DataElement& data_element =
+ resource_request.request_body->elements()->at(0);
+ if (data_element.type() != network::DataElement::TYPE_BYTES)
+ return std::string();
- base::RunLoop().Run();
- callback.Cancel();
+ return std::string(data_element.bytes(), data_element.length());
}
- void Stop() { base::RunLoop::QuitCurrentWhenIdleDeprecated(); }
+ const GURL kInfoURL;
+ const GURL kRegisterStartURL;
+ const GURL kRegisterGetTokenURL;
+ const GURL kRegisterCompleteURL;
+ const GURL kCapabilitiesURL;
+ const GURL kSubmitDocURL;
+ const GURL kSubmitDocWithJobIDURL;
+ const GURL kCreateJobURL;
- protected:
base::test::ScopedTaskEnvironment scoped_task_environment_;
- scoped_refptr<net::TestURLRequestContextGetter> request_context_;
- net::TestURLFetcherFactory fetcher_factory_;
+ network::TestURLLoaderFactory test_url_loader_factory_;
+ scoped_refptr<network::WeakWrapperSharedURLLoaderFactory>
+ test_shared_url_loader_factory_;
std::unique_ptr<PrivetV1HTTPClient> privet_client_;
- NiceMock<MockTestURLFetcherFactoryDelegate> fetcher_delegate_;
+ std::map<GURL, std::vector<network::ResourceRequest>>
+ url_to_resource_requests_;
};
class MockJSONCallback{
@@ -417,16 +390,10 @@ class MockJSONCallback{
class MockRegisterDelegate : public PrivetRegisterOperation::Delegate {
public:
- void OnPrivetRegisterClaimToken(
- PrivetRegisterOperation* operation,
- const std::string& token,
- const GURL& url) override {
- OnPrivetRegisterClaimTokenInternal(token, url);
- }
-
- MOCK_METHOD2(OnPrivetRegisterClaimTokenInternal, void(
- const std::string& token,
- const GURL& url));
+ MOCK_METHOD3(OnPrivetRegisterClaimToken,
+ void(PrivetRegisterOperation* operation,
+ const std::string& token,
+ const GURL& url));
void OnPrivetRegisterError(
PrivetRegisterOperation* operation,
@@ -443,31 +410,17 @@ class MockRegisterDelegate : public PrivetRegisterOperation::Delegate {
PrivetRegisterOperation::FailureReason reason,
int printer_http_code));
- void OnPrivetRegisterDone(
- PrivetRegisterOperation* operation,
- const std::string& device_id) override {
- OnPrivetRegisterDoneInternal(device_id);
- }
-
- MOCK_METHOD1(OnPrivetRegisterDoneInternal,
- void(const std::string& device_id));
+ MOCK_METHOD2(OnPrivetRegisterDone,
+ void(PrivetRegisterOperation* operation,
+ const std::string& device_id));
};
class MockLocalPrintDelegate : public PrivetLocalPrintOperation::Delegate {
public:
- void OnPrivetPrintingDone(
- const PrivetLocalPrintOperation* print_operation) override {
- OnPrivetPrintingDoneInternal();
- }
-
- MOCK_METHOD0(OnPrivetPrintingDoneInternal, void());
-
- void OnPrivetPrintingError(const PrivetLocalPrintOperation* print_operation,
- int http_code) override {
- OnPrivetPrintingErrorInternal(http_code);
- }
-
- MOCK_METHOD1(OnPrivetPrintingErrorInternal, void(int http_code));
+ MOCK_METHOD1(OnPrivetPrintingDone, void(const PrivetLocalPrintOperation*));
+ MOCK_METHOD2(OnPrivetPrintingError,
+ void(const PrivetLocalPrintOperation* print_operation,
+ int http_code));
};
class PrivetInfoTest : public PrivetHTTPTest {
@@ -487,34 +440,20 @@ INSTANTIATE_TEST_CASE_P(PrivetTests, PrivetInfoTest, ValuesIn(kTestParams));
TEST_P(PrivetInfoTest, SuccessfulInfo) {
info_operation_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- EXPECT_EQ(GetUrl("/privet/info"), fetcher->GetOriginalURL());
-
- fetcher->SetResponseString(kSampleInfoResponse);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
-
EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal());
- fetcher->delegate()->OnURLFetchComplete(fetcher);
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
}
TEST_P(PrivetInfoTest, InfoFailureHTTP) {
info_operation_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(404);
-
EXPECT_CALL(info_callback_, OnPrivetJSONDoneInternal());
- fetcher->delegate()->OnURLFetchComplete(fetcher);
+ EXPECT_TRUE(
+ SuccessfulResponse(kInfoURL, kSampleInfoResponse, net::HTTP_NOT_FOUND));
}
class PrivetRegisterTest : public PrivetHTTPTest {
- public:
+ protected:
void SetUp() override {
info_operation_ = privet_client_->CreateInfoOperation(
info_callback_.callback());
@@ -523,31 +462,11 @@ class PrivetRegisterTest : public PrivetHTTPTest {
&register_delegate_);
}
- protected:
- bool SuccessfulResponseToURL(const GURL& url,
- const std::string& response) {
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- if (!fetcher) {
- ADD_FAILURE();
- return false;
- }
-
- EXPECT_EQ(url, fetcher->GetOriginalURL());
- if (url != fetcher->GetOriginalURL())
- return false;
-
- fetcher->SetResponseString(response);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
- fetcher->delegate()->OnURLFetchComplete(fetcher);
- return true;
- }
-
std::unique_ptr<PrivetJSONOperation> info_operation_;
NiceMock<MockJSONCallback> info_callback_;
std::unique_ptr<PrivetRegisterOperation> register_operation_;
StrictMock<MockRegisterDelegate> register_delegate_;
+ PrivetURLLoader::RetryImmediatelyForTest retry_immediately_;
};
INSTANTIATE_TEST_CASE_P(PrivetTests, PrivetRegisterTest, ValuesIn(kTestParams));
@@ -555,109 +474,77 @@ INSTANTIATE_TEST_CASE_P(PrivetTests, PrivetRegisterTest, ValuesIn(kTestParams));
TEST_P(PrivetRegisterTest, RegisterSuccessSimple) {
register_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/register?"
- "action=start&user=example%40google.com"),
- kSampleRegisterStartResponse));
+ SuccessfulResponse(kRegisterStartURL, kSampleRegisterStartResponse));
- EXPECT_CALL(register_delegate_, OnPrivetRegisterClaimTokenInternal(
- "MySampleToken",
- GURL("https://domain.com/SoMeUrL")));
+ EXPECT_CALL(register_delegate_,
+ OnPrivetRegisterClaimToken(_, "MySampleToken",
+ GURL("https://domain.com/SoMeUrL")));
- EXPECT_TRUE(SuccessfulResponseToURL(
- GetUrl("/privet/register?"
- "action=getClaimToken&user=example%40google.com"),
- kSampleRegisterGetClaimTokenResponse));
+ EXPECT_TRUE(SuccessfulResponse(kRegisterGetTokenURL,
+ kSampleRegisterGetClaimTokenResponse));
register_operation_->CompleteRegistration();
- EXPECT_TRUE(SuccessfulResponseToURL(
- GetUrl("/privet/register?"
- "action=complete&user=example%40google.com"),
- kSampleRegisterCompleteResponse));
+ EXPECT_TRUE(SuccessfulResponse(kRegisterCompleteURL,
+ kSampleRegisterCompleteResponse));
- EXPECT_CALL(register_delegate_, OnPrivetRegisterDoneInternal(
- "MyDeviceID"));
+ EXPECT_CALL(register_delegate_, OnPrivetRegisterDone(_, "MyDeviceID"));
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseRegistered));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseRegistered));
}
TEST_P(PrivetRegisterTest, RegisterXSRFFailure) {
register_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/register?"
- "action=start&user=example%40google.com"),
- kSampleRegisterStartResponse));
-
- EXPECT_TRUE(SuccessfulResponseToURL(
- GetUrl("/privet/register?"
- "action=getClaimToken&user=example%40google.com"),
- kSampleXPrivetErrorResponse));
+ SuccessfulResponse(kRegisterStartURL, kSampleRegisterStartResponse));
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ SuccessfulResponse(kRegisterGetTokenURL, kSampleXPrivetErrorResponse));
+
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_CALL(register_delegate_, OnPrivetRegisterClaimTokenInternal(
- "MySampleToken", GURL("https://domain.com/SoMeUrL")));
+ EXPECT_CALL(register_delegate_,
+ OnPrivetRegisterClaimToken(_, "MySampleToken",
+ GURL("https://domain.com/SoMeUrL")));
- EXPECT_TRUE(SuccessfulResponseToURL(
- GetUrl("/privet/register?"
- "action=getClaimToken&user=example%40google.com"),
- kSampleRegisterGetClaimTokenResponse));
+ EXPECT_TRUE(SuccessfulResponse(kRegisterGetTokenURL,
+ kSampleRegisterGetClaimTokenResponse));
}
TEST_P(PrivetRegisterTest, TransientFailure) {
register_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
+ // Make the registration request fail the first time and work after that.
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/register?"
- "action=start&user=example%40google.com"),
- kSampleRegisterErrorTransient));
-
- EXPECT_CALL(fetcher_delegate_, OnRequestStart(0));
-
- RunFor(base::TimeDelta::FromSeconds(2));
-
- testing::Mock::VerifyAndClearExpectations(&fetcher_delegate_);
+ SuccessfulResponse(kRegisterStartURL, kSampleRegisterErrorTransient));
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/register?"
- "action=start&user=example%40google.com"),
- kSampleRegisterStartResponse));
+ SuccessfulResponse(kRegisterStartURL, kSampleRegisterStartResponse));
}
TEST_P(PrivetRegisterTest, PermanentFailure) {
register_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/register?"
- "action=start&user=example%40google.com"),
- kSampleRegisterStartResponse));
+ SuccessfulResponse(kRegisterStartURL, kSampleRegisterStartResponse));
- EXPECT_CALL(register_delegate_,
- OnPrivetRegisterErrorInternal(
- "getClaimToken",
- PrivetRegisterOperation::FAILURE_JSON_ERROR,
- 200));
-
- EXPECT_TRUE(SuccessfulResponseToURL(
- GetUrl("/privet/register?"
- "action=getClaimToken&user=example%40google.com"),
- kSampleRegisterErrorPermanent));
+ EXPECT_CALL(
+ register_delegate_,
+ OnPrivetRegisterErrorInternal(
+ "getClaimToken", PrivetRegisterOperation::FAILURE_JSON_ERROR, 200));
+
+ EXPECT_TRUE(
+ SuccessfulResponse(kRegisterGetTokenURL, kSampleRegisterErrorPermanent));
}
TEST_P(PrivetRegisterTest, InfoFailure) {
@@ -669,31 +556,21 @@ TEST_P(PrivetRegisterTest, InfoFailure) {
PrivetRegisterOperation::FAILURE_TOKEN,
-1));
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseBadJson));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseBadJson));
}
TEST_P(PrivetRegisterTest, RegisterCancel) {
register_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/register?"
- "action=start&user=example%40google.com"),
- kSampleRegisterStartResponse));
+ SuccessfulResponse(kRegisterStartURL, kSampleRegisterStartResponse));
register_operation_->Cancel();
-
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/register?"
- "action=cancel&user=example%40google.com"),
- kSampleRegisterCancelResponse));
-
- // Must keep mocks alive for 3 seconds so the cancelation object can be
- // deleted.
- RunFor(base::TimeDelta::FromSeconds(3));
+ EXPECT_TRUE(SuccessfulResponse(
+ GetUrl("/privet/register?action=cancel&user=example%40google.com"),
+ kSampleRegisterCancelResponse));
}
class PrivetCapabilitiesTest : public PrivetHTTPTest {
@@ -715,13 +592,12 @@ INSTANTIATE_TEST_CASE_P(PrivetTests,
TEST_P(PrivetCapabilitiesTest, SuccessfulCapabilities) {
capabilities_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_CALL(capabilities_callback_, OnPrivetJSONDoneInternal());
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/capabilities"),
- kSampleCapabilitiesResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kCapabilitiesURL, kSampleCapabilitiesResponse));
std::string version;
EXPECT_TRUE(capabilities_callback_.value()->GetString("version", &version));
@@ -731,13 +607,12 @@ TEST_P(PrivetCapabilitiesTest, SuccessfulCapabilities) {
TEST_P(PrivetCapabilitiesTest, CacheToken) {
capabilities_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_CALL(capabilities_callback_, OnPrivetJSONDoneInternal());
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/capabilities"),
- kSampleCapabilitiesResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kCapabilitiesURL, kSampleCapabilitiesResponse));
capabilities_operation_ = privet_client_->CreateCapabilitiesOperation(
capabilities_callback_.callback());
@@ -746,26 +621,24 @@ TEST_P(PrivetCapabilitiesTest, CacheToken) {
EXPECT_CALL(capabilities_callback_, OnPrivetJSONDoneInternal());
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/capabilities"),
- kSampleCapabilitiesResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kCapabilitiesURL, kSampleCapabilitiesResponse));
}
TEST_P(PrivetCapabilitiesTest, BadToken) {
capabilities_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
-
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/capabilities"),
- kSampleXPrivetErrorResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ SuccessfulResponse(kCapabilitiesURL, kSampleXPrivetErrorResponse));
+
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
EXPECT_CALL(capabilities_callback_, OnPrivetJSONDoneInternal());
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/capabilities"),
- kSampleCapabilitiesResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kCapabilitiesURL, kSampleCapabilitiesResponse));
}
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -782,7 +655,7 @@ class FakePwgRasterConverter : public printing::PwgRasterConverter {
ResultCallback callback) override {
base::MappedReadOnlyRegion memory =
base::ReadOnlySharedMemoryRegion::Create(data->size());
- if (!memory.IsValid()) {
+ if (!memory.mapping.IsValid()) {
ADD_FAILURE() << "Failed to create pwg raster shared memory.";
std::move(callback).Run(base::ReadOnlySharedMemoryRegion());
return;
@@ -804,7 +677,7 @@ class FakePwgRasterConverter : public printing::PwgRasterConverter {
class PrivetLocalPrintTest : public PrivetHTTPTest {
public:
void SetUp() override {
- PrivetURLFetcher::ResetTokenMapForTest();
+ PrivetURLLoader::ResetTokenMapForTest();
local_print_operation_ = privet_client_->CreateLocalPrintOperation(
&local_print_delegate_);
@@ -826,6 +699,8 @@ class PrivetLocalPrintTest : public PrivetHTTPTest {
std::unique_ptr<PrivetLocalPrintOperation> local_print_operation_;
StrictMock<MockLocalPrintDelegate> local_print_delegate_;
FakePwgRasterConverter* pwg_converter_;
+ PrivetLocalPrintOperationImpl::RunTasksImmediatelyForTesting
+ run_tasks_immediately_for_local_print_;
};
INSTANTIATE_TEST_CASE_P(PrivetTests,
@@ -840,19 +715,14 @@ TEST_P(PrivetLocalPrintTest, SuccessfulLocalPrint) {
local_print_operation_->SetCapabilities(kSampleCapabilitiesResponse);
local_print_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com&"
- "job_name=Sample+job+name"),
- "Sample print data", kSampleLocalPrintResponse));
+ EXPECT_TRUE(SuccessfulResponse(kSubmitDocURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("Sample print data", GetUploadData(kSubmitDocURL));
}
TEST_P(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
@@ -864,19 +734,14 @@ TEST_P(PrivetLocalPrintTest, SuccessfulLocalPrintWithAnyMimetype) {
kSampleCapabilitiesResponseWithAnyMimetype);
local_print_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com&"
- "job_name=Sample+job+name"),
- "Sample print data", kSampleLocalPrintResponse));
+ EXPECT_TRUE(SuccessfulResponse(kSubmitDocURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("Sample print data", GetUploadData(kSubmitDocURL));
}
TEST_P(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) {
@@ -886,19 +751,14 @@ TEST_P(PrivetLocalPrintTest, SuccessfulPWGLocalPrint) {
local_print_operation_->SetCapabilities(kSampleCapabilitiesResponsePWGOnly);
local_print_operation_->Start();
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndFileData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com"
- "&job_name=Sample+job+name"),
- "foobar", kSampleLocalPrintResponse));
+ EXPECT_TRUE(SuccessfulResponse(kSubmitDocURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("foobar", GetUploadData(kSubmitDocURL));
EXPECT_EQ(printing::TRANSFORM_NORMAL,
pwg_converter_->bitmap_settings().odd_page_transform);
@@ -918,23 +778,19 @@ TEST_P(PrivetLocalPrintTest, SuccessfulPWGLocalPrintDuplex) {
kSampleCapabilitiesResponsePWGSettings);
local_print_operation_->Start();
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseWithCreatejob));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseWithCreatejob));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(SuccessfulResponseToURLAndJSONData(
- GetUrl("/privet/printer/createjob"), kSampleCJTDuplex,
- kSampleCreatejobResponse));
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
+ EXPECT_EQ(NormalizeJson(kSampleCJTDuplex),
+ GetUploadDataAsNormalizedJSON(kCreateJobURL));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndFileData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com"
- "&job_name=Sample+job+name&job_id=1234"),
- "foobar", kSampleLocalPrintResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kSubmitDocWithJobIDURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("foobar", GetUploadData(kSubmitDocWithJobIDURL));
EXPECT_EQ(printing::TRANSFORM_ROTATE_180,
pwg_converter_->bitmap_settings().odd_page_transform);
@@ -954,23 +810,19 @@ TEST_P(PrivetLocalPrintTest, SuccessfulPWGLocalPrintMono) {
kSampleCapabilitiesResponsePWGSettings);
local_print_operation_->Start();
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseWithCreatejob));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseWithCreatejob));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(SuccessfulResponseToURLAndJSONData(
- GetUrl("/privet/printer/createjob"), kSampleCJTMono,
- kSampleCreatejobResponse));
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
+ EXPECT_EQ(NormalizeJson(kSampleCJTMono),
+ GetUploadDataAsNormalizedJSON(kCreateJobURL));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndFileData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com"
- "&job_name=Sample+job+name&job_id=1234"),
- "foobar", kSampleLocalPrintResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kSubmitDocWithJobIDURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("foobar", GetUploadData(kSubmitDocWithJobIDURL));
EXPECT_EQ(printing::TRANSFORM_NORMAL,
pwg_converter_->bitmap_settings().odd_page_transform);
@@ -990,23 +842,19 @@ TEST_P(PrivetLocalPrintTest, SuccessfulPWGLocalPrintMonoToGRAY8Printer) {
kSampleCapabilitiesResponsePWGSettingsMono);
local_print_operation_->Start();
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseWithCreatejob));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseWithCreatejob));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(SuccessfulResponseToURLAndJSONData(
- GetUrl("/privet/printer/createjob"), kSampleCJTMono,
- kSampleCreatejobResponse));
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
+ EXPECT_EQ(NormalizeJson(kSampleCJTMono),
+ GetUploadDataAsNormalizedJSON(kCreateJobURL));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndFileData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com"
- "&job_name=Sample+job+name&job_id=1234"),
- "foobar", kSampleLocalPrintResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kSubmitDocWithJobIDURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("foobar", GetUploadData(kSubmitDocWithJobIDURL));
EXPECT_EQ(printing::TRANSFORM_NORMAL,
pwg_converter_->bitmap_settings().odd_page_transform);
@@ -1026,26 +874,28 @@ TEST_P(PrivetLocalPrintTest, SuccessfulLocalPrintWithCreatejob) {
local_print_operation_->SetCapabilities(kSampleCapabilitiesResponse);
local_print_operation_->Start();
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseWithCreatejob));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseWithCreatejob));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(
- SuccessfulResponseToURLAndJSONData(GetUrl("/privet/printer/createjob"),
- kSampleCJT, kSampleCreatejobResponse));
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
+ EXPECT_EQ(NormalizeJson(kSampleCJT),
+ GetUploadDataAsNormalizedJSON(kCreateJobURL));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com&"
- "job_name=Sample+job+name&job_id=1234"),
- "Sample print data", kSampleLocalPrintResponse));
+ EXPECT_TRUE(
+ SuccessfulResponse(kSubmitDocWithJobIDURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("Sample print data", GetUploadData(kSubmitDocWithJobIDURL));
}
TEST_P(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) {
+ const GURL kSubmitDocURL = GetUrl(
+ "/privet/printer/"
+ "submitdoc?client_name=Chrome&user_name=sample%40gmail.com&job_name="
+ "123456789%3A123456789%3A123456789%3A1...123456789%3A123456789%"
+ "3A123456789%3A&job_id=1234");
+
local_print_operation_->SetUsername("sample@gmail.com");
local_print_operation_->SetJobname(
"123456789:123456789:123456789:123456789:123456789:123456789:123456789:");
@@ -1055,24 +905,18 @@ TEST_P(PrivetLocalPrintTest, SuccessfulLocalPrintWithOverlongName) {
RefCountedBytesFromString("Sample print data"));
local_print_operation_->Start();
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseWithCreatejob));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseWithCreatejob));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(
- SuccessfulResponseToURLAndJSONData(GetUrl("/privet/printer/createjob"),
- kSampleCJT, kSampleCreatejobResponse));
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
+ EXPECT_EQ(NormalizeJson(kSampleCJT),
+ GetUploadDataAsNormalizedJSON(kCreateJobURL));
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
- EXPECT_TRUE(SuccessfulResponseToURLAndData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com&"
- "job_name=123456789%3A123456789%3A123456789%3A1...123456789"
- "%3A123456789%3A123456789%3A&job_id=1234"),
- "Sample print data", kSampleLocalPrintResponse));
+ EXPECT_TRUE(SuccessfulResponse(kSubmitDocURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("Sample print data", GetUploadData(kSubmitDocURL));
}
TEST_P(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) {
@@ -1083,29 +927,23 @@ TEST_P(PrivetLocalPrintTest, PDFPrintInvalidDocumentTypeRetry) {
local_print_operation_->SetData(RefCountedBytesFromString("sample_data"));
local_print_operation_->Start();
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseWithCreatejob));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseWithCreatejob));
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
+
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
+ EXPECT_EQ(NormalizeJson(kSampleCJT),
+ GetUploadDataAsNormalizedJSON(kCreateJobURL));
+
+ EXPECT_TRUE(SuccessfulResponse(kSubmitDocWithJobIDURL,
+ kSampleInvalidDocumentTypeResponse));
+ EXPECT_EQ("sample_data", GetUploadData(kSubmitDocWithJobIDURL));
+
+ EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDone(_));
EXPECT_TRUE(
- SuccessfulResponseToURLAndJSONData(GetUrl("/privet/printer/createjob"),
- kSampleCJT, kSampleCreatejobResponse));
-
- EXPECT_TRUE(SuccessfulResponseToURLAndData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com&"
- "job_name=Sample+job+name&job_id=1234"),
- "sample_data", kSampleInvalidDocumentTypeResponse));
-
- EXPECT_CALL(local_print_delegate_, OnPrivetPrintingDoneInternal());
-
- EXPECT_TRUE(SuccessfulResponseToURLAndFileData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com&"
- "job_name=Sample+job+name&job_id=1234"),
- "sample_data", kSampleLocalPrintResponse));
+ SuccessfulResponse(kSubmitDocWithJobIDURL, kSampleLocalPrintResponse));
+ EXPECT_EQ("sample_data", GetUploadData(kSubmitDocWithJobIDURL));
}
TEST_P(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) {
@@ -1117,39 +955,30 @@ TEST_P(PrivetLocalPrintTest, LocalPrintRetryOnInvalidJobID) {
RefCountedBytesFromString("Sample print data"));
local_print_operation_->Start();
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/info"),
- kSampleInfoResponseWithCreatejob));
-
- EXPECT_TRUE(
- SuccessfulResponseToURL(GetUrl("/privet/info"), kSampleInfoResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponseWithCreatejob));
- EXPECT_TRUE(
- SuccessfulResponseToURLAndJSONData(GetUrl("/privet/printer/createjob"),
- kSampleCJT, kSampleCreatejobResponse));
+ EXPECT_TRUE(SuccessfulResponse(kInfoURL, kSampleInfoResponse));
- EXPECT_TRUE(SuccessfulResponseToURLAndData(
- GetUrl("/privet/printer/submitdoc?"
- "client_name=Chrome&user_name=sample%40gmail.com&"
- "job_name=Sample+job+name&job_id=1234"),
- "Sample print data", kSampleErrorResponsePrinterBusy));
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
+ EXPECT_EQ(NormalizeJson(kSampleCJT),
+ GetUploadDataAsNormalizedJSON(kCreateJobURL));
- RunFor(base::TimeDelta::FromSeconds(3));
+ EXPECT_TRUE(SuccessfulResponse(kSubmitDocWithJobIDURL,
+ kSampleErrorResponsePrinterBusy));
+ EXPECT_EQ("Sample print data", GetUploadData(kSubmitDocWithJobIDURL));
- EXPECT_TRUE(SuccessfulResponseToURL(GetUrl("/privet/printer/createjob"),
- kSampleCreatejobResponse));
+ EXPECT_TRUE(SuccessfulResponse(kCreateJobURL, kSampleCreateJobResponse));
}
#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
-class PrivetHttpWithServerTest : public ::testing::Test,
- public PrivetURLFetcher::Delegate {
+class PrivetHttpWithServerTest : public ::testing::Test {
protected:
PrivetHttpWithServerTest()
- : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD) {}
+ : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
+ shared_url_loader_factory_(
+ base::MakeRefCounted<network::TestSharedURLLoaderFactory>()) {}
void SetUp() override {
- context_getter_ = base::MakeRefCounted<net::TestURLRequestContextGetter>(
- BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
-
server_ =
std::make_unique<EmbeddedTestServer>(EmbeddedTestServer::TYPE_HTTP);
@@ -1160,69 +989,49 @@ class PrivetHttpWithServerTest : public ::testing::Test,
ASSERT_TRUE(server_->Start());
client_ = std::make_unique<PrivetHTTPClientImpl>(
- "test", server_->host_port_pair(), context_getter_);
- }
-
- void OnNeedPrivetToken(PrivetURLFetcher::TokenCallback callback) override {
- std::move(callback).Run("abc");
- }
-
- void OnError(int response_code, PrivetURLFetcher::ErrorType error) override {
- done_ = true;
- success_ = false;
- error_ = error;
-
- base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_);
- }
-
- void OnParsedJson(int response_code,
- const base::DictionaryValue& value,
- bool has_error) override {
- NOTREACHED();
- }
-
- bool OnRawData(bool response_is_file,
- const std::string& data_string,
- const base::FilePath& data_file) override {
- done_ = true;
- success_ = true;
-
- base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, quit_);
- return true;
- }
-
- bool Run() {
- success_ = false;
- done_ = false;
-
- base::RunLoop run_loop;
- quit_ = run_loop.QuitClosure();
-
- std::unique_ptr<PrivetURLFetcher> fetcher = client_->CreateURLFetcher(
- server_->GetURL("/simple.html"), net::URLFetcher::GET, this);
-
- fetcher->SetMaxRetriesForTest(1);
- fetcher->Start();
-
- run_loop.Run();
-
- EXPECT_TRUE(done_);
- return success_;
+ "test", server_->host_port_pair(), shared_url_loader_factory_);
}
- bool success_ = false;
- bool done_ = false;
- PrivetURLFetcher::ErrorType error_ = PrivetURLFetcher::ErrorType();
content::TestBrowserThreadBundle thread_bundle_;
- scoped_refptr<net::TestURLRequestContextGetter> context_getter_;
std::unique_ptr<EmbeddedTestServer> server_;
std::unique_ptr<PrivetHTTPClientImpl> client_;
-
+ scoped_refptr<network::TestSharedURLLoaderFactory> shared_url_loader_factory_;
base::Closure quit_;
};
+class MockPrivetURLLoaderDelegate : public PrivetURLLoader::Delegate {
+ public:
+ // GMock does not like mocking methods with movable parameters.
+ void OnNeedPrivetToken(PrivetURLLoader::TokenCallback callback) override {
+ std::move(callback).Run("abc");
+ }
+ MOCK_METHOD2(OnError,
+ void(int response_code, PrivetURLLoader::ErrorType error));
+ MOCK_METHOD3(OnParsedJson,
+ void(int response_code,
+ const base::DictionaryValue& value,
+ bool has_error));
+ MOCK_METHOD3(OnRawData,
+ bool(bool response_is_file,
+ const std::string& data_string,
+ const base::FilePath& data_file));
+};
+
TEST_F(PrivetHttpWithServerTest, HttpServer) {
- EXPECT_TRUE(Run());
+ StrictMock<MockPrivetURLLoaderDelegate> delegate_;
+
+ std::unique_ptr<PrivetURLLoader> url_loader = client_->CreateURLLoader(
+ server_->GetURL("/simple.html"), "GET", &delegate_);
+ url_loader->SetMaxRetriesForTest(1);
+ url_loader->Start();
+
+ base::RunLoop run_loop;
+ EXPECT_CALL(delegate_, OnRawData(_, _, _))
+ .WillOnce(testing::InvokeWithoutArgs([&]() {
+ run_loop.Quit();
+ return true;
+ }));
+ run_loop.Run();
}
} // namespace
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.cc b/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.cc
index 3b62e9d4d6e..97e922662fa 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.cc
@@ -10,33 +10,32 @@
#include <string>
#include <utility>
+#include "base/bind.h"
#include "chrome/browser/printing/cloud_print/privet_constants.h"
#include "chrome/browser/printing/cloud_print/privet_device_lister_impl.h"
#include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
namespace cloud_print {
struct PrivetLocalPrinterLister::DeviceContext {
- DeviceContext() : has_local_printing(false) {
- }
-
std::unique_ptr<PrivetHTTPResolution> privet_resolution;
std::unique_ptr<PrivetHTTPClient> privet_client;
std::unique_ptr<PrivetJSONOperation> info_operation;
DeviceDescription description;
- bool has_local_printing;
+ bool has_local_printing = false;
};
PrivetLocalPrinterLister::PrivetLocalPrinterLister(
local_discovery::ServiceDiscoveryClient* service_discovery_client,
- net::URLRequestContextGetter* request_context,
- Delegate* delegate) : delegate_(delegate) {
- privet_lister_.reset(
- new PrivetDeviceListerImpl(service_discovery_client, this));
- privet_http_factory_ = PrivetHTTPAsynchronousFactory::CreateInstance(
- request_context);
-}
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
+ Delegate* delegate)
+ : privet_http_factory_(
+ PrivetHTTPAsynchronousFactory::CreateInstance(url_loader_factory)),
+ delegate_(delegate),
+ privet_lister_(
+ new PrivetDeviceListerImpl(service_discovery_client, this)) {}
PrivetLocalPrinterLister::~PrivetLocalPrinterLister() {
}
@@ -64,7 +63,7 @@ void PrivetLocalPrinterLister::DeviceChanged(
return;
}
- std::unique_ptr<DeviceContext> context(new DeviceContext);
+ auto context = std::make_unique<DeviceContext>();
context->has_local_printing = false;
context->description = description;
context->privet_resolution = privet_http_factory_->CreatePrivetHTTP(name);
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.h b/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.h
index 0c6c94e1350..4c036582465 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister.h
@@ -13,7 +13,10 @@
#include "chrome/browser/printing/cloud_print/privet_device_lister.h"
#include "chrome/browser/printing/cloud_print/privet_http.h"
#include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory.h"
-#include "net/url_request/url_request_context.h"
+
+namespace network {
+class SharedURLLoaderFactory;
+}
namespace cloud_print {
@@ -33,7 +36,7 @@ class PrivetLocalPrinterLister : PrivetDeviceLister::Delegate {
PrivetLocalPrinterLister(
local_discovery::ServiceDiscoveryClient* service_discovery_client,
- net::URLRequestContextGetter* request_context,
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
Delegate* delegate);
~PrivetLocalPrinterLister() override;
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister_unittest.cc b/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister_unittest.cc
index f45bed00f57..4c967f0d93f 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister_unittest.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_local_printer_lister_unittest.cc
@@ -12,9 +12,11 @@
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/local_discovery/test_service_discovery_client.h"
+#include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h"
#include "content/public/test/test_browser_thread_bundle.h"
-#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_test_util.h"
+#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
+#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -111,34 +113,21 @@ class MockLocalPrinterListerDelegate
class PrivetLocalPrinterListerTest : public testing::Test {
public:
- PrivetLocalPrinterListerTest() {
- test_service_discovery_client_ = new TestServiceDiscoveryClient();
+ PrivetLocalPrinterListerTest()
+ : test_service_discovery_client_(
+ base::MakeRefCounted<TestServiceDiscoveryClient>()),
+ test_shared_url_loader_factory_(
+ base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
+ &test_url_loader_factory_)),
+ http_asynchronous_factory_impl_(test_shared_url_loader_factory_) {
+ local_printer_lister_ = std::make_unique<PrivetLocalPrinterLister>(
+ test_service_discovery_client_.get(), test_shared_url_loader_factory_,
+ &delegate_);
test_service_discovery_client_->Start();
- url_request_context_ = new net::TestURLRequestContextGetter(
- base::ThreadTaskRunnerHandle::Get());
- local_printer_lister_.reset(new PrivetLocalPrinterLister(
- test_service_discovery_client_.get(),
- url_request_context_.get(),
- &delegate_));
}
- ~PrivetLocalPrinterListerTest() override {}
-
- bool SuccessfulResponseToURL(const GURL& url,
- const std::string& response) {
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- EXPECT_TRUE(fetcher);
- EXPECT_EQ(url, fetcher->GetOriginalURL());
-
- if (!fetcher || url != fetcher->GetOriginalURL())
- return false;
-
- fetcher->SetResponseString(response);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
- fetcher->delegate()->OnURLFetchComplete(fetcher);
- return true;
+ ~PrivetLocalPrinterListerTest() override {
+ test_shared_url_loader_factory_->Detach();
}
void SimulateReceive(const uint8_t* packet, size_t size) {
@@ -154,38 +143,33 @@ class PrivetLocalPrinterListerTest : public testing::Test {
protected:
content::TestBrowserThreadBundle test_thread_bundle;
scoped_refptr<TestServiceDiscoveryClient> test_service_discovery_client_;
- scoped_refptr<net::TestURLRequestContextGetter> url_request_context_;
std::unique_ptr<PrivetLocalPrinterLister> local_printer_lister_;
- net::TestURLFetcherFactory fetcher_factory_;
StrictMock<MockLocalPrinterListerDelegate> delegate_;
+ network::TestURLLoaderFactory test_url_loader_factory_;
+ scoped_refptr<network::WeakWrapperSharedURLLoaderFactory>
+ test_shared_url_loader_factory_;
+ cloud_print::PrivetHTTPAsynchronousFactoryImpl
+ http_asynchronous_factory_impl_;
};
TEST_F(PrivetLocalPrinterListerTest, PrinterAddedTest) {
+ test_url_loader_factory_.AddResponse(GURL(kPrivetInfoURL).spec(),
+ kInfoIsLocalPrinter);
ExpectAnyPacket();
+ EXPECT_CALL(delegate_, LocalPrinterChanged(kServiceName, true, _));
local_printer_lister_->Start();
-
SimulateReceive(kAnnouncePacket, sizeof(kAnnouncePacket));
-
- EXPECT_CALL(delegate_, LocalPrinterChanged(kServiceName, true, _));
-
- EXPECT_TRUE(SuccessfulResponseToURL(
- GURL(kPrivetInfoURL),
- std::string(kInfoIsLocalPrinter)));
}
TEST_F(PrivetLocalPrinterListerTest, NonPrinterAddedTest) {
+ test_url_loader_factory_.AddResponse(GURL(kPrivetInfoURL).spec(),
+ kInfoIsNotLocalPrinter);
ExpectAnyPacket();
+ EXPECT_CALL(delegate_, LocalPrinterChanged(kServiceName, false, _));
local_printer_lister_->Start();
-
SimulateReceive(kAnnouncePacket, sizeof(kAnnouncePacket));
-
- EXPECT_CALL(delegate_, LocalPrinterChanged(kServiceName, false, _));
-
- EXPECT_TRUE(SuccessfulResponseToURL(
- GURL(kPrivetInfoURL),
- std::string(kInfoIsNotLocalPrinter)));
}
} // namespace
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_notifications.cc b/chromium/chrome/browser/printing/cloud_print/privet_notifications.cc
index b91c6db9cad..ca5212726c7 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_notifications.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_notifications.cc
@@ -210,10 +210,6 @@ PrivetNotificationService::PrivetNotificationService(
PrivetNotificationService::~PrivetNotificationService() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-#if BUILDFLAG(ENABLE_MDNS)
- if (traffic_detector_)
- traffic_detector_->Stop();
-#endif
}
void PrivetNotificationService::DeviceChanged(
@@ -329,19 +325,15 @@ void PrivetNotificationService::Start() {
void PrivetNotificationService::OnNotificationsEnabledChanged() {
#if BUILDFLAG(ENABLE_MDNS)
- if (traffic_detector_)
- traffic_detector_->Stop();
- traffic_detector_ = nullptr;
+ traffic_detector_.reset();
if (IsForced()) {
StartLister();
} else if (*enable_privet_notification_member_) {
ReportPrivetUmaEvent(PRIVET_SERVICE_STARTED);
- traffic_detector_ =
- new PrivetTrafficDetector(
- net::ADDRESS_FAMILY_IPV4,
- base::Bind(&PrivetNotificationService::StartLister, AsWeakPtr()));
- traffic_detector_->Start();
+ traffic_detector_ = std::make_unique<PrivetTrafficDetector>(
+ profile_, base::BindRepeating(&PrivetNotificationService::StartLister,
+ AsWeakPtr()));
} else {
device_lister_.reset();
service_discovery_client_ = nullptr;
@@ -369,8 +361,8 @@ void PrivetNotificationService::StartLister() {
std::unique_ptr<PrivetHTTPAsynchronousFactory> http_factory(
PrivetHTTPAsynchronousFactory::CreateInstance(
- content::BrowserContext::GetDefaultStoragePartition(profile_)->
- GetURLRequestContext()));
+ content::BrowserContext::GetDefaultStoragePartition(profile_)
+ ->GetURLLoaderFactoryForBrowserProcess()));
privet_notifications_listener_.reset(
new PrivetNotificationsListener(std::move(http_factory), this));
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_notifications.h b/chromium/chrome/browser/printing/cloud_print/privet_notifications.h
index 986245c7626..29e601bdf8c 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_notifications.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_notifications.h
@@ -140,7 +140,7 @@ class PrivetNotificationService
BooleanPrefMember enable_privet_notification_member_;
#if BUILDFLAG(ENABLE_MDNS)
- scoped_refptr<PrivetTrafficDetector> traffic_detector_;
+ std::unique_ptr<PrivetTrafficDetector> traffic_detector_;
#endif
};
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc b/chromium/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
index f119313b146..e73f469f6ed 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_notifications_unittest.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/printing/cloud_print/privet_notifications.h"
#include <memory>
+#include <utility>
#include "base/message_loop/message_loop.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -16,8 +17,9 @@
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "content/public/test/test_browser_thread_bundle.h"
-#include "net/url_request/test_url_fetcher_factory.h"
-#include "net/url_request/url_request_test_util.h"
+#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
+#include "services/network/test/test_url_loader_factory.h"
+#include "services/network/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -51,16 +53,18 @@ class MockPrivetHttpFactory : public PrivetHTTPAsynchronousFactory {
public:
class MockResolution : public PrivetHTTPResolution {
public:
- MockResolution(const std::string& name,
- net::URLRequestContextGetter* request_context)
- : name_(name), request_context_(request_context) {}
+ MockResolution(
+ const std::string& name,
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
+ : name_(name), url_loader_factory_(url_loader_factory) {}
~MockResolution() override {}
void Start(const net::HostPortPair& address,
const ResultCallback& callback) override {
- callback.Run(std::unique_ptr<PrivetHTTPClient>(new PrivetHTTPClientImpl(
- name_, net::HostPortPair("1.2.3.4", 8080), request_context_.get())));
+ auto privet_http_client = std::make_unique<PrivetHTTPClientImpl>(
+ name_, net::HostPortPair("1.2.3.4", 8080), url_loader_factory_);
+ callback.Run(std::move(privet_http_client));
}
void Start(const ResultCallback& callback) override {
@@ -71,31 +75,32 @@ class MockPrivetHttpFactory : public PrivetHTTPAsynchronousFactory {
private:
std::string name_;
- scoped_refptr<net::URLRequestContextGetter> request_context_;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
};
- explicit MockPrivetHttpFactory(net::URLRequestContextGetter* request_context)
- : request_context_(request_context) {}
+ explicit MockPrivetHttpFactory(
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory)
+ : url_loader_factory_(url_loader_factory) {}
std::unique_ptr<PrivetHTTPResolution> CreatePrivetHTTP(
const std::string& name) override {
- return std::make_unique<MockResolution>(name, request_context_.get());
+ return std::make_unique<MockResolution>(name, url_loader_factory_);
}
private:
- scoped_refptr<net::URLRequestContextGetter> request_context_;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
};
class PrivetNotificationsListenerTest : public testing::Test {
public:
PrivetNotificationsListenerTest()
- : request_context_(new net::TestURLRequestContextGetter(
- base::ThreadTaskRunnerHandle::Get())) {
- notification_listener_.reset(new PrivetNotificationsListener(
- std::unique_ptr<PrivetHTTPAsynchronousFactory>(
- new MockPrivetHttpFactory(request_context_.get())),
- &mock_delegate_));
-
+ : test_shared_url_loader_factory_(
+ base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
+ &test_url_loader_factory_)) {
+ notification_listener_ = std::make_unique<PrivetNotificationsListener>(
+ std::make_unique<MockPrivetHttpFactory>(
+ test_shared_url_loader_factory_),
+ &mock_delegate_);
description_.name = kExampleDeviceHumanName;
description_.description = kExampleDeviceDescription;
}
@@ -103,24 +108,18 @@ class PrivetNotificationsListenerTest : public testing::Test {
~PrivetNotificationsListenerTest() override {}
bool SuccessfulResponseToInfo(const std::string& response) {
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- if (!fetcher || fetcher->GetOriginalURL() != kDeviceInfoURL)
- return false;
-
- fetcher->SetResponseString(response);
- fetcher->set_status(
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK));
- fetcher->set_response_code(200);
- fetcher->delegate()->OnURLFetchComplete(fetcher);
- return true;
+ return test_url_loader_factory_.SimulateResponseForPendingRequest(
+ GURL(kDeviceInfoURL), network::URLLoaderCompletionStatus(net::OK),
+ network::CreateResourceResponseHead(net::HTTP_OK), response);
}
protected:
+ content::TestBrowserThreadBundle test_thread_bundle;
+ network::TestURLLoaderFactory test_url_loader_factory_;
+ scoped_refptr<network::WeakWrapperSharedURLLoaderFactory>
+ test_shared_url_loader_factory_;
StrictMock<MockPrivetNotificationsListenerDeleagate> mock_delegate_;
std::unique_ptr<PrivetNotificationsListener> notification_listener_;
- base::MessageLoop message_loop_;
- scoped_refptr<net::TestURLRequestContextGetter> request_context_;
- net::TestURLFetcherFactory fetcher_factory_;
DeviceDescription description_;
};
@@ -173,16 +172,15 @@ TEST_F(PrivetNotificationsListenerTest, HighUptimeTest) {
TEST_F(PrivetNotificationsListenerTest, HTTPErrorTest) {
notification_listener_->DeviceChanged(kExampleDeviceName, description_);
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- fetcher->set_status(
- net::URLRequestStatus(net::URLRequestStatus::SUCCESS, net::OK));
- fetcher->set_response_code(200);
- fetcher->delegate()->OnURLFetchComplete(fetcher);
+ EXPECT_TRUE(test_url_loader_factory_.SimulateResponseForPendingRequest(
+ GURL(kDeviceInfoURL), network::URLLoaderCompletionStatus(net::OK),
+ network::CreateResourceResponseHead(net::HTTP_NOT_FOUND),
+ /*content=*/""));
}
TEST_F(PrivetNotificationsListenerTest, DictionaryErrorTest) {
notification_listener_->DeviceChanged(kExampleDeviceName, description_);
- SuccessfulResponseToInfo(kInfoResponseNoUptime);
+ EXPECT_TRUE(SuccessfulResponseToInfo(kInfoResponseNoUptime));
}
class TestPrivetNotificationService;
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.cc b/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.cc
index fe574f3cbf9..4aec2773403 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.cc
+++ b/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.cc
@@ -4,47 +4,44 @@
#include "chrome/browser/printing/cloud_print/privet_traffic_detector.h"
-#include <stddef.h>
+#include <utility>
-#include "base/location.h"
-#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
-#include "base/single_thread_task_runner.h"
#include "base/sys_byteorder.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/task/post_task.h"
+#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "chrome/browser/browser_process.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/network_service_instance.h"
+#include "content/public/browser/storage_partition.h"
+#include "net/base/address_family.h"
#include "net/base/ip_address.h"
-#include "net/base/net_errors.h"
-#include "net/base/network_change_notifier.h"
#include "net/base/network_interfaces.h"
#include "net/dns/dns_protocol.h"
-#include "net/dns/dns_response.h"
#include "net/dns/mdns_client.h"
-#include "net/log/net_log_source.h"
-#include "net/socket/datagram_server_socket.h"
-#include "net/socket/udp_server_socket.h"
+#include "services/network/public/mojom/network_service.mojom.h"
namespace {
const int kMaxRestartAttempts = 10;
-const char kPrivetDeviceTypeDnsString[] = "\x07_privet";
void GetNetworkListInBackground(
- const base::Callback<void(const net::NetworkInterfaceList&)> callback) {
- base::AssertBlockingAllowed();
+ base::OnceCallback<void(net::NetworkInterfaceList)> callback) {
net::NetworkInterfaceList networks;
- if (!GetNetworkList(&networks, net::INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES))
- return;
+ {
+ base::ScopedBlockingCall scoped_blocking_call(
+ base::BlockingType::MAY_BLOCK);
+ if (!GetNetworkList(&networks, net::INCLUDE_HOST_SCOPE_VIRTUAL_INTERFACES))
+ return;
+ }
net::NetworkInterfaceList ip4_networks;
- for (size_t i = 0; i < networks.size(); ++i) {
- net::AddressFamily address_family =
- net::GetAddressFamily(networks[i].address);
+ for (const auto& network : networks) {
+ net::AddressFamily address_family = net::GetAddressFamily(network.address);
if (address_family == net::ADDRESS_FAMILY_IPV4 &&
- networks[i].prefix_length >= 24) {
- ip4_networks.push_back(networks[i]);
+ network.prefix_length >= 24) {
+ ip4_networks.push_back(network);
}
}
@@ -57,8 +54,20 @@ void GetNetworkListInBackground(
localhost_prefix,
8,
net::IP_ADDRESS_ATTRIBUTE_NONE));
- content::BrowserThread::PostTask(content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(callback, ip4_networks));
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::BindOnce(std::move(callback), std::move(ip4_networks)));
+}
+
+void CreateUDPSocketOnUIThread(
+ content::BrowserContext* profile,
+ network::mojom::UDPSocketRequest request,
+ network::mojom::UDPSocketReceiverPtr receiver_ptr) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ network::mojom::NetworkContext* network_context =
+ content::BrowserContext::GetDefaultStoragePartition(profile)
+ ->GetNetworkContext();
+ network_context->CreateUDPSocket(std::move(request), std::move(receiver_ptr));
}
} // namespace
@@ -66,34 +75,22 @@ void GetNetworkListInBackground(
namespace cloud_print {
PrivetTrafficDetector::PrivetTrafficDetector(
- net::AddressFamily address_family,
- const base::Closure& on_traffic_detected)
- : on_traffic_detected_(on_traffic_detected),
- callback_runner_(base::ThreadTaskRunnerHandle::Get()),
- address_family_(address_family),
- io_buffer_(
- new net::IOBufferWithSize(net::dns_protocol::kMaxMulticastSize)),
- restart_attempts_(kMaxRestartAttempts),
- weak_ptr_factory_(this) {}
-
-PrivetTrafficDetector::~PrivetTrafficDetector() {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
-}
-
-void PrivetTrafficDetector::Start() {
+ content::BrowserContext* profile,
+ const base::RepeatingClosure& on_traffic_detected)
+ : helper_(new Helper(profile, on_traffic_detected)) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- g_browser_process->network_connection_tracker()->AddNetworkConnectionObserver(
- this);
+ content::GetNetworkConnectionTracker()->AddNetworkConnectionObserver(this);
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&PrivetTrafficDetector::ScheduleRestart,
- weak_ptr_factory_.GetWeakPtr()));
+ base::BindOnce(&PrivetTrafficDetector::Helper::ScheduleRestart,
+ base::Unretained(helper_)));
}
-void PrivetTrafficDetector::Stop() {
+PrivetTrafficDetector::~PrivetTrafficDetector() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- g_browser_process->network_connection_tracker()
- ->RemoveNetworkConnectionObserver(this);
+ content::GetNetworkConnectionTracker()->RemoveNetworkConnectionObserver(this);
+ content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
+ helper_);
}
void PrivetTrafficDetector::OnConnectionChanged(
@@ -101,11 +98,26 @@ void PrivetTrafficDetector::OnConnectionChanged(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
- base::BindOnce(&PrivetTrafficDetector::HandleConnectionChanged,
- weak_ptr_factory_.GetWeakPtr(), type));
+ base::BindOnce(&PrivetTrafficDetector::Helper::HandleConnectionChanged,
+ base::Unretained(helper_), type));
}
-void PrivetTrafficDetector::HandleConnectionChanged(
+PrivetTrafficDetector::Helper::Helper(
+ content::BrowserContext* profile,
+ const base::RepeatingClosure& on_traffic_detected)
+ : profile_(profile),
+ on_traffic_detected_(on_traffic_detected),
+ restart_attempts_(kMaxRestartAttempts),
+ receiver_binding_(this),
+ weak_ptr_factory_(this) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+}
+
+PrivetTrafficDetector::Helper::~Helper() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+}
+
+void PrivetTrafficDetector::Helper::HandleConnectionChanged(
network::mojom::ConnectionType type) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
restart_attempts_ = kMaxRestartAttempts;
@@ -114,73 +126,102 @@ void PrivetTrafficDetector::HandleConnectionChanged(
}
}
-void PrivetTrafficDetector::ScheduleRestart() {
+void PrivetTrafficDetector::Helper::ScheduleRestart() {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- socket_.reset();
+ ResetConnection();
weak_ptr_factory_.InvalidateWeakPtrs();
base::PostDelayedTaskWithTraits(
- FROM_HERE, {base::TaskPriority::BACKGROUND, base::MayBlock()},
- base::BindOnce(&GetNetworkListInBackground,
- base::Bind(&PrivetTrafficDetector::Restart,
- weak_ptr_factory_.GetWeakPtr())),
+ FROM_HERE, {base::TaskPriority::BEST_EFFORT, base::MayBlock()},
+ base::BindOnce(
+ &GetNetworkListInBackground,
+ base::BindOnce(&Helper::Restart, weak_ptr_factory_.GetWeakPtr())),
base::TimeDelta::FromSeconds(3));
}
-void PrivetTrafficDetector::Restart(const net::NetworkInterfaceList& networks) {
+void PrivetTrafficDetector::Helper::Restart(
+ net::NetworkInterfaceList networks) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- networks_ = networks;
- if (Bind() < net::OK || DoLoop(0) < net::OK) {
- if ((restart_attempts_--) > 0)
- ScheduleRestart();
- } else {
- // Reset on success.
- restart_attempts_ = kMaxRestartAttempts;
- }
+ networks_ = std::move(networks);
+ Bind();
}
-int PrivetTrafficDetector::Bind() {
+void PrivetTrafficDetector::Helper::Bind() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
if (!start_time_.is_null()) {
base::TimeDelta time_delta = base::Time::Now() - start_time_;
UMA_HISTOGRAM_LONG_TIMES("LocalDiscovery.DetectorRestartTime", time_delta);
}
start_time_ = base::Time::Now();
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- socket_.reset(new net::UDPServerSocket(NULL, net::NetLogSource()));
- net::IPEndPoint multicast_addr = net::GetMDnsIPEndPoint(address_family_);
+
+ network::mojom::UDPSocketReceiverPtr receiver_ptr;
+ network::mojom::UDPSocketReceiverRequest receiver_request =
+ mojo::MakeRequest(&receiver_ptr);
+ receiver_binding_.Bind(std::move(receiver_request));
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::BindOnce(&CreateUDPSocketOnUIThread, profile_,
+ mojo::MakeRequest(&socket_), std::move(receiver_ptr)));
+
+ net::IPEndPoint multicast_addr =
+ net::GetMDnsIPEndPoint(net::ADDRESS_FAMILY_IPV4);
net::IPEndPoint bind_endpoint(
net::IPAddress::AllZeros(multicast_addr.address().size()),
multicast_addr.port());
- socket_->AllowAddressReuse();
- int rv = socket_->Listen(bind_endpoint);
- if (rv < net::OK)
- return rv;
- socket_->SetMulticastLoopbackMode(false);
- return socket_->JoinGroup(multicast_addr.address());
-}
-
-bool PrivetTrafficDetector::IsSourceAcceptable() const {
- for (size_t i = 0; i < networks_.size(); ++i) {
- if (net::IPAddressMatchesPrefix(recv_addr_.address(), networks_[i].address,
- networks_[i].prefix_length)) {
+
+ network::mojom::UDPSocketOptionsPtr socket_options =
+ network::mojom::UDPSocketOptions::New();
+ socket_options->allow_address_reuse = true;
+ socket_options->multicast_loopback_mode = false;
+
+ socket_->Bind(bind_endpoint, std::move(socket_options),
+ base::BindOnce(&Helper::OnBindComplete,
+ weak_ptr_factory_.GetWeakPtr(), multicast_addr));
+}
+
+void PrivetTrafficDetector::Helper::OnBindComplete(
+ net::IPEndPoint multicast_addr,
+ int rv,
+ const base::Optional<net::IPEndPoint>& ip_endpoint) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+ if (rv == net::OK) {
+ socket_->JoinGroup(multicast_addr.address(),
+ base::BindOnce(&Helper::OnJoinGroupComplete,
+ weak_ptr_factory_.GetWeakPtr()));
+ return;
+ }
+
+ if (restart_attempts_-- > 0)
+ ScheduleRestart();
+}
+
+bool PrivetTrafficDetector::Helper::IsSourceAcceptable() const {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+ for (const auto& network : networks_) {
+ if (net::IPAddressMatchesPrefix(recv_addr_.address(), network.address,
+ network.prefix_length)) {
return true;
}
}
return false;
}
-bool PrivetTrafficDetector::IsPrivetPacket(int rv) const {
- if (rv <= static_cast<int>(sizeof(net::dns_protocol::Header)) ||
+bool PrivetTrafficDetector::Helper::IsPrivetPacket(
+ base::span<const uint8_t> data) const {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+ if (data.size() <= sizeof(net::dns_protocol::Header) ||
!IsSourceAcceptable()) {
return false;
}
- const char* buffer_begin = io_buffer_->data();
- const char* buffer_end = buffer_begin + rv;
+ const char* buffer_begin = reinterpret_cast<const char*>(data.data());
+ const char* buffer_end = buffer_begin + data.size();
const net::dns_protocol::Header* header =
reinterpret_cast<const net::dns_protocol::Header*>(buffer_begin);
// Check if response packet.
if (!(header->flags & base::HostToNet16(net::dns_protocol::kFlagResponse)))
return false;
+
+ static const char kPrivetDeviceTypeDnsString[] = "\x07_privet";
const char* substring_begin = kPrivetDeviceTypeDnsString;
const char* substring_end = substring_begin +
arraysize(kPrivetDeviceTypeDnsString) - 1;
@@ -189,30 +230,45 @@ bool PrivetTrafficDetector::IsPrivetPacket(int rv) const {
substring_end) != buffer_end;
}
-int PrivetTrafficDetector::DoLoop(int rv) {
+void PrivetTrafficDetector::Helper::OnJoinGroupComplete(int rv) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- do {
- if (IsPrivetPacket(rv)) {
- socket_.reset();
- callback_runner_->PostTask(FROM_HERE, on_traffic_detected_);
- base::TimeDelta time_delta = base::Time::Now() - start_time_;
- UMA_HISTOGRAM_LONG_TIMES("LocalDiscovery.DetectorTriggerTime",
- time_delta);
- return net::OK;
- }
+ if (rv == net::OK) {
+ // Reset on success.
+ restart_attempts_ = kMaxRestartAttempts;
+ socket_->ReceiveMoreWithBufferSize(1, net::dns_protocol::kMaxMulticastSize);
+ return;
+ }
- rv = socket_->RecvFrom(
- io_buffer_.get(),
- io_buffer_->size(),
- &recv_addr_,
- base::Bind(base::IgnoreResult(&PrivetTrafficDetector::DoLoop),
- base::Unretained(this)));
- } while (rv > 0);
+ if (restart_attempts_-- > 0)
+ ScheduleRestart();
+}
- if (rv != net::ERR_IO_PENDING)
- return rv;
+void PrivetTrafficDetector::Helper::ResetConnection() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+ socket_.reset();
+ receiver_binding_.Close();
+}
+
+void PrivetTrafficDetector::Helper::OnReceived(
+ int32_t result,
+ const base::Optional<net::IPEndPoint>& src_addr,
+ base::Optional<base::span<const uint8_t>> data) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+ if (result != net::OK)
+ return;
- return net::OK;
+ // |data| and |src_addr| are guaranteed to be non-null when |result| is
+ // net::OK
+ recv_addr_ = src_addr.value();
+ if (IsPrivetPacket(data.value())) {
+ ResetConnection();
+ content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
+ on_traffic_detected_);
+ base::TimeDelta time_delta = base::Time::Now() - start_time_;
+ UMA_HISTOGRAM_LONG_TIMES("LocalDiscovery.DetectorTriggerTime", time_delta);
+ } else {
+ socket_->ReceiveMoreWithBufferSize(1, net::dns_protocol::kMaxMulticastSize);
+ }
}
} // namespace cloud_print
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.h b/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.h
index 395742c4365..86df41d3af5 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_traffic_detector.h
@@ -8,64 +8,90 @@
#include <memory>
#include "base/callback.h"
-#include "base/cancelable_callback.h"
#include "base/macros.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/network_connection_tracker.h"
-#include "net/base/address_family.h"
+#include "mojo/public/cpp/bindings/binding.h"
#include "net/base/ip_endpoint.h"
+#include "net/base/network_interfaces.h"
+#include "services/network/public/cpp/network_connection_tracker.h"
+#include "services/network/public/mojom/udp_socket.mojom.h"
-namespace net {
-class DatagramServerSocket;
-class IOBufferWithSize;
+namespace content {
+class BrowserContext;
}
namespace cloud_print {
-// Detects mDns traffic that looks like "Privet" protocol.
-// Can produce false positives results, but main task of the class is to avoid
-// running full mDns listener if user doesn't have devices.
-// When traffic is detected, class fires callback and shutdowns itself.
+// Detects mDns traffic that looks like the "Privet" protocol. This can produce
+// false positives results, but the main task of the class is to avoid running a
+// full mDns listener if user doesn't have devices.
+// When potential "Privet" traffic has been detected, fire a callback and stop
+// listening for traffic.
+// When the network changes, restarts itself to start listening for traffic
+// again on the new network(s).
+// The class lives on the UI thread, with a helper that lives on the IO thread.
class PrivetTrafficDetector
- : public base::RefCountedThreadSafe<
- PrivetTrafficDetector,
- content::BrowserThread::DeleteOnIOThread>,
- private content::NetworkConnectionTracker::NetworkConnectionObserver {
+ : public network::NetworkConnectionTracker::NetworkConnectionObserver {
public:
- PrivetTrafficDetector(net::AddressFamily address_family,
- const base::Closure& on_traffic_detected);
+ // Called on the UI thread.
+ PrivetTrafficDetector(content::BrowserContext* profile,
+ const base::RepeatingClosure& on_traffic_detected);
+ ~PrivetTrafficDetector() override;
- void Start();
- void Stop();
+ // network::NetworkConnectionTracker::NetworkConnectionObserver:
+ void OnConnectionChanged(network::mojom::ConnectionType type) override;
private:
- friend struct content::BrowserThread::DeleteOnThread<
- content::BrowserThread::IO>;
- friend class base::DeleteHelper<PrivetTrafficDetector>;
- ~PrivetTrafficDetector() override;
+ // Constructed by PrivetTrafficDetector on the UI thread. but lives on the IO
+ // thread and destroyed on the IO thread.
+ class Helper : public network::mojom::UDPSocketReceiver {
+ public:
+ Helper(content::BrowserContext* profile,
+ const base::RepeatingClosure& on_traffic_detected);
+ ~Helper() override;
- // content::NetworkConnectionTracker::NetworkConnectionObserver:
- void OnConnectionChanged(network::mojom::ConnectionType type) override;
+ // network::mojom::UDPSocketReceiver:
+ void OnReceived(int32_t result,
+ const base::Optional<net::IPEndPoint>& src_addr,
+ base::Optional<base::span<const uint8_t>> data) override;
+
+ void HandleConnectionChanged(network::mojom::ConnectionType type);
+ void ScheduleRestart();
+
+ private:
+ void Restart(net::NetworkInterfaceList networks);
+ void Bind();
+ void OnBindComplete(net::IPEndPoint multicast_addr,
+ int rv,
+ const base::Optional<net::IPEndPoint>& ip_address);
+ bool IsSourceAcceptable() const;
+ bool IsPrivetPacket(base::span<const uint8_t> data) const;
+ void OnJoinGroupComplete(int rv);
+ void ResetConnection();
+
+ // Initialized on the UI thread, but only accessed on the IO thread for the
+ // purpose of passing it back to the UI thread. Safe because it is const.
+ content::BrowserContext* const profile_;
+
+ // Initialized on the UI thread, but only accessed on the IO thread.
+ base::RepeatingClosure on_traffic_detected_;
+ int restart_attempts_;
+
+ // Only accessed on the IO thread.
+ net::NetworkInterfaceList networks_;
+ net::IPEndPoint recv_addr_;
+ base::Time start_time_;
+ network::mojom::UDPSocketPtr socket_;
+
+ // Implementation of socket receiver callback.
+ // Initialized on the UI thread, but only accessed on the IO thread.
+ mojo::Binding<network::mojom::UDPSocketReceiver> receiver_binding_;
+
+ base::WeakPtrFactory<Helper> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(Helper);
+ };
- void HandleConnectionChanged(network::mojom::ConnectionType type);
- void ScheduleRestart();
- void Restart(const net::NetworkInterfaceList& networks);
- int Bind();
- bool IsSourceAcceptable() const;
- bool IsPrivetPacket(int rv) const;
- int DoLoop(int rv);
-
- base::Closure on_traffic_detected_;
- scoped_refptr<base::TaskRunner> callback_runner_;
- net::NetworkInterfaceList networks_;
- net::AddressFamily address_family_;
- net::IPEndPoint recv_addr_;
- std::unique_ptr<net::DatagramServerSocket> socket_;
- scoped_refptr<net::IOBufferWithSize> io_buffer_;
- base::Time start_time_;
- int restart_attempts_;
-
- base::WeakPtrFactory<PrivetTrafficDetector> weak_ptr_factory_;
+ Helper* const helper_;
DISALLOW_COPY_AND_ASSIGN(PrivetTrafficDetector);
};
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher.cc b/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher.cc
deleted file mode 100644
index d8d3d0982c4..00000000000
--- a/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher.cc
+++ /dev/null
@@ -1,353 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/printing/cloud_print/privet_url_fetcher.h"
-
-#include <stdint.h>
-
-#include <algorithm>
-#include <limits>
-#include <map>
-#include <memory>
-
-#include "base/bind.h"
-#include "base/json/json_reader.h"
-#include "base/lazy_instance.h"
-#include "base/location.h"
-#include "base/rand_util.h"
-#include "base/strings/stringprintf.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/printing/cloud_print/privet_constants.h"
-#include "components/data_use_measurement/core/data_use_user_data.h"
-#include "net/base/load_flags.h"
-#include "net/http/http_status_code.h"
-#include "net/url_request/url_request_context.h"
-#include "net/url_request/url_request_status.h"
-
-namespace cloud_print {
-
-namespace {
-
-using TokenMap = std::map<std::string, std::string>;
-
-base::LazyInstance<TokenMap>::Leaky g_tokens = LAZY_INSTANCE_INITIALIZER;
-
-const char kXPrivetTokenHeaderPrefix[] = "X-Privet-Token: ";
-const char kRangeHeaderFormat[] = "Range: bytes=%d-%d";
-const char kXPrivetEmptyToken[] = "\"\"";
-const int kPrivetMaxRetries = 20;
-const int kPrivetTimeoutOnError = 5;
-const int kHTTPErrorCodeInvalidXPrivetToken = 418;
-
-std::string MakeRangeHeader(int start, int end) {
- DCHECK_GE(start, 0);
- DCHECK_GT(end, 0);
- DCHECK_GT(end, start);
- return base::StringPrintf(kRangeHeaderFormat, start, end);
-}
-
-} // namespace
-
-void PrivetURLFetcher::Delegate::OnNeedPrivetToken(TokenCallback callback) {
- OnError(0, TOKEN_ERROR);
-}
-
-bool PrivetURLFetcher::Delegate::OnRawData(bool response_is_file,
- const std::string& data_string,
- const base::FilePath& data_file) {
- return false;
-}
-
-PrivetURLFetcher::PrivetURLFetcher(
- const GURL& url,
- net::URLFetcher::RequestType request_type,
- const scoped_refptr<net::URLRequestContextGetter>& context_getter,
- const net::NetworkTrafficAnnotationTag& traffic_annotation,
- PrivetURLFetcher::Delegate* delegate)
- : url_(url),
- request_type_(request_type),
- context_getter_(context_getter),
- traffic_annotation_(traffic_annotation),
- delegate_(delegate),
- max_retries_(kPrivetMaxRetries),
- weak_factory_(this) {}
-
-PrivetURLFetcher::~PrivetURLFetcher() {
-}
-
-// static
-void PrivetURLFetcher::SetTokenForHost(const std::string& host,
- const std::string& token) {
- g_tokens.Get()[host] = token;
-}
-
-// static
-void PrivetURLFetcher::ResetTokenMapForTest() {
- g_tokens.Get().clear();
-}
-
-void PrivetURLFetcher::SetMaxRetriesForTest(int max_retries) {
- DCHECK_EQ(tries_, 0);
- max_retries_ = max_retries;
-}
-
-void PrivetURLFetcher::DoNotRetryOnTransientError() {
- DCHECK_EQ(tries_, 0);
- do_not_retry_on_transient_error_ = true;
-}
-
-void PrivetURLFetcher::SendEmptyPrivetToken() {
- DCHECK_EQ(tries_, 0);
- send_empty_privet_token_ = true;
-}
-
-std::string PrivetURLFetcher::GetPrivetAccessToken() {
- if (send_empty_privet_token_)
- return std::string();
-
- TokenMap::iterator it = g_tokens.Get().find(GetHostString());
- return it != g_tokens.Get().end() ? it->second : std::string();
-}
-
-std::string PrivetURLFetcher::GetHostString() {
- return url_.GetOrigin().spec();
-}
-
-void PrivetURLFetcher::SaveResponseToFile() {
- DCHECK_EQ(tries_, 0);
- make_response_file_ = true;
-}
-
-void PrivetURLFetcher::SetByteRange(int start, int end) {
- DCHECK_EQ(tries_, 0);
- byte_range_start_ = start;
- byte_range_end_ = end;
- has_byte_range_ = true;
-}
-
-void PrivetURLFetcher::Try() {
- tries_++;
- if (tries_ > max_retries_) {
- delegate_->OnError(0, UNKNOWN_ERROR);
- return;
- }
-
- DVLOG(1) << "Attempt: " << tries_;
- url_fetcher_ =
- net::URLFetcher::Create(url_, request_type_, this, traffic_annotation_);
- data_use_measurement::DataUseUserData::AttachToFetcher(
- url_fetcher_.get(), data_use_measurement::DataUseUserData::CLOUD_PRINT);
-
- // Privet requests are relevant to hosts on local network only.
- url_fetcher_->SetLoadFlags(url_fetcher_->GetLoadFlags() |
- net::LOAD_BYPASS_PROXY | net::LOAD_DISABLE_CACHE |
- net::LOAD_DO_NOT_SEND_COOKIES);
- url_fetcher_->SetRequestContext(context_getter_.get());
-
- std::string token = GetPrivetAccessToken();
- if (token.empty())
- token = kXPrivetEmptyToken;
-
- url_fetcher_->AddExtraRequestHeader(std::string(kXPrivetTokenHeaderPrefix) +
- token);
-
- if (has_byte_range_) {
- url_fetcher_->AddExtraRequestHeader(
- MakeRangeHeader(byte_range_start_, byte_range_end_));
- }
-
- if (make_response_file_)
- url_fetcher_->SaveResponseToTemporaryFile(GetFileTaskRunner());
-
- // URLFetcher requires us to set upload data for POST requests.
- if (request_type_ == net::URLFetcher::POST)
- url_fetcher_->SetUploadData(upload_content_type_, upload_data_);
- url_fetcher_->Start();
-}
-
-void PrivetURLFetcher::Start() {
- DCHECK_EQ(tries_, 0); // We haven't called |Start()| yet.
-
- if (!url_.is_valid())
- return delegate_->OnError(0, UNKNOWN_ERROR);
-
- if (!send_empty_privet_token_) {
- std::string privet_access_token;
- privet_access_token = GetPrivetAccessToken();
- if (privet_access_token.empty()) {
- RequestTokenRefresh();
- return;
- }
- }
-
- Try();
-}
-
-void PrivetURLFetcher::SetUploadData(const std::string& upload_content_type,
- const std::string& upload_data) {
- upload_content_type_ = upload_content_type;
- upload_data_ = upload_data;
-}
-
-void PrivetURLFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
- DVLOG(1) << "Status: " << source->GetStatus().status()
- << ", ResponseCode: " << source->GetResponseCode();
- if (source->GetStatus().status() != net::URLRequestStatus::CANCELED &&
- (source->GetResponseCode() == net::HTTP_SERVICE_UNAVAILABLE ||
- source->GetResponseCode() == net::URLFetcher::RESPONSE_CODE_INVALID)) {
- ScheduleRetry(kPrivetTimeoutOnError);
- return;
- }
-
- if (!OnURLFetchCompleteDoNotParseData(source)) {
- // Byte ranges should only be used when we're not parsing the data
- // as JSON.
- DCHECK(!has_byte_range_);
-
- // We should only be saving raw data to a file.
- DCHECK(!make_response_file_);
-
- OnURLFetchCompleteParseData(source);
- }
-}
-
-// Note that this function returns "true" in error cases to indicate
-// that it has fully handled the responses.
-bool PrivetURLFetcher::OnURLFetchCompleteDoNotParseData(
- const net::URLFetcher* source) {
- if (source->GetStatus().status() == net::URLRequestStatus::CANCELED) {
- delegate_->OnError(0, REQUEST_CANCELED);
- return true;
- }
-
- if (source->GetResponseCode() == kHTTPErrorCodeInvalidXPrivetToken) {
- RequestTokenRefresh();
- return true;
- }
-
- if (source->GetResponseCode() != net::HTTP_OK &&
- source->GetResponseCode() != net::HTTP_PARTIAL_CONTENT &&
- source->GetResponseCode() != net::HTTP_BAD_REQUEST) {
- delegate_->OnError(response_code(), RESPONSE_CODE_ERROR);
- return true;
- }
-
- if (make_response_file_) {
- base::FilePath response_file_path;
- if (!source->GetResponseAsFilePath(true, &response_file_path)) {
- delegate_->OnError(0, UNKNOWN_ERROR);
- return true;
- }
-
- return delegate_->OnRawData(true, std::string(), response_file_path);
- }
-
- std::string response_str;
- if (!source->GetResponseAsString(&response_str)) {
- delegate_->OnError(0, UNKNOWN_ERROR);
- return true;
- }
-
- return delegate_->OnRawData(false, response_str, base::FilePath());
-}
-
-void PrivetURLFetcher::OnURLFetchCompleteParseData(
- const net::URLFetcher* source) {
- // Response contains error description.
- bool is_error_response = false;
- if (source->GetResponseCode() != net::HTTP_OK) {
- delegate_->OnError(response_code(), RESPONSE_CODE_ERROR);
- return;
- }
-
- std::string response_str;
- if (!source->GetResponseAsString(&response_str)) {
- delegate_->OnError(0, UNKNOWN_ERROR);
- return;
- }
-
- base::JSONReader json_reader(base::JSON_ALLOW_TRAILING_COMMAS);
- std::unique_ptr<base::Value> value = json_reader.ReadToValue(response_str);
- if (!value || !value->is_dict()) {
- delegate_->OnError(0, JSON_PARSE_ERROR);
- return;
- }
-
- const base::Value* error_value =
- value->FindKeyOfType(kPrivetKeyError, base::Value::Type::STRING);
- if (error_value) {
- const std::string& error = error_value->GetString();
- if (error == kPrivetErrorInvalidXPrivetToken) {
- RequestTokenRefresh();
- return;
- }
- if (PrivetErrorTransient(error)) {
- if (!do_not_retry_on_transient_error_) {
- const base::Value* timeout_value =
- value->FindKeyOfType(kPrivetKeyTimeout, base::Value::Type::INTEGER);
- ScheduleRetry(timeout_value ? timeout_value->GetInt()
- : kPrivetDefaultTimeout);
- return;
- }
- }
- is_error_response = true;
- }
-
- delegate_->OnParsedJson(
- response_code(), *static_cast<const base::DictionaryValue*>(value.get()),
- is_error_response);
-}
-
-void PrivetURLFetcher::ScheduleRetry(int timeout_seconds) {
- double random_scaling_factor =
- 1 + base::RandDouble() * kPrivetMaximumTimeRandomAddition;
-
- int timeout_seconds_randomized =
- static_cast<int>(timeout_seconds * random_scaling_factor);
-
- timeout_seconds_randomized =
- std::max(timeout_seconds_randomized, kPrivetMinimumTimeout);
-
- // Don't wait because only error callback is going to be called.
- if (tries_ >= max_retries_)
- timeout_seconds_randomized = 0;
-
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE,
- base::BindOnce(&PrivetURLFetcher::Try, weak_factory_.GetWeakPtr()),
- base::TimeDelta::FromSeconds(timeout_seconds_randomized));
-}
-
-void PrivetURLFetcher::RequestTokenRefresh() {
- delegate_->OnNeedPrivetToken(base::BindOnce(&PrivetURLFetcher::RefreshToken,
- weak_factory_.GetWeakPtr()));
-}
-
-void PrivetURLFetcher::RefreshToken(const std::string& token) {
- if (token.empty()) {
- delegate_->OnError(0, TOKEN_ERROR);
- } else {
- SetTokenForHost(GetHostString(), token);
- Try();
- }
-}
-
-bool PrivetURLFetcher::PrivetErrorTransient(const std::string& error) {
- return error == kPrivetErrorDeviceBusy ||
- error == kPrivetErrorPendingUserAction ||
- error == kPrivetErrorPrinterBusy;
-}
-
-scoped_refptr<base::SequencedTaskRunner> PrivetURLFetcher::GetFileTaskRunner() {
- if (!file_task_runner_) {
- file_task_runner_ = base::CreateSequencedTaskRunnerWithTraits(
- {base::TaskPriority::BACKGROUND, base::MayBlock()});
- }
-
- return file_task_runner_;
-}
-
-} // namespace cloud_print
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher_unittest.cc b/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher_unittest.cc
deleted file mode 100644
index 8e40a00df14..00000000000
--- a/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher_unittest.cc
+++ /dev/null
@@ -1,299 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/printing/cloud_print/privet_url_fetcher.h"
-
-#include <memory>
-
-#include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
-#include "base/test/scoped_task_environment.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
-#include "net/url_request/test_url_fetcher_factory.h"
-#include "net/url_request/url_request_test_util.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-using testing::StrictMock;
-
-namespace cloud_print {
-
-namespace {
-
-const char kSamplePrivetURL[] =
- "http://10.0.0.8:7676/privet/register?action=start";
-const char kSamplePrivetToken[] = "MyToken";
-const char kEmptyPrivetToken[] = "\"\"";
-
-const char kSampleParsableJSON[] = "{ \"hello\" : 2 }";
-const char kSampleUnparsableJSON[] = "{ \"hello\" : }";
-const char kSampleJSONWithError[] = "{ \"error\" : \"unittest_example\" }";
-
-class MockPrivetURLFetcherDelegate : public PrivetURLFetcher::Delegate {
- public:
- MockPrivetURLFetcherDelegate() : raw_mode_(false) {
- }
-
- ~MockPrivetURLFetcherDelegate() override {
- }
-
- void OnError(int response_code, PrivetURLFetcher::ErrorType error) override {
- OnErrorInternal(error);
- }
-
- MOCK_METHOD1(OnErrorInternal, void(PrivetURLFetcher::ErrorType error));
-
- void OnParsedJson(int response_code,
- const base::DictionaryValue& value,
- bool has_error) override {
- saved_value_.reset(value.DeepCopy());
- OnParsedJsonInternal(has_error);
- }
-
- MOCK_METHOD1(OnParsedJsonInternal, void(bool has_error));
-
- void OnNeedPrivetToken(PrivetURLFetcher::TokenCallback callback) override {}
-
- bool OnRawData(bool response_is_file,
- const std::string& data,
- const base::FilePath& response_file) override {
- if (!raw_mode_) return false;
-
- if (response_is_file) {
- EXPECT_TRUE(response_file != base::FilePath());
- OnFileInternal();
- } else {
- OnRawDataInternal(data);
- }
-
- return true;
- }
-
- MOCK_METHOD1(OnRawDataInternal, void(const std::string& data));
-
- MOCK_METHOD0(OnFileInternal, void());
-
- const base::DictionaryValue* saved_value() { return saved_value_.get(); }
-
- void SetRawMode(bool raw_mode) {
- raw_mode_ = raw_mode;
- }
-
- private:
- std::unique_ptr<base::DictionaryValue> saved_value_;
- bool raw_mode_;
-};
-
-class PrivetURLFetcherTest : public ::testing::Test {
- public:
- PrivetURLFetcherTest() {
- request_context_ = base::MakeRefCounted<net::TestURLRequestContextGetter>(
- base::ThreadTaskRunnerHandle::Get());
- privet_urlfetcher_ = std::make_unique<PrivetURLFetcher>(
- GURL(kSamplePrivetURL), net::URLFetcher::POST, request_context_.get(),
- TRAFFIC_ANNOTATION_FOR_TESTS, &delegate_);
-
- PrivetURLFetcher::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
- kSamplePrivetToken);
- }
- ~PrivetURLFetcherTest() override {}
-
- void RunFor(base::TimeDelta time_period) {
- base::CancelableCallback<void()> callback(base::Bind(
- &PrivetURLFetcherTest::Stop, base::Unretained(this)));
- base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, callback.callback(), time_period);
-
- base::RunLoop().Run();
- callback.Cancel();
- }
-
- void Stop() { base::RunLoop::QuitCurrentWhenIdleDeprecated(); }
-
- protected:
- base::test::ScopedTaskEnvironment scoped_task_environment_;
- scoped_refptr<net::TestURLRequestContextGetter> request_context_;
- net::TestURLFetcherFactory fetcher_factory_;
- std::unique_ptr<PrivetURLFetcher> privet_urlfetcher_;
- StrictMock<MockPrivetURLFetcherDelegate> delegate_;
-};
-
-TEST_F(PrivetURLFetcherTest, FetchSuccess) {
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseString(kSampleParsableJSON);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
-
- EXPECT_CALL(delegate_, OnParsedJsonInternal(false));
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-
- const base::DictionaryValue* value = delegate_.saved_value();
- int hello_value;
- ASSERT_TRUE(value);
- ASSERT_TRUE(value->GetInteger("hello", &hello_value));
- EXPECT_EQ(2, hello_value);
-}
-
-TEST_F(PrivetURLFetcherTest, HTTP503Retry) {
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseString(kSampleParsableJSON);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(503);
-
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-
- RunFor(base::TimeDelta::FromSeconds(7));
- fetcher = fetcher_factory_.GetFetcherByID(0);
-
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseString(kSampleParsableJSON);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
-
- EXPECT_CALL(delegate_, OnParsedJsonInternal(false));
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-}
-
-TEST_F(PrivetURLFetcherTest, ResponseCodeError) {
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseString(kSampleParsableJSON);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(404);
-
- EXPECT_CALL(delegate_,
- OnErrorInternal(PrivetURLFetcher::RESPONSE_CODE_ERROR));
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-}
-
-TEST_F(PrivetURLFetcherTest, JsonParseError) {
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseString(kSampleUnparsableJSON);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
-
- EXPECT_CALL(delegate_,
- OnErrorInternal(PrivetURLFetcher::JSON_PARSE_ERROR));
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-}
-
-TEST_F(PrivetURLFetcherTest, Header) {
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- net::HttpRequestHeaders headers;
- fetcher->GetExtraRequestHeaders(&headers);
-
- std::string header_token;
- ASSERT_TRUE(headers.GetHeader("X-Privet-Token", &header_token));
- EXPECT_EQ(kSamplePrivetToken, header_token);
-}
-
-TEST_F(PrivetURLFetcherTest, Header2) {
- PrivetURLFetcher::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
- "");
-
- privet_urlfetcher_->SendEmptyPrivetToken();
- privet_urlfetcher_->Start();
-
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- net::HttpRequestHeaders headers;
- fetcher->GetExtraRequestHeaders(&headers);
-
- std::string header_token;
- ASSERT_TRUE(headers.GetHeader("X-Privet-Token", &header_token));
- EXPECT_EQ(kEmptyPrivetToken, header_token);
-}
-
-TEST_F(PrivetURLFetcherTest, AlwaysSendEmpty) {
- PrivetURLFetcher::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
- "SampleToken");
-
- privet_urlfetcher_->SendEmptyPrivetToken();
- privet_urlfetcher_->Start();
-
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- net::HttpRequestHeaders headers;
- fetcher->GetExtraRequestHeaders(&headers);
-
- std::string header_token;
- ASSERT_TRUE(headers.GetHeader("X-Privet-Token", &header_token));
- EXPECT_EQ(kEmptyPrivetToken, header_token);
-}
-
-TEST_F(PrivetURLFetcherTest, FetchHasError) {
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseString(kSampleJSONWithError);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
-
- EXPECT_CALL(delegate_, OnParsedJsonInternal(true));
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-}
-
-TEST_F(PrivetURLFetcherTest, FetcherRawData) {
- delegate_.SetRawMode(true);
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseString(kSampleJSONWithError);
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
-
- EXPECT_CALL(delegate_, OnRawDataInternal(kSampleJSONWithError));
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-}
-
-TEST_F(PrivetURLFetcherTest, RangeRequest) {
- delegate_.SetRawMode(true);
- privet_urlfetcher_->SetByteRange(200, 300);
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- net::HttpRequestHeaders headers;
- fetcher->GetExtraRequestHeaders(&headers);
-
- std::string header_range;
- ASSERT_TRUE(headers.GetHeader("Range", &header_range));
- EXPECT_EQ("bytes=200-300", header_range);
-}
-
-TEST_F(PrivetURLFetcherTest, FetcherToFile) {
- delegate_.SetRawMode(true);
- privet_urlfetcher_->SaveResponseToFile();
- privet_urlfetcher_->Start();
- net::TestURLFetcher* fetcher = fetcher_factory_.GetFetcherByID(0);
- ASSERT_TRUE(fetcher);
- fetcher->SetResponseFilePath(
- base::FilePath(FILE_PATH_LITERAL("sample/file")));
- fetcher->set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS,
- net::OK));
- fetcher->set_response_code(200);
-
- EXPECT_CALL(delegate_, OnFileInternal());
- fetcher->delegate()->OnURLFetchComplete(fetcher);
-}
-
-} // namespace
-
-} // namespace cloud_print
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_url_loader.cc b/chromium/chrome/browser/printing/cloud_print/privet_url_loader.cc
new file mode 100644
index 00000000000..70ed0e2061c
--- /dev/null
+++ b/chromium/chrome/browser/printing/cloud_print/privet_url_loader.cc
@@ -0,0 +1,365 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/printing/cloud_print/privet_url_loader.h"
+
+#include <stdint.h>
+
+#include <algorithm>
+#include <limits>
+#include <map>
+#include <memory>
+#include <utility>
+
+#include "base/bind.h"
+#include "base/json/json_reader.h"
+#include "base/lazy_instance.h"
+#include "base/location.h"
+#include "base/no_destructor.h"
+#include "base/rand_util.h"
+#include "base/strings/stringprintf.h"
+#include "base/task/post_task.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/net/system_network_context_manager.h"
+#include "chrome/browser/printing/cloud_print/privet_constants.h"
+#include "net/base/load_flags.h"
+#include "net/http/http_status_code.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
+
+namespace cloud_print {
+
+namespace {
+
+constexpr char kXPrivetTokenHeaderKey[] = "X-Privet-Token";
+constexpr char kRangeHeaderKey[] = "Range";
+constexpr char kRangeHeaderValueFormat[] = "bytes=%d-%d";
+constexpr char kXPrivetEmptyToken[] = "\"\"";
+constexpr int kPrivetMaxRetries = 20;
+constexpr int kPrivetTimeoutOnError = 5;
+constexpr int kHTTPErrorCodeInvalidXPrivetToken = 418;
+constexpr size_t kPrivetMaxContentSize = 1 * 1024 * 1024;
+
+base::LazyInstance<std::map<std::string, std::string>>::Leaky g_tokens =
+ LAZY_INSTANCE_INITIALIZER;
+
+std::string MakeRangeHeaderValue(int start, int end) {
+ DCHECK_GE(start, 0);
+ DCHECK_GT(end, 0);
+ DCHECK_GT(end, start);
+ return base::StringPrintf(kRangeHeaderValueFormat, start, end);
+}
+
+} // namespace
+
+PrivetURLLoader::RetryImmediatelyForTest::RetryImmediatelyForTest() {
+ DCHECK(!skip_retry_timeouts_for_tests_);
+ skip_retry_timeouts_for_tests_ = true;
+}
+
+PrivetURLLoader::RetryImmediatelyForTest::~RetryImmediatelyForTest() {
+ DCHECK(skip_retry_timeouts_for_tests_);
+ skip_retry_timeouts_for_tests_ = false;
+}
+
+// static
+bool PrivetURLLoader::skip_retry_timeouts_for_tests_ = false;
+
+void PrivetURLLoader::Delegate::OnNeedPrivetToken(TokenCallback callback) {
+ OnError(0, TOKEN_ERROR);
+}
+
+bool PrivetURLLoader::Delegate::OnRawData(bool response_is_file,
+ const std::string& data_string,
+ const base::FilePath& data_file) {
+ return false;
+}
+
+PrivetURLLoader::PrivetURLLoader(
+ const GURL& url,
+ const std::string& request_type,
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
+ const net::NetworkTrafficAnnotationTag& traffic_annotation,
+ PrivetURLLoader::Delegate* delegate)
+ : url_(url),
+ request_type_(request_type),
+ url_loader_factory_(url_loader_factory),
+ traffic_annotation_(traffic_annotation),
+ delegate_(delegate),
+ max_retries_(kPrivetMaxRetries),
+ weak_factory_(this) {}
+
+PrivetURLLoader::~PrivetURLLoader() {}
+
+// static
+void PrivetURLLoader::SetTokenForHost(const std::string& host,
+ const std::string& token) {
+ g_tokens.Get()[host] = token;
+}
+
+// static
+void PrivetURLLoader::ResetTokenMapForTest() {
+ g_tokens.Get().clear();
+}
+
+void PrivetURLLoader::SetMaxRetriesForTest(int max_retries) {
+ DCHECK_EQ(tries_, 0);
+ max_retries_ = max_retries;
+}
+
+void PrivetURLLoader::DoNotRetryOnTransientError() {
+ DCHECK_EQ(tries_, 0);
+ do_not_retry_on_transient_error_ = true;
+}
+
+void PrivetURLLoader::SendEmptyPrivetToken() {
+ DCHECK_EQ(tries_, 0);
+ send_empty_privet_token_ = true;
+}
+
+std::string PrivetURLLoader::GetPrivetAccessToken() {
+ if (send_empty_privet_token_)
+ return std::string();
+
+ auto it = g_tokens.Get().find(GetHostString());
+ return it != g_tokens.Get().end() ? it->second : std::string();
+}
+
+std::string PrivetURLLoader::GetHostString() {
+ return url_.GetOrigin().spec();
+}
+
+void PrivetURLLoader::SaveResponseToFile() {
+ DCHECK_EQ(tries_, 0);
+ make_response_file_ = true;
+}
+
+void PrivetURLLoader::SetByteRange(int start, int end) {
+ DCHECK_EQ(tries_, 0);
+ byte_range_start_ = start;
+ byte_range_end_ = end;
+ has_byte_range_ = true;
+}
+
+void PrivetURLLoader::Try() {
+ tries_++;
+ if (tries_ > max_retries_) {
+ delegate_->OnError(0, UNKNOWN_ERROR);
+ return;
+ }
+
+ DVLOG(1) << "Attempt: " << tries_;
+
+ auto request = std::make_unique<network::ResourceRequest>();
+ request->url = url_;
+ request->method = request_type_;
+ // Privet requests are relevant to hosts on local network only.
+ request->load_flags = net::LOAD_BYPASS_PROXY | net::LOAD_DISABLE_CACHE |
+ net::LOAD_DO_NOT_SEND_COOKIES;
+
+ std::string token = GetPrivetAccessToken();
+ if (token.empty())
+ token = kXPrivetEmptyToken;
+ request->headers.SetHeader(kXPrivetTokenHeaderKey, token);
+
+ if (has_byte_range_) {
+ request->headers.SetHeader(
+ kRangeHeaderKey,
+ MakeRangeHeaderValue(byte_range_start_, byte_range_end_));
+ }
+
+ url_loader_ =
+ network::SimpleURLLoader::Create(std::move(request), traffic_annotation_);
+
+ url_loader_->SetAllowHttpErrorResults(true);
+
+ url_loader_->SetOnResponseStartedCallback(base::BindOnce(
+ &PrivetURLLoader::OnResponseStarted, weak_factory_.GetWeakPtr()));
+
+ // URLFetcher requires us to set upload data for POST requests.
+ if (request_type_ == "POST")
+ url_loader_->AttachStringForUpload(upload_data_, upload_content_type_);
+
+ if (make_response_file_) {
+ url_loader_->DownloadToTempFile(
+ url_loader_factory_.get(),
+ base::BindOnce(&PrivetURLLoader::OnDownloadedToFile,
+ weak_factory_.GetWeakPtr()));
+ } else {
+ url_loader_->DownloadToString(
+ url_loader_factory_.get(),
+ base::BindOnce(&PrivetURLLoader::OnDownloadedToString,
+ weak_factory_.GetWeakPtr()),
+ kPrivetMaxContentSize);
+ }
+}
+
+void PrivetURLLoader::Start() {
+ DCHECK_EQ(tries_, 0); // We haven't called |Start()| yet.
+
+ if (!url_.is_valid())
+ return delegate_->OnError(0, UNKNOWN_ERROR);
+
+ if (!send_empty_privet_token_) {
+ std::string privet_access_token;
+ privet_access_token = GetPrivetAccessToken();
+ if (privet_access_token.empty()) {
+ RequestTokenRefresh();
+ return;
+ }
+ }
+
+ Try();
+}
+
+void PrivetURLLoader::SetUploadData(const std::string& upload_content_type,
+ const std::string& upload_data) {
+ upload_content_type_ = upload_content_type;
+ upload_data_ = upload_data;
+}
+
+void PrivetURLLoader::OnResponseStarted(
+ const GURL& final_url,
+ const network::ResourceResponseHead& response_head) {
+ if (!response_head.headers ||
+ response_head.headers->response_code() == net::HTTP_SERVICE_UNAVAILABLE) {
+ url_loader_.reset();
+ ScheduleRetry(kPrivetTimeoutOnError);
+ }
+}
+
+void PrivetURLLoader::OnDownloadedToString(
+ std::unique_ptr<std::string> response_body) {
+ DCHECK(!make_response_file_);
+
+ if (CheckURLLoaderForError())
+ return;
+
+ if (delegate_->OnRawData(false, *response_body, base::FilePath()))
+ return;
+
+ // Byte ranges should only be used when we're not parsing the data as JSON.
+ DCHECK(!has_byte_range_);
+
+ // Response contains error description.
+ int response_code = url_loader_->ResponseInfo()->headers->response_code();
+ bool is_error_response = false;
+ if (response_code != net::HTTP_OK) {
+ delegate_->OnError(response_code, RESPONSE_CODE_ERROR);
+ return;
+ }
+
+ base::JSONReader json_reader(base::JSON_ALLOW_TRAILING_COMMAS);
+ std::unique_ptr<base::Value> value = json_reader.ReadToValue(*response_body);
+ if (!value || !value->is_dict()) {
+ delegate_->OnError(0, JSON_PARSE_ERROR);
+ return;
+ }
+
+ const base::Value* error_value =
+ value->FindKeyOfType(kPrivetKeyError, base::Value::Type::STRING);
+ if (error_value) {
+ const std::string& error = error_value->GetString();
+ if (error == kPrivetErrorInvalidXPrivetToken) {
+ RequestTokenRefresh();
+ return;
+ }
+ if (PrivetErrorTransient(error)) {
+ if (!do_not_retry_on_transient_error_) {
+ const base::Value* timeout_value =
+ value->FindKeyOfType(kPrivetKeyTimeout, base::Value::Type::INTEGER);
+ ScheduleRetry(timeout_value ? timeout_value->GetInt()
+ : kPrivetDefaultTimeout);
+ return;
+ }
+ }
+ is_error_response = true;
+ }
+
+ delegate_->OnParsedJson(
+ response_code, *static_cast<const base::DictionaryValue*>(value.get()),
+ is_error_response);
+}
+
+void PrivetURLLoader::OnDownloadedToFile(base::FilePath path) {
+ DCHECK(make_response_file_);
+
+ if (CheckURLLoaderForError())
+ return;
+
+ bool result = delegate_->OnRawData(true, std::string(), path);
+ DCHECK(result);
+}
+
+bool PrivetURLLoader::CheckURLLoaderForError() {
+ switch (url_loader_->NetError()) {
+ case net::OK:
+ break;
+ case net::ERR_ABORTED:
+ delegate_->OnError(0, REQUEST_CANCELED);
+ return true;
+ default:
+ delegate_->OnError(0, UNKNOWN_ERROR);
+ return true;
+ }
+ int response_code = net::ERR_FAILED;
+ if (url_loader_->ResponseInfo()->headers)
+ response_code = url_loader_->ResponseInfo()->headers->response_code();
+ if (response_code == kHTTPErrorCodeInvalidXPrivetToken) {
+ RequestTokenRefresh();
+ return true;
+ }
+ if (response_code != net::HTTP_OK &&
+ response_code != net::HTTP_PARTIAL_CONTENT &&
+ response_code != net::HTTP_BAD_REQUEST) {
+ delegate_->OnError(response_code, RESPONSE_CODE_ERROR);
+ return true;
+ }
+ return false;
+}
+
+void PrivetURLLoader::ScheduleRetry(int timeout_seconds) {
+ double random_scaling_factor =
+ 1 + base::RandDouble() * kPrivetMaximumTimeRandomAddition;
+
+ int timeout_seconds_randomized =
+ static_cast<int>(timeout_seconds * random_scaling_factor);
+
+ timeout_seconds_randomized =
+ std::max(timeout_seconds_randomized, kPrivetMinimumTimeout);
+
+ // Don't wait because only error callback is going to be called.
+ if (tries_ >= max_retries_)
+ timeout_seconds_randomized = 0;
+
+ if (skip_retry_timeouts_for_tests_)
+ timeout_seconds_randomized = 0;
+
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE,
+ base::BindOnce(&PrivetURLLoader::Try, weak_factory_.GetWeakPtr()),
+ base::TimeDelta::FromSeconds(timeout_seconds_randomized));
+}
+
+void PrivetURLLoader::RequestTokenRefresh() {
+ delegate_->OnNeedPrivetToken(base::BindOnce(&PrivetURLLoader::RefreshToken,
+ weak_factory_.GetWeakPtr()));
+}
+
+void PrivetURLLoader::RefreshToken(const std::string& token) {
+ if (token.empty()) {
+ delegate_->OnError(0, TOKEN_ERROR);
+ } else {
+ SetTokenForHost(GetHostString(), token);
+ Try();
+ }
+}
+
+bool PrivetURLLoader::PrivetErrorTransient(const std::string& error) {
+ return error == kPrivetErrorDeviceBusy ||
+ error == kPrivetErrorPendingUserAction ||
+ error == kPrivetErrorPrinterBusy;
+}
+
+} // namespace cloud_print
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher.h b/chromium/chrome/browser/printing/cloud_print/privet_url_loader.h
index 5be6c5f5f29..2a9f643ec4e 100644
--- a/chromium/chrome/browser/printing/cloud_print/privet_url_fetcher.h
+++ b/chromium/chrome/browser/printing/cloud_print/privet_url_loader.h
@@ -2,33 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_FETCHER_H_
-#define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_FETCHER_H_
+#ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_LOADER_H_
+#define CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_LOADER_H_
#include <memory>
#include <string>
+#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner.h"
#include "base/values.h"
-#include "net/url_request/url_fetcher.h"
-#include "net/url_request/url_fetcher_delegate.h"
-#include "net/url_request/url_request_context_getter.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
+#include "services/network/public/cpp/simple_url_loader.h"
#include "url/gurl.h"
-namespace base {
-class FilePath;
+namespace network {
+class SharedURLLoaderFactory;
}
namespace cloud_print {
-// Privet-specific URLFetcher adapter. Currently supports only the subset
-// of HTTP features required by Privet for GCP 1.5
-// (/privet/info and /privet/register).
-class PrivetURLFetcher : public net::URLFetcherDelegate {
+// Privet-specific URLLoader adapter. Currently supports only the subset of
+// HTTP features required by Privet for GCP 1.5 (/privet/info and
+// /privet/register).
+class PrivetURLLoader {
public:
enum ErrorType {
JSON_PARSE_ERROR,
@@ -62,17 +62,14 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
const base::FilePath& data_file);
};
- PrivetURLFetcher(
+ PrivetURLLoader(
const GURL& url,
- net::URLFetcher::RequestType request_type,
- const scoped_refptr<net::URLRequestContextGetter>& context_getter,
+ const std::string& request_type,
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
const net::NetworkTrafficAnnotationTag& traffic_annotation,
Delegate* delegate);
- ~PrivetURLFetcher() override;
-
- // net::URLFetcherDelegate methods.
- void OnURLFetchComplete(const net::URLFetcher* source) override;
+ virtual ~PrivetURLLoader();
static void SetTokenForHost(const std::string& host,
const std::string& token);
@@ -98,17 +95,18 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
void SetUploadData(const std::string& upload_content_type,
const std::string& upload_data);
- const GURL& url() const {
- return url_fetcher_ ? url_fetcher_->GetOriginalURL() : url_;
- }
- int response_code() const {
- return url_fetcher_ ? url_fetcher_->GetResponseCode() : -1;
- }
+ // A class that can be used in tests that want to bypass the delay when
+ // retrying loading a URL. Create one of this object in your test, it will
+ // disable the delay for retry on construction and revert it back on
+ // destruction.
+ // Note that you should not have more than one of these allocated at a time.
+ class RetryImmediatelyForTest final {
+ public:
+ RetryImmediatelyForTest();
+ ~RetryImmediatelyForTest();
+ };
private:
- void OnURLFetchCompleteParseData(const net::URLFetcher* source);
- bool OnURLFetchCompleteDoNotParseData(const net::URLFetcher* source);
-
std::string GetHostString(); // Get string representing the host.
std::string GetPrivetAccessToken();
void Try();
@@ -116,13 +114,15 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
bool PrivetErrorTransient(const std::string& error);
void RequestTokenRefresh();
void RefreshToken(const std::string& token);
-
- // Lazily create |file_task_runner_| and return a reference.
- scoped_refptr<base::SequencedTaskRunner> GetFileTaskRunner();
+ void OnResponseStarted(const GURL& final_url,
+ const network::ResourceResponseHead& response_head);
+ void OnDownloadedToString(std::unique_ptr<std::string> response_body);
+ void OnDownloadedToFile(base::FilePath path);
+ bool CheckURLLoaderForError();
const GURL url_;
- const net::URLFetcher::RequestType request_type_;
- scoped_refptr<net::URLRequestContextGetter> context_getter_;
+ const std::string request_type_;
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
const net::NetworkTrafficAnnotationTag traffic_annotation_;
Delegate* const delegate_;
@@ -131,6 +131,7 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
bool send_empty_privet_token_ = false;
bool has_byte_range_ = false;
bool make_response_file_ = false;
+ static bool skip_retry_timeouts_for_tests_;
int byte_range_start_ = 0;
int byte_range_end_ = 0;
@@ -138,13 +139,12 @@ class PrivetURLFetcher : public net::URLFetcherDelegate {
int tries_ = 0;
std::string upload_data_;
std::string upload_content_type_;
- std::unique_ptr<net::URLFetcher> url_fetcher_;
- scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
+ std::unique_ptr<network::SimpleURLLoader> url_loader_;
- base::WeakPtrFactory<PrivetURLFetcher> weak_factory_;
- DISALLOW_COPY_AND_ASSIGN(PrivetURLFetcher);
+ base::WeakPtrFactory<PrivetURLLoader> weak_factory_;
+ DISALLOW_COPY_AND_ASSIGN(PrivetURLLoader);
};
} // namespace cloud_print
-#endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_FETCHER_H_
+#endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_PRIVET_URL_LOADER_H_
diff --git a/chromium/chrome/browser/printing/cloud_print/privet_url_loader_unittest.cc b/chromium/chrome/browser/printing/cloud_print/privet_url_loader_unittest.cc
new file mode 100644
index 00000000000..2b83ead820f
--- /dev/null
+++ b/chromium/chrome/browser/printing/cloud_print/privet_url_loader_unittest.cc
@@ -0,0 +1,298 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/printing/cloud_print/privet_url_loader.h"
+
+#include <memory>
+
+#include "base/bind.h"
+#include "base/files/file_util.h"
+#include "base/run_loop.h"
+#include "base/test/bind_test_util.h"
+#include "base/test/scoped_task_environment.h"
+#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
+#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
+#include "services/network/test/test_url_loader_factory.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using ::testing::_;
+
+namespace cloud_print {
+
+namespace {
+
+const char kSamplePrivetURL[] =
+ "http://10.0.0.8:7676/privet/register?action=start";
+const char kSamplePrivetToken[] = "MyToken";
+const char kEmptyPrivetToken[] = "\"\"";
+
+const char kSampleParsableJSON[] = "{ \"hello\" : 2 }";
+const char kSampleUnparsableJSON[] = "{ \"hello\" : }";
+const char kSampleJSONWithError[] = "{ \"error\" : \"unittest_example\" }";
+const net::HttpStatusCode kHTTPErrorCodeInvalidXPrivetToken =
+ static_cast<net::HttpStatusCode>(418);
+
+class MockPrivetURLLoaderDelegate : public PrivetURLLoader::Delegate {
+ public:
+ MockPrivetURLLoaderDelegate(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner)
+ : raw_mode_(false), task_runner_(task_runner) {}
+
+ ~MockPrivetURLLoaderDelegate() override {}
+
+ MOCK_METHOD2(OnError,
+ void(int response_code, PrivetURLLoader::ErrorType error));
+
+ void OnParsedJson(int response_code,
+ const base::DictionaryValue& value,
+ bool has_error) override {
+ saved_value_.reset(value.DeepCopy());
+ OnParsedJsonInternal(has_error);
+ }
+
+ MOCK_METHOD1(OnParsedJsonInternal, void(bool has_error));
+
+ void OnNeedPrivetToken(PrivetURLLoader::TokenCallback callback) override {
+ auto closure = base::BindOnce(
+ [](PrivetURLLoader::TokenCallback callback) {
+ std::move(callback).Run(kSamplePrivetToken);
+ },
+ std::move(callback));
+ task_runner_->PostTask(FROM_HERE, std::move(closure));
+ OnNeedPrivetTokenInternal();
+ }
+
+ MOCK_METHOD0(OnNeedPrivetTokenInternal, void());
+
+ bool OnRawData(bool response_is_file,
+ const std::string& data,
+ const base::FilePath& response_file) override {
+ if (!raw_mode_)
+ return false;
+
+ if (response_is_file) {
+ EXPECT_TRUE(response_file != base::FilePath());
+ OnFileInternal(response_file);
+ } else {
+ OnRawDataInternal(data);
+ }
+
+ return true;
+ }
+
+ MOCK_METHOD1(OnRawDataInternal, void(const std::string& data));
+
+ MOCK_METHOD1(OnFileInternal, void(const base::FilePath& response_file));
+
+ const base::DictionaryValue* saved_value() { return saved_value_.get(); }
+
+ void SetRawMode(bool raw_mode) { raw_mode_ = raw_mode; }
+
+ private:
+ std::unique_ptr<base::DictionaryValue> saved_value_;
+ bool raw_mode_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+};
+
+class PrivetURLLoaderTest : public ::testing::Test {
+ public:
+ PrivetURLLoaderTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::IO),
+ test_shared_url_loader_factory_(
+ base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
+ &test_url_loader_factory_)),
+ delegate_(scoped_task_environment_.GetMainThreadTaskRunner()) {
+ privet_url_loader_ = std::make_unique<PrivetURLLoader>(
+ GURL(kSamplePrivetURL), "POST", test_shared_url_loader_factory_,
+ TRAFFIC_ANNOTATION_FOR_TESTS, &delegate_);
+
+ PrivetURLLoader::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
+ kSamplePrivetToken);
+ }
+ ~PrivetURLLoaderTest() override {}
+
+ protected:
+ void StartPrivetURLLoaderAndCaptureHeaders(net::HttpRequestHeaders* headers) {
+ test_url_loader_factory_.SetInterceptor(base::BindLambdaForTesting(
+ [&](const network::ResourceRequest& request) {
+ *headers = request.headers;
+ }));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+ test_url_loader_factory_.SetInterceptor(base::NullCallback());
+ }
+
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
+ network::TestURLLoaderFactory test_url_loader_factory_;
+ scoped_refptr<network::WeakWrapperSharedURLLoaderFactory>
+ test_shared_url_loader_factory_;
+ std::unique_ptr<PrivetURLLoader> privet_url_loader_;
+ testing::StrictMock<MockPrivetURLLoaderDelegate> delegate_;
+};
+
+TEST_F(PrivetURLLoaderTest, FetchSuccess) {
+ test_url_loader_factory_.AddResponse(kSamplePrivetURL, kSampleParsableJSON);
+
+ EXPECT_CALL(delegate_, OnParsedJsonInternal(false));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+
+ const base::DictionaryValue* value = delegate_.saved_value();
+ int hello_value;
+ ASSERT_TRUE(value);
+ ASSERT_TRUE(value->GetInteger("hello", &hello_value));
+ EXPECT_EQ(2, hello_value);
+}
+
+// An interceptor used by the HTTP503Retry test that returns multiple failures
+// then success.
+class RetryURLLoaderInterceptor {
+ public:
+ explicit RetryURLLoaderInterceptor(
+ network::TestURLLoaderFactory* test_url_loader_factory)
+ : test_url_loader_factory_(test_url_loader_factory) {
+ test_url_loader_factory_->SetInterceptor(base::BindRepeating(
+ &RetryURLLoaderInterceptor::InterceptURL, base::Unretained(this)));
+ }
+
+ void InterceptURL(const network::ResourceRequest& resource_request) {
+ if (resource_request.url != kSamplePrivetURL)
+ return;
+ net::HttpStatusCode status =
+ counter_++ < 3 ? net::HTTP_SERVICE_UNAVAILABLE : net::HTTP_OK;
+ test_url_loader_factory_->AddResponse(kSamplePrivetURL, kSampleParsableJSON,
+ status);
+ }
+
+ private:
+ network::TestURLLoaderFactory* test_url_loader_factory_;
+ int counter_ = 0;
+ GURL url_;
+};
+
+TEST_F(PrivetURLLoaderTest, HTTP503Retry) {
+ PrivetURLLoader::RetryImmediatelyForTest retry_immediately;
+
+ // The interceptor simulates the service being unavailable and then available.
+ RetryURLLoaderInterceptor interceptor(&test_url_loader_factory_);
+
+ EXPECT_CALL(delegate_, OnParsedJsonInternal(false));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+}
+
+TEST_F(PrivetURLLoaderTest, ResponseCodeError) {
+ test_url_loader_factory_.AddResponse(kSamplePrivetURL, kSampleParsableJSON,
+ net::HTTP_NOT_FOUND);
+ EXPECT_CALL(delegate_, OnError(_, PrivetURLLoader::RESPONSE_CODE_ERROR));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+}
+
+TEST_F(PrivetURLLoaderTest, JsonParseError) {
+ test_url_loader_factory_.AddResponse(kSamplePrivetURL, kSampleUnparsableJSON);
+ EXPECT_CALL(delegate_, OnError(_, PrivetURLLoader::JSON_PARSE_ERROR));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+}
+
+TEST_F(PrivetURLLoaderTest, Header) {
+ net::HttpRequestHeaders request_headers;
+ StartPrivetURLLoaderAndCaptureHeaders(&request_headers);
+
+ std::string header_token;
+ ASSERT_TRUE(request_headers.GetHeader("X-Privet-Token", &header_token));
+ EXPECT_EQ(kSamplePrivetToken, header_token);
+}
+
+TEST_F(PrivetURLLoaderTest, Header2) {
+ PrivetURLLoader::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
+ "");
+ privet_url_loader_->SendEmptyPrivetToken();
+
+ net::HttpRequestHeaders request_headers;
+ StartPrivetURLLoaderAndCaptureHeaders(&request_headers);
+
+ std::string header_token;
+ ASSERT_TRUE(request_headers.GetHeader("X-Privet-Token", &header_token));
+ EXPECT_EQ(kEmptyPrivetToken, header_token);
+}
+
+TEST_F(PrivetURLLoaderTest, AlwaysSendEmpty) {
+ PrivetURLLoader::SetTokenForHost(GURL(kSamplePrivetURL).GetOrigin().spec(),
+ "SampleToken");
+
+ privet_url_loader_->SendEmptyPrivetToken();
+
+ net::HttpRequestHeaders request_headers;
+ StartPrivetURLLoaderAndCaptureHeaders(&request_headers);
+
+ std::string header_token;
+ ASSERT_TRUE(request_headers.GetHeader("X-Privet-Token", &header_token));
+ EXPECT_EQ(kEmptyPrivetToken, header_token);
+}
+
+TEST_F(PrivetURLLoaderTest, HandleInvalidToken) {
+ privet_url_loader_->SetMaxRetriesForTest(1);
+ test_url_loader_factory_.AddResponse(kSamplePrivetURL, kSampleParsableJSON,
+ kHTTPErrorCodeInvalidXPrivetToken);
+ EXPECT_CALL(delegate_, OnNeedPrivetTokenInternal());
+ EXPECT_CALL(delegate_, OnError(0, PrivetURLLoader::UNKNOWN_ERROR));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+}
+
+TEST_F(PrivetURLLoaderTest, FetchHasError) {
+ test_url_loader_factory_.AddResponse(kSamplePrivetURL, kSampleJSONWithError);
+ EXPECT_CALL(delegate_, OnParsedJsonInternal(true));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+}
+
+TEST_F(PrivetURLLoaderTest, LoaderRawData) {
+ delegate_.SetRawMode(true);
+ test_url_loader_factory_.AddResponse(kSamplePrivetURL, kSampleJSONWithError);
+ EXPECT_CALL(delegate_, OnRawDataInternal(kSampleJSONWithError));
+ privet_url_loader_->Start();
+ base::RunLoop().RunUntilIdle();
+}
+
+TEST_F(PrivetURLLoaderTest, RangeRequest) {
+ delegate_.SetRawMode(true);
+ privet_url_loader_->SetByteRange(200, 300);
+
+ net::HttpRequestHeaders request_headers;
+ StartPrivetURLLoaderAndCaptureHeaders(&request_headers);
+
+ std::string header_range;
+ ASSERT_TRUE(request_headers.GetHeader("Range", &header_range));
+ EXPECT_EQ("bytes=200-300", header_range);
+}
+
+TEST_F(PrivetURLLoaderTest, LoaderToFile) {
+ test_url_loader_factory_.AddResponse(kSamplePrivetURL, kSampleParsableJSON);
+ delegate_.SetRawMode(true);
+ privet_url_loader_->SaveResponseToFile();
+ // Downloading to a file bounce to another thread for the write so we cannot
+ // just use RunLoop::RunUntilIdle() and have to wait for the callback.
+ base::FilePath response_file;
+ base::RunLoop run_loop;
+ EXPECT_CALL(delegate_, OnFileInternal(testing::_))
+ .WillOnce(testing::Invoke([&](const base::FilePath& response_file_param) {
+ response_file = response_file_param;
+ run_loop.Quit();
+ }));
+ privet_url_loader_->Start();
+ run_loop.Run();
+
+ std::string file_content;
+ ASSERT_TRUE(base::ReadFileToString(response_file, &file_content));
+ EXPECT_EQ(kSampleParsableJSON, file_content);
+}
+
+} // namespace
+
+} // namespace cloud_print
diff --git a/chromium/chrome/browser/printing/pdf_nup_converter_client.cc b/chromium/chrome/browser/printing/pdf_nup_converter_client.cc
new file mode 100644
index 00000000000..b8adf0bf5e6
--- /dev/null
+++ b/chromium/chrome/browser/printing/pdf_nup_converter_client.cc
@@ -0,0 +1,92 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/printing/pdf_nup_converter_client.h"
+
+#include <utility>
+
+#include "base/bind.h"
+#include "chrome/services/printing/public/mojom/constants.mojom.h"
+#include "chrome/services/printing/public/mojom/pdf_nup_converter.mojom.h"
+#include "content/public/common/service_manager_connection.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace printing {
+
+PdfNupConverterClient::PdfNupConverterClient(content::WebContents* web_contents)
+ : web_contents_(web_contents) {}
+
+PdfNupConverterClient::~PdfNupConverterClient() {}
+
+void PdfNupConverterClient::DoNupPdfConvert(
+ int document_cookie,
+ uint32_t pages_per_sheet,
+ const gfx::Size& page_size,
+ std::vector<base::ReadOnlySharedMemoryRegion> pdf_page_regions,
+ mojom::PdfNupConverter::NupPageConvertCallback callback) {
+ auto& nup_converter = GetPdfNupConverterRequest(document_cookie);
+ nup_converter->NupPageConvert(pages_per_sheet, page_size,
+ std::move(pdf_page_regions),
+ std::move(callback));
+}
+
+void PdfNupConverterClient::DoNupPdfDocumentConvert(
+ int document_cookie,
+ uint32_t pages_per_sheet,
+ const gfx::Size& page_size,
+ base::ReadOnlySharedMemoryRegion src_pdf_document,
+ mojom::PdfNupConverter::NupDocumentConvertCallback callback) {
+ auto& nup_converter = GetPdfNupConverterRequest(document_cookie);
+ nup_converter->NupDocumentConvert(
+ pages_per_sheet, page_size, std::move(src_pdf_document),
+ base::BindOnce(&PdfNupConverterClient::OnDidNupPdfDocumentConvert,
+ base::Unretained(this), document_cookie,
+ std::move(callback)));
+}
+
+void PdfNupConverterClient::OnDidNupPdfDocumentConvert(
+ int document_cookie,
+ mojom::PdfNupConverter::NupDocumentConvertCallback callback,
+ mojom::PdfNupConverter::Status status,
+ base::ReadOnlySharedMemoryRegion region) {
+ RemovePdfNupConverterRequest(document_cookie);
+ std::move(callback).Run(status, std::move(region));
+}
+
+mojom::PdfNupConverterPtr& PdfNupConverterClient::GetPdfNupConverterRequest(
+ int cookie) {
+ auto iter = pdf_nup_converter_map_.find(cookie);
+ if (iter != pdf_nup_converter_map_.end()) {
+ DCHECK(iter->second.is_bound());
+ return iter->second;
+ }
+
+ auto iterator =
+ pdf_nup_converter_map_.emplace(cookie, CreatePdfNupConverterRequest())
+ .first;
+ return iterator->second;
+}
+
+void PdfNupConverterClient::RemovePdfNupConverterRequest(int cookie) {
+ size_t erased = pdf_nup_converter_map_.erase(cookie);
+ DCHECK_EQ(erased, 1u);
+}
+
+mojom::PdfNupConverterPtr
+PdfNupConverterClient::CreatePdfNupConverterRequest() {
+ if (!connector_) {
+ service_manager::mojom::ConnectorRequest connector_request;
+ connector_ = service_manager::Connector::Create(&connector_request);
+ content::ServiceManagerConnection::GetForProcess()
+ ->GetConnector()
+ ->BindConnectorRequest(std::move(connector_request));
+ }
+ mojom::PdfNupConverterPtr pdf_nup_converter;
+ connector_->BindInterface(printing::mojom::kChromePrintingServiceName,
+ &pdf_nup_converter);
+ pdf_nup_converter->SetWebContentsURL(web_contents_->GetLastCommittedURL());
+ return pdf_nup_converter;
+}
+
+} // namespace printing
diff --git a/chromium/chrome/browser/printing/pdf_nup_converter_client.h b/chromium/chrome/browser/printing/pdf_nup_converter_client.h
new file mode 100644
index 00000000000..33b0d84dd4d
--- /dev/null
+++ b/chromium/chrome/browser/printing/pdf_nup_converter_client.h
@@ -0,0 +1,69 @@
+// 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 CHROME_BROWSER_PRINTING_PDF_NUP_CONVERTER_CLIENT_H_
+#define CHROME_BROWSER_PRINTING_PDF_NUP_CONVERTER_CLIENT_H_
+
+#include <map>
+#include <memory>
+
+#include "chrome/services/printing/public/mojom/pdf_nup_converter.mojom.h"
+#include "content/public/browser/web_contents_user_data.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace printing {
+
+// Class to manage print requests and their communication with pdf N-up
+// converter service.
+// Each N-up conversion request has a separate interface pointer to connect
+// with remote service. The request and its printing results are tracked by its
+// document cookie.
+class PdfNupConverterClient
+ : public content::WebContentsUserData<PdfNupConverterClient> {
+ public:
+ explicit PdfNupConverterClient(content::WebContents* web_contents);
+ ~PdfNupConverterClient() override;
+
+ void DoNupPdfConvert(
+ int document_cookie,
+ uint32_t pages_per_sheet,
+ const gfx::Size& page_size,
+ std::vector<base::ReadOnlySharedMemoryRegion> pdf_page_regions,
+ mojom::PdfNupConverter::NupPageConvertCallback callback);
+ void DoNupPdfDocumentConvert(
+ int document_cookie,
+ uint32_t pages_per_sheet,
+ const gfx::Size& page_size,
+ base::ReadOnlySharedMemoryRegion src_pdf_document,
+ mojom::PdfNupConverter::NupDocumentConvertCallback callback);
+
+ private:
+ void OnDidNupPdfDocumentConvert(
+ int document_cookie,
+ mojom::PdfNupConverter::NupDocumentConvertCallback callback,
+ mojom::PdfNupConverter::Status status,
+ base::ReadOnlySharedMemoryRegion region);
+
+ // Get the request or create a new one if none exists.
+ mojom::PdfNupConverterPtr& GetPdfNupConverterRequest(int cookie);
+
+ // Remove an existing request from |pdf_nup_converter_map_|.
+ void RemovePdfNupConverterRequest(int cookie);
+
+ mojom::PdfNupConverterPtr CreatePdfNupConverterRequest();
+
+ std::unique_ptr<service_manager::Connector> connector_;
+
+ // Stores the mapping between document cookies and their corresponding
+ // requests.
+ std::map<int, mojom::PdfNupConverterPtr> pdf_nup_converter_map_;
+
+ content::WebContents* web_contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(PdfNupConverterClient);
+};
+
+} // namespace printing
+
+#endif // CHROME_BROWSER_PRINTING_PDF_NUP_CONVERTER_CLIENT_H_
diff --git a/chromium/chrome/browser/printing/pdf_to_emf_converter.cc b/chromium/chrome/browser/printing/pdf_to_emf_converter.cc
index d435f7e1581..fe66eceea05 100644
--- a/chromium/chrome/browser/printing/pdf_to_emf_converter.cc
+++ b/chromium/chrome/browser/printing/pdf_to_emf_converter.cc
@@ -19,7 +19,7 @@
#include "base/memory/ref_counted_delete_on_sequence.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
diff --git a/chromium/chrome/browser/printing/print_dialog_cloud.cc b/chromium/chrome/browser/printing/print_dialog_cloud.cc
index 34fb4950ad8..1186955b47b 100644
--- a/chromium/chrome/browser/printing/print_dialog_cloud.cc
+++ b/chromium/chrome/browser/printing/print_dialog_cloud.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "components/cloud_devices/common/cloud_devices_urls.h"
-#include "components/google/core/browser/google_util.h"
+#include "components/google/core/common/google_util.h"
#include "components/signin/core/browser/profile_management_switches.h"
#include "components/signin/core/browser/signin_header_helper.h"
#include "components/signin/core/browser/signin_metrics.h"
diff --git a/chromium/chrome/browser/printing/print_dialog_cloud_win.cc b/chromium/chrome/browser/printing/print_dialog_cloud_win.cc
index baecdb40dc6..f1cc30c43a9 100644
--- a/chromium/chrome/browser/printing/print_dialog_cloud_win.cc
+++ b/chromium/chrome/browser/printing/print_dialog_cloud_win.cc
@@ -17,7 +17,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
@@ -26,7 +26,7 @@
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/common/chrome_switches.h"
#include "components/cloud_devices/common/cloud_devices_urls.h"
-#include "components/google/core/browser/google_util.h"
+#include "components/google/core/common/google_util.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/message_port_provider.h"
diff --git a/chromium/chrome/browser/printing/print_job.cc b/chromium/chrome/browser/printing/print_job.cc
index e76a3f12e36..7f44a89164e 100644
--- a/chromium/chrome/browser/printing/print_job.cc
+++ b/chromium/chrome/browser/printing/print_job.cc
@@ -13,7 +13,7 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
@@ -42,8 +42,7 @@ void HoldRefCallback(scoped_refptr<PrintJob> job, base::OnceClosure callback) {
PrintJob::PrintJob()
: is_job_pending_(false),
is_canceling_(false),
- task_runner_(base::ThreadTaskRunnerHandle::Get()),
- quit_factory_(this) {
+ task_runner_(base::ThreadTaskRunnerHandle::Get()) {
DCHECK(base::MessageLoopForUI::IsCurrent());
}
@@ -166,11 +165,10 @@ void PrintJob::StartPrinting() {
void PrintJob::Stop() {
DCHECK(RunsTasksInCurrentSequence());
- if (quit_factory_.HasWeakPtrs()) {
+ if (quit_closure_) {
// In case we're running a nested run loop to wait for a job to finish,
// and we finished before the timeout, quit the nested loop right away.
- Quit();
- quit_factory_.InvalidateWeakPtrs();
+ std::move(quit_closure_).Run();
}
// Be sure to live long enough.
@@ -212,11 +210,12 @@ bool PrintJob::FlushJob(base::TimeDelta timeout) {
// Make sure the object outlive this message loop.
scoped_refptr<PrintJob> handle(this);
+ base::RunLoop loop(base::RunLoop::Type::kNestableTasksAllowed);
+ quit_closure_ = loop.QuitClosure();
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
- FROM_HERE, base::BindOnce(&PrintJob::Quit, quit_factory_.GetWeakPtr()),
- timeout);
+ FROM_HERE, loop.QuitClosure(), timeout);
- base::RunLoop(base::RunLoop::Type::kNestableTasksAllowed).Run();
+ loop.Run();
return true;
}
@@ -494,7 +493,7 @@ void PrintJob::ControlledWorkerShutdown() {
base::PostTaskWithTraitsAndReply(
FROM_HERE,
{base::MayBlock(), base::WithBaseSyncPrimitives(),
- base::TaskPriority::BACKGROUND,
+ base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
base::BindOnce(&PrintJobWorker::Stop, base::Unretained(worker_.get())),
base::BindOnce(&PrintJob::HoldUntilStopIsCalled, this));
@@ -516,10 +515,6 @@ bool PrintJob::PostTask(const base::Location& from_here,
void PrintJob::HoldUntilStopIsCalled() {
}
-void PrintJob::Quit() {
- base::RunLoop::QuitCurrentWhenIdleDeprecated();
-}
-
void PrintJob::set_settings(const PrintSettings& settings) {
settings_ = settings;
}
diff --git a/chromium/chrome/browser/printing/print_job.h b/chromium/chrome/browser/printing/print_job.h
index a8fdec34ca6..b3c4b793240 100644
--- a/chromium/chrome/browser/printing/print_job.h
+++ b/chromium/chrome/browser/printing/print_job.h
@@ -8,10 +8,10 @@
#include <memory>
#include <vector>
+#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -148,9 +148,6 @@ class PrintJob : public base::RefCountedThreadSafe<PrintJob>,
// eventual deadlock.
void ControlledWorkerShutdown();
- // Called at shutdown when running a nested run loop.
- void Quit();
-
void HoldUntilStopIsCalled();
#if defined(OS_WIN)
@@ -209,8 +206,8 @@ class PrintJob : public base::RefCountedThreadSafe<PrintJob>,
// thread.
scoped_refptr<base::SequencedTaskRunner> task_runner_;
- // Used at shutdown so that we can quit a nested run loop.
- base::WeakPtrFactory<PrintJob> quit_factory_;
+ // Holds the quit closure while running a nested RunLoop to flush tasks.
+ base::OnceClosure quit_closure_;
DISALLOW_COPY_AND_ASSIGN(PrintJob);
};
diff --git a/chromium/chrome/browser/printing/print_preview_data_service.cc b/chromium/chrome/browser/printing/print_preview_data_service.cc
index 7c4605b2b92..ab0b6986ee0 100644
--- a/chromium/chrome/browser/printing/print_preview_data_service.cc
+++ b/chromium/chrome/browser/printing/print_preview_data_service.cc
@@ -12,6 +12,22 @@
#include "base/stl_util.h"
#include "printing/print_job_constants.h"
+namespace {
+
+#if DCHECK_IS_ON()
+void ValidatePreviewData(const scoped_refptr<base::RefCountedMemory>& data) {
+ // PDFs are generally much bigger. This is just a sanity check on size.
+ DCHECK(data);
+ DCHECK_GE(data->size(), 50U);
+
+ static const char kPdfHeader[] = "%PDF-";
+ const char* content = data->front_as<const char>();
+ DCHECK_EQ(0, memcmp(content, kPdfHeader, strlen(kPdfHeader)));
+}
+#endif
+
+} // namespace
+
// PrintPreviewDataStore stores data for preview workflow and preview printing
// workflow.
//
@@ -50,6 +66,10 @@ class PrintPreviewDataStore {
if (IsInvalidIndex(index))
return;
+#if DCHECK_IS_ON()
+ ValidatePreviewData(data);
+#endif
+
page_data_map_[index] = std::move(data);
}
diff --git a/chromium/chrome/browser/printing/print_preview_dialog_controller.cc b/chromium/chrome/browser/printing/print_preview_dialog_controller.cc
index 0abdaa583c3..4ffe5d22e5a 100644
--- a/chromium/chrome/browser/printing/print_preview_dialog_controller.cc
+++ b/chromium/chrome/browser/printing/print_preview_dialog_controller.cc
@@ -29,7 +29,6 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/url_constants.h"
#include "components/guest_view/browser/guest_view_base.h"
-#include "components/printing/browser/print_manager_utils.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_controller.h"
@@ -377,7 +376,6 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog(
content::HostZoomMap::Get(preview_dialog->GetSiteInstance())
->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0);
PrintViewManager::CreateForWebContents(preview_dialog);
- CreateCompositeClientIfNeeded(preview_dialog);
extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
preview_dialog);
diff --git a/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc b/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
index db1126fc62b..3c4afe78ecd 100644
--- a/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
+++ b/chromium/chrome/browser/printing/print_preview_dialog_controller_browsertest.cc
@@ -129,7 +129,7 @@ void PluginsLoadedCallback(
}
bool GetPdfPluginInfo(content::WebPluginInfo* info) {
- base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe(
+ static const base::FilePath pdf_plugin_path(
ChromeContentClient::kPDFPluginPath);
return content::PluginService::GetInstance()->GetPluginInfoByPath(
pdf_plugin_path, info);
diff --git a/chromium/chrome/browser/printing/print_preview_message_handler.cc b/chromium/chrome/browser/printing/print_preview_message_handler.cc
index e1613a9b52a..7f4f4dad7b8 100644
--- a/chromium/chrome/browser/printing/print_preview_message_handler.cc
+++ b/chromium/chrome/browser/printing/print_preview_message_handler.cc
@@ -8,7 +8,6 @@
#include <memory>
#include <utility>
-#include <vector>
#include "base/bind.h"
#include "base/memory/ref_counted.h"
@@ -24,22 +23,17 @@
#include "components/printing/browser/print_composite_client.h"
#include "components/printing/browser/print_manager_utils.h"
#include "components/printing/common/print_messages.h"
-#include "components/services/pdf_compositor/public/cpp/pdf_service_mojo_types.h"
-#include "components/services/pdf_compositor/public/cpp/pdf_service_mojo_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
-#include "printing/page_size_margins.h"
#include "printing/print_job_constants.h"
#include "printing/print_settings.h"
using content::BrowserThread;
using content::WebContents;
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::PrintPreviewMessageHandler);
-
namespace printing {
namespace {
@@ -51,7 +45,7 @@ void StopWorker(int document_cookie) {
g_browser_process->print_job_manager()->queue();
scoped_refptr<PrinterQuery> printer_query =
queue->PopPrinterQuery(document_cookie);
- if (printer_query.get()) {
+ if (printer_query) {
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::BindOnce(&PrinterQuery::StopWorker, printer_query));
@@ -112,8 +106,8 @@ void PrintPreviewMessageHandler::OnRequestPrintPreview(
PrintPreviewUI::SetInitialParams(GetPrintPreviewDialog(), params);
}
-void PrintPreviewMessageHandler::OnDidGetPreviewPageCount(
- const PrintHostMsg_DidGetPreviewPageCount_Params& params,
+void PrintPreviewMessageHandler::OnDidStartPreview(
+ const PrintHostMsg_DidStartPreview_Params& params,
const PrintHostMsg_PreviewIds& ids) {
if (params.page_count <= 0) {
NOTREACHED();
@@ -125,7 +119,7 @@ void PrintPreviewMessageHandler::OnDidGetPreviewPageCount(
return;
print_preview_ui->ClearAllPreviewData();
- print_preview_ui->OnDidGetPreviewPageCount(params, ids.request_id);
+ print_preview_ui->OnDidStartPreview(params, ids.request_id);
}
void PrintPreviewMessageHandler::OnDidPreviewPage(
@@ -147,12 +141,9 @@ void PrintPreviewMessageHandler::OnDidPreviewPage(
// Use utility process to convert skia metafile to pdf.
client->DoCompositePageToPdf(
- params.document_cookie, render_frame_host, params.page_number,
- content.metafile_data_handle, content.data_size,
- content.subframe_content_info,
+ params.document_cookie, render_frame_host, page_number, content,
base::BindOnce(&PrintPreviewMessageHandler::OnCompositePdfPageDone,
- weak_ptr_factory_.GetWeakPtr(), params.page_number,
- ids));
+ weak_ptr_factory_.GetWeakPtr(), page_number, ids));
} else {
NotifyUIPreviewPageReady(
page_number, ids,
@@ -182,8 +173,7 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
DCHECK(client);
client->DoCompositeDocumentToPdf(
- params.document_cookie, render_frame_host, content.metafile_data_handle,
- content.data_size, content.subframe_content_info,
+ params.document_cookie, render_frame_host, content,
base::BindOnce(&PrintPreviewMessageHandler::OnCompositePdfDocumentDone,
weak_ptr_factory_.GetWeakPtr(),
params.expected_pages_count, ids));
@@ -262,9 +252,7 @@ void PrintPreviewMessageHandler::NotifyUIPreviewPageReady(
return;
// Don't bother notifying the UI if this request has been cancelled already.
- bool cancel = false;
- PrintPreviewUI::GetCurrentPrintPreviewStatus(ids, &cancel);
- if (cancel)
+ if (PrintPreviewUI::ShouldCancelRequest(ids))
return;
print_preview_ui->SetPrintPreviewDataForIndex(page_number,
@@ -293,7 +281,7 @@ void PrintPreviewMessageHandler::OnCompositePdfPageDone(
const PrintHostMsg_PreviewIds& ids,
mojom::PdfCompositor::Status status,
base::ReadOnlySharedMemoryRegion region) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != mojom::PdfCompositor::Status::SUCCESS) {
DLOG(ERROR) << "Compositing pdf failed with error " << status;
return;
@@ -308,7 +296,7 @@ void PrintPreviewMessageHandler::OnCompositePdfDocumentDone(
const PrintHostMsg_PreviewIds& ids,
mojom::PdfCompositor::Status status,
base::ReadOnlySharedMemoryRegion region) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (status != mojom::PdfCompositor::Status::SUCCESS) {
DLOG(ERROR) << "Compositing pdf failed with error " << status;
return;
@@ -336,8 +324,7 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
handled = true;
IPC_BEGIN_MESSAGE_MAP(PrintPreviewMessageHandler, message)
- IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPreviewPageCount,
- OnDidGetPreviewPageCount)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_DidStartPreview, OnDidStartPreview)
IPC_MESSAGE_HANDLER(PrintHostMsg_PrintPreviewFailed,
OnPrintPreviewFailed)
IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetDefaultPageLayout,
diff --git a/chromium/chrome/browser/printing/print_preview_message_handler.h b/chromium/chrome/browser/printing/print_preview_message_handler.h
index 6356792f29e..534f7e65143 100644
--- a/chromium/chrome/browser/printing/print_preview_message_handler.h
+++ b/chromium/chrome/browser/printing/print_preview_message_handler.h
@@ -5,23 +5,25 @@
#ifndef CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
#define CHROME_BROWSER_PRINTING_PRINT_PREVIEW_MESSAGE_HANDLER_H_
-#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/read_only_shared_memory_region.h"
-#include "base/memory/ref_counted_memory.h"
#include "base/memory/weak_ptr.h"
#include "components/services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
class PrintPreviewUI;
-struct PrintHostMsg_DidGetPreviewPageCount_Params;
struct PrintHostMsg_DidPreviewDocument_Params;
struct PrintHostMsg_DidPreviewPage_Params;
+struct PrintHostMsg_DidStartPreview_Params;
struct PrintHostMsg_PreviewIds;
struct PrintHostMsg_RequestPrintPreview_Params;
struct PrintHostMsg_SetOptionsFromDocument_Params;
+namespace base {
+class RefCountedMemory;
+}
+
namespace content {
class RenderFrameHost;
class WebContents;
@@ -47,9 +49,10 @@ class PrintPreviewMessageHandler
content::RenderFrameHost* render_frame_host) override;
private:
- explicit PrintPreviewMessageHandler(content::WebContents* web_contents);
friend class content::WebContentsUserData<PrintPreviewMessageHandler>;
+ explicit PrintPreviewMessageHandler(content::WebContents* web_contents);
+
// Gets the print preview dialog associated with the WebContents being
// observed.
content::WebContents* GetPrintPreviewDialog();
@@ -66,9 +69,8 @@ class PrintPreviewMessageHandler
const gfx::Rect& printable_area_in_points,
bool has_custom_page_size_style,
const PrintHostMsg_PreviewIds& ids);
- void OnDidGetPreviewPageCount(
- const PrintHostMsg_DidGetPreviewPageCount_Params& params,
- const PrintHostMsg_PreviewIds& ids);
+ void OnDidStartPreview(const PrintHostMsg_DidStartPreview_Params& params,
+ const PrintHostMsg_PreviewIds& ids);
void OnDidPreviewPage(content::RenderFrameHost* render_frame_host,
const PrintHostMsg_DidPreviewPage_Params& params,
const PrintHostMsg_PreviewIds& ids);
diff --git a/chromium/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc b/chromium/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc
index e8f0cfb878f..9e86ff0a545 100644
--- a/chromium/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc
+++ b/chromium/chrome/browser/printing/print_preview_pdf_generated_browsertest.cc
@@ -16,6 +16,7 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "base/containers/span.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -140,8 +141,7 @@ class PrintPreviewObserver : public WebContentsObserver {
bool OnMessageReceived(const IPC::Message& message) override {
IPC_BEGIN_MESSAGE_MAP(PrintPreviewObserver, message)
- IPC_MESSAGE_HANDLER(PrintHostMsg_DidGetPreviewPageCount,
- OnDidGetPreviewPageCount)
+ IPC_MESSAGE_HANDLER(PrintHostMsg_DidStartPreview, OnDidStartPreview)
IPC_END_MESSAGE_MAP()
return false;
}
@@ -267,11 +267,10 @@ class PrintPreviewObserver : public WebContentsObserver {
DISALLOW_COPY_AND_ASSIGN(UIDoneLoadingMessageHandler);
};
- // Called when the observer gets the IPC message stating that the page count
- // is ready.
- void OnDidGetPreviewPageCount(
- const PrintHostMsg_DidGetPreviewPageCount_Params& params,
- const PrintHostMsg_PreviewIds& ids) {
+ // Called when the observer gets the IPC message with the preview document's
+ // properties.
+ void OnDidStartPreview(const PrintHostMsg_DidStartPreview_Params& params,
+ const PrintHostMsg_PreviewIds& ids) {
WebContents* web_contents = GetDialog();
ASSERT_TRUE(web_contents);
Observe(web_contents);
@@ -341,8 +340,10 @@ class PrintPreviewPdfGeneratedBrowserTest : public InProcessBrowserTest {
std::string pdf_data;
ASSERT_TRUE(base::ReadFileToString(pdf_file_save_path_, &pdf_data));
- ASSERT_TRUE(chrome_pdf::GetPDFDocInfo(pdf_data.data(), pdf_data.size(),
- &num_pages, &max_width_in_points));
+
+ auto pdf_span = base::as_bytes(base::make_span(pdf_data));
+ ASSERT_TRUE(
+ chrome_pdf::GetPDFDocInfo(pdf_span, &num_pages, &max_width_in_points));
ASSERT_GT(num_pages, 0);
double max_width_in_pixels =
@@ -351,8 +352,7 @@ class PrintPreviewPdfGeneratedBrowserTest : public InProcessBrowserTest {
for (int i = 0; i < num_pages; ++i) {
double width_in_points, height_in_points;
ASSERT_TRUE(chrome_pdf::GetPDFPageSizeByIndex(
- pdf_data.data(), pdf_data.size(), i, &width_in_points,
- &height_in_points));
+ pdf_span, i, &width_in_points, &height_in_points));
double width_in_pixels = ConvertUnitDouble(
width_in_points, kPointsPerInch, kDpi);
@@ -386,10 +386,9 @@ class PrintPreviewPdfGeneratedBrowserTest : public InProcessBrowserTest {
settings.area.size().GetArea());
ASSERT_TRUE(chrome_pdf::RenderPDFPageToBitmap(
- pdf_data.data(), pdf_data.size(), i, page_bitmap_data.data(),
- settings.area.size().width(), settings.area.size().height(),
- settings.dpi.width(), settings.dpi.height(), settings.autorotate,
- settings.use_color));
+ pdf_span, i, page_bitmap_data.data(), settings.area.size().width(),
+ settings.area.size().height(), settings.dpi.width(),
+ settings.dpi.height(), settings.autorotate, settings.use_color));
FillPng(&page_bitmap_data, width_in_pixels, max_width_in_pixels,
settings.area.size().height());
bitmap_data.insert(bitmap_data.end(),
diff --git a/chromium/chrome/browser/printing/print_view_manager.cc b/chromium/chrome/browser/printing/print_view_manager.cc
index 482546828df..64ba0f74168 100644
--- a/chromium/chrome/browser/printing/print_view_manager.cc
+++ b/chromium/chrome/browser/printing/print_view_manager.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/printing/print_view_manager.h"
#include <map>
+#include <memory>
#include <utility>
#include "base/bind.h"
@@ -27,8 +28,6 @@
using content::BrowserThread;
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::PrintViewManager);
-
namespace {
// Keeps track of pending scripted print preview closures.
@@ -39,17 +38,16 @@ base::LazyInstance<std::map<content::RenderProcessHost*, base::Closure>>::Leaky
void EnableInternalPDFPluginForContents(int render_process_id,
int render_frame_id) {
// Always enable the internal PDF plugin for the print preview page.
- base::FilePath pdf_plugin_path = base::FilePath::FromUTF8Unsafe(
+ static const base::FilePath pdf_plugin_path(
ChromeContentClient::kPDFPluginPath);
-
- content::WebPluginInfo pdf_plugin;
- if (!content::PluginService::GetInstance()->GetPluginInfoByPath(
- pdf_plugin_path, &pdf_plugin)) {
+ auto* plugin_service = content::PluginService::GetInstance();
+ const content::PepperPluginInfo* info =
+ plugin_service->GetRegisteredPpapiPluginInfo(pdf_plugin_path);
+ if (!info)
return;
- }
ChromePluginServiceFilter::GetInstance()->OverridePluginForFrame(
- render_process_id, render_frame_id, GURL(), pdf_plugin);
+ render_process_id, render_frame_id, info->ToWebPluginInfo());
}
} // namespace
diff --git a/chromium/chrome/browser/printing/print_view_manager_base.cc b/chromium/chrome/browser/printing/print_view_manager_base.cc
index 9b0c15b3c50..169bfefa0e4 100644
--- a/chromium/chrome/browser/printing/print_view_manager_base.cc
+++ b/chromium/chrome/browser/printing/print_view_manager_base.cc
@@ -16,7 +16,7 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
@@ -47,7 +47,7 @@
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/system/buffer.h"
#include "printing/buildflags/buildflags.h"
-#include "printing/pdf_metafile_skia.h"
+#include "printing/metafile_skia.h"
#include "printing/print_settings.h"
#include "printing/printed_document.h"
#include "ui/base/l10n/l10n_util.h"
@@ -108,7 +108,6 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
: PrintManager(web_contents),
printing_rfh_(nullptr),
printing_succeeded_(false),
- inside_inner_message_loop_(false),
queue_(g_browser_process->print_job_manager()->queue()),
weak_ptr_factory_(this) {
DCHECK(queue_);
@@ -164,8 +163,7 @@ void PrintViewManagerBase::PrintDocument(
print_job_->StartConversionToNativeFormat(print_data, page_size, content_area,
offsets);
#else
- std::unique_ptr<PdfMetafileSkia> metafile =
- std::make_unique<PdfMetafileSkia>();
+ std::unique_ptr<MetafileSkia> metafile = std::make_unique<MetafileSkia>();
CHECK(metafile->InitFromData(print_data->front(), print_data->size()));
// Update the rendered document. It will send notifications to the listener.
@@ -316,10 +314,9 @@ void PrintViewManagerBase::OnDidPrintDocument(
}
auto* client = PrintCompositeClient::FromWebContents(web_contents());
- if (IsOopifEnabled() && !PrintingPdfContent(render_frame_host)) {
+ if (IsOopifEnabled() && print_job_->document()->settings().is_modifiable()) {
client->DoCompositeDocumentToPdf(
- params.document_cookie, render_frame_host, content.metafile_data_handle,
- content.data_size, content.subframe_content_info,
+ params.document_cookie, render_frame_host, content,
base::BindOnce(&PrintViewManagerBase::OnComposePdfDone,
weak_ptr_factory_.GetWeakPtr(), params));
return;
@@ -503,9 +500,9 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
// to actually spool the pages, only to have the renderer generate them. Run
// a message loop until we get our signal that the print job is satisfied.
// PrintJob will send a ALL_PAGES_REQUESTED after having received all the
- // pages it needs. RunLoop::QuitCurrentWhenIdleDeprecated() will be called as
- // soon as print_job_->document()->IsComplete() is true on either
- // ALL_PAGES_REQUESTED or in DidPrintDocument(). The check is done in
+ // pages it needs. |quit_inner_loop_| will be called as soon as
+ // print_job_->document()->IsComplete() is true on either ALL_PAGES_REQUESTED
+ // or in DidPrintDocument(). The check is done in
// ShouldQuitFromInnerMessageLoop().
// BLOCKS until all the pages are received. (Need to enable recursive task)
if (!RunInnerMessageLoop()) {
@@ -519,18 +516,16 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
void PrintViewManagerBase::ShouldQuitFromInnerMessageLoop() {
// Look at the reason.
DCHECK(print_job_->document());
- if (print_job_->document() &&
- print_job_->document()->IsComplete() &&
- inside_inner_message_loop_) {
+ if (print_job_->document() && print_job_->document()->IsComplete() &&
+ quit_inner_loop_) {
// We are in a message loop created by RenderAllMissingPagesNow. Quit from
// it.
- base::RunLoop::QuitCurrentWhenIdleDeprecated();
- inside_inner_message_loop_ = false;
+ std::move(quit_inner_loop_).Run();
}
}
bool PrintViewManagerBase::CreateNewPrintJob(PrinterQuery* query) {
- DCHECK(!inside_inner_message_loop_);
+ DCHECK(!quit_inner_loop_);
DCHECK(query);
// Disconnect the current |print_job_|.
@@ -575,9 +570,9 @@ void PrintViewManagerBase::TerminatePrintJob(bool cancel) {
if (cancel) {
// We don't need the metafile data anymore because the printing is canceled.
print_job_->Cancel();
- inside_inner_message_loop_ = false;
+ quit_inner_loop_.Reset();
} else {
- DCHECK(!inside_inner_message_loop_);
+ DCHECK(!quit_inner_loop_);
DCHECK(!print_job_->document() || print_job_->document()->IsComplete());
// WebContents is either dying or navigating elsewhere. We need to render
@@ -626,7 +621,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
run_loop.QuitWhenIdleClosure());
- inside_inner_message_loop_ = true;
+ quit_inner_loop_ = run_loop.QuitClosure();
// Need to enable recursive task.
{
@@ -634,12 +629,9 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
run_loop.Run();
}
- bool success = true;
- if (inside_inner_message_loop_) {
- // Ok we timed out. That's sad.
- inside_inner_message_loop_ = false;
- success = false;
- }
+ // If the inner-loop quit closure is still set then we timed out.
+ bool success = !quit_inner_loop_;
+ quit_inner_loop_.Reset();
return success;
}
diff --git a/chromium/chrome/browser/printing/print_view_manager_base.h b/chromium/chrome/browser/printing/print_view_manager_base.h
index fe0e0b5b065..542d061efc8 100644
--- a/chromium/chrome/browser/printing/print_view_manager_base.h
+++ b/chromium/chrome/browser/printing/print_view_manager_base.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/memory/scoped_refptr.h"
@@ -198,10 +199,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
// Indication of success of the print job.
bool printing_succeeded_;
- // Running an inner message loop inside RenderAllMissingPagesNow(). This means
- // we are _blocking_ until all the necessary pages have been rendered or the
- // print settings are being loaded.
- bool inside_inner_message_loop_;
+ // Set while running an inner message loop inside RenderAllMissingPagesNow().
+ // This means we are _blocking_ until all the necessary pages have been
+ // rendered or the print settings are being loaded.
+ base::OnceClosure quit_inner_loop_;
// Whether printing is enabled.
BooleanPrefMember printing_enabled_;
diff --git a/chromium/chrome/browser/printing/print_view_manager_basic.cc b/chromium/chrome/browser/printing/print_view_manager_basic.cc
index 6ac06d63531..b5a450b23d1 100644
--- a/chromium/chrome/browser/printing/print_view_manager_basic.cc
+++ b/chromium/chrome/browser/printing/print_view_manager_basic.cc
@@ -11,8 +11,6 @@
#include "printing/printing_context_android.h"
#endif
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::PrintViewManagerBasic);
-
namespace printing {
PrintViewManagerBasic::PrintViewManagerBasic(content::WebContents* web_contents)
diff --git a/chromium/chrome/browser/printing/print_view_manager_common.cc b/chromium/chrome/browser/printing/print_view_manager_common.cc
index 3d36b0b972b..faba5d96af7 100644
--- a/chromium/chrome/browser/printing/print_view_manager_common.cc
+++ b/chromium/chrome/browser/printing/print_view_manager_common.cc
@@ -4,12 +4,9 @@
#include "chrome/browser/printing/print_view_manager_common.h"
-#include "chrome/common/webui_url_constants.h"
#include "content/public/browser/render_frame_host.h"
#include "extensions/buildflags/buildflags.h"
-#include "extensions/common/constants.h"
#include "printing/buildflags/buildflags.h"
-#include "url/gurl.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "components/guest_view/browser/guest_view_manager.h"
@@ -120,12 +117,4 @@ content::RenderFrameHost* GetFrameToPrint(content::WebContents* contents) {
: contents->GetMainFrame();
}
-bool PrintingPdfContent(content::RenderFrameHost* rfh) {
- GURL url = rfh->GetLastCommittedURL();
- // Whether it is inside print preview or pdf plugin extension.
- return url.GetOrigin() == chrome::kChromeUIPrintURL ||
- (url.SchemeIs(extensions::kExtensionScheme) &&
- url.host_piece() == extension_misc::kPdfExtensionId);
-}
-
} // namespace printing
diff --git a/chromium/chrome/browser/printing/print_view_manager_common.h b/chromium/chrome/browser/printing/print_view_manager_common.h
index 96556eb0a96..16b4373214d 100644
--- a/chromium/chrome/browser/printing/print_view_manager_common.h
+++ b/chromium/chrome/browser/printing/print_view_manager_common.h
@@ -26,13 +26,6 @@ void StartBasicPrint(content::WebContents* contents);
// frame (this makes print selection work for multiple frames).
content::RenderFrameHost* GetFrameToPrint(content::WebContents* contents);
-// Whether the content sent to |rfh| is in PDF format.
-// When print preview dialog is printed, the content returned is always
-// in PDF format because print preview already stores the PDF file for
-// the previewed web page; When a full page PDF plugin is printed, the document
-// in it is in PDF format so will return in PDF also.
-bool PrintingPdfContent(content::RenderFrameHost* rfh);
-
} // namespace printing
#endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_
diff --git a/chromium/chrome/browser/printing/printer_manager_dialog_linux.cc b/chromium/chrome/browser/printing/printer_manager_dialog_linux.cc
index 1340045a976..47a23f44a1b 100644
--- a/chromium/chrome/browser/printing/printer_manager_dialog_linux.cc
+++ b/chromium/chrome/browser/printing/printer_manager_dialog_linux.cc
@@ -12,7 +12,7 @@
#include "base/nix/xdg_util.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_restrictions.h"
namespace {
diff --git a/chromium/chrome/browser/printing/printer_manager_dialog_win.cc b/chromium/chrome/browser/printing/printer_manager_dialog_win.cc
index ab3c2452932..6659071d8cf 100644
--- a/chromium/chrome/browser/printing/printer_manager_dialog_win.cc
+++ b/chromium/chrome/browser/printing/printer_manager_dialog_win.cc
@@ -10,7 +10,7 @@
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread.h"
namespace {
diff --git a/chromium/chrome/browser/printing/printing_message_filter.cc b/chromium/chrome/browser/printing/printing_message_filter.cc
index 54866fdcdb6..67079421bf4 100644
--- a/chromium/chrome/browser/printing/printing_message_filter.cc
+++ b/chromium/chrome/browser/printing/printing_message_filter.cc
@@ -364,7 +364,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintingMessageFilter::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids,
bool* cancel) {
- PrintPreviewUI::GetCurrentPrintPreviewStatus(ids, cancel);
+ *cancel = PrintPreviewUI::ShouldCancelRequest(ids);
}
#endif
diff --git a/chromium/chrome/browser/profiling_host/BUILD.gn b/chromium/chrome/browser/profiling_host/BUILD.gn
index 853b995581d..9fd1b0b4680 100644
--- a/chromium/chrome/browser/profiling_host/BUILD.gn
+++ b/chromium/chrome/browser/profiling_host/BUILD.gn
@@ -16,6 +16,7 @@ static_library("profiling_host") {
deps = [
"//base",
+ "//chrome/common:non_code_constants",
"//components/heap_profiling",
"//components/services/heap_profiling/public/cpp",
"//content/public/browser",
diff --git a/chromium/chrome/browser/budget_service/BUILD.gn b/chromium/chrome/browser/push_messaging/BUILD.gn
index 7f63e2f1ec6..7f63e2f1ec6 100644
--- a/chromium/chrome/browser/budget_service/BUILD.gn
+++ b/chromium/chrome/browser/push_messaging/BUILD.gn
diff --git a/chromium/chrome/browser/renderer_host/pepper/device_id_fetcher.cc b/chromium/chrome/browser/renderer_host/pepper/device_id_fetcher.cc
index b00a8b9a55b..d2015629961 100644
--- a/chromium/chrome/browser/renderer_host/pepper/device_id_fetcher.cc
+++ b/chromium/chrome/browser/renderer_host/pepper/device_id_fetcher.cc
@@ -7,7 +7,7 @@
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
@@ -125,7 +125,7 @@ void DeviceIDFetcher::CheckPrefsOnUIThread() {
// Try the legacy path first for ChromeOS. We pass the new salt in as well
// in case the legacy id doesn't exist.
base::PostTaskWithTraits(FROM_HERE,
- {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&DeviceIDFetcher::LegacyComputeAsync,
this, profile->GetPath(), salt));
#else
diff --git a/chromium/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom b/chromium/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom
index 3682bf2567c..fc04dae81ec 100644
--- a/chromium/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom
+++ b/chromium/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom
@@ -50,3 +50,15 @@ enum LifecycleUnitStateChangeReason {
// Initiated by a user action (e.g. changing focus, clicking reload).
USER_INITIATED = 4,
};
+
+// An enumeration of reasons for a discard.
+enum LifecycleUnitDiscardReason {
+ // The discard is requested from outside of TabManager (e.g. by an extension).
+ EXTERNAL = 0,
+ // The discard is requested proactively by TabManager when the system is in a
+ // good state.
+ PROACTIVE = 1,
+ // The discard is requested urgently by TabManager when the system is in a
+ // critical condition.
+ URGENT = 2,
+};
diff --git a/chromium/chrome/browser/resources/BUILD.gn b/chromium/chrome/browser/resources/BUILD.gn
index 9806bf10ff1..bb7c0b6bca4 100644
--- a/chromium/chrome/browser/resources/BUILD.gn
+++ b/chromium/chrome/browser/resources/BUILD.gn
@@ -23,13 +23,13 @@ if (closure_compile) {
"pdf:closure_compile",
"print_preview:closure_compile",
"settings:closure_compile",
+ "signin/dice_sync_confirmation:closure_compile",
]
}
if (is_chromeos) {
deps += [
"chromeos:closure_compile",
"md_user_manager:closure_compile",
- "signin/dice_sync_confirmation:closure_compile",
"welcome/dice_welcome:closure_compile",
]
}
diff --git a/chromium/chrome/browser/resources/about_sys/about_sys.css b/chromium/chrome/browser/resources/about_sys/about_sys.css
index b8ea3b7c14b..eabfa210925 100644
--- a/chromium/chrome/browser/resources/about_sys/about_sys.css
+++ b/chromium/chrome/browser/resources/about_sys/about_sys.css
@@ -30,12 +30,12 @@ h1 {
}
h2 {
- -webkit-padding-end: 1em;
- -webkit-padding-start: 0;
color: rgb(58, 117, 189);
display: inline-block;
font-size: 110%;
font-weight: normal;
+ padding-inline-end: 1em;
+ padding-inline-start: 0;
}
#header {
@@ -76,11 +76,11 @@ div#header h1::before {
}
#header p {
- -webkit-padding-start: 0.4em;
color: white;
display: inline;
font-size: 84%;
font-style: italic;
+ padding-inline-start: 0.4em;
}
.list {
@@ -104,11 +104,11 @@ div#header h1::before {
.list tr td:nth-last-child(1),
.list tr th:nth-last-child(1) {
- -webkit-padding-end: 1em;
+ padding-inline-end: 1em;
}
.list:not(.filtered) .tab .name {
- -webkit-padding-start: 1.5em;
+ padding-inline-start: 1.5em;
}
.list .name {
@@ -144,7 +144,7 @@ html[dir='rtl'] .number-collapsed {
tr > *:nth-child(1),
tr > *:nth-child(2) {
- -webkit-border-end: 1px solid rgb(181, 198, 222);
+ border-inline-end: 1px solid rgb(181, 198, 222);
}
.name {
diff --git a/chromium/chrome/browser/resources/accessibility/OWNERS b/chromium/chrome/browser/resources/accessibility/OWNERS
new file mode 100644
index 00000000000..697dba28c57
--- /dev/null
+++ b/chromium/chrome/browser/resources/accessibility/OWNERS
@@ -0,0 +1,4 @@
+file://ui/accessibility/OWNERS
+
+# TEAM: chromium-accessibility@chromium.org
+# COMPONENT: Internals>Accessibility
diff --git a/chromium/chrome/browser/resources/accessibility/accessibility.css b/chromium/chrome/browser/resources/accessibility/accessibility.css
new file mode 100644
index 00000000000..63359c25d3f
--- /dev/null
+++ b/chromium/chrome/browser/resources/accessibility/accessibility.css
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+body {
+ font-family: Arial, sans-serif;
+ font-size: 12px;
+ margin: 10px 20px;
+ min-width: 47em;
+ padding-bottom: 65px;
+}
+
+img {
+ float: left;
+ height: 16px;
+ padding-right: 5px;
+ width: 16px;
+}
+
+.row {
+ border-bottom: 1px solid #A0A0A0;
+ padding: 5px;
+}
+
+.url {
+ color: #A0A0A0;
+}
+
+p {
+ line-height: 1.2em;
+}
+
+.columns {
+ display: flex;
+}
+
+.column {
+ flex-basis: 50%;
+}
+
+.checkbox-row {
+ align-items: center;
+ display: flex;
+}
+
+.checkbox-wrapper {
+ flex-grow: 0;
+ margin: 0 0 2px 0;
+ padding: 0;
+ width: 32px;
+}
+
+.secondary {
+ color: #696969;
+ margin: 0 0 12px 32px;
+}
+
+a {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ margin-left: 20px;
+}
+
+label {
+ flex-grow: 1;
+ margin: 0 0 2px 0;
+ padding: 0;
+}
+
+label.disabled {
+ color: #696969;
+}
+
+label input[type='checkbox'] {
+ margin-right: 6px;
+}
diff --git a/chromium/chrome/browser/resources/accessibility/accessibility.html b/chromium/chrome/browser/resources/accessibility/accessibility.html
new file mode 100644
index 00000000000..1b7543d2ccc
--- /dev/null
+++ b/chromium/chrome/browser/resources/accessibility/accessibility.html
@@ -0,0 +1,152 @@
+<!doctype html>
+<html>
+<!--
+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.
+-->
+<head>
+ <meta charset="utf-8">
+ <title>Accessibility Internals</title>
+ <link rel="stylesheet" href="chrome://resources/css/chrome_shared.css">
+ <link rel="stylesheet" href="accessibility.css">
+ <script src="chrome://resources/js/cr.js"></script>
+ <script src="chrome://resources/js/load_time_data.js"></script>
+ <script src="chrome://resources/js/action_link.js"></script>
+ <script src="chrome://resources/js/util.js"></script>
+ <script src="strings.js"></script>
+ <script src="accessibility.js"></script>
+</head>
+<body>
+ <h1>Accessibility Internals</h1>
+
+ <div class="columns">
+ <div class="column">
+ <h2>Global accessibility mode:</h2>
+
+ <div class="checkbox-row">
+ <span class="checkbox-wrapper">
+ <input type="checkbox" id="native"
+ aria-describedby="native_secondary">
+ </span>
+ <label for="native">
+ Native accessibility API support
+ </label>
+ </div>
+ <div id="native_secondary" class="secondary">
+ Allows Chrome to be controlled via native accessibility APIs
+ specific to this platform.
+ </div>
+
+ <div class="checkbox-row">
+ <span class="checkbox-wrapper">
+ <input type="checkbox" id="web"
+ aria-describedby="web_secondary">
+ </span>
+ <label for="web">
+ Web accessibility
+ </label>
+ </div>
+ <div id="web_secondary" class="secondary">
+ Accessibility support is enabled for web content.
+ </div>
+
+ <div class="checkbox-row">
+ <span class="checkbox-wrapper">
+ <input type="checkbox" id="text"
+ aria-describedby="text_secondary">
+ </span>
+ <label for="text">
+ Text metrics
+ </label>
+ </div>
+ <div id="text_secondary" class="secondary">
+ Enables support for querying line breaks and the bounding
+ box of arbitrary character ranges.
+ </div>
+
+ <div class="checkbox-row">
+ <span class="checkbox-wrapper">
+ <input type="checkbox" id="screenreader"
+ aria-describedby="screenreader_secondary">
+ </span>
+ <label for="screenreader">
+ Screen reader support
+ </label>
+ </div>
+ <div id="screenreader_secondary" class="secondary">
+ Exposes accessibility APIs typically needed only by
+ screen readers.
+ </div>
+
+ <div class="checkbox-row">
+ <span class="checkbox-wrapper">
+ <input type="checkbox" id="html"
+ aria-describedby="html_secondary">
+ </span>
+ <label for="html">
+ HTML
+ </label>
+ </div>
+ <div id="html_secondary" class="secondary">
+ Exposes HTML tag names and attributes via accessibility APIs.
+ </div>
+
+ <h2>Options:</h2>
+
+ <div class="checkbox-row">
+ <span class="checkbox-wrapper">
+ <input type="checkbox" id="internal"
+ aria-describedby="internal_secondary">
+ </span>
+ <label for="internal">
+ Internal
+ </label>
+ </div>
+ <div id="internal_secondary" class="secondary">
+ Show internal accessibility tree instead of native
+ </div>
+
+ </div>
+ <div class="column">
+ <p>
+ Accessibility features in Chrome are off by default and enabled
+ automatically on-demand. Changes to this page only take effect
+ until the next time Chrome is restarted.
+ </p>
+ <p>
+ To force accessibility to be enabled at launch, run Chrome with this
+ command-line flag:
+ <pre>--force-renderer-accessibility</pre>
+ </p>
+ <p>
+ To disable accessibility, run Chrome with this flag:
+ <pre>--disable-renderer-accessibility</pre>
+ </p>
+ </div>
+ </div>
+
+ <!--
+ <div id="global" class="row">Global accessibility mode:
+ <a is="action-link" role="button" id="toggle_global"
+ aria-labelledby="global"></a>
+ </div>
+
+ <div id="internal" class="row">
+ Show internal accessibility tree instead of native:
+ <a is="action-link" role="button" id="toggle_internal"
+ aria-labelledby="internal"></a>
+ </div>
+-->
+ <h2>Chrome Native UI:</h2>
+ <div id="native_ui">
+ <a is="action-link" tabindex="0" role="button" id="showNativeUI">
+ show accessibility tree
+ </a> after <input type="number" value="0" id="native_ui_delay"> ms
+ </div>
+
+ <h2>Pages:</h2>
+ <div id="pages" class="list"></div>
+ <script src="chrome://resources/js/i18n_template.js"></script>
+</body>
+</html>
diff --git a/chromium/chrome/browser/resources/accessibility/accessibility.js b/chromium/chrome/browser/resources/accessibility/accessibility.js
new file mode 100644
index 00000000000..617f9b84809
--- /dev/null
+++ b/chromium/chrome/browser/resources/accessibility/accessibility.js
@@ -0,0 +1,318 @@
+// 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.
+
+cr.define('accessibility', function() {
+ 'use strict';
+
+ // Note: keep these values in sync with the values in
+ // content/common/accessibility_mode_enums.h
+ const AXMode = {
+ kNativeAPIs: 1 << 0,
+ kWebContents: 1 << 1,
+ kInlineTextBoxes: 1 << 2,
+ kScreenReader: 1 << 3,
+ kHTML: 1 << 4,
+
+ get kAXModeWebContentsOnly() {
+ return AXMode.kWebContents | AXMode.kInlineTextBoxes |
+ AXMode.kScreenReader | AXMode.kHTML;
+ },
+
+ get kAXModeComplete() {
+ return AXMode.kNativeAPIs | AXMode.kWebContents |
+ AXMode.kInlineTextBoxes | AXMode.kScreenReader | AXMode.kHTML;
+ }
+ };
+
+ function requestData() {
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', 'targets-data.json', false);
+ xhr.send(null);
+ if (xhr.status === 200) {
+ console.log(xhr.responseText);
+ return JSON.parse(xhr.responseText);
+ }
+ return [];
+ }
+
+ function toggleAccessibility(data, element, mode) {
+ chrome.send(
+ 'toggleAccessibility',
+ [String(data.processId), String(data.routeId), mode]);
+ document.location.reload();
+ }
+
+ function requestWebContentsTree(data, element) {
+ chrome.send(
+ 'requestWebContentsTree',
+ [String(data.processId), String(data.routeId)]);
+ }
+
+ function initialize() {
+ console.log('initialize');
+ var data = requestData();
+
+ bindCheckbox('native', data['native']);
+ bindCheckbox('web', data['web']);
+ bindCheckbox('text', data['text']);
+ bindCheckbox('screenreader', data['screenreader']);
+ bindCheckbox('html', data['html']);
+ bindCheckbox('internal', data['internal']);
+
+ $('pages').textContent = '';
+
+ var list = data['list'];
+ for (var i = 0; i < list.length; i++) {
+ addToPagesList(list[i]);
+ }
+
+ var showNativeUI = $('showNativeUI');
+ showNativeUI.addEventListener('click', function() {
+ var delay = $('native_ui_delay').value;
+ setTimeout(function() {
+ chrome.send('requestNativeUITree');
+ }, delay);
+ });
+ }
+
+ function bindCheckbox(name, value) {
+ if (value == 'on')
+ $(name).checked = true;
+ if (value == 'disabled') {
+ $(name).disabled = true;
+ $(name).labels[0].classList.add('disabled');
+ }
+ $(name).addEventListener('change', function() {
+ chrome.send('setGlobalFlag', [name, $(name).checked]);
+ document.location.reload();
+ });
+ }
+
+ function addToPagesList(data) {
+ // TODO: iterate through data and pages rows instead
+ var id = data['processId'] + '.' + data['routeId'];
+ var row = document.createElement('div');
+ row.className = 'row';
+ row.id = id;
+ formatRow(row, data);
+
+ row.processId = data.processId;
+ row.routeId = data.routeId;
+
+ var list = $('pages');
+ list.appendChild(row);
+ }
+
+ function formatRow(row, data) {
+ if (!('url' in data)) {
+ if ('error' in data) {
+ row.appendChild(createErrorMessageElement(data, row));
+ return;
+ }
+ }
+
+ var siteInfo = document.createElement('div');
+ var properties = ['favicon_url', 'name', 'url'];
+ for (var j = 0; j < properties.length; j++)
+ siteInfo.appendChild(formatValue(data, properties[j]));
+ row.appendChild(siteInfo);
+
+ row.appendChild(createModeElement(AXMode.kNativeAPIs, data));
+ row.appendChild(createModeElement(AXMode.kWebContents, data));
+ row.appendChild(createModeElement(AXMode.kInlineTextBoxes, data));
+ row.appendChild(createModeElement(AXMode.kScreenReader, data));
+ row.appendChild(createModeElement(AXMode.kHTML, data));
+
+ row.appendChild(document.createTextNode(' | '));
+
+ if ('tree' in data) {
+ row.appendChild(createShowAccessibilityTreeElement(data, row, true));
+ row.appendChild(createHideAccessibilityTreeElement(row.id));
+ row.appendChild(createAccessibilityTreeElement(data));
+ } else {
+ row.appendChild(createShowAccessibilityTreeElement(data, row, false));
+ if ('error' in data)
+ row.appendChild(createErrorMessageElement(data, row));
+ }
+ }
+
+ function insertHeadingInline(parentElement, headingText) {
+ var h4 = document.createElement('h4');
+ h4.textContent = headingText;
+ h4.style.display = 'inline';
+ parentElement.appendChild(h4);
+ }
+
+ function formatValue(data, property) {
+ var value = data[property];
+
+ if (property == 'favicon_url') {
+ var faviconElement = document.createElement('img');
+ if (value)
+ faviconElement.src = value;
+ faviconElement.alt = '';
+ return faviconElement;
+ }
+
+ var text = value ? String(value) : '';
+ if (text.length > 100)
+ text = text.substring(0, 100) + '\u2026'; // ellipsis
+
+ var span = document.createElement('span');
+ var content = ' ' + text + ' ';
+ if (property == 'name') {
+ insertHeadingInline(span, content);
+ } else {
+ span.textContent = content;
+ }
+ span.className = property;
+ return span;
+ }
+
+ function getNameForAccessibilityMode(mode) {
+ switch (mode) {
+ case AXMode.kNativeAPIs:
+ return 'native';
+ case AXMode.kWebContents:
+ return 'web';
+ case AXMode.kInlineTextBoxes:
+ return 'inline text';
+ case AXMode.kScreenReader:
+ return 'screen reader';
+ case AXMode.kHTML:
+ return 'html';
+ }
+ return 'unknown';
+ }
+
+ function createModeElement(mode, data) {
+ var currentMode = data['a11y_mode'];
+ var link = document.createElement('a', 'action-link');
+ link.setAttribute('role', 'button');
+
+ var stateText = ((currentMode & mode) != 0) ? 'true' : 'false';
+ link.textContent = getNameForAccessibilityMode(mode) + ': ' + stateText;
+ link.setAttribute('aria-pressed', stateText);
+ link.addEventListener(
+ 'click', toggleAccessibility.bind(this, data, link, mode));
+ return link;
+ }
+
+ function createShowAccessibilityTreeElement(data, row, opt_refresh) {
+ var link = document.createElement('a', 'action-link');
+ link.setAttribute('role', 'button');
+ if (opt_refresh)
+ link.textContent = 'refresh accessibility tree';
+ else
+ link.textContent = 'show accessibility tree';
+ link.id = row.id + ':showTree';
+ link.addEventListener(
+ 'click', requestWebContentsTree.bind(this, data, link));
+ return link;
+ }
+
+ function createHideAccessibilityTreeElement(id) {
+ var link = document.createElement('a', 'action-link');
+ link.setAttribute('role', 'button');
+ link.textContent = 'hide accessibility tree';
+ link.addEventListener('click', function() {
+ $(id + ':showTree').textContent = 'show accessibility tree';
+ var existingTreeElements = $(id).getElementsByTagName('pre');
+ for (var i = 0; i < existingTreeElements.length; i++)
+ $(id).removeChild(existingTreeElements[i]);
+ var row = $(id);
+ while (row.lastChild != $(id + ':showTree'))
+ row.removeChild(row.lastChild);
+ });
+ return link;
+ }
+
+ function createErrorMessageElement(data) {
+ var errorMessageElement = document.createElement('div');
+ var errorMessage = data.error;
+ errorMessageElement.innerHTML = errorMessage + '&nbsp;';
+ var closeLink = document.createElement('a');
+ closeLink.href = '#';
+ closeLink.textContent = '[close]';
+ closeLink.addEventListener('click', function() {
+ var parentElement = errorMessageElement.parentElement;
+ parentElement.removeChild(errorMessageElement);
+ if (parentElement.childElementCount == 0)
+ parentElement.parentElement.removeChild(parentElement);
+ });
+ errorMessageElement.appendChild(closeLink);
+ return errorMessageElement;
+ }
+
+ // Called from C++
+ function showTree(data) {
+ var id = data.processId + '.' + data.routeId;
+ var row = $(id);
+ if (!row)
+ return;
+
+ row.textContent = '';
+ formatRow(row, data);
+ }
+
+ // Called from C++
+ function showNativeUITree(data) {
+ var treeContainer = document.querySelector('#native_ui div');
+ if (!treeContainer) {
+ var treeContainer = document.createElement('div');
+ $('native_ui').appendChild(treeContainer);
+ }
+
+ var dstIds =
+ new Set(Array.prototype.map.call(treeContainer.children, el => el.id));
+ data.forEach(function(browser) {
+ var srcId = 'browser_' + browser.id;
+ if (dstIds.has(srcId)) {
+ // Update browser windows in place.
+ dstIds.delete(srcId);
+ var title = document.querySelector('#' + srcId + ' h4');
+ title.textContent = browser.title;
+ var tree = document.querySelector('#' + srcId + ' pre');
+ tree.textContent = browser.tree;
+ } else {
+ // Add new browser windows.
+ var browserElement = createNativeUITreeElement(browser);
+ treeContainer.appendChild(browserElement);
+ }
+ });
+ dstIds.forEach(function(dstId) {
+ // Remove browser windows that no longer exist.
+ var browserElement = document.querySelector('#' + dstId);
+ treeContainer.removeChild(browserElement);
+ });
+ }
+
+ function createNativeUITreeElement(browser) {
+ var details = document.createElement('details');
+ var summary = document.createElement('summary');
+ var treeElement = document.createElement('pre');
+ insertHeadingInline(summary, browser.title);
+ treeElement.textContent = browser.tree;
+ details.id = 'browser_' + browser.id;
+ details.appendChild(summary);
+ details.appendChild(treeElement);
+ return details;
+ }
+
+ function createAccessibilityTreeElement(data) {
+ var treeElement = document.createElement('pre');
+ var tree = data.tree;
+ treeElement.textContent = tree;
+ return treeElement;
+ }
+
+ // These are the functions we export so they can be called from C++.
+ return {
+ initialize: initialize,
+ showTree: showTree,
+ showNativeUITree: showNativeUITree
+ };
+});
+
+document.addEventListener('DOMContentLoaded', accessibility.initialize);
diff --git a/chromium/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css b/chromium/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css
index 55b21cbfd64..5cb1cd22553 100644
--- a/chromium/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css
+++ b/chromium/chrome/browser/resources/bluetooth_internals/bluetooth_internals.css
@@ -98,12 +98,12 @@ list .spinner {
/* Page container */
#page-container {
- -webkit-margin-start: var(--sidebar-width);
+ margin-inline-start: var(--sidebar-width);
}
@media screen and (max-width: 600px) {
#page-container {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
}
}
@@ -117,13 +117,13 @@ list .spinner {
}
#page-container .header-extras {
- -webkit-margin-end: var(--section-padding);
- -webkit-margin-start: var(--sidebar-width);
align-items: flex-end;
display: flex;
height: var(--header-height);
justify-content: flex-end;
left: 0;
+ margin-inline-end: var(--section-padding);
+ margin-inline-start: var(--sidebar-width);
position: fixed;
right: 0;
top: 0;
@@ -212,21 +212,21 @@ list .spinner {
}
.sidebar-content button {
- -webkit-padding-start: var(--section-padding);
background-color: transparent;
border: 0;
color: #999;
cursor: pointer;
font: inherit;
height: 40px;
+ padding-inline-start: var(--section-padding);
text-align: start;
width: 100%;
}
.sidebar-content .selected button {
- -webkit-border-start: 6px solid rgb(78, 87, 100);
- -webkit-padding-start: 10px;
+ border-inline-start: 6px solid rgb(78, 87, 100);
color: rgb(70, 78, 90);
+ padding-inline-start: 10px;
}
.sidebar-content button:hover {
@@ -347,10 +347,10 @@ table .removed {
}
.snackbar a {
- -webkit-margin-start: auto;
display: flex;
flex-direction: column;
justify-content: center;
+ margin-inline-start: auto;
text-transform: uppercase;
}
@@ -370,8 +370,8 @@ table .removed {
}
.snackbar div {
- -webkit-margin-end: 24px;
align-self: flex-start;
+ margin-inline-end: 24px;
}
.snackbar a {
@@ -408,7 +408,7 @@ table .removed {
}
.object-fieldset .status div:first-child {
- -webkit-margin-end: 1em;
+ margin-inline-end: 1em;
white-space: nowrap;
}
@@ -430,7 +430,7 @@ table .removed {
/* Device Details Page */
.device-details-page section,
.info-container fieldset {
- -webkit-margin-start: 1em;
+ margin-inline-start: 1em;
}
/* Value Control */
diff --git a/chromium/chrome/browser/resources/certificate_viewer.css b/chromium/chrome/browser/resources/certificate_viewer.css
index d48a11ba4a4..84bd0412aa1 100644
--- a/chromium/chrome/browser/resources/certificate_viewer.css
+++ b/chromium/chrome/browser/resources/certificate_viewer.css
@@ -37,7 +37,7 @@ h3 {
#usages,
#cert-field-value {
- -webkit-padding-start: 15px;
+ padding-inline-start: 15px;
white-space: pre-wrap;
}
@@ -56,9 +56,9 @@ h3 {
#usages,
.groups > div > div {
- -webkit-padding-start: 20px;
color: #787878;
line-height: 18px;
+ padding-inline-start: 20px;
}
.attribute {
@@ -121,8 +121,8 @@ tabpanel {
}
#export {
- -webkit-margin-start: 1px;
float: right;
margin-bottom: 20px;
+ margin-inline-start: 1px;
margin-top: 10px;
}
diff --git a/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn b/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn
index 571af2a38f9..8a5a05a7181 100644
--- a/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn
@@ -9,6 +9,7 @@ optimize_webui("build") {
host = "bluetooth_pairing_dialog"
html_in_files = [ "bluetooth_pairing_dialog.html" ]
html_out_files = [ "vulcanized.html" ]
+ html_out_files_polymer2 = [ "vulcanized.p2.html" ]
input = rebase_path(".", root_build_dir)
js_out_files = [ "crisper.js" ]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn b/chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn
index 840635e5137..33abaf33d30 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/BUILD.gn
@@ -7,6 +7,7 @@ import("//chrome/common/features.gni")
import("//components/nacl/features.gni")
import("//testing/test.gni")
import("//chrome/test/base/js2gtest.gni")
+import("//third_party/closure_compiler/compile_js.gni")
import("run_jsbundler.gni")
assert(is_chromeos)
@@ -14,7 +15,7 @@ assert(is_chromeos)
declare_args() {
# Whether to compress the main Chromevox javascript files or load the
# modules individually from source files.
- chromevox_compress_js = !is_debug
+ chromevox_compress_js = true
}
closure_library_dir =
@@ -39,7 +40,6 @@ chromevox_modules = [
"chromevox/background/injected_script_loader.js",
"chromevox/background/kbexplorer.js",
"chromevox/background/keymaps/key_map.js",
- "chromevox/background/mathmaps/math_map.js",
"chromevox/background/options.js",
"chromevox/background/prefs.js",
"chromevox/background/tabs_api_handler.js",
@@ -99,10 +99,6 @@ chromevox_modules = [
"common/interframe.js",
"common/key_sequence.js",
"common/key_util.js",
- "common/math_semantic_attr.js",
- "common/math_semantic_tree.js",
- "common/math_semantic_util.js",
- "common/math_util.js",
"common/media_widget.js",
"common/memoize.js",
"common/msgs.js",
@@ -117,7 +113,6 @@ chromevox_modules = [
"common/table_util.js",
"common/time_widget.js",
"common/traverse_content.js",
- "common/traverse_math.js",
"common/traverse_table.js",
"common/traverse_util.js",
"common/xpath_util.js",
@@ -137,12 +132,15 @@ chromevox_modules = [
"cvox2/background/earcon_engine.js",
"cvox2/background/editing.js",
"cvox2/background/event_source.js",
+ "cvox2/background/event_stream_logger.js",
"cvox2/background/find_handler.js",
"cvox2/background/gesture_command_data.js",
"cvox2/background/gesture_command_handler.js",
"cvox2/background/i_search.js",
"cvox2/background/keyboard_handler.js",
"cvox2/background/live_regions.js",
+ "cvox2/background/log.js",
+ "cvox2/background/log_store.js",
"cvox2/background/math_handler.js",
"cvox2/background/media_automation_handler.js",
"cvox2/background/next_earcons.js",
@@ -171,30 +169,15 @@ chromevox_modules = [
"host/chrome/earcons.js",
"host/chrome/extension_bridge.js",
"host/chrome/host.js",
- "host/chrome/mathjax.js",
"host/chrome/tts.js",
"host/chrome/tts_background.js",
"host/chrome/tts_base.js",
"host/interface/abstract_earcons.js",
"host/interface/abstract_host.js",
- "host/interface/abstract_mathjax.js",
"host/interface/abstract_tts.js",
"host/interface/braille_interface.js",
"host/interface/host_factory.js",
- "host/interface/mathjax_interface.js",
"host/interface/tts_interface.js",
- "speech_rules/base_rule_store.js",
- "speech_rules/math_simple_store.js",
- "speech_rules/math_store.js",
- "speech_rules/mathml_store.js",
- "speech_rules/mathml_store_rules.js",
- "speech_rules/mathml_store_util.js",
- "speech_rules/speech_rule.js",
- "speech_rules/speech_rule_engine.js",
- "speech_rules/speech_rule_evaluator.js",
- "speech_rules/speech_rule_functions.js",
- "speech_rules/speech_rule_store.js",
- "speech_rules/store_util.js",
"walkers/abstract_node_walker.js",
"walkers/abstract_selection_walker.js",
"walkers/abstract_shifter.js",
@@ -204,7 +187,6 @@ chromevox_modules = [
"walkers/column_walker.js",
"walkers/group_walker.js",
"walkers/layout_line_walker.js",
- "walkers/math_shifter.js",
"walkers/object_walker.js",
"walkers/row_walker.js",
"walkers/sentence_walker.js",
@@ -249,6 +231,7 @@ group("chromevox") {
":chromevox_background_script",
":chromevox_content_script",
":chromevox_kbexplorer_script",
+ ":chromevox_log_script",
":chromevox_min_content_script",
":chromevox_options_script",
":chromevox_panel_script",
@@ -261,6 +244,7 @@ group("chromevox") {
chromevox_background_script_loader_file = "cvox2/background/loader.js"
chromevox_content_script_loader_file = "chromevox/injected/loader.js"
chromevox_kbexplorer_loader_file = "chromevox/background/kbexplorer_loader.js"
+chromevox_log_loader_file = "cvox2/background/log_loader.js"
chromevox_min_content_script_loader_file = "cvox2/injected/loader.js"
chromevox_options_script_loader_file = "chromevox/background/options_loader.js"
chromevox_panel_script_loader_file = "cvox2/background/panel_loader.js"
@@ -303,36 +287,6 @@ run_jsbundler("chromevox_copied_files") {
"chromevox/background/keymaps/experimental.json",
"chromevox/background/keymaps/flat_keymap.json",
"chromevox/background/keymaps/next_keymap.json",
- "chromevox/background/mathmaps/functions/algebra.json",
- "chromevox/background/mathmaps/functions/elementary.json",
- "chromevox/background/mathmaps/functions/hyperbolic.json",
- "chromevox/background/mathmaps/functions/trigonometry.json",
- "chromevox/background/mathmaps/symbols/greek-capital.json",
- "chromevox/background/mathmaps/symbols/greek-mathfonts.json",
- "chromevox/background/mathmaps/symbols/greek-scripts.json",
- "chromevox/background/mathmaps/symbols/greek-small.json",
- "chromevox/background/mathmaps/symbols/greek-symbols.json",
- "chromevox/background/mathmaps/symbols/hebrew_letters.json",
- "chromevox/background/mathmaps/symbols/latin-lower-double-accent.json",
- "chromevox/background/mathmaps/symbols/latin-lower-normal.json",
- "chromevox/background/mathmaps/symbols/latin-lower-phonetic.json",
- "chromevox/background/mathmaps/symbols/latin-lower-single-accent.json",
- "chromevox/background/mathmaps/symbols/latin-mathfonts.json",
- "chromevox/background/mathmaps/symbols/latin-rest.json",
- "chromevox/background/mathmaps/symbols/latin-upper-double-accent.json",
- "chromevox/background/mathmaps/symbols/latin-upper-normal.json",
- "chromevox/background/mathmaps/symbols/latin-upper-single-accent.json",
- "chromevox/background/mathmaps/symbols/math_angles.json",
- "chromevox/background/mathmaps/symbols/math_arrows.json",
- "chromevox/background/mathmaps/symbols/math_characters.json",
- "chromevox/background/mathmaps/symbols/math_delimiters.json",
- "chromevox/background/mathmaps/symbols/math_digits.json",
- "chromevox/background/mathmaps/symbols/math_geometry.json",
- "chromevox/background/mathmaps/symbols/math_harpoons.json",
- "chromevox/background/mathmaps/symbols/math_non_characters.json",
- "chromevox/background/mathmaps/symbols/math_symbols.json",
- "chromevox/background/mathmaps/symbols/math_whitespace.json",
- "chromevox/background/mathmaps/symbols/other_stars.json",
"chromevox/background/options.css",
"chromevox/background/options.html",
"chromevox/background/unchecked.png",
@@ -344,6 +298,8 @@ run_jsbundler("chromevox_copied_files") {
"cvox2/background/earcons/skim.wav",
"cvox2/background/earcons/small_room_2.wav",
"cvox2/background/earcons/static.wav",
+ "cvox2/background/log.css",
+ "cvox2/background/log.html",
"cvox2/background/panel.css",
"cvox2/background/panel.html",
"images/chromevox-128.png",
@@ -364,6 +320,7 @@ run_jsbundler("chromevox_copied_files") {
chromevox_background_script_loader_file,
chromevox_content_script_loader_file,
chromevox_kbexplorer_loader_file,
+ chromevox_log_loader_file,
chromevox_min_content_script_loader_file,
chromevox_options_script_loader_file,
chromevox_panel_script_loader_file,
@@ -480,6 +437,13 @@ if (chromevox_compress_js) {
output_file = "$chromevox_out_dir/chromeVoxKbExplorerScript.js"
}
+ compress_js("chromevox_log_script") {
+ sources = [
+ chromevox_log_loader_file,
+ ]
+ output_file = "$chromevox_out_dir/chromeVoxLogScript.js"
+ }
+
compress_js("chromevox_options_script") {
sources = [
chromevox_options_script_loader_file,
@@ -599,7 +563,6 @@ action("chromevox_test_messages_js") {
chromevox_test_modules = [
"host/testing/earcons.js",
"host/testing/host.js",
- "host/testing/mathjax.js",
"host/testing/tts.js",
"testing/spoken_list_builder.js",
"testing/test_msgs.js",
@@ -640,7 +603,6 @@ js2gtest("chromevox_unitjs_tests") {
"common/editable_text_test.unitjs",
"common/find_util_test.unitjs",
"common/key_sequence_test.unitjs",
- "common/math_semantic_tree_test.unitjs",
"common/page_selection_test.unitjs",
"common/selection_util_test.unitjs",
"common/spannable_test.unitjs",
@@ -650,7 +612,6 @@ js2gtest("chromevox_unitjs_tests") {
"walkers/character_walker_test.unitjs",
"walkers/group_walker_test.unitjs",
"walkers/layout_line_walker_test.unitjs",
- "walkers/math_shifter_test.unitjs",
"walkers/object_walker_test.unitjs",
"walkers/sentence_walker_test.unitjs",
"walkers/structural_line_walker_test.unitjs",
@@ -683,6 +644,7 @@ js2gtest("chromevox_extjs_tests") {
"cvox2/background/editing_test.extjs",
"cvox2/background/i_search_test.extjs",
"cvox2/background/live_regions_test.extjs",
+ "cvox2/background/log_store_test.extjs",
"cvox2/background/output_test.extjs",
"cvox2/background/panel_test.extjs",
"cvox2/background/recovery_strategy_test.extjs",
@@ -698,3 +660,36 @@ js2gtest("chromevox_extjs_tests") {
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
}
+
+js_library("tree_walker") {
+ sources = [
+ "cvox2/background/tree_walker.js",
+ ]
+ deps = [
+ ":automation_predicate",
+ ":constants",
+ ]
+ externs_list = [
+ "$externs_path/automation.js",
+ "$externs_path/chrome_extensions.js",
+ ]
+}
+
+js_library("automation_predicate") {
+ sources = [
+ "cvox2/background/automation_predicate.js",
+ ]
+ deps = [
+ ":constants",
+ ]
+ externs_list = [
+ "$externs_path/automation.js",
+ "$externs_path/chrome_extensions.js",
+ ]
+}
+
+js_library("constants") {
+ sources = [
+ "cvox2/background/constants.js",
+ ]
+}
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json
index ac731659114..d9f77a8a1c1 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/keymaps/next_keymap.json
@@ -586,6 +586,15 @@
}
},
{
+ "command": "showLogPage",
+ "sequence": {
+ "cvoxModifier": true,
+ "keys": {
+ "keyCode": [79, 87]
+ }
+ }
+ },
+ {
"command": "help",
"sequence": {
"cvoxModifier": true,
@@ -950,6 +959,15 @@
},
"doubleTap": true
}
+ },
+ {
+ "command": "showTtsSettings",
+ "sequence": {
+ "cvoxModifier": true,
+ "keys": {
+ "keyCode": [79, 83]
+ }
+ }
}
]
}
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/algebra.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/algebra.json
deleted file mode 100644
index c3d01c1a3f4..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/algebra.json
+++ /dev/null
@@ -1,58 +0,0 @@
-[
- {"category": "Algebra",
- "mappings": {
- "default": {
- "default": "degree"
- }
- },
- "key": "deg",
- "names": ["deg"]
- },
- {"category": "Algebra",
- "mappings": {
- "default": {
- "default": "determinant",
- "short": "det"
- }
- },
- "key": "det",
- "names": ["det"]
- },
- {"category": "Algebra",
- "mappings": {
- "default": {
- "default": "dimension"
- }
- },
- "key": "dim",
- "names": ["dim"]
- },
- {"category": "Algebra",
- "mappings": {
- "default": {
- "default": "homomorphism",
- "short": "hom"
- }
- },
- "key": "hom",
- "names": ["hom", "Hom"]
- },
- {"category": "Algebra",
- "mappings": {
- "default": {
- "default": "kernel"
- }
- },
- "key": "ker",
- "names": ["ker"]
- },
- {"category": "Algebra",
- "mappings": {
- "default": {
- "default": "trace"
- }
- },
- "key": "Tr",
- "names": ["Tr", "tr"]
- }
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/elementary.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/elementary.json
deleted file mode 100644
index 86280747dfe..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/elementary.json
+++ /dev/null
@@ -1,211 +0,0 @@
-[
- {"category": "Elementary",
- "mappings": {
- "default": {
- "default": "logarithm",
- "alternative": "logarithm function",
- "short": "log"
- }
- },
- "key": "log",
- "names": ["log"]
- },
- {"category": "Elementary",
- "mappings": {
- "default": {
- "default": "natural logarithm",
- "alternative": "natural logarithm function",
- "short": "natural log"
- }
- },
- "key": "ln",
- "names": ["ln"]
- },
- {"category": "Elementary",
- "mappings": {
- "default": {
- "default": "logarithm base 10",
- "short": "log base 10"} },
- "key": "lg",
- "names": ["lg"]},
- {"category": "Elementary",
- "mappings": {
- "default": {
- "default": "exponential",
- "alternative": "exponential function",
- "short": "exp"
- }
- },
- "key": "exp",
- "names": ["exp", "expt"]
- },
-
- {"category": "Elementary",
- "mappings": {
- "default": {
- "default": "greatest common divisor",
- "short": "gcd"
- }
- },
- "key": "gcd",
- "names": ["gcd"]
- },
- {"category": "Elementary",
- "mappings": {
- "default": {
- "default": "least common multiple",
- "short": "lcm"
- }
- },
- "key": "lcm",
- "names": ["lcm"]
- },
-
- {"category": "Complex",
- "mappings": {
- "default": {
- "default": "argument",
- "short": "arg"
- }
- },
- "key": "arg",
- "names": ["arg"]
- },
- {"category": "Complex",
- "mappings": {
- "default": {
- "default": "imaginary part",
- "short": "imaginary"
- }
- },
- "key": "im",
- "names": ["im"]
- },
- {"category": "Complex",
- "mappings": {
- "default": {
- "default": "real part",
- "short": "real"
- }
- },
- "key": "re",
- "names": ["re"]
- },
-
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "infimum",
- "short": "inf"
- }
- },
- "key": "inf",
- "names": ["inf"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "limit",
- "short": "lim"
- }
- },
- "key": "lim",
- "names": ["lim"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "infimum default",
- "alternative": "inferior limit",
- "short": "liminf"
- }
- },
- "key": "liminf",
- "names": ["lim inf"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "supremum limit",
- "alternative": "superior limit",
- "short": "limsup"
- }
- },
- "key": "limsup",
- "names": ["lim sup"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "maximum",
- "short": "max"
- }
- },
- "key": "max",
- "names": ["max"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "minimum",
- "short": "min"
- }
- },
- "key": "min",
- "names": ["min"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "supremum",
- "short": "sup"
- }
- },
- "key": "sup",
- "names": ["sup"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "injective limit",
- "alternative": "direct limit",
- "short": "colimit"
- }
- },
- "key": "injlim",
- "names": ["injlim", "inj lim"]
- },
- {"category": "Limits",
- "mappings": {
- "default": {
- "default": "projective limit",
- "alternative": "inverse limit",
- "short": "limit"
- }
- },
- "key": "projlim",
- "names": ["projlim", "proj lim"]
- },
-
-
- {"category": "Elementary",
- "mappings": {
- "default": {
- "default": "modulo",
- "short": "mod"
- }
- },
- "key": "mod",
- "names": ["mod"]
- },
-
- {"category": "Probability",
- "mappings": {
- "default": {
- "default": "probability"
- }
- },
- "key": "Pr",
- "names": ["Pr"]
- }
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/hyperbolic.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/hyperbolic.json
deleted file mode 100644
index 507a34a7265..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/hyperbolic.json
+++ /dev/null
@@ -1,109 +0,0 @@
-[
- {"category": "Hyperbolic",
- "mappings": {
- "default": {
- "default": "hyperbolic cosine function",
- "short": "hyperbolic cosine"
- }
- },
- "key": "cosh",
- "names": ["cosh"]
- },
- {"category": "Hyperbolic",
- "mappings": {
- "default": {
- "default": "hyperbolic cotangent function",
- "short": "hyperbolic cotangent"} },
- "key": "coth",
- "names": ["coth"]
- },
- {"category": "Hyperbolic",
- "mappings": {
- "default": {
- "default": "hyperbolic cosecant function",
- "short": "hyperbolic cosecant"} },
- "key": "csch",
- "names": ["csch"]
- },
- {"category": "Hyperbolic",
- "mappings": {
- "default": {
- "default": "hyperbolic secant function",
- "short": "hyperbolic secant"} },
- "key": "sech",
- "names": ["sech"]
- },
- {"category": "Hyperbolic",
- "mappings": {
- "default": {
- "default": "hyperbolic sine function",
- "short": "hyperbolic sine"
- }
- },
- "key": "sinh",
- "names": ["sinh"]
- },
- {"category": "Hyperbolic",
- "mappings": {
- "default": {
- "default": "hyperbolic tangent function",
- "short": "hyperbolic tangent"} },
- "key": "tanh",
- "names": ["tanh"]
- },
-
- {"category": "Area",
- "mappings": {
- "default": {
- "default": "inverse hyperbolic cosine function",
- "alternative": "area hyperbolic cosine function",
- "short": "area hyperbolic cosine"} },
- "key": "arcosh",
- "names": ["arcosh", "arccosh"]
- },
- {"category": "Area",
- "mappings": {
- "default": {
- "default": "inverse hyperbolic cotangent function",
- "alternative": "area hyperbolic cotangent function",
- "short": "area hyperbolic cotangent"} },
- "key": "arcoth",
- "names": ["arcoth", "arccoth"]
- },
- {"category": "Area",
- "mappings": {
- "default": {
- "default": "inverse hyperbolic cosecant function",
- "alternative": "area hyperbolic cosecant function",
- "short": "area hyperbolic cosecant"} },
- "key": "arcsch",
- "names": ["arcsch", "arccsch"]
- },
- {"category": "Area",
- "mappings": {
- "default": {
- "default": "inverse hyperbolic secant function",
- "alternative": "area hyperbolic secant function",
- "short": "area hyperbolic secant"} },
- "key": "arsech",
- "names": ["arsech", "arcsech"]
- },
- {"category": "Area",
- "mappings": {
- "default": {
- "default": "inverse hyperbolic sine function",
- "alternative": "area hyperbolic sine function",
- "short": "area hyperbolic sine"} },
- "key": "arsinh",
- "names": ["arsinh", "arcsinh"]
- },
- {"category": "Area",
- "mappings": {
- "default": {
- "default": "inverse hyperbolic tangent function",
- "alternative": "area hyperbolic tangent function",
- "short": "area hyperbolic tangent"} },
- "key": "artanh",
- "names": ["artanh", "arctanh"]
- }
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/trigonometry.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/trigonometry.json
deleted file mode 100644
index 2c4d2b79619..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/functions/trigonometry.json
+++ /dev/null
@@ -1,110 +0,0 @@
-[
- {"category": "Trigonometric",
- "mappings": {
- "default": {
- "default": "cosine function",
- "short": "cosine"
- }
- },
- "key": "cos",
- "names": ["cos", "cosine"]
- },
- {"category": "Trigonometric",
- "mappings": {
- "default": {
- "default": "cotangent function",
- "short": "cotangent"} },
- "key": "cot",
- "names": ["cot"]
- },
- {"category": "Trigonometric",
- "mappings": {
- "default": {
- "default": "cosecant function",
- "short": "cosecant"} },
- "key": "csc",
- "names": ["csc"]
- },
- {"category": "Trigonometric",
- "mappings": {
- "default": {
- "default": "secant function",
- "short": "secant"} },
- "key": "sec",
- "names": ["sec"]
- },
- {"category": "Trigonometric",
- "mappings": {
- "default": {
- "default": "sine function",
- "alternative": "sine function",
- "short": "sine"
- }
- },
- "key": "sin",
- "names": ["sin", "sine"]
- },
- {"category": "Trigonometric",
- "mappings": {
- "default": {
- "default": "tangent function",
- "short": "tangent"} },
- "key": "tan",
- "names": ["tan"]
- },
-
- {"category": "Cyclometric",
- "mappings": {
- "default": {
- "default": "inverse cosine function",
- "alternative": "arc cosine function",
- "short": "arc cosine"} },
- "key": "arccos",
- "names": ["arccos"]
- },
- {"category": "Cyclometric",
- "mappings": {
- "default": {
- "default": "inverse cotangent function",
- "alternative": "arc cotangent function",
- "short": "arc cotangent"} },
- "key": "arccot",
- "names": ["arccot"]
- },
- {"category": "Cyclometric",
- "mappings": {
- "default": {
- "default": "inverse cosecant function",
- "alternative": "arc cosecant function",
- "short": "arc cosecant"} },
- "key": "arccsc",
- "names": ["arccsc"]
- },
- {"category": "Cyclometric",
- "mappings": {
- "default": {
- "default": "inverse secant function",
- "alternative": "arc secant function",
- "short": "arc secant"} },
- "key": "arcsec",
- "names": ["arcsec"]
- },
- {"category": "Cyclometric",
- "mappings": {
- "default": {
- "default": "inverse sine function",
- "alternative": "arc sine function",
- "short": "arc sine"} },
- "key": "arcsin",
- "names": ["arcsin"]
- },
- {"category": "Cyclometric",
- "mappings": {
- "default": {
- "default": "inverse tangent function",
- "alternative": "arc tangent function",
- "short": "arc tangent"} },
- "key": "arctan",
- "names": ["arctan"]
- }
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-capital.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-capital.json
deleted file mode 100644
index b9bcfcfdaeb..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-capital.json
+++ /dev/null
@@ -1,242 +0,0 @@
-[
-{"category": "Lu",
- "names": [],
- "key": "0391",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter alpha",
- "alternative": "",
- "short": "cap alpha"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0392",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter beta",
- "alternative": "",
- "short": "cap beta"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0393",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter gamma",
- "alternative": "",
- "short": "cap gamma"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0394",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter delta",
- "alternative": "",
- "short": "cap delta"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0395",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter epsilon",
- "alternative": "",
- "short": "cap epsilon"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0396",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter zeta",
- "alternative": "",
- "short": "cap zeta"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0397",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter eta",
- "alternative": "",
- "short": "cap eta"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0398",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter theta",
- "alternative": "",
- "short": "cap theta"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0399",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter iota",
- "alternative": "",
- "short": "cap iota"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "039A",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter kappa",
- "alternative": "",
- "short": "cap kappa"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "039B",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter lamda",
- "alternative": "greek capital letter lambda",
- "short": "cap lamda"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "039C",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter mu",
- "alternative": "",
- "short": "cap mu"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "039D",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter nu",
- "alternative": "",
- "short": "cap nu"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "039E",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter xi",
- "alternative": "",
- "short": "cap xi"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "039F",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter omicron",
- "alternative": "",
- "short": "cap omicron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A0",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter pi",
- "alternative": "",
- "short": "cap pi"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A1",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter rho",
- "alternative": "",
- "short": "cap rho"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A3",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter sigma",
- "alternative": "",
- "short": "cap sigma"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A4",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter tau",
- "alternative": "",
- "short": "cap tau"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A5",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter upsilon",
- "alternative": "",
- "short": "cap upsilon"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A6",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter phi",
- "alternative": "",
- "short": "cap phi"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A7",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter chi",
- "alternative": "",
- "short": "cap chi"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A8",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter psi",
- "alternative": "",
- "short": "cap psi"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "03A9",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek capital letter omega",
- "alternative": "",
- "short": "cap omega"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-mathfonts.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-mathfonts.json
deleted file mode 100644
index 073a88607be..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-mathfonts.json
+++ /dev/null
@@ -1,1502 +0,0 @@
-[
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital alpha",
- "alternative": "bold capital alpha",
- "short": "bold cap alpha"
- }
- },
- "key": "1D6A8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital beta",
- "alternative": "bold capital beta",
- "short": "bold cap beta"
- }
- },
- "key": "1D6A9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital gamma",
- "alternative": "bold capital gamma",
- "short": "bold cap gamma"
- }
- },
- "key": "1D6AA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital delta",
- "alternative": "bold capital delta",
- "short": "bold cap delta"
- }
- },
- "key": "1D6AB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital epsilon",
- "alternative": "bold capital epsilon",
- "short": "bold cap epsilon"
- }
- },
- "key": "1D6AC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital zeta",
- "alternative": "bold capital zeta",
- "short": "bold cap zeta"
- }
- },
- "key": "1D6AD"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital eta",
- "alternative": "bold capital eta",
- "short": "bold cap eta"
- }
- },
- "key": "1D6AE"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital theta",
- "alternative": "bold capital theta",
- "short": "bold cap theta"
- }
- },
- "key": "1D6AF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital iota",
- "alternative": "bold capital iota",
- "short": "bold cap iota"
- }
- },
- "key": "1D6B0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital kappa",
- "alternative": "bold capital kappa",
- "short": "bold cap kappa"
- }
- },
- "key": "1D6B1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital lamda",
- "alternative": "bold capital lamda",
- "short": "bold cap lamda"
- }
- },
- "key": "1D6B2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital mu",
- "alternative": "bold capital mu",
- "short": "bold cap mu"
- }
- },
- "key": "1D6B3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital nu",
- "alternative": "bold capital nu",
- "short": "bold cap nu"
- }
- },
- "key": "1D6B4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital xi",
- "alternative": "bold capital xi",
- "short": "bold cap xi"
- }
- },
- "key": "1D6B5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital omicron",
- "alternative": "bold capital omicron",
- "short": "bold cap omicron"
- }
- },
- "key": "1D6B6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital pi",
- "alternative": "bold capital pi",
- "short": "bold cap pi"
- }
- },
- "key": "1D6B7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital rho",
- "alternative": "bold capital rho",
- "short": "bold cap rho"
- }
- },
- "key": "1D6B8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital theta symbol",
- "alternative": "bold capital theta",
- "short": "bold cap theta"
- }
- },
- "key": "1D6B9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital sigma",
- "alternative": "bold capital sigma",
- "short": "bold cap sigma"
- }
- },
- "key": "1D6BA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital tau",
- "alternative": "bold capital tau",
- "short": "bold cap tau"
- }
- },
- "key": "1D6BB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital upsilon",
- "alternative": "bold capital upsilon",
- "short": "bold cap upsilon"
- }
- },
- "key": "1D6BC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital phi",
- "alternative": "bold capital phi",
- "short": "bold cap phi"
- }
- },
- "key": "1D6BD"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital chi",
- "alternative": "bold capital chi",
- "short": "bold cap chi"
- }
- },
- "key": "1D6BE"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital psi",
- "alternative": "bold capital psi",
- "short": "bold cap psi"
- }
- },
- "key": "1D6BF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital omega",
- "alternative": "bold capital omega",
- "short": "bold cap omega"
- }
- },
- "key": "1D6C0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small alpha",
- "alternative": "bold small alpha",
- "short": "bold alpha"
- }
- },
- "key": "1D6C2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small beta",
- "alternative": "bold small beta",
- "short": "bold beta"
- }
- },
- "key": "1D6C3"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small gamma",
- "alternative": "bold small gamma",
- "short": "bold gamma"
- }
- },
- "key": "1D6C4"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small delta",
- "alternative": "bold small delta",
- "short": "bold delta"
- }
- },
- "key": "1D6C5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small epsilon",
- "alternative": "bold small epsilon",
- "short": "bold epsilon"
- }
- },
- "key": "1D6C6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small zeta",
- "alternative": "bold small zeta",
- "short": "bold zeta"
- }
- },
- "key": "1D6C7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small eta",
- "alternative": "bold small eta",
- "short": "bold eta"
- }
- },
- "key": "1D6C8"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small theta",
- "alternative": "bold small theta",
- "short": "bold theta"
- }
- },
- "key": "1D6C9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small iota",
- "alternative": "bold small iota",
- "short": "bold iota"
- }
- },
- "key": "1D6CA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small kappa",
- "alternative": "bold small kappa",
- "short": "bold kappa"
- }
- },
- "key": "1D6CB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small lamda",
- "alternative": "bold small lamda",
- "short": "bold lamda"
- }
- },
- "key": "1D6CC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small mu",
- "alternative": "bold small mu",
- "short": "bold mu"
- }
- },
- "key": "1D6CD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small nu",
- "alternative": "bold small nu",
- "short": "bold nu"
- }
- },
- "key": "1D6CE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small xi",
- "alternative": "bold small xi",
- "short": "bold xi"
- }
- },
- "key": "1D6CF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small omicron",
- "alternative": "bold small omicron",
- "short": "bold omicron"
- }
- },
- "key": "1D6D0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small pi",
- "alternative": "bold small pi",
- "short": "bold pi"
- }
- },
- "key": "1D6D1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small rho",
- "alternative": "bold small rho",
- "short": "bold rho"
- }
- },
- "key": "1D6D2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small final sigma",
- "alternative": "bold small final sigma",
- "short": "bold final sigma"
- }
- },
- "key": "1D6D3"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small sigma",
- "alternative": "bold small sigma",
- "short": "bold sigma"
- }
- },
- "key": "1D6D4"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small tau",
- "alternative": "bold small tau",
- "short": "bold tau"
- }
- },
- "key": "1D6D5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small upsilon",
- "alternative": "bold small upsilon",
- "short": "bold upsilon"
- }
- },
- "key": "1D6D6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small phi",
- "alternative": "bold small phi",
- "short": "bold phi"
- }
- },
- "key": "1D6D7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small chi",
- "alternative": "bold small chi",
- "short": "bold chi"
- }
- },
- "key": "1D6D8"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small psi",
- "alternative": "bold small psi",
- "short": "bold psi"
- }
- },
- "key": "1D6D9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small omega",
- "alternative": "bold small omega",
- "short": "bold omega"
- }
- },
- "key": "1D6DA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital alpha",
- "alternative": "italic capital alpha",
- "short": "italic cap alpha"
- }
- },
- "key": "1D6E2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital beta",
- "alternative": "italic capital beta",
- "short": "italic cap beta"
- }
- },
- "key": "1D6E3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital gamma",
- "alternative": "italic capital gamma",
- "short": "italic cap gamma"
- }
- },
- "key": "1D6E4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital delta",
- "alternative": "italic capital delta",
- "short": "italic cap delta"
- }
- },
- "key": "1D6E5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital epsilon",
- "alternative": "italic capital epsilon",
- "short": "italic cap epsilon"
- }
- },
- "key": "1D6E6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital zeta",
- "alternative": "italic capital zeta",
- "short": "italic cap zeta"
- }
- },
- "key": "1D6E7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital eta",
- "alternative": "italic capital eta",
- "short": "italic cap eta"
- }
- },
- "key": "1D6E8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital theta",
- "alternative": "italic capital theta",
- "short": "italic cap theta"
- }
- },
- "key": "1D6E9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital iota",
- "alternative": "italic capital iota",
- "short": "italic cap iota"
- }
- },
- "key": "1D6EA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital kappa",
- "alternative": "italic capital kappa",
- "short": "italic cap kappa"
- }
- },
- "key": "1D6EB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital lamda",
- "alternative": "italic capital lamda",
- "short": "italic cap lamda"
- }
- },
- "key": "1D6EC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital mu",
- "alternative": "italic capital mu",
- "short": "italic cap mu"
- }
- },
- "key": "1D6ED"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital nu",
- "alternative": "italic capital nu",
- "short": "italic cap nu"
- }
- },
- "key": "1D6EE"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital xi",
- "alternative": "italic capital xi",
- "short": "italic cap xi"
- }
- },
- "key": "1D6EF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital omicron",
- "alternative": "italic capital omicron",
- "short": "italic cap omicron"
- }
- },
- "key": "1D6F0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital pi",
- "alternative": "italic capital pi",
- "short": "italic cap pi"
- }
- },
- "key": "1D6F1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital rho",
- "alternative": "italic capital rho",
- "short": "italic cap rho"
- }
- },
- "key": "1D6F2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital theta symbol",
- "alternative": "italic capital theta",
- "short": "italic cap theta"
- }
- },
- "key": "1D6F3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital sigma",
- "alternative": "italic capital sigma",
- "short": "italic cap sigma"
- }
- },
- "key": "1D6F4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital tau",
- "alternative": "italic capital tau",
- "short": "italic cap tau"
- }
- },
- "key": "1D6F5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital upsilon",
- "alternative": "italic capital upsilon",
- "short": "italic cap upsilon"
- }
- },
- "key": "1D6F6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital phi",
- "alternative": "italic capital phi",
- "short": "italic cap phi"
- }
- },
- "key": "1D6F7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital chi",
- "alternative": "italic capital chi",
- "short": "italic cap chi"
- }
- },
- "key": "1D6F8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital psi",
- "alternative": "italic capital psi",
- "short": "italic cap psi"
- }
- },
- "key": "1D6F9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital omega",
- "alternative": "italic capital omega",
- "short": "italic cap omega"
- }
- },
- "key": "1D6FA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small alpha",
- "alternative": "italic small alpha",
- "short": "italic alpha"
- }
- },
- "key": "1D6FC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small beta",
- "alternative": "italic small beta",
- "short": "italic beta"
- }
- },
- "key": "1D6FD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small gamma",
- "alternative": "italic small gamma",
- "short": "italic gamma"
- }
- },
- "key": "1D6FE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small delta",
- "alternative": "italic small delta",
- "short": "italic delta"
- }
- },
- "key": "1D6FF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small epsilon",
- "alternative": "italic small epsilon",
- "short": "italic epsilon"
- }
- },
- "key": "1D700"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small zeta",
- "alternative": "italic small zeta",
- "short": "italic zeta"
- }
- },
- "key": "1D701"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small eta",
- "alternative": "italic small eta",
- "short": "italic eta"
- }
- },
- "key": "1D702"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small theta",
- "alternative": "italic small theta",
- "short": "italic theta"
- }
- },
- "key": "1D703"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small iota",
- "alternative": "italic small iota",
- "short": "italic iota"
- }
- },
- "key": "1D704"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small kappa",
- "alternative": "italic small kappa",
- "short": "italic kappa"
- }
- },
- "key": "1D705"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small lamda",
- "alternative": "italic small lamda",
- "short": "italic lamda"
- }
- },
- "key": "1D706"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small mu",
- "alternative": "italic small mu",
- "short": "italic mu"
- }
- },
- "key": "1D707"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small nu",
- "alternative": "italic small nu",
- "short": "italic nu"
- }
- },
- "key": "1D708"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small xi",
- "alternative": "italic small xi",
- "short": "italic xi"
- }
- },
- "key": "1D709"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small omicron",
- "alternative": "italic small omicron",
- "short": "italic omicron"
- }
- },
- "key": "1D70A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small pi",
- "alternative": "italic small pi",
- "short": "italic pi"
- }
- },
- "key": "1D70B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small rho",
- "alternative": "italic small rho",
- "short": "italic rho"
- }
- },
- "key": "1D70C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small final sigma",
- "alternative": "italic small final sigma",
- "short": "italic final sigma"
- }
- },
- "key": "1D70D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small sigma",
- "alternative": "italic small sigma",
- "short": "italic sigma"
- }
- },
- "key": "1D70E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small tau",
- "alternative": "italic small tau",
- "short": "italic tau"
- }
- },
- "key": "1D70F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small upsilon",
- "alternative": "italic small upsilon",
- "short": "italic upsilon"
- }
- },
- "key": "1D710"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small phi",
- "alternative": "italic small phi",
- "short": "italic phi"
- }
- },
- "key": "1D711"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small chi",
- "alternative": "italic small chi",
- "short": "italic chi"
- }
- },
- "key": "1D712"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small psi",
- "alternative": "italic small psi",
- "short": "italic psi"
- }
- },
- "key": "1D713"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small omega",
- "alternative": "italic small omega",
- "short": "italic omega"
- }
- },
- "key": "1D714"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital alpha",
- "alternative": "sans serif bold capital alpha",
- "short": "sans serif bold cap alpha"
- }
- },
- "key": "1D756"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital beta",
- "alternative": "sans serif bold capital beta",
- "short": "sans serif bold cap beta"
- }
- },
- "key": "1D757"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital gamma",
- "alternative": "sans serif bold capital gamma",
- "short": "sans serif bold cap gamma"
- }
- },
- "key": "1D758"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital delta",
- "alternative": "sans serif bold capital delta",
- "short": "sans serif bold cap delta"
- }
- },
- "key": "1D759"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital epsilon",
- "alternative": "sans serif bold capital epsilon",
- "short": "sans serif bold cap epsilon"
- }
- },
- "key": "1D75A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital zeta",
- "alternative": "sans serif bold capital zeta",
- "short": "sans serif bold cap zeta"
- }
- },
- "key": "1D75B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital eta",
- "alternative": "sans serif bold capital eta",
- "short": "sans serif bold cap eta"
- }
- },
- "key": "1D75C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital theta",
- "alternative": "sans serif bold capital theta",
- "short": "sans serif bold cap theta"
- }
- },
- "key": "1D75D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital iota",
- "alternative": "sans serif bold capital iota",
- "short": "sans serif bold cap iota"
- }
- },
- "key": "1D75E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital kappa",
- "alternative": "sans serif bold capital kappa",
- "short": "sans serif bold cap kappa"
- }
- },
- "key": "1D75F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital lamda",
- "alternative": "sans serif bold capital lamda",
- "short": "sans serif bold cap lamda"
- }
- },
- "key": "1D760"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital mu",
- "alternative": "sans serif bold capital mu",
- "short": "sans serif bold cap mu"
- }
- },
- "key": "1D761"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital nu",
- "alternative": "sans serif bold capital nu",
- "short": "sans serif bold cap nu"
- }
- },
- "key": "1D762"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital xi",
- "alternative": "sans serif bold capital xi",
- "short": "sans serif bold cap xi"
- }
- },
- "key": "1D763"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital omicron",
- "alternative": "sans serif bold capital omicron",
- "short": "sans serif bold cap omicron"
- }
- },
- "key": "1D764"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital pi",
- "alternative": "sans serif bold capital pi",
- "short": "sans serif bold cap pi"
- }
- },
- "key": "1D765"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital rho",
- "alternative": "sans serif bold capital rho",
- "short": "sans serif bold cap rho"
- }
- },
- "key": "1D766"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital theta symbol",
- "alternative": "sans serif bold capital theta",
- "short": "sans serif bold cap theta"
- }
- },
- "key": "1D767"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital sigma",
- "alternative": "sans serif bold capital sigma",
- "short": "sans serif bold cap sigma"
- }
- },
- "key": "1D768"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital tau",
- "alternative": "sans serif bold capital tau",
- "short": "sans serif bold cap tau"
- }
- },
- "key": "1D769"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital upsilon",
- "alternative": "sans serif bold capital upsilon",
- "short": "sans serif bold cap upsilon"
- }
- },
- "key": "1D76A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital phi",
- "alternative": "sans serif bold capital phi",
- "short": "sans serif bold cap phi"
- }
- },
- "key": "1D76B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital chi",
- "alternative": "sans serif bold capital chi",
- "short": "sans serif bold cap chi"
- }
- },
- "key": "1D76C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital psi",
- "alternative": "sans serif bold capital psi",
- "short": "sans serif bold cap psi"
- }
- },
- "key": "1D76D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital omega",
- "alternative": "sans serif bold capital omega",
- "short": "sans serif bold cap omega"
- }
- },
- "key": "1D76E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small alpha",
- "alternative": "sans serif bold small alpha",
- "short": "sans serif bold alpha"
- }
- },
- "key": "1D770"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small beta",
- "alternative": "sans serif bold small beta",
- "short": "sans serif bold beta"
- }
- },
- "key": "1D771"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small gamma",
- "alternative": "sans serif bold small gamma",
- "short": "sans serif bold gamma"
- }
- },
- "key": "1D772"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small delta",
- "alternative": "sans serif bold small delta",
- "short": "sans serif bold delta"
- }
- },
- "key": "1D773"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small epsilon",
- "alternative": "sans serif bold small epsilon",
- "short": "sans serif bold epsilon"
- }
- },
- "key": "1D774"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small zeta",
- "alternative": "sans serif bold small zeta",
- "short": "sans serif bold zeta"
- }
- },
- "key": "1D775"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small eta",
- "alternative": "sans serif bold small eta",
- "short": "sans serif bold eta"
- }
- },
- "key": "1D776"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small theta",
- "alternative": "sans serif bold small theta",
- "short": "sans serif bold theta"
- }
- },
- "key": "1D777"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small iota",
- "alternative": "sans serif bold small iota",
- "short": "sans serif bold iota"
- }
- },
- "key": "1D778"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small kappa",
- "alternative": "sans serif bold small kappa",
- "short": "sans serif bold kappa"
- }
- },
- "key": "1D779"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small lamda",
- "alternative": "sans serif bold small lamda",
- "short": "sans serif bold lamda"
- }
- },
- "key": "1D77A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small mu",
- "alternative": "sans serif bold small mu",
- "short": "sans serif bold mu"
- }
- },
- "key": "1D77B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small nu",
- "alternative": "sans serif bold small nu",
- "short": "sans serif bold nu"
- }
- },
- "key": "1D77C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small xi",
- "alternative": "sans serif bold small xi",
- "short": "sans serif bold xi"
- }
- },
- "key": "1D77D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small omicron",
- "alternative": "sans serif bold small omicron",
- "short": "sans serif bold omicron"
- }
- },
- "key": "1D77E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small pi",
- "alternative": "sans serif bold small pi",
- "short": "sans serif bold pi"
- }
- },
- "key": "1D77F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small rho",
- "alternative": "sans serif bold small rho",
- "short": "sans serif bold rho"
- }
- },
- "key": "1D780"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small final sigma",
- "alternative": "sans serif bold small final sigma",
- "short": "sans serif bold final sigma"
- }
- },
- "key": "1D781"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small sigma",
- "alternative": "sans serif bold small sigma",
- "short": "sans serif bold sigma"
- }
- },
- "key": "1D782"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small tau",
- "alternative": "sans serif bold small tau",
- "short": "sans serif bold tau"
- }
- },
- "key": "1D783"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small upsilon",
- "alternative": "sans serif bold small upsilon",
- "short": "sans serif bold upsilon"
- }
- },
- "key": "1D784"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small phi",
- "alternative": "sans serif bold small phi",
- "short": "sans serif bold phi"
- }
- },
- "key": "1D785"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small chi",
- "alternative": "sans serif bold small chi",
- "short": "sans serif bold chi"
- }
- },
- "key": "1D786"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small psi",
- "alternative": "sans serif bold small psi",
- "short": "sans serif bold psi"
- }
- },
- "key": "1D787"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small omega",
- "alternative": "sans serif bold small omega",
- "short": "sans serif bold omega"
- }
- },
- "key": "1D788"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-scripts.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-scripts.json
deleted file mode 100644
index bd5e4d17151..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-scripts.json
+++ /dev/null
@@ -1,122 +0,0 @@
-[
-{"category": "Ll",
- "names": [],
- "key": "1D26",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek letter small capital gamma",
- "alternative": "greek letter gamma",
- "short": "small cap gamma"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D27",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek letter small capital lamda",
- "alternative": "greek letter lamda",
- "short": "small cap lamda"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D28",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek letter small capital pi",
- "alternative": "greek letter pi",
- "short": "small cap pi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D29",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek letter small capital rho",
- "alternative": "greek letter rho",
- "short": "small cap rho"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D2A",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek letter small capital psi",
- "alternative": "greek letter psi",
- "short": "small cap psi"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D5E",
- "active": true,
- "mappings": {
- "default": {
- "default": "modifier letter small greek gamma",
- "alternative": "greek letter superscript gamma",
- "short": "superscript gamma"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D60",
- "active": true,
- "mappings": {
- "default": {
- "default": "modifier letter small greek phi",
- "alternative": "greek letter superscript phi",
- "short": "superscript phi"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D66",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek subscript small letter beta",
- "alternative": "",
- "short": "subscript beta"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D67",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek subscript small letter gamma",
- "alternative": "greek letter gamma",
- "short": "subscript gamma"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D68",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek subscript small letter rho",
- "alternative": "greek letter rho",
- "short": "subscript rho"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D69",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek subscript small letter phi",
- "alternative": "greek letter phi",
- "short": "subscript phi"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D6A",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek subscript small letter chi",
- "alternative": "greek letter chi",
- "short": "subscript chi"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-small.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-small.json
deleted file mode 100644
index 2816f03f8ed..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-small.json
+++ /dev/null
@@ -1,252 +0,0 @@
-[
-{"category": "Ll",
- "names": [],
- "key": "03B1",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter alpha",
- "alternative": "",
- "short": "alpha"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B2",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter beta",
- "alternative": "",
- "short": "beta"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B3",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter gamma",
- "alternative": "",
- "short": "gamma"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B4",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter delta",
- "alternative": "",
- "short": "delta"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B5",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter epsilon",
- "alternative": "",
- "short": "epsilon"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B6",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter zeta",
- "alternative": "",
- "short": "zeta"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B7",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter eta",
- "alternative": "",
- "short": "eta"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B8",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter theta",
- "alternative": "",
- "short": "theta"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03B9",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter iota",
- "alternative": "",
- "short": "iota"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03BA",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter kappa",
- "alternative": "",
- "short": "kappa"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03BB",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter lamda",
- "alternative": "greek small letter lambda",
- "short": "lamda"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03BC",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter mu",
- "alternative": "",
- "short": "mu"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03BD",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter nu",
- "alternative": "",
- "short": "nu"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03BE",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter xi",
- "alternative": "",
- "short": "xi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03BF",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter omicron",
- "alternative": "",
- "short": "omicron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C0",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter pi",
- "alternative": "",
- "short": "pi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C1",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter rho",
- "alternative": "",
- "short": "rho"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C2",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter final sigma",
- "alternative": "",
- "short": "final sigma"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C3",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter sigma",
- "alternative": "",
- "short": "sigma"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C4",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter tau",
- "alternative": "",
- "short": "tau"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C5",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter upsilon",
- "alternative": "",
- "short": "upsilon"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C6",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter phi",
- "alternative": "",
- "short": "phi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C7",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter chi",
- "alternative": "",
- "short": "chi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C8",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter psi",
- "alternative": "",
- "short": "psi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "03C9",
- "active": true,
- "mappings": {
- "default": {
- "default": "greek small letter omega",
- "alternative": "",
- "short": "omega"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-symbols.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-symbols.json
deleted file mode 100644
index d5bbd2e1e7d..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/greek-symbols.json
+++ /dev/null
@@ -1,357 +0,0 @@
-[
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek beta symbol",
- "alternative": "greek small letter curled beta",
- "short": "beta"
- }
- },
- "key": "03D0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek theta symbol",
- "alternative": "greek small letter script theta",
- "short": "theta"
- }
- },
- "key": "03D1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek phi symbol",
- "alternative": "greek small letter script phi",
- "short": "phi"
- }
- },
- "key": "03D5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek pi symbol",
- "alternative": "greek small letter omega pi",
- "short": "pi"
- }
- },
- "key": "03D6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek kai symbol",
- "short": "kai"
- }
- },
- "key": "03D7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek kappa symbol",
- "alternative": "greek small letter script kappa",
- "short": "kappa"
- }
- },
- "key": "03F0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek rho symbol",
- "alternative": "greek small letter tailed rho",
- "short": "rho"
- }
- },
- "key": "03F1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "greek lunate epsilon symbol",
- "short": "epsilon"
- }
- },
- "key": "03F5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greek reversed lunate epsilon symbol",
- "short": "reversed epsilon"
- }
- },
- "key": "03F6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "greek capital theta symbol",
- "short": "cap theta"
- }
- },
- "key": "03F4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical bold nabla",
- "alternative": "bold nabla"
- }
- },
- "key": "1D6C1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical bold partial differential",
- "alternative": "bold partial differential",
- "short": "bold partial differential"
- }
- },
- "key": "1D6DB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold epsilon symbol",
- "alternative": "bold epsilon",
- "short": "bold epsilon"
- }
- },
- "key": "1D6DC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold theta symbol",
- "alternative": "bold theta",
- "short": "bold theta"
- }
- },
- "key": "1D6DD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold kappa symbol",
- "alternative": "bold kappa",
- "short": "bold kappa"
- }
- },
- "key": "1D6DE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold phi symbol",
- "alternative": "bold phi",
- "short": "bold phi"
- }
- },
- "key": "1D6DF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold rho symbol",
- "alternative": "bold rho",
- "short": "bold rho"
- }
- },
- "key": "1D6E0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold pi symbol",
- "alternative": "bold pi",
- "short": "bold pi"
- }
- },
- "key": "1D6E1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical italic nabla",
- "alternative": "italic nabla",
- "short": "italic nabla"
- }
- },
- "key": "1D6FB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical italic partial differential",
- "alternative": "italic partial differential",
- "short": "italic partial differential"
- }
- },
- "key": "1D715"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic epsilon symbol",
- "alternative": "italic epsilon",
- "short": "italic epsilon"
- }
- },
- "key": "1D716"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic theta symbol",
- "alternative": "italic theta",
- "short": "italic theta"
- }
- },
- "key": "1D717"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic kappa symbol",
- "alternative": "italic kappa",
- "short": "italic kappa"
- }
- },
- "key": "1D718"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic phi symbol",
- "alternative": "italic phi",
- "short": "italic phi"
- }
- },
- "key": "1D719"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic rho symbol",
- "alternative": "italic rho",
- "short": "italic rho"
- }
- },
- "key": "1D71A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic pi symbol",
- "alternative": "italic pi",
- "short": "italic pi"
- }
- },
- "key": "1D71B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold nabla",
- "alternative": "sans serif bold nabla",
- "short": "sans serif bold nabla"
- }
- },
- "key": "1D76F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold partial differential",
- "alternative": "sans serif bold partial differential",
- "short": "sans serif bold partial differential"
- }
- },
- "key": "1D789"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold epsilon symbol",
- "alternative": "sans serif bold epsilon",
- "short": "sans serif bold epsilon"
- }
- },
- "key": "1D78A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold theta symbol",
- "alternative": "sans serif bold theta",
- "short": "sans serif bold theta"
- }
- },
- "key": "1D78B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold kappa symbol",
- "alternative": "sans serif bold kappa",
- "short": "sans serif bold kappa"
- }
- },
- "key": "1D78C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold phi symbol",
- "alternative": "sans serif bold phi",
- "short": "sans serif bold phi"
- }
- },
- "key": "1D78D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold rho symbol",
- "alternative": "sans serif bold rho",
- "short": "sans serif bold rho"
- }
- },
- "key": "1D78E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold pi symbol",
- "alternative": "sans serif bold pi",
- "short": "sans serif bold pi"
- }
- },
- "key": "1D78F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital digamma",
- "alternative": "bold capital digamma",
- "short": "bold cap digamma"
- }
- },
- "key": "1D7CA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small digamma",
- "alternative": "bold small digamma",
- "short": "bold digamma"
- }
- },
- "key": "1D7CB"
-}
-] \ No newline at end of file
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/hebrew_letters.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/hebrew_letters.json
deleted file mode 100644
index dfa863b95a8..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/hebrew_letters.json
+++ /dev/null
@@ -1,42 +0,0 @@
-[
-{"category": "Lo",
- "mappings": {
- "default": {
- "default": "alef symbol",
- "alternative": "first transfinite cardinal",
- "short": "alef"
- }
- },
- "key": "2135"
-},
-{"category": "Lo",
- "mappings": {
- "default": {
- "default": "bet symbol",
- "alternative": "second transfinite cardinal",
- "short": "bet"
- }
- },
- "key": "2136"
-},
-{"category": "Lo",
- "mappings": {
- "default": {
- "default": "gimel symbol",
- "alternative": "third transfinite cardinal",
- "short": "gimel"
- }
- },
- "key": "2137"
-},
-{"category": "Lo",
- "mappings": {
- "default": {
- "default": "dalet symbol",
- "alternative": "fourth transfinite cardinal",
- "short": "dalet"
- }
- },
- "key": "2138"
-}
-] \ No newline at end of file
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-double-accent.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-double-accent.json
deleted file mode 100644
index 8a241c2fa15..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-double-accent.json
+++ /dev/null
@@ -1,572 +0,0 @@
-[
-{"category": "Ll",
- "names": [],
- "key": "01D6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with diaeresis and macron",
- "alternative": "latin small letter u double overdot overbar",
- "short": "u double overdot overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01D8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with diaeresis and acute",
- "alternative": "latin small letter u double overdot acute",
- "short": "u double overdot acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01DA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with diaeresis and caron",
- "alternative": "latin small letter u double overdot hacek",
- "short": "u double overdot caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01DC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with diaeresis and grave",
- "alternative": "latin small letter u double overdot grave",
- "short": "u double overdot grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01DF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with diaeresis and macron",
- "alternative": "latin small letter a double overdot overbar",
- "short": "a double overdot overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01E1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with dot above and macron",
- "alternative": "latin small letter a dot overbar",
- "short": "a overdot overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01ED",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with ogonek and macron",
- "alternative": "latin small letter o ogonek overbar",
- "short": "o ogonek overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01FB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with ring above and acute",
- "alternative": "latin small letter a ring above acute",
- "short": "a ring above acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "022B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with diaeresis and macron",
- "alternative": "latin small letter o double overdot overbar",
- "short": "o double overdot overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "022D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with tilde and macron",
- "alternative": "latin small letter o tilde overbar",
- "short": "o tilde overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0231",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with dot above and macron",
- "alternative": "latin small letter o overdot overbar",
- "short": "o overdot overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E09",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with cedilla and acute",
- "alternative": "latin small letter c cedilla acute",
- "short": "c cedilla acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E15",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with macron and grave",
- "alternative": "latin small letter e overbar grave",
- "short": "e overbar grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E17",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with macron and acute",
- "alternative": "latin small letter e overbar acute",
- "short": "e overbar acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E1D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with cedilla and breve",
- "alternative": "latin small letter e cedilla breve",
- "short": "e cedilla breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E2F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with diaeresis and acute",
- "alternative": "latin small letter i double overdot acute",
- "short": "i double overdot acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E39",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with dot below and macron",
- "alternative": "latin small letter l underdot overbar",
- "short": "l underdot overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E4D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with tilde and acute",
- "alternative": "latin small letter o tilde acute",
- "short": "o tilde acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E4F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with tilde and diaeresis",
- "alternative": "latin small letter o tilde double overdot",
- "short": "o tilde double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E51",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with macron and grave",
- "alternative": "latin small letter o overbar grave",
- "short": "o overbar grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E53",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with macron and acute",
- "alternative": "latin small letter o overbar acute",
- "short": "o overbar acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E5D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with dot below and macron",
- "alternative": "latin small letter r underdot overbar",
- "short": "r underdot overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E65",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with acute and dot above",
- "alternative": "latin small letter s acute overdot",
- "short": "s acute overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E67",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with caron and dot above",
- "alternative": "latin small letter s caron overdot",
- "short": "s caron overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E69",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with dot below and dot above",
- "alternative": "latin small letter s underdot overdot",
- "short": "s underdot overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E79",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with tilde and acute",
- "alternative": "latin small letter u tilde acute",
- "short": "u tilde acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E7B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with macron and diaeresis",
- "alternative": "latin small letter u overbar double overdot",
- "short": "u overbar double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EA5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with circumflex and acute",
- "alternative": "latin small letter a hat acute",
- "short": "a hat acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EA7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with circumflex and grave",
- "alternative": "latin small letter a hat grave",
- "short": "a hat grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EA9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with circumflex and hook above",
- "alternative": "latin small letter a hat hook above",
- "short": "a hat hook above"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EAB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with circumflex and tilde",
- "alternative": "latin small letter a hat tilde",
- "short": "a hat tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EAD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with circumflex and dot below",
- "alternative": "latin small letter a hat underdot",
- "short": "a hat underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EAF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with breve and acute",
- "alternative": "latin small letter a breve acute",
- "short": "a breve acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EB1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with breve and grave",
- "alternative": "latin small letter a breve grave",
- "short": "a breve grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EB3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with breve and hook above",
- "alternative": "latin small letter a breve hook above",
- "short": "a breve hook above"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EB5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with breve and tilde",
- "alternative": "latin small letter a breve tilde",
- "short": "a breve tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EB7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with breve and dot below",
- "alternative": "latin small letter a breve underdot",
- "short": "a breve underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EBF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with circumflex and acute",
- "alternative": "latin small letter e hat acute",
- "short": "e hat acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EC1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with circumflex and grave",
- "alternative": "latin small letter e hat grave",
- "short": "e hat grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EC3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with circumflex and hook above",
- "alternative": "latin small letter e hat hook above",
- "short": "e hat hook above"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EC5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with circumflex and tilde",
- "alternative": "latin small letter e hat tilde",
- "short": "e hat tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EC7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with circumflex and dot below",
- "alternative": "latin small letter e hat underdot",
- "short": "e hat underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ED1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with circumflex and acute",
- "alternative": "latin small letter o hat acute",
- "short": "o hat acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ED3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with circumflex and grave",
- "alternative": "latin small letter o hat grave",
- "short": "o hat grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ED5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with circumflex and hook above",
- "alternative": "latin small letter o hat hook above",
- "short": "o hat hook above"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ED7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with circumflex and tilde",
- "alternative": "latin small letter o hat tilde",
- "short": "o hat tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ED9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with circumflex and dot below",
- "alternative": "latin small letter o hat underdot",
- "short": "o hat underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EDB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with horn and acute",
- "alternative": "latin small letter o acute prime",
- "short": "o acute prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EDD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with horn and grave",
- "alternative": "latin small letter o grave prime",
- "short": "o grave prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EDF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with horn and hook above",
- "alternative": "latin small letter o hook above prime",
- "short": "o hook above prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EE1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with horn and tilde",
- "alternative": "latin small letter o tilde prime",
- "short": "o tilde prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EE3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with horn and dot below",
- "alternative": "latin small letter o underdot prime",
- "short": "o underdot prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EE9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with horn and acute",
- "alternative": "latin small letter u acute prime",
- "short": "u acute prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EEB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with horn and grave",
- "alternative": "latin small letter u grave prime",
- "short": "u grave prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EED",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with horn and hook above",
- "alternative": "latin small letter u hook above prime",
- "short": "u hook above prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EEF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with horn and tilde",
- "alternative": "latin small letter u tilde prime",
- "short": "u tilde prime"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EF1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with horn and dot below",
- "alternative": "latin small letter u underdot prime",
- "short": "u underdot prime"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-normal.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-normal.json
deleted file mode 100644
index 0504d7b8499..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-normal.json
+++ /dev/null
@@ -1,522 +0,0 @@
-[
-{"category": "Ll",
- "names": [],
- "key": "0061",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a",
- "alternative": "",
- "short": "a"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0062",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter b",
- "alternative": "",
- "short": "b"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0063",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c",
- "alternative": "",
- "short": "c"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0064",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d",
- "alternative": "",
- "short": "d"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0065",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e",
- "alternative": "",
- "short": "e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0066",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter f",
- "alternative": "",
- "short": "f"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0067",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g",
- "alternative": "",
- "short": "g"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0068",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h",
- "alternative": "",
- "short": "h"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0069",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i",
- "alternative": "",
- "short": "i"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "006A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter j",
- "alternative": "",
- "short": "j"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "006B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter k",
- "alternative": "",
- "short": "k"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "006C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l",
- "alternative": "",
- "short": "l"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "006D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter m",
- "alternative": "",
- "short": "m"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "006E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n",
- "alternative": "",
- "short": "n"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "006F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o",
- "alternative": "",
- "short": "o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0070",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter p",
- "alternative": "",
- "short": "p"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0071",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter q",
- "alternative": "",
- "short": "q"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0072",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r",
- "alternative": "",
- "short": "r"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0073",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s",
- "alternative": "",
- "short": "s"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0074",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t",
- "alternative": "",
- "short": "t"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0075",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u",
- "alternative": "",
- "short": "u"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0076",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter v",
- "alternative": "",
- "short": "v"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0077",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w",
- "alternative": "",
- "short": "w"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0078",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter x",
- "alternative": "",
- "short": "x"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0079",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y",
- "alternative": "",
- "short": "y"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "007A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z",
- "alternative": "",
- "short": "z"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF41",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter a",
- "alternative": "",
- "short": "a"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF42",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter b",
- "alternative": "",
- "short": "b"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF43",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter c",
- "alternative": "",
- "short": "c"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF44",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter d",
- "alternative": "",
- "short": "d"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF45",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter e",
- "alternative": "",
- "short": "e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF46",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter f",
- "alternative": "",
- "short": "f"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF47",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter g",
- "alternative": "",
- "short": "g"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF48",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter h",
- "alternative": "",
- "short": "h"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF49",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter i",
- "alternative": "",
- "short": "i"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF4A",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter j",
- "alternative": "",
- "short": "j"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF4B",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter k",
- "alternative": "",
- "short": "k"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF4C",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter l",
- "alternative": "",
- "short": "l"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF4D",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter m",
- "alternative": "",
- "short": "m"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF4E",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter n",
- "alternative": "",
- "short": "n"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF4F",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter o",
- "alternative": "",
- "short": "o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF50",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter p",
- "alternative": "",
- "short": "p"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF51",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter q",
- "alternative": "",
- "short": "q"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF52",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter r",
- "alternative": "",
- "short": "r"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF53",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter s",
- "alternative": "",
- "short": "s"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF54",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter t",
- "alternative": "",
- "short": "t"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF55",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter u",
- "alternative": "",
- "short": "u"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF56",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter v",
- "alternative": "",
- "short": "v"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF57",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter w",
- "alternative": "",
- "short": "w"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF58",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter x",
- "alternative": "",
- "short": "x"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF59",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter y",
- "alternative": "",
- "short": "y"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "FF5A",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin small letter z",
- "alternative": "",
- "short": "z"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-phonetic.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-phonetic.json
deleted file mode 100644
index 7f7709fd6f3..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-phonetic.json
+++ /dev/null
@@ -1,2152 +0,0 @@
-[
-{"category": "Ll",
- "names": [],
- "key": "00F8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with stroke",
- "alternative": "latin small letter o slash",
- "short": "o with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0111",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with stroke",
- "alternative": "latin small letter d bar",
- "short": "d with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0127",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with stroke",
- "alternative": "latin small letter h bar",
- "short": "h with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0142",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with stroke",
- "alternative": "latin small letter l slash",
- "short": "l with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0167",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with stroke",
- "alternative": "latin small letter t bar",
- "short": "t with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0180",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter b with stroke",
- "alternative": "latin small letter b bar",
- "short": "b with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "019B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter lambda with stroke",
- "alternative": "latin small letter barred lambda",
- "short": "lambda with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01B6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z with stroke",
- "alternative": "latin small letter z bar",
- "short": "z with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01BE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin letter inverted glottal stop with stroke",
- "alternative": "latin letter inverted glottal stop bar",
- "short": "latin letter inverted glottal stop with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01E5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with stroke",
- "alternative": "latin small letter g bar",
- "short": "g with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01FF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with stroke and acute",
- "alternative": "",
- "short": "o with stroke and acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "023C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with stroke",
- "alternative": "",
- "short": "c with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0247",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with stroke",
- "alternative": "",
- "short": "e with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0249",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter j with stroke",
- "alternative": "",
- "short": "j with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "024D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with stroke",
- "alternative": "",
- "short": "r with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "024F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with stroke",
- "alternative": "",
- "short": "y with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "025F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter dotless j with stroke",
- "alternative": "latin small letter dotless j bar",
- "short": "dotless j with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0268",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with stroke",
- "alternative": "latin small letter barred i",
- "short": "i with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0284",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter dotless j with stroke and hook",
- "alternative": "latin small letter dotless j bar hook",
- "short": "dotless j with stroke and hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin letter glottal stop with stroke",
- "alternative": "latin letter glottal stop bar",
- "short": "latin letter glottal stop with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin letter reversed glottal stop with stroke",
- "alternative": "latin letter reversed glottal stop bar",
- "short": "latin letter reversed glottal stop with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D13",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter sideways o with stroke",
- "alternative": "",
- "short": "sideways o with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D7C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter iota with stroke",
- "alternative": "",
- "short": "iota with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D7D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter p with stroke",
- "alternative": "",
- "short": "p with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D7F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter upsilon with stroke",
- "alternative": "",
- "short": "upsilon with stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E9C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter long s with diagonal stroke",
- "alternative": "",
- "short": "long s with diagonal stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E9D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter long s with high stroke",
- "alternative": "",
- "short": "long s with high stroke"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "018D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter turned delta",
- "alternative": "",
- "short": "turned delta"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E9B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter long s with dot above",
- "alternative": "",
- "short": "long s with dot above"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E9F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter delta",
- "alternative": "",
- "short": "delta"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0138",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter kra",
- "alternative": "",
- "short": "kra"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "017F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter long s",
- "alternative": "",
- "short": "long s"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0183",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter b with topbar",
- "alternative": "latin small letter b topbar",
- "short": "b with topbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0185",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter tone six",
- "alternative": "",
- "short": "tone six"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0188",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with hook",
- "alternative": "latin small letter c hook",
- "short": "c with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "018C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with topbar",
- "alternative": "latin small letter d topbar",
- "short": "d with topbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0192",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter f with hook",
- "alternative": "latin small letter script f",
- "short": "f with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0195",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter hv",
- "alternative": "latin small letter h v",
- "short": "hv"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0199",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter k with hook",
- "alternative": "latin small letter k hook",
- "short": "k with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "019A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with bar",
- "alternative": "latin small letter barred l",
- "short": "l with bar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "019E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with long right leg",
- "alternative": "",
- "short": "n with long right leg"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01A1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with horn",
- "alternative": "latin small letter o horn",
- "short": "o with horn"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01A3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter oi",
- "alternative": "latin small letter o i",
- "short": "oi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01A5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter p with hook",
- "alternative": "latin small letter p hook",
- "short": "p with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01A8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter tone two",
- "alternative": "",
- "short": "tone two"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01AA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin letter reversed esh loop",
- "alternative": "",
- "short": "latin letter reversed esh loop"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01AB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with palatal hook",
- "alternative": "latin small letter t palatal hook",
- "short": "t with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01AD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with hook",
- "alternative": "latin small letter t hook",
- "short": "t with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01B0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with horn",
- "alternative": "latin small letter u horn",
- "short": "u with horn"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01B4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with hook",
- "alternative": "latin small letter y hook",
- "short": "y with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01B9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter ezh reversed",
- "alternative": "latin small letter reversed yogh",
- "short": "ezh reversed"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01BA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter ezh with tail",
- "alternative": "latin small letter yogh with tail",
- "short": "ezh with tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01BD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter tone five",
- "alternative": "",
- "short": "tone five"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01BF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin letter wynn",
- "alternative": "",
- "short": "latin letter wynn"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01C6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter dz with caron",
- "alternative": "latin small letter d z hacek",
- "short": "dz with caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01C9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter lj",
- "alternative": "latin small letter l j",
- "short": "lj"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01CC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter nj",
- "alternative": "latin small letter n j",
- "short": "nj"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01E3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter ae with macron",
- "alternative": "latin small letter a e macron",
- "short": "ae with macron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01EF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter ezh with caron",
- "alternative": "latin small letter yogh hacek",
- "short": "ezh with caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01F3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter dz",
- "alternative": "",
- "short": "dz"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "021D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter yogh",
- "alternative": "",
- "short": "yogh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "026E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter lezh",
- "alternative": "latin small letter l yogh",
- "short": "lezh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0292",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter ezh",
- "alternative": "latin small letter yogh",
- "short": "ezh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0293",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter ezh with curl",
- "alternative": "latin small letter yogh curl",
- "short": "ezh with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter dezh digraph",
- "alternative": "latin small letter d yogh",
- "short": "dezh digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01DD",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned e",
- "alternative": "",
- "short": "turned e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01FD",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ae with acute",
- "alternative": "",
- "short": "ae with acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "021D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter yogh",
- "alternative": "",
- "short": "yogh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0221",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter d with curl",
- "alternative": "",
- "short": "d with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0223",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ou",
- "alternative": "",
- "short": "ou"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0225",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter z with hook",
- "alternative": "",
- "short": "z with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0234",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter l with curl",
- "alternative": "",
- "short": "l with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0235",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter n with curl",
- "alternative": "",
- "short": "n with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0236",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter t with curl",
- "alternative": "",
- "short": "t with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0238",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter db digraph",
- "alternative": "",
- "short": "db digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0239",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter qp digraph",
- "alternative": "",
- "short": "qp digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "023F",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter s with swash tail",
- "alternative": "",
- "short": "s with swash tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0240",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter z with swash tail",
- "alternative": "",
- "short": "z with swash tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0242",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter glottal stop",
- "alternative": "",
- "short": "glottal stop"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "024B",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter q with hook tail",
- "alternative": "",
- "short": "q with hook tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0250",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned a",
- "alternative": "",
- "short": "turned a"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0251",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter alpha",
- "alternative": "latin small letter script a",
- "short": "alpha"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0252",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned alpha",
- "alternative": "latin small letter turned script a",
- "short": "turned alpha"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0253",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter b with hook",
- "alternative": "latin small letter b hook",
- "short": "b with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0254",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter open o",
- "alternative": "",
- "short": "open o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0255",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter c with curl",
- "alternative": "latin small letter c curl",
- "short": "c with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0256",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter d with tail",
- "alternative": "latin small letter d retroflex hook",
- "short": "d with tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0257",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter d with hook",
- "alternative": "latin small letter d hook",
- "short": "d with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0258",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter reversed e",
- "alternative": "",
- "short": "reversed e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0259",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter schwa",
- "alternative": "",
- "short": "schwa"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "025A",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter schwa with hook",
- "alternative": "latin small letter schwa hook",
- "short": "schwa with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "025B",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter open e",
- "alternative": "latin small letter epsilon",
- "short": "open e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "025C",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter reversed open e",
- "alternative": "latin small letter reversed epsilon",
- "short": "reversed open e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "025D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter reversed open e with hook",
- "alternative": "latin small letter reversed epsilon hook",
- "short": "reversed open e with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "025E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter closed reversed open e",
- "alternative": "latin small letter closed reversed epsilon",
- "short": "closed reversed open e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0260",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter g with hook",
- "alternative": "latin small letter g hook",
- "short": "g with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0261",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter script g",
- "alternative": "",
- "short": "script g"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0263",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter gamma",
- "alternative": "",
- "short": "gamma"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0264",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter rams horn",
- "alternative": "latin small letter baby gamma",
- "short": "rams horn"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0265",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned h",
- "alternative": "",
- "short": "turned h"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0266",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter h with hook",
- "alternative": "latin small letter h hook",
- "short": "h with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0267",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter heng with hook",
- "alternative": "latin small letter heng hook",
- "short": "heng with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0269",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter iota",
- "alternative": "",
- "short": "iota"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "026B",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter l with middle tilde",
- "alternative": "",
- "short": "l with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "026C",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter l with belt",
- "alternative": "latin small letter l belt",
- "short": "l with belt"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "026D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter l with retroflex hook",
- "alternative": "latin small letter l retroflex hook",
- "short": "l with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "026E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter lezh",
- "alternative": "latin small letter l yogh",
- "short": "lezh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "026F",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned m",
- "alternative": "",
- "short": "turned m"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0270",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned m with long leg",
- "alternative": "",
- "short": "turned m with long leg"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0271",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter m with hook",
- "alternative": "latin small letter m hook",
- "short": "m with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0272",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter n with left hook",
- "alternative": "latin small letter n hook",
- "short": "n with left hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0273",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter n with retroflex hook",
- "alternative": "latin small letter n retroflex hook",
- "short": "n with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0275",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter barred o",
- "alternative": "",
- "short": "barred o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0277",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter closed omega",
- "alternative": "",
- "short": "closed omega"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0278",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter phi",
- "alternative": "",
- "short": "phi"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0279",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned r",
- "alternative": "",
- "short": "turned r"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "027A",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned r with long leg",
- "alternative": "",
- "short": "turned r with long leg"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "027B",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned r with hook",
- "alternative": "latin small letter turned r hook",
- "short": "turned r with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "027C",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter r with long leg",
- "alternative": "",
- "short": "r with long leg"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "027D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter r with tail",
- "alternative": "latin small letter r hook",
- "short": "r with tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "027E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter r with fishhook",
- "alternative": "latin small letter fishhook r",
- "short": "r with fishhook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "027F",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter reversed r with fishhook",
- "alternative": "latin small letter reversed fishhook r",
- "short": "reversed r with fishhook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0282",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter s with hook",
- "alternative": "latin small letter s hook",
- "short": "s with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0283",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter esh",
- "alternative": "",
- "short": "esh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0285",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter squat reversed esh",
- "alternative": "",
- "short": "squat reversed esh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0286",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter esh with curl",
- "alternative": "latin small letter esh curl",
- "short": "esh with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0287",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned t",
- "alternative": "",
- "short": "turned t"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0288",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter t with retroflex hook",
- "alternative": "latin small letter t retroflex hook",
- "short": "t with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0289",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter u bar",
- "alternative": "",
- "short": "u bar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "028A",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter upsilon",
- "alternative": "",
- "short": "upsilon"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "028B",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter v with hook",
- "alternative": "latin small letter script v",
- "short": "v with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "028C",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned v",
- "alternative": "",
- "short": "turned v"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "028D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned w",
- "alternative": "",
- "short": "turned w"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "028E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned y",
- "alternative": "",
- "short": "turned y"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0290",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter z with retroflex hook",
- "alternative": "latin small letter z retroflex hook",
- "short": "z with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0291",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter z with curl",
- "alternative": "latin small letter z curl",
- "short": "z with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0292",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ezh",
- "alternative": "latin small letter yogh",
- "short": "ezh"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0293",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ezh with curl",
- "alternative": "latin small letter yogh curl",
- "short": "ezh with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0295",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter pharyngeal voiced fricative",
- "alternative": "latin letter reversed glottal stop",
- "short": "latin letter pharyngeal voiced fricative"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0296",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter inverted glottal stop",
- "alternative": "",
- "short": "latin letter inverted glottal stop"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0297",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter stretched c",
- "alternative": "",
- "short": "latin letter stretched c"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0298",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter bilabial click",
- "alternative": "latin letter bullseye",
- "short": "latin letter bilabial click"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "029A",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter closed open e",
- "alternative": "latin small letter closed epsilon",
- "short": "closed open e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "029E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned k",
- "alternative": "",
- "short": "turned k"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A0",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter q with hook",
- "alternative": "latin small letter q hook",
- "short": "q with hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A3",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter dz digraph",
- "alternative": "latin small letter d z",
- "short": "dz digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A4",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter dezh digraph",
- "alternative": "latin small letter d yogh",
- "short": "dezh digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A5",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter dz digraph with curl",
- "alternative": "latin small letter d z curl",
- "short": "dz digraph with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A6",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ts digraph",
- "alternative": "latin small letter t s",
- "short": "ts digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A7",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter tesh digraph",
- "alternative": "latin small letter t esh",
- "short": "tesh digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A8",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter tc digraph with curl",
- "alternative": "latin small letter t c curl",
- "short": "tc digraph with curl"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02A9",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter feng digraph",
- "alternative": "",
- "short": "feng digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02AA",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ls digraph",
- "alternative": "",
- "short": "ls digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02AB",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter lz digraph",
- "alternative": "",
- "short": "lz digraph"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02AC",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter bilabial percussive",
- "alternative": "",
- "short": "latin letter bilabial percussive"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02AD",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter bidental percussive",
- "alternative": "",
- "short": "latin letter bidental percussive"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02AE",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned h with fishhook",
- "alternative": "",
- "short": "turned h with fishhook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "02AF",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned h with fishhook and tail",
- "alternative": "",
- "short": "turned h with fishhook and tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D02",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned ae",
- "alternative": "",
- "short": "turned ae"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D08",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned open e",
- "alternative": "",
- "short": "turned open e"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D09",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned i",
- "alternative": "",
- "short": "turned i"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D11",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter sideways o",
- "alternative": "",
- "short": "sideways o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D12",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter sideways open o",
- "alternative": "",
- "short": "sideways open o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D14",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned oe",
- "alternative": "",
- "short": "turned oe"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D16",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter top half o",
- "alternative": "",
- "short": "top half o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D17",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter bottom half o",
- "alternative": "",
- "short": "bottom half o"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D1D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter sideways u",
- "alternative": "",
- "short": "sideways u"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D1E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter sideways diaeresized u",
- "alternative": "",
- "short": "sideways diaeresized u"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D1F",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter sideways turned m",
- "alternative": "",
- "short": "sideways turned m"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D24",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter voiced laryngeal spirant",
- "alternative": "",
- "short": "latin letter voiced laryngeal spirant"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D25",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin letter ain",
- "alternative": "",
- "short": "latin letter ain"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D6B",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ue",
- "alternative": "",
- "short": "ue"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D6C",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter b with middle tilde",
- "alternative": "",
- "short": "b with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D6D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter d with middle tilde",
- "alternative": "",
- "short": "d with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D6E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter f with middle tilde",
- "alternative": "",
- "short": "f with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D6F",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter m with middle tilde",
- "alternative": "",
- "short": "m with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D70",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter n with middle tilde",
- "alternative": "",
- "short": "n with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D71",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter p with middle tilde",
- "alternative": "",
- "short": "p with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D72",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter r with middle tilde",
- "alternative": "",
- "short": "r with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D73",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter r with fishhook and middle tilde",
- "alternative": "",
- "short": "r with fishhook and middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D74",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter s with middle tilde",
- "alternative": "",
- "short": "s with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D75",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter t with middle tilde",
- "alternative": "",
- "short": "t with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D76",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter z with middle tilde",
- "alternative": "",
- "short": "z with middle tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D77",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter turned g",
- "alternative": "",
- "short": "turned g"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D79",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter insular g",
- "alternative": "",
- "short": "insular g"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D7A",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter th with strikethrough",
- "alternative": "",
- "short": "th with strikethrough"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D80",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter b with palatal hook",
- "alternative": "",
- "short": "b with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D81",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter d with palatal hook",
- "alternative": "",
- "short": "d with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D82",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter f with palatal hook",
- "alternative": "",
- "short": "f with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D83",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter g with palatal hook",
- "alternative": "",
- "short": "g with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D84",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter k with palatal hook",
- "alternative": "",
- "short": "k with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D85",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter l with palatal hook",
- "alternative": "",
- "short": "l with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D86",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter m with palatal hook",
- "alternative": "",
- "short": "m with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D87",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter n with palatal hook",
- "alternative": "",
- "short": "n with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D88",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter p with palatal hook",
- "alternative": "",
- "short": "p with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D89",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter r with palatal hook",
- "alternative": "",
- "short": "r with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D8A",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter s with palatal hook",
- "alternative": "",
- "short": "s with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D8B",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter esh with palatal hook",
- "alternative": "",
- "short": "esh with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D8C",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter v with palatal hook",
- "alternative": "",
- "short": "v with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D8D",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter x with palatal hook",
- "alternative": "",
- "short": "x with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D8E",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter z with palatal hook",
- "alternative": "",
- "short": "z with palatal hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D8F",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter a with retroflex hook",
- "alternative": "",
- "short": "a with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D90",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter alpha with retroflex hook",
- "alternative": "",
- "short": "alpha with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D91",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter d with hook and tail",
- "alternative": "",
- "short": "d with hook and tail"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D92",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter e with retroflex hook",
- "alternative": "",
- "short": "e with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D93",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter open e with retroflex hook",
- "alternative": "",
- "short": "open e with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D94",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter reversed open e with retroflex hook",
- "alternative": "",
- "short": "reversed open e with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D95",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter schwa with retroflex hook",
- "alternative": "",
- "short": "schwa with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D96",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter i with retroflex hook",
- "alternative": "",
- "short": "i with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D97",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter open o with retroflex hook",
- "alternative": "",
- "short": "open o with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D98",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter esh with retroflex hook",
- "alternative": "",
- "short": "esh with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D99",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter u with retroflex hook",
- "alternative": "",
- "short": "u with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1D9A",
- "active": false,
- "mappings": {
- "default": {
- "default": "latin small letter ezh with retroflex hook",
- "alternative": "",
- "short": "ezh with retroflex hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0149",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n preceded by apostrophe",
- "alternative": "latin small letter apostrophe n",
- "short": "n preceded by apostrophe"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "014B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter eng",
- "alternative": "",
- "short": "eng"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-single-accent.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-single-accent.json
deleted file mode 100644
index 825ba13e4d8..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-lower-single-accent.json
+++ /dev/null
@@ -1,1912 +0,0 @@
-[
-{"category": "Ll",
- "names": [],
- "key": "00E0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with grave",
- "alternative": "latin small letter a grave",
- "short": "a grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with acute",
- "alternative": "latin small letter a acute",
- "short": "a acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with circumflex",
- "alternative": "latin small letter a hat",
- "short": "a hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with tilde",
- "alternative": "latin small letter a tilde",
- "short": "a tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with diaeresis",
- "alternative": "latin small letter a double overdot",
- "short": "a double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with ring above",
- "alternative": "latin small letter a ring",
- "short": "a ring"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with cedilla",
- "alternative": "latin small letter c cedilla",
- "short": "c cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with grave",
- "alternative": "latin small letter e grave",
- "short": "e grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00E9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with acute",
- "alternative": "latin small letter e acute",
- "short": "e acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00EA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with circumflex",
- "alternative": "latin small letter e hat",
- "short": "e hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00EB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with diaeresis",
- "alternative": "latin small letter e double overdot",
- "short": "e double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00EC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with grave",
- "alternative": "latin small letter i grave",
- "short": "i grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00ED",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with acute",
- "alternative": "latin small letter i acute",
- "short": "i acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00EE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with circumflex",
- "alternative": "latin small letter i hat",
- "short": "i hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00EF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with diaeresis",
- "alternative": "latin small letter i double overdot",
- "short": "i double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00F1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with tilde",
- "alternative": "latin small letter n tilde",
- "short": "n tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00F2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with grave",
- "alternative": "latin small letter o grave",
- "short": "o grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00F3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with acute",
- "alternative": "latin small letter o acute",
- "short": "o acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00F4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with circumflex",
- "alternative": "latin small letter o hat",
- "short": "o hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00F5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with tilde",
- "alternative": "latin small letter o tilde",
- "short": "o tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00F6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with diaeresis",
- "alternative": "latin small letter o double overdot",
- "short": "o double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00F9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with grave",
- "alternative": "latin small letter u grave",
- "short": "u grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00FA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with acute",
- "alternative": "latin small letter u acute",
- "short": "u acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00FB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with circumflex",
- "alternative": "latin small letter u hat",
- "short": "u hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00FC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with diaeresis",
- "alternative": "latin small letter u double overdot",
- "short": "u double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00FD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with acute",
- "alternative": "latin small letter y acute",
- "short": "y acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "00FF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with diaeresis",
- "alternative": "latin small letter y double overdot",
- "short": "y double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0101",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with macron",
- "alternative": "latin small letter a overbar",
- "short": "a overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0103",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with breve",
- "alternative": "latin small letter a breve",
- "short": "a breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0105",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with ogonek",
- "alternative": "latin small letter a ogonek",
- "short": "a ogonek"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0107",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with acute",
- "alternative": "latin small letter c acute",
- "short": "c acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0109",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with circumflex",
- "alternative": "latin small letter c hat",
- "short": "c hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "010B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with dot above",
- "alternative": "latin small letter c dot",
- "short": "c overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "010D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter c with caron",
- "alternative": "latin small letter c hacek",
- "short": "c caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "010F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with caron",
- "alternative": "latin small letter d hacek",
- "short": "d caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0113",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with macron",
- "alternative": "latin small letter e overbar",
- "short": "e overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0115",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with breve",
- "alternative": "latin small letter e breve",
- "short": "e breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0117",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with dot above",
- "alternative": "latin small letter e dot",
- "short": "e overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0119",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with ogonek",
- "alternative": "latin small letter e ogonek",
- "short": "e ogonek"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "011B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with caron",
- "alternative": "latin small letter e hacek",
- "short": "e caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "011D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with circumflex",
- "alternative": "latin small letter g hat",
- "short": "g hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "011F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with breve",
- "alternative": "latin small letter g breve",
- "short": "g breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0121",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with dot above",
- "alternative": "latin small letter g dot",
- "short": "g overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0123",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with cedilla",
- "alternative": "latin small letter g cedilla",
- "short": "g cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0125",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with circumflex",
- "alternative": "latin small letter h hat",
- "short": "h hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0129",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with tilde",
- "alternative": "latin small letter i tilde",
- "short": "i tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "012B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with macron",
- "alternative": "latin small letter i overbar",
- "short": "i overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "012D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with breve",
- "alternative": "latin small letter i breve",
- "short": "i breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "012F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with ogonek",
- "alternative": "latin small letter i ogonek",
- "short": "i ogonek"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0131",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter dotless i",
- "alternative": "latin small letter dotless i",
- "short": "dotless i"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0135",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter j circumflex",
- "alternative": "latin small letter j hat",
- "short": "j hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0137",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter k with cedilla",
- "alternative": "latin small letter k cedilla",
- "short": "k cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "013A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with acute",
- "alternative": "latin small letter l acute",
- "short": "l acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "013C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with cedilla",
- "alternative": "latin small letter l cedilla",
- "short": "l cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "013E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with caron",
- "alternative": "latin small letter l hacek",
- "short": "l caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0140",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with middle dot",
- "alternative": "latin small letter l middle dot",
- "short": "l middle dot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0144",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with acute",
- "alternative": "latin small letter n acute",
- "short": "n acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0146",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with cedilla",
- "alternative": "latin small letter n cedilla",
- "short": "n cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0148",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with caron",
- "alternative": "latin small letter n hacek",
- "short": "n caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "014D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o macron",
- "alternative": "latin small letter o overbar",
- "short": "o overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "014F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with breve",
- "alternative": "latin small letter o breve",
- "short": "o breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0151",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with double acute",
- "alternative": "latin small letter o double acute",
- "short": "o double acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0155",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with acute",
- "alternative": "latin small letter r acute",
- "short": "r acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0157",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with cedilla",
- "alternative": "latin small letter r cedilla",
- "short": "r cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0159",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with caron",
- "alternative": "latin small letter r hacek",
- "short": "r caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "015B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with acute",
- "alternative": "latin small letter s acute",
- "short": "s acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "015D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with circumflex",
- "alternative": "latin small letter s hat",
- "short": "s hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "015F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with cedilla",
- "alternative": "latin small letter s cedilla",
- "short": "s cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0161",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with caron",
- "alternative": "latin small letter s hacek",
- "short": "s caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0163",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with cedilla",
- "alternative": "latin small letter t cedilla",
- "short": "t cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0165",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with caron",
- "alternative": "latin small letter t hacek",
- "short": "t caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0169",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with tilde",
- "alternative": "latin small letter u tilde",
- "short": "u tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "016B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with macron",
- "alternative": "latin small letter u overbar",
- "short": "u overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "016D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with breve",
- "alternative": "latin small letter u breve",
- "short": "u breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "016F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with ring above",
- "alternative": "latin small letter u ring",
- "short": "u ring"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0171",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with double acute",
- "alternative": "latin small letter u double acute",
- "short": "u double acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0173",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with ogonek",
- "alternative": "latin small letter u ogonek",
- "short": "u ogonek"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0175",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w with circumflex",
- "alternative": "latin small letter w hat",
- "short": "w hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0177",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with circumflex",
- "alternative": "latin small letter y hat",
- "short": "y hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "017A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z with acute",
- "alternative": "latin small letter z acute",
- "short": "z acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "017C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z with dot above",
- "alternative": "latin small letter z dot",
- "short": "z overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "017E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z with caron",
- "alternative": "latin small letter z hacek",
- "short": "z caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01CE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with caron",
- "alternative": "latin small letter a hacek",
- "short": "a caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01D0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with caron",
- "alternative": "latin small letter i hacek",
- "short": "i caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01D2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with caron",
- "alternative": "latin small letter o hacek",
- "short": "o caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01D4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with caron",
- "alternative": "latin small letter u hacek",
- "short": "u caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01E7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with caron",
- "alternative": "latin small letter g hacek",
- "short": "g caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01E9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter k with caron",
- "alternative": "latin small letter k hacek",
- "short": "k caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01EB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with ogonek",
- "alternative": "latin small letter o ogonek",
- "short": "o ogonek"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01F0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter j with caron",
- "alternative": "latin small letter j hacek",
- "short": "j caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01F5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with acute",
- "alternative": "latin small letter g acute",
- "short": "g acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "01F9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with grave",
- "alternative": "latin small letter n grave",
- "short": "n grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0201",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with double grave",
- "alternative": "latin small letter a double grave",
- "short": "a double grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0203",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with inverted breve",
- "alternative": "latin small letter a inverted breve",
- "short": "a inverted breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0205",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with double grave",
- "alternative": "latin small letter e double grave",
- "short": "e double grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0207",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with inverted breve",
- "alternative": "latin small letter e inverted breve",
- "short": "e inverted breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0209",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with double grave",
- "alternative": "latin small letter i double grave",
- "short": "i double grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "020B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with inverted breve",
- "alternative": "latin small letter i inverted breve",
- "short": "i inverted breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "020D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with double grave",
- "alternative": "latin small letter o double grave",
- "short": "o double grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "020F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with inverted breve",
- "alternative": "latin small letter o inverted breve",
- "short": "o inverted breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0211",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with double grave",
- "alternative": "latin small letter r double grave",
- "short": "r double grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0213",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with inverted breve",
- "alternative": "latin small letter r inverted breve",
- "short": "r inverted breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0215",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with double grave",
- "alternative": "latin small letter u double grave",
- "short": "u double grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0217",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with inverted breve",
- "alternative": "latin small letter u inverted breve",
- "short": "u inverted breve"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0219",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with comma below",
- "alternative": "latin small letter s comma below",
- "short": "s comma below"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "021B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with comma below",
- "alternative": "latin small letter t comma below",
- "short": "t comma below"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "021F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with caron",
- "alternative": "latin small letter h caron",
- "short": "h caron"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0227",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with dot above",
- "alternative": "latin small letter a overdot",
- "short": "a overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0229",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with cedilla",
- "alternative": "latin small letter e cedilla",
- "short": "e cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "022F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with dot above",
- "alternative": "latin small letter o overdot",
- "short": "o overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0233",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with macron",
- "alternative": "latin small letter y overbar",
- "short": "y overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "0237",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter dotless j",
- "alternative": "latin small letter dotless j",
- "short": "dotless j"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E01",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a ring below",
- "alternative": "latin small letter a ring below",
- "short": "a ring below"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E03",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter b with dot above",
- "alternative": "latin small letter b overdot",
- "short": "b overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E05",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter b with dot below",
- "alternative": "latin small letter b underdot",
- "short": "b underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E07",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter b with line below",
- "alternative": "latin small letter b underbar",
- "short": "b underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E0B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with dot above",
- "alternative": "latin small letter d overdot",
- "short": "d overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E0D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with dot below",
- "alternative": "latin small letter d underdot",
- "short": "d underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E0F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with line below",
- "alternative": "latin small letter d underbar",
- "short": "d underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E11",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with cedilla",
- "alternative": "latin small letter d cedilla",
- "short": "d cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E13",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter d with circumflex below",
- "alternative": "latin small letter d underhat",
- "short": "d underhat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E19",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with circumflex below",
- "alternative": "latin small letter e underhat",
- "short": "e underhat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E1B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with tilde below",
- "alternative": "latin small letter e tilde below",
- "short": "e tilde below"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E1F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter f with dot above",
- "alternative": "latin small letter f overdot",
- "short": "f overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E21",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter g with macron",
- "alternative": "latin small letter g overbar",
- "short": "g overbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E23",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with dot above",
- "alternative": "latin small letter h overdot",
- "short": "h overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E25",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with dot below",
- "alternative": "latin small letter h underdot",
- "short": "h underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E27",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with diaeresis",
- "alternative": "latin small letter h double overdot",
- "short": "h double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E29",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with cedilla",
- "alternative": "latin small letter h cedilla",
- "short": "h cedilla"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E2B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with breve below",
- "alternative": "latin small letter h breve below",
- "short": "h breve below"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E2D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with tilde below",
- "alternative": "latin small letter i tilde below",
- "short": "i tilde below"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E31",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter k with acute",
- "alternative": "latin small letter k acute",
- "short": "k acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E33",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter k with dot below",
- "alternative": "latin small letter k underdot",
- "short": "k underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E35",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter k with line below",
- "alternative": "latin small letter k underbar",
- "short": "k underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E37",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with dot below",
- "alternative": "latin small letter l underdot",
- "short": "l underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E3B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with line below",
- "alternative": "latin small letter l underbar",
- "short": "l underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E3D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter l with circumflex below",
- "alternative": "latin small letter l underhat",
- "short": "l underhat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E3F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter m with acute",
- "alternative": "latin small letter m acute",
- "short": "m acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E41",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter m with dot above",
- "alternative": "latin small letter m overdot",
- "short": "m overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E43",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter m with dot below",
- "alternative": "latin small letter m underdot",
- "short": "m underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E45",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with dot above",
- "alternative": "latin small letter n overdot",
- "short": "n overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E47",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with dot below",
- "alternative": "latin small letter n underdot",
- "short": "n underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E49",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with line below",
- "alternative": "latin small letter n underbar",
- "short": "n underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E4B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter n with circumflex below",
- "alternative": "latin small letter n underhat",
- "short": "n underhat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E55",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter p with acute",
- "alternative": "latin small letter p acute",
- "short": "p acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E57",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter p with dot above",
- "alternative": "latin small letter p overdot",
- "short": "p overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E59",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with dot above",
- "alternative": "latin small letter r overdot",
- "short": "r overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E5B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with dot below",
- "alternative": "latin small letter r underdot",
- "short": "r underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E5F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter r with line below",
- "alternative": "latin small letter r underbar",
- "short": "r underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E61",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with dot above",
- "alternative": "latin small letter s overdot",
- "short": "s overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E63",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter s with dot below",
- "alternative": "latin small letter s underdot",
- "short": "s underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E6B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with dot above",
- "alternative": "latin small letter t overdot",
- "short": "t overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E6D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with dot below",
- "alternative": "latin small letter t underdot",
- "short": "t underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E6F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with line below",
- "alternative": "latin small letter t underbar",
- "short": "t underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E71",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with circumflex below",
- "alternative": "latin small letter t underhat",
- "short": "t underhat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E73",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with diaeresis below",
- "alternative": "latin small letter u double underdot",
- "short": "u double underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E75",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with tilde below",
- "alternative": "latin small letter u tilde below",
- "short": "u tilde below"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E77",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with circumflex below",
- "alternative": "latin small letter u underhat",
- "short": "u underhat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E7D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter v with tilde",
- "alternative": "latin small letter v tilde",
- "short": "v tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E7F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter v with dot below",
- "alternative": "latin small letter v underdot",
- "short": "v underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E81",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w with grave",
- "alternative": "latin small letter w grave",
- "short": "w grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E83",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w with acute",
- "alternative": "latin small letter w acute",
- "short": "w acute"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E85",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w with diaeresis",
- "alternative": "latin small letter w double overdot",
- "short": "w double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E87",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w with dot above",
- "alternative": "latin small letter w overdot",
- "short": "w overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E89",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w with dot below",
- "alternative": "latin small letter w underdot",
- "short": "w underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E8B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter x with dot above",
- "alternative": "latin small letter x overdot",
- "short": "x overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E8D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter x with diaeresis",
- "alternative": "latin small letter x double overdot",
- "short": "x double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E8F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with dot above",
- "alternative": "latin small letter y overdot",
- "short": "y overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E91",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z with circumflex",
- "alternative": "latin small letter z hat",
- "short": "z hat"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E93",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z with dot below",
- "alternative": "latin small letter z underdot",
- "short": "z underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E95",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter z with line below",
- "alternative": "latin small letter z underbar",
- "short": "z underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E96",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter h with line below",
- "alternative": "latin small letter h underbar",
- "short": "h underbar"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E97",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter t with diaeresis",
- "alternative": "latin small letter t double overdot",
- "short": "t double overdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E98",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter w with ring above",
- "alternative": "latin small letter w ring",
- "short": "w ring"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E99",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with ring above",
- "alternative": "latin small letter y ring",
- "short": "y ring"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1E9A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with right half ring",
- "alternative": "latin small letter a right half ring",
- "short": "a right half ring"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EA1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with dot below",
- "alternative": "latin small letter a underdot",
- "short": "a underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EA3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter a with hook above",
- "alternative": "latin small letter a hook",
- "short": "a hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EB9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with dot below",
- "alternative": "latin small letter e underdot",
- "short": "e underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EBB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with hook above",
- "alternative": "latin small letter e hook",
- "short": "e hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EBD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter e with tilde",
- "alternative": "latin small letter e tilde",
- "short": "e tilde"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EC9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with hook above",
- "alternative": "latin small letter i hook",
- "short": "i hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ECB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter i with dot below",
- "alternative": "latin small letter i underdot",
- "short": "i underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ECD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with dot below",
- "alternative": "latin small letter o underdot",
- "short": "o underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1ECF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter o with hook above",
- "alternative": "latin small letter o hook",
- "short": "o hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EE5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with dot below",
- "alternative": "latin small letter u underdot",
- "short": "u underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EE7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter u with hook above",
- "alternative": "latin small letter u hook",
- "short": "u hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EF3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with grave",
- "alternative": "latin small letter y grave",
- "short": "y grave"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EF5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with dot below",
- "alternative": "latin small letter y underdot",
- "short": "y underdot"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EF7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with hook above",
- "alternative": "latin small letter y hook",
- "short": "y hook"
- }}},
-{"category": "Ll",
- "names": [],
- "key": "1EF9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin small letter y with tilde",
- "alternative": "latin small letter y tilde",
- "short": "y tilde"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-mathfonts.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-mathfonts.json
deleted file mode 100644
index 9adf11ef60a..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-mathfonts.json
+++ /dev/null
@@ -1,5502 +0,0 @@
-[
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital a",
- "alternative": "bold capital a",
- "short": "bold cap a"
- }
- },
- "key": "1D400"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital b",
- "alternative": "bold capital b",
- "short": "bold cap b"
- }
- },
- "key": "1D401"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital c",
- "alternative": "bold capital c",
- "short": "bold cap c"
- }
- },
- "key": "1D402"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital d",
- "alternative": "bold capital d",
- "short": "bold cap d"
- }
- },
- "key": "1D403"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital e",
- "alternative": "bold capital e",
- "short": "bold cap e"
- }
- },
- "key": "1D404"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital f",
- "alternative": "bold capital f",
- "short": "bold cap f"
- }
- },
- "key": "1D405"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital g",
- "alternative": "bold capital g",
- "short": "bold cap g"
- }
- },
- "key": "1D406"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital h",
- "alternative": "bold capital h",
- "short": "bold cap h"
- }
- },
- "key": "1D407"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital i",
- "alternative": "bold capital i",
- "short": "bold cap i"
- }
- },
- "key": "1D408"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital j",
- "alternative": "bold capital j",
- "short": "bold cap j"
- }
- },
- "key": "1D409"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital k",
- "alternative": "bold capital k",
- "short": "bold cap k"
- }
- },
- "key": "1D40A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital l",
- "alternative": "bold capital l",
- "short": "bold cap l"
- }
- },
- "key": "1D40B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital m",
- "alternative": "bold capital m",
- "short": "bold cap m"
- }
- },
- "key": "1D40C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital n",
- "alternative": "bold capital n",
- "short": "bold cap n"
- }
- },
- "key": "1D40D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital o",
- "alternative": "bold capital o",
- "short": "bold cap o"
- }
- },
- "key": "1D40E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital p",
- "alternative": "bold capital p",
- "short": "bold cap p"
- }
- },
- "key": "1D40F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital q",
- "alternative": "bold capital q",
- "short": "bold cap q"
- }
- },
- "key": "1D410"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital r",
- "alternative": "bold capital r",
- "short": "bold cap r"
- }
- },
- "key": "1D411"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital s",
- "alternative": "bold capital s",
- "short": "bold cap s"
- }
- },
- "key": "1D412"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital t",
- "alternative": "bold capital t",
- "short": "bold cap t"
- }
- },
- "key": "1D413"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital u",
- "alternative": "bold capital u",
- "short": "bold cap u"
- }
- },
- "key": "1D414"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital v",
- "alternative": "bold capital v",
- "short": "bold cap v"
- }
- },
- "key": "1D415"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital w",
- "alternative": "bold capital w",
- "short": "bold cap w"
- }
- },
- "key": "1D416"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital x",
- "alternative": "bold capital x",
- "short": "bold cap x"
- }
- },
- "key": "1D417"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital y",
- "alternative": "bold capital y",
- "short": "bold cap y"
- }
- },
- "key": "1D418"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold capital z",
- "alternative": "bold capital z",
- "short": "bold cap z"
- }
- },
- "key": "1D419"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small a",
- "alternative": "bold small a",
- "short": "bold a"
- }
- },
- "key": "1D41A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small b",
- "alternative": "bold small b",
- "short": "bold b"
- }
- },
- "key": "1D41B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small c",
- "alternative": "bold small c",
- "short": "bold c"
- }
- },
- "key": "1D41C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small d",
- "alternative": "bold small d",
- "short": "bold d"
- }
- },
- "key": "1D41D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small e",
- "alternative": "bold small e",
- "short": "bold e"
- }
- },
- "key": "1D41E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small f",
- "alternative": "bold small f",
- "short": "bold f"
- }
- },
- "key": "1D41F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small g",
- "alternative": "bold small g",
- "short": "bold g"
- }
- },
- "key": "1D420"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small h",
- "alternative": "bold small h",
- "short": "bold h"
- }
- },
- "key": "1D421"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small i",
- "alternative": "bold small i",
- "short": "bold i"
- }
- },
- "key": "1D422"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small j",
- "alternative": "bold small j",
- "short": "bold j"
- }
- },
- "key": "1D423"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small k",
- "alternative": "bold small k",
- "short": "bold k"
- }
- },
- "key": "1D424"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small l",
- "alternative": "bold small l",
- "short": "bold l"
- }
- },
- "key": "1D425"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small m",
- "alternative": "bold small m",
- "short": "bold m"
- }
- },
- "key": "1D426"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small n",
- "alternative": "bold small n",
- "short": "bold n"
- }
- },
- "key": "1D427"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small o",
- "alternative": "bold small o",
- "short": "bold o"
- }
- },
- "key": "1D428"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small p",
- "alternative": "bold small p",
- "short": "bold p"
- }
- },
- "key": "1D429"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small q",
- "alternative": "bold small q",
- "short": "bold q"
- }
- },
- "key": "1D42A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small r",
- "alternative": "bold small r",
- "short": "bold r"
- }
- },
- "key": "1D42B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small s",
- "alternative": "bold small s",
- "short": "bold s"
- }
- },
- "key": "1D42C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small t",
- "alternative": "bold small t",
- "short": "bold t"
- }
- },
- "key": "1D42D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small u",
- "alternative": "bold small u",
- "short": "bold u"
- }
- },
- "key": "1D42E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small v",
- "alternative": "bold small v",
- "short": "bold v"
- }
- },
- "key": "1D42F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small w",
- "alternative": "bold small w",
- "short": "bold w"
- }
- },
- "key": "1D430"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small x",
- "alternative": "bold small x",
- "short": "bold x"
- }
- },
- "key": "1D431"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small y",
- "alternative": "bold small y",
- "short": "bold y"
- }
- },
- "key": "1D432"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold small z",
- "alternative": "bold small z",
- "short": "bold z"
- }
- },
- "key": "1D433"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital a",
- "alternative": "italic capital a",
- "short": "italic cap a"
- }
- },
- "key": "1D434"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital b",
- "alternative": "italic capital b",
- "short": "italic cap b"
- }
- },
- "key": "1D435"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital c",
- "alternative": "italic capital c",
- "short": "italic cap c"
- }
- },
- "key": "1D436"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital d",
- "alternative": "italic capital d",
- "short": "italic cap d"
- }
- },
- "key": "1D437"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital e",
- "alternative": "italic capital e",
- "short": "italic cap e"
- }
- },
- "key": "1D438"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital f",
- "alternative": "italic capital f",
- "short": "italic cap f"
- }
- },
- "key": "1D439"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital g",
- "alternative": "italic capital g",
- "short": "italic cap g"
- }
- },
- "key": "1D43A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital h",
- "alternative": "italic capital h",
- "short": "italic cap h"
- }
- },
- "key": "1D43B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital i",
- "alternative": "italic capital i",
- "short": "italic cap i"
- }
- },
- "key": "1D43C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital j",
- "alternative": "italic capital j",
- "short": "italic cap j"
- }
- },
- "key": "1D43D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital k",
- "alternative": "italic capital k",
- "short": "italic cap k"
- }
- },
- "key": "1D43E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital l",
- "alternative": "italic capital l",
- "short": "italic cap l"
- }
- },
- "key": "1D43F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital m",
- "alternative": "italic capital m",
- "short": "italic cap m"
- }
- },
- "key": "1D440"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital n",
- "alternative": "italic capital n",
- "short": "italic cap n"
- }
- },
- "key": "1D441"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital o",
- "alternative": "italic capital o",
- "short": "italic cap o"
- }
- },
- "key": "1D442"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital p",
- "alternative": "italic capital p",
- "short": "italic cap p"
- }
- },
- "key": "1D443"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital q",
- "alternative": "italic capital q",
- "short": "italic cap q"
- }
- },
- "key": "1D444"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital r",
- "alternative": "italic capital r",
- "short": "italic cap r"
- }
- },
- "key": "1D445"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital s",
- "alternative": "italic capital s",
- "short": "italic cap s"
- }
- },
- "key": "1D446"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital t",
- "alternative": "italic capital t",
- "short": "italic cap t"
- }
- },
- "key": "1D447"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital u",
- "alternative": "italic capital u",
- "short": "italic cap u"
- }
- },
- "key": "1D448"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital v",
- "alternative": "italic capital v",
- "short": "italic cap v"
- }
- },
- "key": "1D449"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital w",
- "alternative": "italic capital w",
- "short": "italic cap w"
- }
- },
- "key": "1D44A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital x",
- "alternative": "italic capital x",
- "short": "italic cap x"
- }
- },
- "key": "1D44B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital y",
- "alternative": "italic capital y",
- "short": "italic cap y"
- }
- },
- "key": "1D44C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical italic capital z",
- "alternative": "italic capital z",
- "short": "italic cap z"
- }
- },
- "key": "1D44D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small a",
- "alternative": "italic small a",
- "short": "italic a"
- }
- },
- "key": "1D44E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small b",
- "alternative": "italic small b",
- "short": "italic b"
- }
- },
- "key": "1D44F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small c",
- "alternative": "italic small c",
- "short": "italic c"
- }
- },
- "key": "1D450"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small d",
- "alternative": "italic small d",
- "short": "italic d"
- }
- },
- "key": "1D451"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small e",
- "alternative": "italic small e",
- "short": "italic e"
- }
- },
- "key": "1D452"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small f",
- "alternative": "italic small f",
- "short": "italic f"
- }
- },
- "key": "1D453"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small g",
- "alternative": "italic small g",
- "short": "italic g"
- }
- },
- "key": "1D454"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small i",
- "alternative": "italic small i",
- "short": "italic i"
- }
- },
- "key": "1D456"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small j",
- "alternative": "italic small j",
- "short": "italic j"
- }
- },
- "key": "1D457"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small k",
- "alternative": "italic small k",
- "short": "italic k"
- }
- },
- "key": "1D458"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small l",
- "alternative": "italic small l",
- "short": "italic l"
- }
- },
- "key": "1D459"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small m",
- "alternative": "italic small m",
- "short": "italic m"
- }
- },
- "key": "1D45A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small n",
- "alternative": "italic small n",
- "short": "italic n"
- }
- },
- "key": "1D45B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small o",
- "alternative": "italic small o",
- "short": "italic o"
- }
- },
- "key": "1D45C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small p",
- "alternative": "italic small p",
- "short": "italic p"
- }
- },
- "key": "1D45D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small q",
- "alternative": "italic small q",
- "short": "italic q"
- }
- },
- "key": "1D45E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small r",
- "alternative": "italic small r",
- "short": "italic r"
- }
- },
- "key": "1D45F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small s",
- "alternative": "italic small s",
- "short": "italic s"
- }
- },
- "key": "1D460"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small t",
- "alternative": "italic small t",
- "short": "italic t"
- }
- },
- "key": "1D461"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small u",
- "alternative": "italic small u",
- "short": "italic u"
- }
- },
- "key": "1D462"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small v",
- "alternative": "italic small v",
- "short": "italic v"
- }
- },
- "key": "1D463"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small w",
- "alternative": "italic small w",
- "short": "italic w"
- }
- },
- "key": "1D464"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small x",
- "alternative": "italic small x",
- "short": "italic x"
- }
- },
- "key": "1D465"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small y",
- "alternative": "italic small y",
- "short": "italic y"
- }
- },
- "key": "1D466"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small z",
- "alternative": "italic small z",
- "short": "italic z"
- }
- },
- "key": "1D467"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital a",
- "alternative": "script capital a",
- "short": "script a"
- }
- },
- "key": "1D49C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital c",
- "alternative": "script capital c",
- "short": "script c"
- }
- },
- "key": "1D49E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital d",
- "alternative": "script capital d",
- "short": "script d"
- }
- },
- "key": "1D49F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital g",
- "alternative": "script capital g",
- "short": "script g"
- }
- },
- "key": "1D4A2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital j",
- "alternative": "script capital j",
- "short": "script j"
- }
- },
- "key": "1D4A5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital k",
- "alternative": "script capital k",
- "short": "script k"
- }
- },
- "key": "1D4A6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital n",
- "alternative": "script capital n",
- "short": "script n"
- }
- },
- "key": "1D4A9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital o",
- "alternative": "script capital o",
- "short": "script o"
- }
- },
- "key": "1D4AA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital p",
- "alternative": "script capital p",
- "short": "script p"
- }
- },
- "key": "1D4AB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital q",
- "alternative": "script capital q",
- "short": "script q"
- }
- },
- "key": "1D4AC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital s",
- "alternative": "script capital s",
- "short": "script s"
- }
- },
- "key": "1D4AE"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital t",
- "alternative": "script capital t",
- "short": "script t"
- }
- },
- "key": "1D4AF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital u",
- "alternative": "script capital u",
- "short": "script u"
- }
- },
- "key": "1D4B0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital v",
- "alternative": "script capital v",
- "short": "script v"
- }
- },
- "key": "1D4B1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital w",
- "alternative": "script capital w",
- "short": "script w"
- }
- },
- "key": "1D4B2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital x",
- "alternative": "script capital x",
- "short": "script x"
- }
- },
- "key": "1D4B3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital y",
- "alternative": "script capital y",
- "short": "script y"
- }
- },
- "key": "1D4B4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical script capital z",
- "alternative": "script capital z",
- "short": "script z"
- }
- },
- "key": "1D4B5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small a",
- "alternative": "script small a",
- "short": "script a"
- }
- },
- "key": "1D4B6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small b",
- "alternative": "script small b",
- "short": "script b"
- }
- },
- "key": "1D4B7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small c",
- "alternative": "script small c",
- "short": "script c"
- }
- },
- "key": "1D4B8"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small d",
- "alternative": "script small d",
- "short": "script d"
- }
- },
- "key": "1D4B9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small f",
- "alternative": "script small f",
- "short": "script f"
- }
- },
- "key": "1D4BB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small h",
- "alternative": "script small h",
- "short": "script h"
- }
- },
- "key": "1D4BD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small i",
- "alternative": "script small i",
- "short": "script i"
- }
- },
- "key": "1D4BE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small j",
- "alternative": "script small j",
- "short": "script j"
- }
- },
- "key": "1D4BF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small k",
- "alternative": "script small k",
- "short": "script k"
- }
- },
- "key": "1D4C0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small l",
- "alternative": "script small l",
- "short": "script l"
- }
- },
- "key": "1D4C1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small m",
- "alternative": "script small m",
- "short": "script m"
- }
- },
- "key": "1D4C2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small n",
- "alternative": "script small n",
- "short": "script n"
- }
- },
- "key": "1D4C3"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small p",
- "alternative": "script small p",
- "short": "script p"
- }
- },
- "key": "1D4C5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small q",
- "alternative": "script small q",
- "short": "script q"
- }
- },
- "key": "1D4C6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small r",
- "alternative": "script small r",
- "short": "script r"
- }
- },
- "key": "1D4C7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small s",
- "alternative": "script small s",
- "short": "script s"
- }
- },
- "key": "1D4C8"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small t",
- "alternative": "script small t",
- "short": "script t"
- }
- },
- "key": "1D4C9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small u",
- "alternative": "script small u",
- "short": "script u"
- }
- },
- "key": "1D4CA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small v",
- "alternative": "script small v",
- "short": "script v"
- }
- },
- "key": "1D4CB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small w",
- "alternative": "script small w",
- "short": "script w"
- }
- },
- "key": "1D4CC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small x",
- "alternative": "script small x",
- "short": "script x"
- }
- },
- "key": "1D4CD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small y",
- "alternative": "script small y",
- "short": "script y"
- }
- },
- "key": "1D4CE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical script small z",
- "alternative": "script small z",
- "short": "script z"
- }
- },
- "key": "1D4CF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital a",
- "alternative": "bold script capital a",
- "short": "bold script cap a"
- }
- },
- "key": "1D4D0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital b",
- "alternative": "bold script capital b",
- "short": "bold script cap b"
- }
- },
- "key": "1D4D1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital c",
- "alternative": "bold script capital c",
- "short": "bold script cap c"
- }
- },
- "key": "1D4D2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital d",
- "alternative": "bold script capital d",
- "short": "bold script cap d"
- }
- },
- "key": "1D4D3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital e",
- "alternative": "bold script capital e",
- "short": "bold script cap e"
- }
- },
- "key": "1D4D4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital f",
- "alternative": "bold script capital f",
- "short": "bold script cap f"
- }
- },
- "key": "1D4D5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital g",
- "alternative": "bold script capital g",
- "short": "bold script cap g"
- }
- },
- "key": "1D4D6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital h",
- "alternative": "bold script capital h",
- "short": "bold script cap h"
- }
- },
- "key": "1D4D7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital i",
- "alternative": "bold script capital i",
- "short": "bold script cap i"
- }
- },
- "key": "1D4D8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital j",
- "alternative": "bold script capital j",
- "short": "bold script cap j"
- }
- },
- "key": "1D4D9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital k",
- "alternative": "bold script capital k",
- "short": "bold script cap k"
- }
- },
- "key": "1D4DA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital l",
- "alternative": "bold script capital l",
- "short": "bold script cap l"
- }
- },
- "key": "1D4DB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital m",
- "alternative": "bold script capital m",
- "short": "bold script cap m"
- }
- },
- "key": "1D4DC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital n",
- "alternative": "bold script capital n",
- "short": "bold script cap n"
- }
- },
- "key": "1D4DD"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital o",
- "alternative": "bold script capital o",
- "short": "bold script cap o"
- }
- },
- "key": "1D4DE"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital p",
- "alternative": "bold script capital p",
- "short": "bold script cap p"
- }
- },
- "key": "1D4DF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital q",
- "alternative": "bold script capital q",
- "short": "bold script cap q"
- }
- },
- "key": "1D4E0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital r",
- "alternative": "bold script capital r",
- "short": "bold script cap r"
- }
- },
- "key": "1D4E1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital s",
- "alternative": "bold script capital s",
- "short": "bold script cap s"
- }
- },
- "key": "1D4E2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital t",
- "alternative": "bold script capital t",
- "short": "bold script cap t"
- }
- },
- "key": "1D4E3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital u",
- "alternative": "bold script capital u",
- "short": "bold script cap u"
- }
- },
- "key": "1D4E4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital v",
- "alternative": "bold script capital v",
- "short": "bold script cap v"
- }
- },
- "key": "1D4E5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital w",
- "alternative": "bold script capital w",
- "short": "bold script cap w"
- }
- },
- "key": "1D4E6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital x",
- "alternative": "bold script capital x",
- "short": "bold script cap x"
- }
- },
- "key": "1D4E7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital y",
- "alternative": "bold script capital y",
- "short": "bold script cap y"
- }
- },
- "key": "1D4E8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold script capital z",
- "alternative": "bold script capital z",
- "short": "bold script cap z"
- }
- },
- "key": "1D4E9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small a",
- "alternative": "bold script small a",
- "short": "bold script a"
- }
- },
- "key": "1D4EA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small b",
- "alternative": "bold script small b",
- "short": "bold script b"
- }
- },
- "key": "1D4EB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small c",
- "alternative": "bold script small c",
- "short": "bold script c"
- }
- },
- "key": "1D4EC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small d",
- "alternative": "bold script small d",
- "short": "bold script d"
- }
- },
- "key": "1D4ED"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small e",
- "alternative": "bold script small e",
- "short": "bold script e"
- }
- },
- "key": "1D4EE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small f",
- "alternative": "bold script small f",
- "short": "bold script f"
- }
- },
- "key": "1D4EF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small g",
- "alternative": "bold script small g",
- "short": "bold script g"
- }
- },
- "key": "1D4F0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small h",
- "alternative": "bold script small h",
- "short": "bold script h"
- }
- },
- "key": "1D4F1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small i",
- "alternative": "bold script small i",
- "short": "bold script i"
- }
- },
- "key": "1D4F2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small j",
- "alternative": "bold script small j",
- "short": "bold script j"
- }
- },
- "key": "1D4F3"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small k",
- "alternative": "bold script small k",
- "short": "bold script k"
- }
- },
- "key": "1D4F4"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small l",
- "alternative": "bold script small l",
- "short": "bold script l"
- }
- },
- "key": "1D4F5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small m",
- "alternative": "bold script small m",
- "short": "bold script m"
- }
- },
- "key": "1D4F6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small n",
- "alternative": "bold script small n",
- "short": "bold script n"
- }
- },
- "key": "1D4F7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small o",
- "alternative": "bold script small o",
- "short": "bold script o"
- }
- },
- "key": "1D4F8"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small p",
- "alternative": "bold script small p",
- "short": "bold script p"
- }
- },
- "key": "1D4F9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small q",
- "alternative": "bold script small q",
- "short": "bold script q"
- }
- },
- "key": "1D4FA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small r",
- "alternative": "bold script small r",
- "short": "bold script r"
- }
- },
- "key": "1D4FB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small s",
- "alternative": "bold script small s",
- "short": "bold script s"
- }
- },
- "key": "1D4FC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small t",
- "alternative": "bold script small t",
- "short": "bold script t"
- }
- },
- "key": "1D4FD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small u",
- "alternative": "bold script small u",
- "short": "bold script u"
- }
- },
- "key": "1D4FE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small v",
- "alternative": "bold script small v",
- "short": "bold script v"
- }
- },
- "key": "1D4FF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small w",
- "alternative": "bold script small w",
- "short": "bold script w"
- }
- },
- "key": "1D500"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small x",
- "alternative": "bold script small x",
- "short": "bold script x"
- }
- },
- "key": "1D501"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small y",
- "alternative": "bold script small y",
- "short": "bold script y"
- }
- },
- "key": "1D502"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold script small z",
- "alternative": "bold script small z",
- "short": "bold script z"
- }
- },
- "key": "1D503"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital a",
- "alternative": "fraktur capital a",
- "short": "fraktur cap a"
- }
- },
- "key": "1D504"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital b",
- "alternative": "fraktur capital b",
- "short": "fraktur cap b"
- }
- },
- "key": "1D505"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital d",
- "alternative": "fraktur capital d",
- "short": "fraktur cap d"
- }
- },
- "key": "1D507"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital e",
- "alternative": "fraktur capital e",
- "short": "fraktur cap e"
- }
- },
- "key": "1D508"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital f",
- "alternative": "fraktur capital f",
- "short": "fraktur cap f"
- }
- },
- "key": "1D509"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital g",
- "alternative": "fraktur capital g",
- "short": "fraktur cap g"
- }
- },
- "key": "1D50A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital j",
- "alternative": "fraktur capital j",
- "short": "fraktur cap j"
- }
- },
- "key": "1D50D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital k",
- "alternative": "fraktur capital k",
- "short": "fraktur cap k"
- }
- },
- "key": "1D50E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital l",
- "alternative": "fraktur capital l",
- "short": "fraktur cap l"
- }
- },
- "key": "1D50F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital m",
- "alternative": "fraktur capital m",
- "short": "fraktur cap m"
- }
- },
- "key": "1D510"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital n",
- "alternative": "fraktur capital n",
- "short": "fraktur cap n"
- }
- },
- "key": "1D511"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital o",
- "alternative": "fraktur capital o",
- "short": "fraktur cap o"
- }
- },
- "key": "1D512"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital p",
- "alternative": "fraktur capital p",
- "short": "fraktur cap p"
- }
- },
- "key": "1D513"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital q",
- "alternative": "fraktur capital q",
- "short": "fraktur cap q"
- }
- },
- "key": "1D514"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital s",
- "alternative": "fraktur capital s",
- "short": "fraktur cap s"
- }
- },
- "key": "1D516"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital t",
- "alternative": "fraktur capital t",
- "short": "fraktur cap t"
- }
- },
- "key": "1D517"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital u",
- "alternative": "fraktur capital u",
- "short": "fraktur cap u"
- }
- },
- "key": "1D518"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital v",
- "alternative": "fraktur capital v",
- "short": "fraktur cap v"
- }
- },
- "key": "1D519"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital w",
- "alternative": "fraktur capital w",
- "short": "fraktur cap w"
- }
- },
- "key": "1D51A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital x",
- "alternative": "fraktur capital x",
- "short": "fraktur cap x"
- }
- },
- "key": "1D51B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical fraktur capital y",
- "alternative": "fraktur capital y",
- "short": "fraktur cap y"
- }
- },
- "key": "1D51C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small a",
- "alternative": "fraktur small a",
- "short": "fraktur a"
- }
- },
- "key": "1D51E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small b",
- "alternative": "fraktur small b",
- "short": "fraktur b"
- }
- },
- "key": "1D51F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small c",
- "alternative": "fraktur small c",
- "short": "fraktur c"
- }
- },
- "key": "1D520"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small d",
- "alternative": "fraktur small d",
- "short": "fraktur d"
- }
- },
- "key": "1D521"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small e",
- "alternative": "fraktur small e",
- "short": "fraktur e"
- }
- },
- "key": "1D522"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small f",
- "alternative": "fraktur small f",
- "short": "fraktur f"
- }
- },
- "key": "1D523"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small g",
- "alternative": "fraktur small g",
- "short": "fraktur g"
- }
- },
- "key": "1D524"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small h",
- "alternative": "fraktur small h",
- "short": "fraktur h"
- }
- },
- "key": "1D525"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small i",
- "alternative": "fraktur small i",
- "short": "fraktur i"
- }
- },
- "key": "1D526"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small j",
- "alternative": "fraktur small j",
- "short": "fraktur j"
- }
- },
- "key": "1D527"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small k",
- "alternative": "fraktur small k",
- "short": "fraktur k"
- }
- },
- "key": "1D528"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small l",
- "alternative": "fraktur small l",
- "short": "fraktur l"
- }
- },
- "key": "1D529"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small m",
- "alternative": "fraktur small m",
- "short": "fraktur m"
- }
- },
- "key": "1D52A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small n",
- "alternative": "fraktur small n",
- "short": "fraktur n"
- }
- },
- "key": "1D52B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small o",
- "alternative": "fraktur small o",
- "short": "fraktur o"
- }
- },
- "key": "1D52C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small p",
- "alternative": "fraktur small p",
- "short": "fraktur p"
- }
- },
- "key": "1D52D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small q",
- "alternative": "fraktur small q",
- "short": "fraktur q"
- }
- },
- "key": "1D52E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small r",
- "alternative": "fraktur small r",
- "short": "fraktur r"
- }
- },
- "key": "1D52F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small s",
- "alternative": "fraktur small s",
- "short": "fraktur s"
- }
- },
- "key": "1D530"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small t",
- "alternative": "fraktur small t",
- "short": "fraktur t"
- }
- },
- "key": "1D531"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small u",
- "alternative": "fraktur small u",
- "short": "fraktur u"
- }
- },
- "key": "1D532"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small v",
- "alternative": "fraktur small v",
- "short": "fraktur v"
- }
- },
- "key": "1D533"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small w",
- "alternative": "fraktur small w",
- "short": "fraktur w"
- }
- },
- "key": "1D534"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small x",
- "alternative": "fraktur small x",
- "short": "fraktur x"
- }
- },
- "key": "1D535"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small y",
- "alternative": "fraktur small y",
- "short": "fraktur y"
- }
- },
- "key": "1D536"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical fraktur small z",
- "alternative": "fraktur small z",
- "short": "fraktur z"
- }
- },
- "key": "1D537"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital a",
- "alternative": "double struck capital a",
- "short": "double struck cap a"
- }
- },
- "key": "1D538"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital b",
- "alternative": "double struck capital b",
- "short": "double struck cap b"
- }
- },
- "key": "1D539"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital d",
- "alternative": "double struck capital d",
- "short": "double struck cap d"
- }
- },
- "key": "1D53B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital e",
- "alternative": "double struck capital e",
- "short": "double struck cap e"
- }
- },
- "key": "1D53C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital f",
- "alternative": "double struck capital f",
- "short": "double struck cap f"
- }
- },
- "key": "1D53D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital g",
- "alternative": "double struck capital g",
- "short": "double struck cap g"
- }
- },
- "key": "1D53E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital i",
- "alternative": "double struck capital i",
- "short": "double struck cap i"
- }
- },
- "key": "1D540"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital j",
- "alternative": "double struck capital j",
- "short": "double struck cap j"
- }
- },
- "key": "1D541"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital k",
- "alternative": "double struck capital k",
- "short": "double struck cap k"
- }
- },
- "key": "1D542"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital l",
- "alternative": "double struck capital l",
- "short": "double struck cap l"
- }
- },
- "key": "1D543"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital m",
- "alternative": "double struck capital m",
- "short": "double struck cap m"
- }
- },
- "key": "1D544"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital o",
- "alternative": "double struck capital o",
- "short": "double struck cap o"
- }
- },
- "key": "1D546"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital s",
- "alternative": "double struck capital s",
- "short": "double struck cap s"
- }
- },
- "key": "1D54A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital t",
- "alternative": "double struck capital t",
- "short": "double struck cap t"
- }
- },
- "key": "1D54B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital u",
- "alternative": "double struck capital u",
- "short": "double struck cap u"
- }
- },
- "key": "1D54C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital v",
- "alternative": "double struck capital v",
- "short": "double struck cap v"
- }
- },
- "key": "1D54D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital w",
- "alternative": "double struck capital w",
- "short": "double struck cap w"
- }
- },
- "key": "1D54E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital x",
- "alternative": "double struck capital x",
- "short": "double struck cap x"
- }
- },
- "key": "1D54F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital y",
- "alternative": "double struck capital y",
- "short": "double struck cap y"
- }
- },
- "key": "1D550"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small a",
- "alternative": "double struck small a",
- "short": "double struck a"
- }
- },
- "key": "1D552"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small b",
- "alternative": "double struck small b",
- "short": "double struck b"
- }
- },
- "key": "1D553"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small c",
- "alternative": "double struck small c",
- "short": "double struck c"
- }
- },
- "key": "1D554"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small d",
- "alternative": "double struck small d",
- "short": "double struck d"
- }
- },
- "key": "1D555"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small e",
- "alternative": "double struck small e",
- "short": "double struck e"
- }
- },
- "key": "1D556"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small f",
- "alternative": "double struck small f",
- "short": "double struck f"
- }
- },
- "key": "1D557"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small g",
- "alternative": "double struck small g",
- "short": "double struck g"
- }
- },
- "key": "1D558"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small h",
- "alternative": "double struck small h",
- "short": "double struck h"
- }
- },
- "key": "1D559"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small i",
- "alternative": "double struck small i",
- "short": "double struck i"
- }
- },
- "key": "1D55A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small j",
- "alternative": "double struck small j",
- "short": "double struck j"
- }
- },
- "key": "1D55B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small k",
- "alternative": "double struck small k",
- "short": "double struck k"
- }
- },
- "key": "1D55C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small l",
- "alternative": "double struck small l",
- "short": "double struck l"
- }
- },
- "key": "1D55D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small m",
- "alternative": "double struck small m",
- "short": "double struck m"
- }
- },
- "key": "1D55E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small n",
- "alternative": "double struck small n",
- "short": "double struck n"
- }
- },
- "key": "1D55F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small o",
- "alternative": "double struck small o",
- "short": "double struck o"
- }
- },
- "key": "1D560"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small p",
- "alternative": "double struck small p",
- "short": "double struck p"
- }
- },
- "key": "1D561"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small q",
- "alternative": "double struck small q",
- "short": "double struck q"
- }
- },
- "key": "1D562"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small r",
- "alternative": "double struck small r",
- "short": "double struck r"
- }
- },
- "key": "1D563"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small s",
- "alternative": "double struck small s",
- "short": "double struck s"
- }
- },
- "key": "1D564"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small t",
- "alternative": "double struck small t",
- "short": "double struck t"
- }
- },
- "key": "1D565"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small u",
- "alternative": "double struck small u",
- "short": "double struck u"
- }
- },
- "key": "1D566"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small v",
- "alternative": "double struck small v",
- "short": "double struck v"
- }
- },
- "key": "1D567"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small w",
- "alternative": "double struck small w",
- "short": "double struck w"
- }
- },
- "key": "1D568"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small x",
- "alternative": "double struck small x",
- "short": "double struck x"
- }
- },
- "key": "1D569"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small y",
- "alternative": "double struck small y",
- "short": "double struck y"
- }
- },
- "key": "1D56A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical double struck small z",
- "alternative": "double struck small z",
- "short": "double struck z"
- }
- },
- "key": "1D56B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital a",
- "alternative": "bold fraktur capital a",
- "short": "bold fraktur cap a"
- }
- },
- "key": "1D56C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital b",
- "alternative": "bold fraktur capital b",
- "short": "bold fraktur cap b"
- }
- },
- "key": "1D56D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital c",
- "alternative": "bold fraktur capital c",
- "short": "bold fraktur cap c"
- }
- },
- "key": "1D56E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital d",
- "alternative": "bold fraktur capital d",
- "short": "bold fraktur cap d"
- }
- },
- "key": "1D56F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital e",
- "alternative": "bold fraktur capital e",
- "short": "bold fraktur cap e"
- }
- },
- "key": "1D570"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital f",
- "alternative": "bold fraktur capital f",
- "short": "bold fraktur cap f"
- }
- },
- "key": "1D571"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital g",
- "alternative": "bold fraktur capital g",
- "short": "bold fraktur cap g"
- }
- },
- "key": "1D572"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital h",
- "alternative": "bold fraktur capital h",
- "short": "bold fraktur cap h"
- }
- },
- "key": "1D573"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital i",
- "alternative": "bold fraktur capital i",
- "short": "bold fraktur cap i"
- }
- },
- "key": "1D574"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital j",
- "alternative": "bold fraktur capital j",
- "short": "bold fraktur cap j"
- }
- },
- "key": "1D575"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital k",
- "alternative": "bold fraktur capital k",
- "short": "bold fraktur cap k"
- }
- },
- "key": "1D576"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital l",
- "alternative": "bold fraktur capital l",
- "short": "bold fraktur cap l"
- }
- },
- "key": "1D577"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital m",
- "alternative": "bold fraktur capital m",
- "short": "bold fraktur cap m"
- }
- },
- "key": "1D578"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital n",
- "alternative": "bold fraktur capital n",
- "short": "bold fraktur cap n"
- }
- },
- "key": "1D579"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital o",
- "alternative": "bold fraktur capital o",
- "short": "bold fraktur cap o"
- }
- },
- "key": "1D57A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital p",
- "alternative": "bold fraktur capital p",
- "short": "bold fraktur cap p"
- }
- },
- "key": "1D57B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital q",
- "alternative": "bold fraktur capital q",
- "short": "bold fraktur cap q"
- }
- },
- "key": "1D57C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital r",
- "alternative": "bold fraktur capital r",
- "short": "bold fraktur cap r"
- }
- },
- "key": "1D57D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital s",
- "alternative": "bold fraktur capital s",
- "short": "bold fraktur cap s"
- }
- },
- "key": "1D57E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital t",
- "alternative": "bold fraktur capital t",
- "short": "bold fraktur cap t"
- }
- },
- "key": "1D57F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital u",
- "alternative": "bold fraktur capital u",
- "short": "bold fraktur cap u"
- }
- },
- "key": "1D580"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital v",
- "alternative": "bold fraktur capital v",
- "short": "bold fraktur cap v"
- }
- },
- "key": "1D581"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital w",
- "alternative": "bold fraktur capital w",
- "short": "bold fraktur cap w"
- }
- },
- "key": "1D582"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital x",
- "alternative": "bold fraktur capital x",
- "short": "bold fraktur cap x"
- }
- },
- "key": "1D583"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital y",
- "alternative": "bold fraktur capital y",
- "short": "bold fraktur cap y"
- }
- },
- "key": "1D584"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur capital z",
- "alternative": "bold fraktur capital z",
- "short": "bold fraktur cap z"
- }
- },
- "key": "1D585"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small a",
- "alternative": "bold fraktur small a",
- "short": "bold fraktur a"
- }
- },
- "key": "1D586"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small b",
- "alternative": "bold fraktur small b",
- "short": "bold fraktur b"
- }
- },
- "key": "1D587"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small c",
- "alternative": "bold fraktur small c",
- "short": "bold fraktur c"
- }
- },
- "key": "1D588"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small d",
- "alternative": "bold fraktur small d",
- "short": "bold fraktur d"
- }
- },
- "key": "1D589"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small e",
- "alternative": "bold fraktur small e",
- "short": "bold fraktur e"
- }
- },
- "key": "1D58A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small f",
- "alternative": "bold fraktur small f",
- "short": "bold fraktur f"
- }
- },
- "key": "1D58B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small g",
- "alternative": "bold fraktur small g",
- "short": "bold fraktur g"
- }
- },
- "key": "1D58C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small h",
- "alternative": "bold fraktur small h",
- "short": "bold fraktur h"
- }
- },
- "key": "1D58D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small i",
- "alternative": "bold fraktur small i",
- "short": "bold fraktur i"
- }
- },
- "key": "1D58E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small j",
- "alternative": "bold fraktur small j",
- "short": "bold fraktur j"
- }
- },
- "key": "1D58F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small k",
- "alternative": "bold fraktur small k",
- "short": "bold fraktur k"
- }
- },
- "key": "1D590"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small l",
- "alternative": "bold fraktur small l",
- "short": "bold fraktur l"
- }
- },
- "key": "1D591"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small m",
- "alternative": "bold fraktur small m",
- "short": "bold fraktur m"
- }
- },
- "key": "1D592"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small n",
- "alternative": "bold fraktur small n",
- "short": "bold fraktur n"
- }
- },
- "key": "1D593"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small o",
- "alternative": "bold fraktur small o",
- "short": "bold fraktur o"
- }
- },
- "key": "1D594"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small p",
- "alternative": "bold fraktur small p",
- "short": "bold fraktur p"
- }
- },
- "key": "1D595"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small q",
- "alternative": "bold fraktur small q",
- "short": "bold fraktur q"
- }
- },
- "key": "1D596"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small r",
- "alternative": "bold fraktur small r",
- "short": "bold fraktur r"
- }
- },
- "key": "1D597"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small s",
- "alternative": "bold fraktur small s",
- "short": "bold fraktur s"
- }
- },
- "key": "1D598"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small t",
- "alternative": "bold fraktur small t",
- "short": "bold fraktur t"
- }
- },
- "key": "1D599"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small u",
- "alternative": "bold fraktur small u",
- "short": "bold fraktur u"
- }
- },
- "key": "1D59A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small v",
- "alternative": "bold fraktur small v",
- "short": "bold fraktur v"
- }
- },
- "key": "1D59B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small w",
- "alternative": "bold fraktur small w",
- "short": "bold fraktur w"
- }
- },
- "key": "1D59C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small x",
- "alternative": "bold fraktur small x",
- "short": "bold fraktur x"
- }
- },
- "key": "1D59D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small y",
- "alternative": "bold fraktur small y",
- "short": "bold fraktur y"
- }
- },
- "key": "1D59E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical bold fraktur small z",
- "alternative": "bold fraktur small z",
- "short": "bold fraktur z"
- }
- },
- "key": "1D59F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital a",
- "alternative": "sans serif capital a",
- "short": "sans serif cap a"
- }
- },
- "key": "1D5A0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital b",
- "alternative": "sans serif capital b",
- "short": "sans serif cap b"
- }
- },
- "key": "1D5A1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital c",
- "alternative": "sans serif capital c",
- "short": "sans serif cap c"
- }
- },
- "key": "1D5A2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital d",
- "alternative": "sans serif capital d",
- "short": "sans serif cap d"
- }
- },
- "key": "1D5A3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital e",
- "alternative": "sans serif capital e",
- "short": "sans serif cap e"
- }
- },
- "key": "1D5A4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital f",
- "alternative": "sans serif capital f",
- "short": "sans serif cap f"
- }
- },
- "key": "1D5A5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital g",
- "alternative": "sans serif capital g",
- "short": "sans serif cap g"
- }
- },
- "key": "1D5A6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital h",
- "alternative": "sans serif capital h",
- "short": "sans serif cap h"
- }
- },
- "key": "1D5A7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital i",
- "alternative": "sans serif capital i",
- "short": "sans serif cap i"
- }
- },
- "key": "1D5A8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital j",
- "alternative": "sans serif capital j",
- "short": "sans serif cap j"
- }
- },
- "key": "1D5A9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital k",
- "alternative": "sans serif capital k",
- "short": "sans serif cap k"
- }
- },
- "key": "1D5AA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital l",
- "alternative": "sans serif capital l",
- "short": "sans serif cap l"
- }
- },
- "key": "1D5AB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital m",
- "alternative": "sans serif capital m",
- "short": "sans serif cap m"
- }
- },
- "key": "1D5AC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital n",
- "alternative": "sans serif capital n",
- "short": "sans serif cap n"
- }
- },
- "key": "1D5AD"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital o",
- "alternative": "sans serif capital o",
- "short": "sans serif cap o"
- }
- },
- "key": "1D5AE"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital p",
- "alternative": "sans serif capital p",
- "short": "sans serif cap p"
- }
- },
- "key": "1D5AF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital q",
- "alternative": "sans serif capital q",
- "short": "sans serif cap q"
- }
- },
- "key": "1D5B0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital r",
- "alternative": "sans serif capital r",
- "short": "sans serif cap r"
- }
- },
- "key": "1D5B1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital s",
- "alternative": "sans serif capital s",
- "short": "sans serif cap s"
- }
- },
- "key": "1D5B2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital t",
- "alternative": "sans serif capital t",
- "short": "sans serif cap t"
- }
- },
- "key": "1D5B3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital u",
- "alternative": "sans serif capital u",
- "short": "sans serif cap u"
- }
- },
- "key": "1D5B4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital v",
- "alternative": "sans serif capital v",
- "short": "sans serif cap v"
- }
- },
- "key": "1D5B5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital w",
- "alternative": "sans serif capital w",
- "short": "sans serif cap w"
- }
- },
- "key": "1D5B6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital x",
- "alternative": "sans serif capital x",
- "short": "sans serif cap x"
- }
- },
- "key": "1D5B7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital y",
- "alternative": "sans serif capital y",
- "short": "sans serif cap y"
- }
- },
- "key": "1D5B8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif capital z",
- "alternative": "sans serif capital z",
- "short": "sans serif cap z"
- }
- },
- "key": "1D5B9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small a",
- "alternative": "sans serif small a",
- "short": "sans serif a"
- }
- },
- "key": "1D5BA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small b",
- "alternative": "sans serif small b",
- "short": "sans serif b"
- }
- },
- "key": "1D5BB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small c",
- "alternative": "sans serif small c",
- "short": "sans serif c"
- }
- },
- "key": "1D5BC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small d",
- "alternative": "sans serif small d",
- "short": "sans serif d"
- }
- },
- "key": "1D5BD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small e",
- "alternative": "sans serif small e",
- "short": "sans serif e"
- }
- },
- "key": "1D5BE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small f",
- "alternative": "sans serif small f",
- "short": "sans serif f"
- }
- },
- "key": "1D5BF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small g",
- "alternative": "sans serif small g",
- "short": "sans serif g"
- }
- },
- "key": "1D5C0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small h",
- "alternative": "sans serif small h",
- "short": "sans serif h"
- }
- },
- "key": "1D5C1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small i",
- "alternative": "sans serif small i",
- "short": "sans serif i"
- }
- },
- "key": "1D5C2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small j",
- "alternative": "sans serif small j",
- "short": "sans serif j"
- }
- },
- "key": "1D5C3"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small k",
- "alternative": "sans serif small k",
- "short": "sans serif k"
- }
- },
- "key": "1D5C4"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small l",
- "alternative": "sans serif small l",
- "short": "sans serif l"
- }
- },
- "key": "1D5C5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small m",
- "alternative": "sans serif small m",
- "short": "sans serif m"
- }
- },
- "key": "1D5C6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small n",
- "alternative": "sans serif small n",
- "short": "sans serif n"
- }
- },
- "key": "1D5C7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small o",
- "alternative": "sans serif small o",
- "short": "sans serif o"
- }
- },
- "key": "1D5C8"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small p",
- "alternative": "sans serif small p",
- "short": "sans serif p"
- }
- },
- "key": "1D5C9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small q",
- "alternative": "sans serif small q",
- "short": "sans serif q"
- }
- },
- "key": "1D5CA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small r",
- "alternative": "sans serif small r",
- "short": "sans serif r"
- }
- },
- "key": "1D5CB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small s",
- "alternative": "sans serif small s",
- "short": "sans serif s"
- }
- },
- "key": "1D5CC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small t",
- "alternative": "sans serif small t",
- "short": "sans serif t"
- }
- },
- "key": "1D5CD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small u",
- "alternative": "sans serif small u",
- "short": "sans serif u"
- }
- },
- "key": "1D5CE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small v",
- "alternative": "sans serif small v",
- "short": "sans serif v"
- }
- },
- "key": "1D5CF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small w",
- "alternative": "sans serif small w",
- "short": "sans serif w"
- }
- },
- "key": "1D5D0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small x",
- "alternative": "sans serif small x",
- "short": "sans serif x"
- }
- },
- "key": "1D5D1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small y",
- "alternative": "sans serif small y",
- "short": "sans serif y"
- }
- },
- "key": "1D5D2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif small z",
- "alternative": "sans serif small z",
- "short": "sans serif z"
- }
- },
- "key": "1D5D3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital a",
- "alternative": "sans serif bold capital a",
- "short": "sans serif bold cap a"
- }
- },
- "key": "1D5D4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital b",
- "alternative": "sans serif bold capital b",
- "short": "sans serif bold cap b"
- }
- },
- "key": "1D5D5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital c",
- "alternative": "sans serif bold capital c",
- "short": "sans serif bold cap c"
- }
- },
- "key": "1D5D6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital d",
- "alternative": "sans serif bold capital d",
- "short": "sans serif bold cap d"
- }
- },
- "key": "1D5D7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital e",
- "alternative": "sans serif bold capital e",
- "short": "sans serif bold cap e"
- }
- },
- "key": "1D5D8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital f",
- "alternative": "sans serif bold capital f",
- "short": "sans serif bold cap f"
- }
- },
- "key": "1D5D9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital g",
- "alternative": "sans serif bold capital g",
- "short": "sans serif bold cap g"
- }
- },
- "key": "1D5DA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital h",
- "alternative": "sans serif bold capital h",
- "short": "sans serif bold cap h"
- }
- },
- "key": "1D5DB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital i",
- "alternative": "sans serif bold capital i",
- "short": "sans serif bold cap i"
- }
- },
- "key": "1D5DC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital j",
- "alternative": "sans serif bold capital j",
- "short": "sans serif bold cap j"
- }
- },
- "key": "1D5DD"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital k",
- "alternative": "sans serif bold capital k",
- "short": "sans serif bold cap k"
- }
- },
- "key": "1D5DE"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital l",
- "alternative": "sans serif bold capital l",
- "short": "sans serif bold cap l"
- }
- },
- "key": "1D5DF"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital m",
- "alternative": "sans serif bold capital m",
- "short": "sans serif bold cap m"
- }
- },
- "key": "1D5E0"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital n",
- "alternative": "sans serif bold capital n",
- "short": "sans serif bold cap n"
- }
- },
- "key": "1D5E1"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital o",
- "alternative": "sans serif bold capital o",
- "short": "sans serif bold cap o"
- }
- },
- "key": "1D5E2"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital p",
- "alternative": "sans serif bold capital p",
- "short": "sans serif bold cap p"
- }
- },
- "key": "1D5E3"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital q",
- "alternative": "sans serif bold capital q",
- "short": "sans serif bold cap q"
- }
- },
- "key": "1D5E4"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital r",
- "alternative": "sans serif bold capital r",
- "short": "sans serif bold cap r"
- }
- },
- "key": "1D5E5"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital s",
- "alternative": "sans serif bold capital s",
- "short": "sans serif bold cap s"
- }
- },
- "key": "1D5E6"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital t",
- "alternative": "sans serif bold capital t",
- "short": "sans serif bold cap t"
- }
- },
- "key": "1D5E7"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital u",
- "alternative": "sans serif bold capital u",
- "short": "sans serif bold cap u"
- }
- },
- "key": "1D5E8"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital v",
- "alternative": "sans serif bold capital v",
- "short": "sans serif bold cap v"
- }
- },
- "key": "1D5E9"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital w",
- "alternative": "sans serif bold capital w",
- "short": "sans serif bold cap w"
- }
- },
- "key": "1D5EA"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital x",
- "alternative": "sans serif bold capital x",
- "short": "sans serif bold cap x"
- }
- },
- "key": "1D5EB"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital y",
- "alternative": "sans serif bold capital y",
- "short": "sans serif bold cap y"
- }
- },
- "key": "1D5EC"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold capital z",
- "alternative": "sans serif bold capital z",
- "short": "sans serif bold cap z"
- }
- },
- "key": "1D5ED"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small a",
- "alternative": "sans serif bold small a",
- "short": "sans serif bold a"
- }
- },
- "key": "1D5EE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small b",
- "alternative": "sans serif bold small b",
- "short": "sans serif bold b"
- }
- },
- "key": "1D5EF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small c",
- "alternative": "sans serif bold small c",
- "short": "sans serif bold c"
- }
- },
- "key": "1D5F0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small d",
- "alternative": "sans serif bold small d",
- "short": "sans serif bold d"
- }
- },
- "key": "1D5F1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small e",
- "alternative": "sans serif bold small e",
- "short": "sans serif bold e"
- }
- },
- "key": "1D5F2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small f",
- "alternative": "sans serif bold small f",
- "short": "sans serif bold f"
- }
- },
- "key": "1D5F3"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small g",
- "alternative": "sans serif bold small g",
- "short": "sans serif bold g"
- }
- },
- "key": "1D5F4"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small h",
- "alternative": "sans serif bold small h",
- "short": "sans serif bold h"
- }
- },
- "key": "1D5F5"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small i",
- "alternative": "sans serif bold small i",
- "short": "sans serif bold i"
- }
- },
- "key": "1D5F6"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small j",
- "alternative": "sans serif bold small j",
- "short": "sans serif bold j"
- }
- },
- "key": "1D5F7"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small k",
- "alternative": "sans serif bold small k",
- "short": "sans serif bold k"
- }
- },
- "key": "1D5F8"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small l",
- "alternative": "sans serif bold small l",
- "short": "sans serif bold l"
- }
- },
- "key": "1D5F9"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small m",
- "alternative": "sans serif bold small m",
- "short": "sans serif bold m"
- }
- },
- "key": "1D5FA"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small n",
- "alternative": "sans serif bold small n",
- "short": "sans serif bold n"
- }
- },
- "key": "1D5FB"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small o",
- "alternative": "sans serif bold small o",
- "short": "sans serif bold o"
- }
- },
- "key": "1D5FC"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small p",
- "alternative": "sans serif bold small p",
- "short": "sans serif bold p"
- }
- },
- "key": "1D5FD"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small q",
- "alternative": "sans serif bold small q",
- "short": "sans serif bold q"
- }
- },
- "key": "1D5FE"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small r",
- "alternative": "sans serif bold small r",
- "short": "sans serif bold r"
- }
- },
- "key": "1D5FF"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small s",
- "alternative": "sans serif bold small s",
- "short": "sans serif bold s"
- }
- },
- "key": "1D600"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small t",
- "alternative": "sans serif bold small t",
- "short": "sans serif bold t"
- }
- },
- "key": "1D601"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small u",
- "alternative": "sans serif bold small u",
- "short": "sans serif bold u"
- }
- },
- "key": "1D602"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small v",
- "alternative": "sans serif bold small v",
- "short": "sans serif bold v"
- }
- },
- "key": "1D603"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small w",
- "alternative": "sans serif bold small w",
- "short": "sans serif bold w"
- }
- },
- "key": "1D604"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small x",
- "alternative": "sans serif bold small x",
- "short": "sans serif bold x"
- }
- },
- "key": "1D605"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small y",
- "alternative": "sans serif bold small y",
- "short": "sans serif bold y"
- }
- },
- "key": "1D606"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold small z",
- "alternative": "sans serif bold small z",
- "short": "sans serif bold z"
- }
- },
- "key": "1D607"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital a",
- "alternative": "sans serif italic capital a",
- "short": "sans serif italic cap a"
- }
- },
- "key": "1D608"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital b",
- "alternative": "sans serif italic capital b",
- "short": "sans serif italic cap b"
- }
- },
- "key": "1D609"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital c",
- "alternative": "sans serif italic capital c",
- "short": "sans serif italic cap c"
- }
- },
- "key": "1D60A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital d",
- "alternative": "sans serif italic capital d",
- "short": "sans serif italic cap d"
- }
- },
- "key": "1D60B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital e",
- "alternative": "sans serif italic capital e",
- "short": "sans serif italic cap e"
- }
- },
- "key": "1D60C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital f",
- "alternative": "sans serif italic capital f",
- "short": "sans serif italic cap f"
- }
- },
- "key": "1D60D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital g",
- "alternative": "sans serif italic capital g",
- "short": "sans serif italic cap g"
- }
- },
- "key": "1D60E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital h",
- "alternative": "sans serif italic capital h",
- "short": "sans serif italic cap h"
- }
- },
- "key": "1D60F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital i",
- "alternative": "sans serif italic capital i",
- "short": "sans serif italic cap i"
- }
- },
- "key": "1D610"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital j",
- "alternative": "sans serif italic capital j",
- "short": "sans serif italic cap j"
- }
- },
- "key": "1D611"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital k",
- "alternative": "sans serif italic capital k",
- "short": "sans serif italic cap k"
- }
- },
- "key": "1D612"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital l",
- "alternative": "sans serif italic capital l",
- "short": "sans serif italic cap l"
- }
- },
- "key": "1D613"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital m",
- "alternative": "sans serif italic capital m",
- "short": "sans serif italic cap m"
- }
- },
- "key": "1D614"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital n",
- "alternative": "sans serif italic capital n",
- "short": "sans serif italic cap n"
- }
- },
- "key": "1D615"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital o",
- "alternative": "sans serif italic capital o",
- "short": "sans serif italic cap o"
- }
- },
- "key": "1D616"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital p",
- "alternative": "sans serif italic capital p",
- "short": "sans serif italic cap p"
- }
- },
- "key": "1D617"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital q",
- "alternative": "sans serif italic capital q",
- "short": "sans serif italic cap q"
- }
- },
- "key": "1D618"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital r",
- "alternative": "sans serif italic capital r",
- "short": "sans serif italic cap r"
- }
- },
- "key": "1D619"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital s",
- "alternative": "sans serif italic capital s",
- "short": "sans serif italic cap s"
- }
- },
- "key": "1D61A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital t",
- "alternative": "sans serif italic capital t",
- "short": "sans serif italic cap t"
- }
- },
- "key": "1D61B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital u",
- "alternative": "sans serif italic capital u",
- "short": "sans serif italic cap u"
- }
- },
- "key": "1D61C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital v",
- "alternative": "sans serif italic capital v",
- "short": "sans serif italic cap v"
- }
- },
- "key": "1D61D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital w",
- "alternative": "sans serif italic capital w",
- "short": "sans serif italic cap w"
- }
- },
- "key": "1D61E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital x",
- "alternative": "sans serif italic capital x",
- "short": "sans serif italic cap x"
- }
- },
- "key": "1D61F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital y",
- "alternative": "sans serif italic capital y",
- "short": "sans serif italic cap y"
- }
- },
- "key": "1D620"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic capital z",
- "alternative": "sans serif italic capital z",
- "short": "sans serif italic cap z"
- }
- },
- "key": "1D621"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small a",
- "alternative": "sans serif italic small a",
- "short": "sans serif italic a"
- }
- },
- "key": "1D622"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small b",
- "alternative": "sans serif italic small b",
- "short": "sans serif italic b"
- }
- },
- "key": "1D623"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small c",
- "alternative": "sans serif italic small c",
- "short": "sans serif italic c"
- }
- },
- "key": "1D624"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small d",
- "alternative": "sans serif italic small d",
- "short": "sans serif italic d"
- }
- },
- "key": "1D625"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small e",
- "alternative": "sans serif italic small e",
- "short": "sans serif italic e"
- }
- },
- "key": "1D626"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small f",
- "alternative": "sans serif italic small f",
- "short": "sans serif italic f"
- }
- },
- "key": "1D627"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small g",
- "alternative": "sans serif italic small g",
- "short": "sans serif italic g"
- }
- },
- "key": "1D628"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small h",
- "alternative": "sans serif italic small h",
- "short": "sans serif italic h"
- }
- },
- "key": "1D629"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small i",
- "alternative": "sans serif italic small i",
- "short": "sans serif italic i"
- }
- },
- "key": "1D62A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small j",
- "alternative": "sans serif italic small j",
- "short": "sans serif italic j"
- }
- },
- "key": "1D62B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small k",
- "alternative": "sans serif italic small k",
- "short": "sans serif italic k"
- }
- },
- "key": "1D62C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small l",
- "alternative": "sans serif italic small l",
- "short": "sans serif italic l"
- }
- },
- "key": "1D62D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small m",
- "alternative": "sans serif italic small m",
- "short": "sans serif italic m"
- }
- },
- "key": "1D62E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small n",
- "alternative": "sans serif italic small n",
- "short": "sans serif italic n"
- }
- },
- "key": "1D62F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small o",
- "alternative": "sans serif italic small o",
- "short": "sans serif italic o"
- }
- },
- "key": "1D630"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small p",
- "alternative": "sans serif italic small p",
- "short": "sans serif italic p"
- }
- },
- "key": "1D631"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small q",
- "alternative": "sans serif italic small q",
- "short": "sans serif italic q"
- }
- },
- "key": "1D632"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small r",
- "alternative": "sans serif italic small r",
- "short": "sans serif italic r"
- }
- },
- "key": "1D633"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small s",
- "alternative": "sans serif italic small s",
- "short": "sans serif italic s"
- }
- },
- "key": "1D634"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small t",
- "alternative": "sans serif italic small t",
- "short": "sans serif italic t"
- }
- },
- "key": "1D635"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small u",
- "alternative": "sans serif italic small u",
- "short": "sans serif italic u"
- }
- },
- "key": "1D636"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small v",
- "alternative": "sans serif italic small v",
- "short": "sans serif italic v"
- }
- },
- "key": "1D637"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small w",
- "alternative": "sans serif italic small w",
- "short": "sans serif italic w"
- }
- },
- "key": "1D638"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small x",
- "alternative": "sans serif italic small x",
- "short": "sans serif italic x"
- }
- },
- "key": "1D639"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small y",
- "alternative": "sans serif italic small y",
- "short": "sans serif italic y"
- }
- },
- "key": "1D63A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical sans serif italic small z",
- "alternative": "sans serif italic small z",
- "short": "sans serif italic z"
- }
- },
- "key": "1D63B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital a",
- "alternative": "monospace capital a",
- "short": "monospace cap a"
- }
- },
- "key": "1D670"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital b",
- "alternative": "monospace capital b",
- "short": "monospace cap b"
- }
- },
- "key": "1D671"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital c",
- "alternative": "monospace capital c",
- "short": "monospace cap c"
- }
- },
- "key": "1D672"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital d",
- "alternative": "monospace capital d",
- "short": "monospace cap d"
- }
- },
- "key": "1D673"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital e",
- "alternative": "monospace capital e",
- "short": "monospace cap e"
- }
- },
- "key": "1D674"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital f",
- "alternative": "monospace capital f",
- "short": "monospace cap f"
- }
- },
- "key": "1D675"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital g",
- "alternative": "monospace capital g",
- "short": "monospace cap g"
- }
- },
- "key": "1D676"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital h",
- "alternative": "monospace capital h",
- "short": "monospace cap h"
- }
- },
- "key": "1D677"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital i",
- "alternative": "monospace capital i",
- "short": "monospace cap i"
- }
- },
- "key": "1D678"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital j",
- "alternative": "monospace capital j",
- "short": "monospace cap j"
- }
- },
- "key": "1D679"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital k",
- "alternative": "monospace capital k",
- "short": "monospace cap k"
- }
- },
- "key": "1D67A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital l",
- "alternative": "monospace capital l",
- "short": "monospace cap l"
- }
- },
- "key": "1D67B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital m",
- "alternative": "monospace capital m",
- "short": "monospace cap m"
- }
- },
- "key": "1D67C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital n",
- "alternative": "monospace capital n",
- "short": "monospace cap n"
- }
- },
- "key": "1D67D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital o",
- "alternative": "monospace capital o",
- "short": "monospace cap o"
- }
- },
- "key": "1D67E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital p",
- "alternative": "monospace capital p",
- "short": "monospace cap p"
- }
- },
- "key": "1D67F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital q",
- "alternative": "monospace capital q",
- "short": "monospace cap q"
- }
- },
- "key": "1D680"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital r",
- "alternative": "monospace capital r",
- "short": "monospace cap r"
- }
- },
- "key": "1D681"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital s",
- "alternative": "monospace capital s",
- "short": "monospace cap s"
- }
- },
- "key": "1D682"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital t",
- "alternative": "monospace capital t",
- "short": "monospace cap t"
- }
- },
- "key": "1D683"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital u",
- "alternative": "monospace capital u",
- "short": "monospace cap u"
- }
- },
- "key": "1D684"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital v",
- "alternative": "monospace capital v",
- "short": "monospace cap v"
- }
- },
- "key": "1D685"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital w",
- "alternative": "monospace capital w",
- "short": "monospace cap w"
- }
- },
- "key": "1D686"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital x",
- "alternative": "monospace capital x",
- "short": "monospace cap x"
- }
- },
- "key": "1D687"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital y",
- "alternative": "monospace capital y",
- "short": "monospace cap y"
- }
- },
- "key": "1D688"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical monospace capital z",
- "alternative": "monospace capital z",
- "short": "monospace cap z"
- }
- },
- "key": "1D689"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small a",
- "alternative": "monospace small a",
- "short": "monospace a"
- }
- },
- "key": "1D68A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small b",
- "alternative": "monospace small b",
- "short": "monospace b"
- }
- },
- "key": "1D68B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small c",
- "alternative": "monospace small c",
- "short": "monospace c"
- }
- },
- "key": "1D68C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small d",
- "alternative": "monospace small d",
- "short": "monospace d"
- }
- },
- "key": "1D68D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small e",
- "alternative": "monospace small e",
- "short": "monospace e"
- }
- },
- "key": "1D68E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small f",
- "alternative": "monospace small f",
- "short": "monospace f"
- }
- },
- "key": "1D68F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small g",
- "alternative": "monospace small g",
- "short": "monospace g"
- }
- },
- "key": "1D690"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small h",
- "alternative": "monospace small h",
- "short": "monospace h"
- }
- },
- "key": "1D691"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small i",
- "alternative": "monospace small i",
- "short": "monospace i"
- }
- },
- "key": "1D692"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small j",
- "alternative": "monospace small j",
- "short": "monospace j"
- }
- },
- "key": "1D693"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small k",
- "alternative": "monospace small k",
- "short": "monospace k"
- }
- },
- "key": "1D694"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small l",
- "alternative": "monospace small l",
- "short": "monospace l"
- }
- },
- "key": "1D695"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small m",
- "alternative": "monospace small m",
- "short": "monospace m"
- }
- },
- "key": "1D696"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small n",
- "alternative": "monospace small n",
- "short": "monospace n"
- }
- },
- "key": "1D697"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small o",
- "alternative": "monospace small o",
- "short": "monospace o"
- }
- },
- "key": "1D698"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small p",
- "alternative": "monospace small p",
- "short": "monospace p"
- }
- },
- "key": "1D699"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small q",
- "alternative": "monospace small q",
- "short": "monospace q"
- }
- },
- "key": "1D69A"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small r",
- "alternative": "monospace small r",
- "short": "monospace r"
- }
- },
- "key": "1D69B"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small s",
- "alternative": "monospace small s",
- "short": "monospace s"
- }
- },
- "key": "1D69C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small t",
- "alternative": "monospace small t",
- "short": "monospace t"
- }
- },
- "key": "1D69D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small u",
- "alternative": "monospace small u",
- "short": "monospace u"
- }
- },
- "key": "1D69E"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small v",
- "alternative": "monospace small v",
- "short": "monospace v"
- }
- },
- "key": "1D69F"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small w",
- "alternative": "monospace small w",
- "short": "monospace w"
- }
- },
- "key": "1D6A0"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small x",
- "alternative": "monospace small x",
- "short": "monospace x"
- }
- },
- "key": "1D6A1"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small y",
- "alternative": "monospace small y",
- "short": "monospace y"
- }
- },
- "key": "1D6A2"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical monospace small z",
- "alternative": "monospace small z",
- "short": "monospace z"
- }
- },
- "key": "1D6A3"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small dotless i",
- "alternative": "italic small dotless i",
- "short": "italic dotless i"
- }
- },
- "key": "1D6A4"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small dotless j",
- "alternative": "italic small dotless j",
- "short": "italic dotless j"
- }
- },
- "key": "1D6A5"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-rest.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-rest.json
deleted file mode 100644
index bc8209093b9..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-rest.json
+++ /dev/null
@@ -1,2402 +0,0 @@
-[
-{"category": "Mn",
- "names": [],
- "key": "0363",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter a",
- "alternative": "",
- "short": "combining a"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "0364",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter e",
- "alternative": "",
- "short": "combining e"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "0365",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter i",
- "alternative": "",
- "short": "combining i"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "0366",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter o",
- "alternative": "",
- "short": "combining o"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "0367",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter u",
- "alternative": "",
- "short": "combining u"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "0368",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter c",
- "alternative": "",
- "short": "combining c"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "0369",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter d",
- "alternative": "",
- "short": "combining d"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "036A",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter h",
- "alternative": "",
- "short": "combining h"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "036B",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter m",
- "alternative": "",
- "short": "combining m"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "036C",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter r",
- "alternative": "",
- "short": "combining r"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "036D",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter t",
- "alternative": "",
- "short": "combining t"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "036E",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter v",
- "alternative": "",
- "short": "combining v"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "036F",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter x",
- "alternative": "",
- "short": "combining x"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D62",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter i",
- "alternative": "",
- "short": "subscript i"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D63",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter r",
- "alternative": "",
- "short": "subscript r"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D64",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter u",
- "alternative": "",
- "short": "subscript u"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "1D65",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter v",
- "alternative": "",
- "short": "subscript v"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DCA",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter r below",
- "alternative": "",
- "short": "combining r below"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DD3",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter flattened open a above",
- "alternative": "",
- "short": "combining flattened open a above"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DD4",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter ae",
- "alternative": "",
- "short": "combining ae"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DD5",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter ao",
- "alternative": "",
- "short": "combining ao"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DD6",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter av",
- "alternative": "",
- "short": "combining av"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DD7",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter c cedilla",
- "alternative": "",
- "short": "combining c cedilla"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DD8",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter insular d",
- "alternative": "",
- "short": "combining insular d"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DD9",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter eth",
- "alternative": "",
- "short": "combining eth"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DDA",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter g",
- "alternative": "",
- "short": "combining g"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DDB",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin letter small capital g",
- "alternative": "",
- "short": "combining small cap g"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DDC",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter k",
- "alternative": "",
- "short": "combining k"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DDD",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter l",
- "alternative": "",
- "short": "combining l"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DDE",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin letter small capital l",
- "alternative": "",
- "short": "combining small cap l"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DDF",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin letter small capital m",
- "alternative": "",
- "short": "combining small cap m"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DE0",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter n",
- "alternative": "",
- "short": "combining n"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DE1",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin letter small capital n",
- "alternative": "",
- "short": "combining small cap n"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DE2",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin letter small capital r",
- "alternative": "",
- "short": "combining small cap r"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DE3",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter r rotunda",
- "alternative": "",
- "short": "combining r rotunda"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DE4",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter s",
- "alternative": "",
- "short": "combining s"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DE5",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter long s",
- "alternative": "",
- "short": "combining long s"
- }}},
-{"category": "Mn",
- "names": [],
- "key": "1DE6",
- "active": true,
- "mappings": {
- "default": {
- "default": "combining latin small letter z",
- "alternative": "",
- "short": "combining z"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2071",
- "active": true,
- "mappings": {
- "default": {
- "default": "superscript latin small letter i",
- "alternative": "",
- "short": "superscript i"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "207F",
- "active": true,
- "mappings": {
- "default": {
- "default": "superscript latin small letter n",
- "alternative": "",
- "short": "superscript n"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2090",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter a",
- "alternative": "",
- "short": "subscript a"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2091",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter e",
- "alternative": "",
- "short": "subscript e"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2092",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter o",
- "alternative": "",
- "short": "subscript o"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2093",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter x",
- "alternative": "",
- "short": "subscript x"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2094",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter schwa",
- "alternative": "",
- "short": "subscript schwa"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2095",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter h",
- "alternative": "",
- "short": "subscript h"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2096",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter k",
- "alternative": "",
- "short": "subscript k"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2097",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter l",
- "alternative": "",
- "short": "subscript l"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2098",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter m",
- "alternative": "",
- "short": "subscript m"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2099",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter n",
- "alternative": "",
- "short": "subscript n"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "209A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter p",
- "alternative": "",
- "short": "subscript p"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "209B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter s",
- "alternative": "",
- "short": "subscript s"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "209C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter t",
- "alternative": "",
- "short": "subscript t"
- }}},
-{"category": "So",
- "names": [],
- "key": "249C",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter a",
- "alternative": "",
- "short": "parenthesized a"
- }}},
-{"category": "So",
- "names": [],
- "key": "249D",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter b",
- "alternative": "",
- "short": "parenthesized b"
- }}},
-{"category": "So",
- "names": [],
- "key": "249E",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter c",
- "alternative": "",
- "short": "parenthesized c"
- }}},
-{"category": "So",
- "names": [],
- "key": "249F",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter d",
- "alternative": "",
- "short": "parenthesized d"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A0",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter e",
- "alternative": "",
- "short": "parenthesized e"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A1",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter f",
- "alternative": "",
- "short": "parenthesized f"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A2",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter g",
- "alternative": "",
- "short": "parenthesized g"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A3",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter h",
- "alternative": "",
- "short": "parenthesized h"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A4",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter i",
- "alternative": "",
- "short": "parenthesized i"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A5",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter j",
- "alternative": "",
- "short": "parenthesized j"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A6",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter k",
- "alternative": "",
- "short": "parenthesized k"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A7",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter l",
- "alternative": "",
- "short": "parenthesized l"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A8",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter m",
- "alternative": "",
- "short": "parenthesized m"
- }}},
-{"category": "So",
- "names": [],
- "key": "24A9",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter n",
- "alternative": "",
- "short": "parenthesized n"
- }}},
-{"category": "So",
- "names": [],
- "key": "24AA",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter o",
- "alternative": "",
- "short": "parenthesized o"
- }}},
-{"category": "So",
- "names": [],
- "key": "24AB",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter p",
- "alternative": "",
- "short": "parenthesized p"
- }}},
-{"category": "So",
- "names": [],
- "key": "24AC",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter q",
- "alternative": "",
- "short": "parenthesized q"
- }}},
-{"category": "So",
- "names": [],
- "key": "24AD",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter r",
- "alternative": "",
- "short": "parenthesized r"
- }}},
-{"category": "So",
- "names": [],
- "key": "24AE",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter s",
- "alternative": "",
- "short": "parenthesized s"
- }}},
-{"category": "So",
- "names": [],
- "key": "24AF",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter t",
- "alternative": "",
- "short": "parenthesized t"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B0",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter u",
- "alternative": "",
- "short": "parenthesized u"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B1",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter v",
- "alternative": "",
- "short": "parenthesized v"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B2",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter w",
- "alternative": "",
- "short": "parenthesized w"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B3",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter x",
- "alternative": "",
- "short": "parenthesized x"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B4",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter y",
- "alternative": "",
- "short": "parenthesized y"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B5",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin small letter z",
- "alternative": "",
- "short": "parenthesized z"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B6",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter a",
- "alternative": "",
- "short": "circled cap a"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B7",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter b",
- "alternative": "",
- "short": "circled cap b"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B8",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter c",
- "alternative": "",
- "short": "circled cap c"
- }}},
-{"category": "So",
- "names": [],
- "key": "24B9",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter d",
- "alternative": "",
- "short": "circled cap d"
- }}},
-{"category": "So",
- "names": [],
- "key": "24BA",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter e",
- "alternative": "",
- "short": "circled cap e"
- }}},
-{"category": "So",
- "names": [],
- "key": "24BB",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter f",
- "alternative": "",
- "short": "circled cap f"
- }}},
-{"category": "So",
- "names": [],
- "key": "24BC",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter g",
- "alternative": "",
- "short": "circled cap g"
- }}},
-{"category": "So",
- "names": [],
- "key": "24BD",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter h",
- "alternative": "",
- "short": "circled cap h"
- }}},
-{"category": "So",
- "names": [],
- "key": "24BE",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter i",
- "alternative": "",
- "short": "circled cap i"
- }}},
-{"category": "So",
- "names": [],
- "key": "24BF",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter j",
- "alternative": "",
- "short": "circled cap j"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C0",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter k",
- "alternative": "",
- "short": "circled cap k"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C1",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter l",
- "alternative": "",
- "short": "circled cap l"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C2",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter m",
- "alternative": "",
- "short": "circled cap m"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C3",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter n",
- "alternative": "",
- "short": "circled cap n"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C4",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter o",
- "alternative": "",
- "short": "circled cap o"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C5",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter p",
- "alternative": "",
- "short": "circled cap p"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C6",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter q",
- "alternative": "",
- "short": "circled cap q"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C7",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter r",
- "alternative": "",
- "short": "circled cap r"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C8",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter s",
- "alternative": "",
- "short": "circled cap s"
- }}},
-{"category": "So",
- "names": [],
- "key": "24C9",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter t",
- "alternative": "",
- "short": "circled cap t"
- }}},
-{"category": "So",
- "names": [],
- "key": "24CA",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter u",
- "alternative": "",
- "short": "circled cap u"
- }}},
-{"category": "So",
- "names": [],
- "key": "24CB",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter v",
- "alternative": "",
- "short": "circled cap v"
- }}},
-{"category": "So",
- "names": [],
- "key": "24CC",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter w",
- "alternative": "",
- "short": "circled cap w"
- }}},
-{"category": "So",
- "names": [],
- "key": "24CD",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter x",
- "alternative": "",
- "short": "circled cap x"
- }}},
-{"category": "So",
- "names": [],
- "key": "24CE",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter y",
- "alternative": "",
- "short": "circled cap y"
- }}},
-{"category": "So",
- "names": [],
- "key": "24CF",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin capital letter z",
- "alternative": "",
- "short": "circled cap z"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D0",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter a",
- "alternative": "",
- "short": "circled a"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D1",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter b",
- "alternative": "",
- "short": "circled b"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D2",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter c",
- "alternative": "",
- "short": "circled c"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D3",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter d",
- "alternative": "",
- "short": "circled d"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D4",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter e",
- "alternative": "",
- "short": "circled e"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D5",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter f",
- "alternative": "",
- "short": "circled f"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D6",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter g",
- "alternative": "",
- "short": "circled g"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D7",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter h",
- "alternative": "",
- "short": "circled h"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D8",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter i",
- "alternative": "",
- "short": "circled i"
- }}},
-{"category": "So",
- "names": [],
- "key": "24D9",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter j",
- "alternative": "",
- "short": "circled j"
- }}},
-{"category": "So",
- "names": [],
- "key": "24DA",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter k",
- "alternative": "",
- "short": "circled k"
- }}},
-{"category": "So",
- "names": [],
- "key": "24DB",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter l",
- "alternative": "",
- "short": "circled l"
- }}},
-{"category": "So",
- "names": [],
- "key": "24DC",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter m",
- "alternative": "",
- "short": "circled m"
- }}},
-{"category": "So",
- "names": [],
- "key": "24DD",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter n",
- "alternative": "",
- "short": "circled n"
- }}},
-{"category": "So",
- "names": [],
- "key": "24DE",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter o",
- "alternative": "",
- "short": "circled o"
- }}},
-{"category": "So",
- "names": [],
- "key": "24DF",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter p",
- "alternative": "",
- "short": "circled p"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E0",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter q",
- "alternative": "",
- "short": "circled q"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E1",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter r",
- "alternative": "",
- "short": "circled r"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E2",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter s",
- "alternative": "",
- "short": "circled s"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E3",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter t",
- "alternative": "",
- "short": "circled t"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E4",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter u",
- "alternative": "",
- "short": "circled u"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E5",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter v",
- "alternative": "",
- "short": "circled v"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E6",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter w",
- "alternative": "",
- "short": "circled w"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E7",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter x",
- "alternative": "",
- "short": "circled x"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E8",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter y",
- "alternative": "",
- "short": "circled y"
- }}},
-{"category": "So",
- "names": [],
- "key": "24E9",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled latin small letter z",
- "alternative": "",
- "short": "circled z"
- }}},
-{"category": "Lm",
- "names": [],
- "key": "2C7C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin subscript small letter j",
- "alternative": "",
- "short": "subscript j"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F110",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter a",
- "alternative": "",
- "short": "parenthesized cap a"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F111",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter b",
- "alternative": "",
- "short": "parenthesized cap b"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F112",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter c",
- "alternative": "",
- "short": "parenthesized cap c"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F113",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter d",
- "alternative": "",
- "short": "parenthesized cap d"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F114",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter e",
- "alternative": "",
- "short": "parenthesized cap e"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F115",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter f",
- "alternative": "",
- "short": "parenthesized cap f"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F116",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter g",
- "alternative": "",
- "short": "parenthesized cap g"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F117",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter h",
- "alternative": "",
- "short": "parenthesized cap h"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F118",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter i",
- "alternative": "",
- "short": "parenthesized cap i"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F119",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter j",
- "alternative": "",
- "short": "parenthesized cap j"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F11A",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter k",
- "alternative": "",
- "short": "parenthesized cap k"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F11B",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter l",
- "alternative": "",
- "short": "parenthesized cap l"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F11C",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter m",
- "alternative": "",
- "short": "parenthesized cap m"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F11D",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter n",
- "alternative": "",
- "short": "parenthesized cap n"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F11E",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter o",
- "alternative": "",
- "short": "parenthesized cap o"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F11F",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter p",
- "alternative": "",
- "short": "parenthesized cap p"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F120",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter q",
- "alternative": "",
- "short": "parenthesized cap q"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F121",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter r",
- "alternative": "",
- "short": "parenthesized cap r"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F122",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter s",
- "alternative": "",
- "short": "parenthesized cap s"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F123",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter t",
- "alternative": "",
- "short": "parenthesized cap t"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F124",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter u",
- "alternative": "",
- "short": "parenthesized cap u"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F125",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter v",
- "alternative": "",
- "short": "parenthesized cap v"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F126",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter w",
- "alternative": "",
- "short": "parenthesized cap w"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F127",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter x",
- "alternative": "",
- "short": "parenthesized cap x"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F128",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter y",
- "alternative": "",
- "short": "parenthesized cap y"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F129",
- "active": true,
- "mappings": {
- "default": {
- "default": "parenthesized latin capital letter z",
- "alternative": "",
- "short": "parenthesized cap z"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F12A",
- "active": true,
- "mappings": {
- "default": {
- "default": "tortoise shell bracketed latin capital letter s",
- "alternative": "",
- "short": "tortoise shell bracketed cap s"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F12B",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled italic latin capital letter c",
- "alternative": "",
- "short": "circled italic cap c"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F12C",
- "active": true,
- "mappings": {
- "default": {
- "default": "circled italic latin capital letter r",
- "alternative": "",
- "short": "circled italic cap r"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F130",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter a",
- "alternative": "",
- "short": "squared cap a"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F131",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter b",
- "alternative": "",
- "short": "squared cap b"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F132",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter c",
- "alternative": "",
- "short": "squared cap c"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F133",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter d",
- "alternative": "",
- "short": "squared cap d"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F134",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter e",
- "alternative": "",
- "short": "squared cap e"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F135",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter f",
- "alternative": "",
- "short": "squared cap f"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F136",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter g",
- "alternative": "",
- "short": "squared cap g"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F137",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter h",
- "alternative": "",
- "short": "squared cap h"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F138",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter i",
- "alternative": "",
- "short": "squared cap i"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F139",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter j",
- "alternative": "",
- "short": "squared cap j"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F13A",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter k",
- "alternative": "",
- "short": "squared cap k"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F13B",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter l",
- "alternative": "",
- "short": "squared cap l"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F13C",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter m",
- "alternative": "",
- "short": "squared cap m"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F13D",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter n",
- "alternative": "",
- "short": "squared cap n"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F13E",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter o",
- "alternative": "",
- "short": "squared cap o"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F13F",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter p",
- "alternative": "",
- "short": "squared cap p"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F140",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter q",
- "alternative": "",
- "short": "squared cap q"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F141",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter r",
- "alternative": "",
- "short": "squared cap r"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F142",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter s",
- "alternative": "",
- "short": "squared cap s"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F143",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter t",
- "alternative": "",
- "short": "squared cap t"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F144",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter u",
- "alternative": "",
- "short": "squared cap u"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F145",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter v",
- "alternative": "",
- "short": "squared cap v"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F146",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter w",
- "alternative": "",
- "short": "squared cap w"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F147",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter x",
- "alternative": "",
- "short": "squared cap x"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F148",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter y",
- "alternative": "",
- "short": "squared cap y"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F149",
- "active": true,
- "mappings": {
- "default": {
- "default": "squared latin capital letter z",
- "alternative": "",
- "short": "squared cap z"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F150",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter a",
- "alternative": "",
- "short": "negative circled cap a"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F151",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter b",
- "alternative": "",
- "short": "negative circled cap b"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F152",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter c",
- "alternative": "",
- "short": "negative circled cap c"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F153",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter d",
- "alternative": "",
- "short": "negative circled cap d"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F154",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter e",
- "alternative": "",
- "short": "negative circled cap e"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F155",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter f",
- "alternative": "",
- "short": "negative circled cap f"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F156",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter g",
- "alternative": "",
- "short": "negative circled cap g"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F157",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter h",
- "alternative": "",
- "short": "negative circled cap h"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F158",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter i",
- "alternative": "",
- "short": "negative circled cap i"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F159",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter j",
- "alternative": "",
- "short": "negative circled cap j"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F15A",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter k",
- "alternative": "",
- "short": "negative circled cap k"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F15B",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter l",
- "alternative": "",
- "short": "negative circled cap l"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F15C",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter m",
- "alternative": "",
- "short": "negative circled cap m"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F15D",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter n",
- "alternative": "",
- "short": "negative circled cap n"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F15E",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter o",
- "alternative": "",
- "short": "negative circled cap o"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F15F",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter p",
- "alternative": "",
- "short": "negative circled cap p"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F160",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter q",
- "alternative": "",
- "short": "negative circled cap q"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F161",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter r",
- "alternative": "",
- "short": "negative circled cap r"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F162",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter s",
- "alternative": "",
- "short": "negative circled cap s"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F163",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter t",
- "alternative": "",
- "short": "negative circled cap t"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F164",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter u",
- "alternative": "",
- "short": "negative circled cap u"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F165",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter v",
- "alternative": "",
- "short": "negative circled cap v"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F166",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter w",
- "alternative": "",
- "short": "negative circled cap w"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F167",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter x",
- "alternative": "",
- "short": "negative circled cap x"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F168",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter y",
- "alternative": "",
- "short": "negative circled cap y"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F169",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative circled latin capital letter z",
- "alternative": "",
- "short": "negative circled cap z"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F170",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter a",
- "alternative": "",
- "short": "negative squared cap a"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F171",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter b",
- "alternative": "",
- "short": "negative squared cap b"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F172",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter c",
- "alternative": "",
- "short": "negative squared cap c"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F173",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter d",
- "alternative": "",
- "short": "negative squared cap d"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F174",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter e",
- "alternative": "",
- "short": "negative squared cap e"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F175",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter f",
- "alternative": "",
- "short": "negative squared cap f"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F176",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter g",
- "alternative": "",
- "short": "negative squared cap g"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F177",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter h",
- "alternative": "",
- "short": "negative squared cap h"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F178",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter i",
- "alternative": "",
- "short": "negative squared cap i"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F179",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter j",
- "alternative": "",
- "short": "negative squared cap j"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F17A",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter k",
- "alternative": "",
- "short": "negative squared cap k"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F17B",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter l",
- "alternative": "",
- "short": "negative squared cap l"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F17C",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter m",
- "alternative": "",
- "short": "negative squared cap m"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F17D",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter n",
- "alternative": "",
- "short": "negative squared cap n"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F17E",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter o",
- "alternative": "",
- "short": "negative squared cap o"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F17F",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter p",
- "alternative": "",
- "short": "negative squared cap p"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F180",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter q",
- "alternative": "",
- "short": "negative squared cap q"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F181",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter r",
- "alternative": "",
- "short": "negative squared cap r"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F182",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter s",
- "alternative": "",
- "short": "negative squared cap s"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F183",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter t",
- "alternative": "",
- "short": "negative squared cap t"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F184",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter u",
- "alternative": "",
- "short": "negative squared cap u"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F185",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter v",
- "alternative": "",
- "short": "negative squared cap v"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F186",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter w",
- "alternative": "",
- "short": "negative squared cap w"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F187",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter x",
- "alternative": "",
- "short": "negative squared cap x"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F188",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter y",
- "alternative": "",
- "short": "negative squared cap y"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F189",
- "active": true,
- "mappings": {
- "default": {
- "default": "negative squared latin capital letter z",
- "alternative": "",
- "short": "negative squared cap z"
- }}},
-{"category": "So",
- "names": [],
- "key": "1F18A",
- "active": true,
- "mappings": {
- "default": {
- "default": "crossed negative squared latin capital letter p",
- "alternative": "",
- "short": "crossed negative squared cap p"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-double-accent.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-double-accent.json
deleted file mode 100644
index 5966a1ef0c9..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-double-accent.json
+++ /dev/null
@@ -1,572 +0,0 @@
-[
-{"category": "Lu",
- "names": [],
- "key": "01D5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with diaeresis and macron",
- "alternative": "latin capital letter u double overdot overbar",
- "short": "cap u double overdot overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01D7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with diaeresis and acute",
- "alternative": "latin capital letter u double overdot acute",
- "short": "cap u double overdot acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01D9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with diaeresis and caron",
- "alternative": "latin capital letter u double overdot hacek",
- "short": "cap u double overdot caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01DB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with diaeresis and grave",
- "alternative": "latin capital letter u double overdot grave",
- "short": "cap u double overdot grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01DE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with diaeresis and macron",
- "alternative": "latin capital letter a double overdot overbar",
- "short": "cap a double overdot overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01E0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with dot above and macron",
- "alternative": "latin capital letter a dot overbar",
- "short": "cap a overdot overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01EC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with ogonek and macron",
- "alternative": "latin capital letter o ogonek overbar",
- "short": "cap o ogonek overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01FA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with ring above and acute",
- "alternative": "latin capital letter a ring acute",
- "short": "cap a ring acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "022A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with diaeresis and macron",
- "alternative": "latin capital letter o double overdot overbar",
- "short": "cap o double overdot overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "022C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with tilde and macron",
- "alternative": "latin capital letter o tilde overbar",
- "short": "cap o tilde overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0230",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with dot above and macron",
- "alternative": "latin capital letter o overdot overbar",
- "short": "cap o overdot overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E08",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter c with cedilla and acute",
- "alternative": "latin capital letter c cedilla acute",
- "short": "cap c cedilla acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E14",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with macron and grave",
- "alternative": "latin capital letter e overbar grave",
- "short": "cap e overbar grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E16",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with macron and acute",
- "alternative": "latin capital letter e overbar acute",
- "short": "cap e overbar acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E1C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with cedilla and breve",
- "alternative": "latin capital letter e cedilla breve",
- "short": "cap e cedilla breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E2E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with diaeresis and acute",
- "alternative": "latin capital letter i double overdot acute",
- "short": "cap i double overdot acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E38",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with dot below and macron",
- "alternative": "latin capital letter l underdot overbar",
- "short": "cap l underdot overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E4C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with tilde and acute",
- "alternative": "latin capital letter o tilde acute",
- "short": "cap o tilde acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E4E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with tilde and diaeresis",
- "alternative": "latin capital letter o tilde double overdot",
- "short": "cap o tilde double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E50",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with macron and grave",
- "alternative": "latin capital letter o overbar grave",
- "short": "cap o overbar grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E52",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with macron and acute",
- "alternative": "latin capital letter o overbar acute",
- "short": "cap o overbar acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E5C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with dot below and macron",
- "alternative": "cap r underdot and overbar",
- "short": "cap r overbar underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E64",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with acute dot above",
- "alternative": "latin capital letter s acute overdot",
- "short": "cap s acute overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E66",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with caron and dot above",
- "alternative": "latin capital letter s caron overdot",
- "short": "cap s caron overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E68",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with dot below and dot above",
- "alternative": "latin capital letter s underdot overdot",
- "short": "cap s underdot overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E78",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with tilde and acute",
- "alternative": "latin capital letter u tilde acute",
- "short": "cap u tilde acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E7A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with macron and diaeresis",
- "alternative": "latin capital letter u overbar double overdot",
- "short": "cap u overbar double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EA4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with circumflex and acute",
- "alternative": "latin capital letter a hat acute",
- "short": "cap a hat acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EA6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with circumflex and grave",
- "alternative": "latin capital letter a hat grave",
- "short": "cap a hat grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EA8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with circumflex and hook above",
- "alternative": "latin capital letter a hat hook",
- "short": "cap a hat hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EAA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with circumflex and tilde",
- "alternative": "latin capital letter a hat tilde",
- "short": "cap a hat tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EAC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with circumflex and dot below",
- "alternative": "latin capital letter a hat underdot",
- "short": "cap a hat underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EAE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with breve and acute",
- "alternative": "latin capital letter a breve acute",
- "short": "cap a breve acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EB0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with breve and grave",
- "alternative": "latin capital letter a breve grave",
- "short": "cap a breve grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EB2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with breve and hook above",
- "alternative": "latin capital letter a breve hook",
- "short": "cap a breve hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EB4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with breve and tilde",
- "alternative": "latin capital letter a breve tilde",
- "short": "cap a breve tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EB6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with breve and dot below",
- "alternative": "latin capital letter a breve underdot",
- "short": "cap a breve underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EBE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with circumflex and acute",
- "alternative": "latin capital letter e hat acute",
- "short": "cap e hat acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EC0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with circumflex and grave",
- "alternative": "latin capital letter e hat grave",
- "short": "cap e hat grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EC2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with circumflex and hook above",
- "alternative": "latin capital letter e hat hook",
- "short": "cap e hat hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EC4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with circumflex and tilde",
- "alternative": "latin capital letter e hat tilde",
- "short": "cap e hat tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EC6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with circumflex and dot below",
- "alternative": "latin capital letter e hat underdot",
- "short": "cap e hat underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ED0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with circumflex and acute",
- "alternative": "latin capital letter o hat acute",
- "short": "cap o hat acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ED2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with circumflex and grave",
- "alternative": "latin capital letter o hat grave",
- "short": "cap o hat grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ED4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with circumflex and hook above",
- "alternative": "latin capital letter o hat hook",
- "short": "cap o hat hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ED6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with circumflex and tilde",
- "alternative": "latin capital letter o hat tilde",
- "short": "cap o hat tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ED8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with circumflex and dot below",
- "alternative": "latin capital letter o hat underdot",
- "short": "cap o hat underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EDA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with horn and acute",
- "alternative": "latin capital letter o acute prime",
- "short": "cap o acute prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EDC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with horn and grave",
- "alternative": "latin capital letter o grave prime",
- "short": "cap o grave prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EDE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with horn and hook above",
- "alternative": "latin capital letter o hook prime",
- "short": "cap o hook prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EE0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with horn and tilde",
- "alternative": "latin capital letter o tilde prime",
- "short": "cap o tilde prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EE2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with horn and dot below",
- "alternative": "latin capital letter o underdot prime",
- "short": "cap o underdot prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EE8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with horn and acute",
- "alternative": "latin capital letter u acute prime",
- "short": "cap u acute prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EEA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with horn and grave",
- "alternative": "latin capital letter u grave prime",
- "short": "cap u grave prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EEC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with horn and hook above",
- "alternative": "latin capital letter u hook prime",
- "short": "cap u hook prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EEE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with horn and tilde",
- "alternative": "latin capital letter u tilde prime",
- "short": "cap u tilde prime"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EF0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with horn and dot below",
- "alternative": "latin capital letter u underdot prime",
- "short": "cap u underdot prime"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-normal.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-normal.json
deleted file mode 100644
index b3fcb4b175a..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-normal.json
+++ /dev/null
@@ -1,522 +0,0 @@
-[
-{"category": "Lu",
- "names": [],
- "key": "0041",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a",
- "alternative": "",
- "short": "cap a"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0042",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter b",
- "alternative": "",
- "short": "cap b"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0043",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter c",
- "alternative": "",
- "short": "cap c"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0044",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter d",
- "alternative": "",
- "short": "cap d"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0045",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e",
- "alternative": "",
- "short": "cap e"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0046",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter f",
- "alternative": "",
- "short": "cap f"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0047",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g",
- "alternative": "",
- "short": "cap g"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0048",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h",
- "alternative": "",
- "short": "cap h"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0049",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i",
- "alternative": "",
- "short": "cap i"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "004A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter j",
- "alternative": "",
- "short": "cap j"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "004B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter k",
- "alternative": "",
- "short": "cap k"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "004C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l",
- "alternative": "",
- "short": "cap l"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "004D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter m",
- "alternative": "",
- "short": "cap m"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "004E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n",
- "alternative": "",
- "short": "cap n"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "004F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o",
- "alternative": "",
- "short": "cap o"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0050",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter p",
- "alternative": "",
- "short": "cap p"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0051",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter q",
- "alternative": "",
- "short": "cap q"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0052",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r",
- "alternative": "",
- "short": "cap r"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0053",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s",
- "alternative": "",
- "short": "cap s"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0054",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t",
- "alternative": "",
- "short": "cap t"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0055",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u",
- "alternative": "",
- "short": "cap u"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0056",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter v",
- "alternative": "",
- "short": "cap v"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0057",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter w",
- "alternative": "",
- "short": "cap w"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0058",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter x",
- "alternative": "",
- "short": "cap x"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0059",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y",
- "alternative": "",
- "short": "cap y"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "005A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter z",
- "alternative": "",
- "short": "cap z"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF21",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter a",
- "alternative": "fullwidth latin cap a",
- "short": "cap a"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF22",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter b",
- "alternative": "fullwidth latin cap b",
- "short": "cap b"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF23",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter c",
- "alternative": "fullwidth latin cap c",
- "short": "cap c"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF24",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter d",
- "alternative": "fullwidth latin cap d",
- "short": "cap d"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF25",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter e",
- "alternative": "fullwidth latin cap e",
- "short": "cap e"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF26",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter f",
- "alternative": "fullwidth latin cap f",
- "short": "cap f"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF27",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter g",
- "alternative": "fullwidth latin cap g",
- "short": "cap g"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF28",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter h",
- "alternative": "fullwidth latin cap h",
- "short": "cap h"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF29",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter i",
- "alternative": "fullwidth latin cap i",
- "short": "cap i"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF2A",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter j",
- "alternative": "fullwidth latin cap j",
- "short": "cap j"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF2B",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter k",
- "alternative": "fullwidth latin cap k",
- "short": "cap k"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF2C",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter l",
- "alternative": "fullwidth latin cap l",
- "short": "cap l"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF2D",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter m",
- "alternative": "fullwidth latin cap m",
- "short": "cap m"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF2E",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter n",
- "alternative": "fullwidth latin cap n",
- "short": "cap n"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF2F",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter o",
- "alternative": "fullwidth latin cap o",
- "short": "cap o"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF30",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter p",
- "alternative": "fullwidth latin cap p",
- "short": "cap p"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF31",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter q",
- "alternative": "fullwidth latin cap q",
- "short": "cap q"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF32",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter r",
- "alternative": "fullwidth latin cap r",
- "short": "cap r"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF33",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter s",
- "alternative": "fullwidth latin cap s",
- "short": "cap s"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF34",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter t",
- "alternative": "fullwidth latin cap t",
- "short": "cap t"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF35",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter u",
- "alternative": "fullwidth latin cap u",
- "short": "cap u"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF36",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter v",
- "alternative": "fullwidth latin cap v",
- "short": "cap v"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF37",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter w",
- "alternative": "fullwidth latin cap w",
- "short": "cap w"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF38",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter x",
- "alternative": "fullwidth latin cap x",
- "short": "cap x"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF39",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter y",
- "alternative": "fullwidth latin cap y",
- "short": "cap y"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "FF3A",
- "active": true,
- "mappings": {
- "default": {
- "default": "fullwidth latin capital letter z",
- "alternative": "fullwidth latin cap z",
- "short": "cap z"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-single-accent.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-single-accent.json
deleted file mode 100644
index d5387520b40..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/latin-upper-single-accent.json
+++ /dev/null
@@ -1,1842 +0,0 @@
-[
-{"category": "Lu",
- "names": [],
- "key": "00C0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with grave",
- "alternative": "latin capital letter a grave",
- "short": "cap a grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with acute",
- "alternative": "latin capital letter a acute",
- "short": "cap a acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with circumflex",
- "alternative": "latin capital letter a hat",
- "short": "cap a hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with tilde",
- "alternative": "latin capital letter a tilde",
- "short": "cap a tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with diaeresis",
- "alternative": "latin capital letter a double overdot",
- "short": "cap a double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with ring above",
- "alternative": "latin capital letter a ring",
- "short": "cap a ring"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C7",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter c cedilla",
- "alternative": "latin capital letter c cedilla",
- "short": "cap c cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with grave",
- "alternative": "latin capital letter e grave",
- "short": "cap e grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00C9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with acute",
- "alternative": "latin capital letter e acute",
- "short": "cap e acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00CA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with circumflex",
- "alternative": "latin capital letter e hat",
- "short": "cap e hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00CB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with diaeresis",
- "alternative": "latin capital letter e double overdot",
- "short": "cap e double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00CC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with grave",
- "alternative": "latin capital letter i grave",
- "short": "cap i grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00CD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with acute",
- "alternative": "latin capital letter i acute",
- "short": "cap i acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00CE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with circumflex",
- "alternative": "latin capital letter i hat",
- "short": "cap i hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00CF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with diaeresis",
- "alternative": "latin capital letter i double overdot",
- "short": "cap i double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00D1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n tilde",
- "alternative": "latin capital letter n tilde",
- "short": "cap n tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00D2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with grave",
- "alternative": "latin capital letter o grave",
- "short": "cap o grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00D3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with acute",
- "alternative": "latin capital letter o acute",
- "short": "cap o acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00D4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with circumflex",
- "alternative": "latin capital letter o hat",
- "short": "cap o hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00D5",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with tilde",
- "alternative": "latin capital letter o tilde",
- "short": "cap o tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00D6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with diaeresis",
- "alternative": "latin capital letter o double overdot",
- "short": "cap o double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00D9",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with grave",
- "alternative": "latin capital letter u grave",
- "short": "cap u grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00DA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with acute",
- "alternative": "latin capital letter u acute",
- "short": "cap u acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00DB",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with circumflex",
- "alternative": "latin capital letter u hat",
- "short": "cap u hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00DC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with diaeresis",
- "alternative": "latin capital letter u double overdot",
- "short": "cap u double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "00DD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with acute",
- "alternative": "latin capital letter y acute",
- "short": "cap y acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0100",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a macron",
- "alternative": "latin capital letter a overbar",
- "short": "cap a overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0102",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with breve",
- "alternative": "latin capital letter a breve",
- "short": "cap a breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0104",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with ogonek",
- "alternative": "latin capital letter a ogonek",
- "short": "cap a ogonek"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0106",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter c with acute",
- "alternative": "latin capital letter c acute",
- "short": "cap c acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0108",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter c with circumflex",
- "alternative": "latin capital letter c hat",
- "short": "cap c hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "010A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter c with dot above",
- "alternative": "latin capital letter c overdot",
- "short": "cap c overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "010C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter c with caron",
- "alternative": "latin capital letter c hacek",
- "short": "cap c caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "010E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter d with caron",
- "alternative": "latin capital letter d hacek",
- "short": "cap d caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0112",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with macron",
- "alternative": "latin capital letter e overbar",
- "short": "cap e overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0114",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with breve",
- "alternative": "latin capital letter e breve",
- "short": "cap e breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0116",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with dot above",
- "alternative": "latin capital letter e overdot",
- "short": "cap e overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0118",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with ogonek",
- "alternative": "latin capital letter e ogonek",
- "short": "cap e ogonek"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "011A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with caron",
- "alternative": "latin capital letter e hacek",
- "short": "cap e caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "011C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g with circumflex",
- "alternative": "latin capital letter g hat",
- "short": "cap g hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "011E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g with breve",
- "alternative": "latin capital letter g breve",
- "short": "cap g breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0120",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g with dot above",
- "alternative": "latin capital letter g overdot",
- "short": "cap g overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0122",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g with cedilla",
- "alternative": "latin capital letter g cedilla",
- "short": "cap g cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0124",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h with circumflex",
- "alternative": "latin capital letter h hat",
- "short": "cap h hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0128",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with tilde",
- "alternative": "latin capital letter i tilde",
- "short": "cap i tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "012A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with macron",
- "alternative": "latin capital letter i overbar",
- "short": "cap i overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "012C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with breve",
- "alternative": "latin capital letter i breve",
- "short": "cap i breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "012E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with ogonek",
- "alternative": "latin capital letter i ogonek",
- "short": "cap i ogonek"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0130",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with dot above",
- "alternative": "latin capital letter i overdot",
- "short": "cap i overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0134",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter j circumflex",
- "alternative": "latin capital letter j hat",
- "short": "cap j hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0136",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter k with cedilla",
- "alternative": "latin capital letter k cedilla",
- "short": "cap k cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0139",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with acute",
- "alternative": "latin capital letter l acute",
- "short": "cap l acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "013B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with cedilla",
- "alternative": "latin capital letter l cedilla",
- "short": "cap l cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "013D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with caron",
- "alternative": "latin capital letter l hacek",
- "short": "cap l caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "013F",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with middle dot",
- "alternative": "latin capital letter l middle dot",
- "short": "cap l middle dot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0143",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with acute",
- "alternative": "latin capital letter n acute",
- "short": "cap n acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0145",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with cedilla",
- "alternative": "latin capital letter n cedilla",
- "short": "cap n cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0147",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with caron",
- "alternative": "latin capital letter n hacek",
- "short": "cap n caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "014C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o macron",
- "alternative": "latin capital letter o overbar",
- "short": "cap o overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "014E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with breve",
- "alternative": "latin capital letter o breve",
- "short": "cap o breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0150",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with double acute",
- "alternative": "latin capital letter o double acute",
- "short": "cap o double acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0154",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r acute",
- "alternative": "latin capital letter r acute",
- "short": "cap r acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0156",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with cedilla",
- "alternative": "latin capital letter r cedilla",
- "short": "cap r cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0158",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with caron",
- "alternative": "latin capital letter r hacek",
- "short": "cap r caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "015A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with acute",
- "alternative": "latin capital letter s acute",
- "short": "cap s acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "015C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with circumflex",
- "alternative": "latin capital letter s hat",
- "short": "cap s hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "015E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with cedilla",
- "alternative": "latin capital letter s cedilla",
- "short": "cap s cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0160",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with caron",
- "alternative": "latin capital letter s hacek",
- "short": "cap s caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0162",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t with cedilla",
- "alternative": "latin capital letter t cedilla",
- "short": "cap t cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0164",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t with caron",
- "alternative": "latin capital letter t hacek",
- "short": "cap t caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0168",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with tilde",
- "alternative": "latin capital letter u tilde",
- "short": "cap u tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "016A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with macron",
- "alternative": "latin capital letter u overbar",
- "short": "cap u overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "016C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with breve",
- "alternative": "latin capital letter u breve",
- "short": "cap u breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "016E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with ring above",
- "alternative": "latin capital letter u ring",
- "short": "cap u ring"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0170",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with double acute",
- "alternative": "latin capital letter u double acute",
- "short": "cap u double acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0172",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with ogonek",
- "alternative": "latin capital letter u ogonek",
- "short": "cap u ogonek"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0174",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter w with circumflex",
- "alternative": "latin capital letter w hat",
- "short": "cap w hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0176",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with circumflex",
- "alternative": "latin capital letter y hat",
- "short": "cap y hat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0178",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with diaeresis",
- "alternative": "latin capital letter y double overdot",
- "short": "cap y double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0179",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter z with acute",
- "alternative": "latin capital letter z acute",
- "short": "cap z acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "017B",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter z with dot above",
- "alternative": "latin capital letter z overdot",
- "short": "cap z overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "017D",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter z with caron",
- "alternative": "latin capital letter z hacek",
- "short": "cap z caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01CD",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with caron",
- "alternative": "latin capital letter a hacek",
- "short": "cap a caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01CF",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with caron",
- "alternative": "latin capital letter i hacek",
- "short": "cap i caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01D1",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with caron",
- "alternative": "latin capital letter o hacek",
- "short": "cap o caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01D3",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with caron",
- "alternative": "latin capital letter u hacek",
- "short": "cap u caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01E6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g with caron",
- "alternative": "latin capital letter g hacek",
- "short": "cap g caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01E8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter k with caron",
- "alternative": "latin capital letter k hacek",
- "short": "cap k caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01EA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with ogonek",
- "alternative": "latin capital letter o ogonek",
- "short": "cap o ogonek"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01F4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g with acute",
- "alternative": "latin capital letter g acute",
- "short": "cap g acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "01F8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with grave",
- "alternative": "latin capital letter n grave",
- "short": "cap n grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0200",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with double grave",
- "alternative": "latin capital letter a double grave",
- "short": "cap a double grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0202",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with inverted breve",
- "alternative": "latin capital letter a inverted breve",
- "short": "cap a inverted breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0204",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with double grave",
- "alternative": "latin capital letter e double grave",
- "short": "cap e double grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0206",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with inverted breve",
- "alternative": "latin capital letter e inverted breve",
- "short": "cap e inverted breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0208",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with double grave",
- "alternative": "latin capital letter i double grave",
- "short": "cap i double grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "020A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with inverted breve",
- "alternative": "latin capital letter i inverted breve",
- "short": "cap i inverted breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "020C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with double grave",
- "alternative": "latin capital letter o double grave",
- "short": "cap o double grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "020E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with inverted breve",
- "alternative": "latin capital letter o inverted breve",
- "short": "cap o inverted breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0210",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with double grave",
- "alternative": "latin capital letter r double grave",
- "short": "cap r double grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0212",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with inverted breve",
- "alternative": "latin capital letter r inverted breve",
- "short": "cap r inverted breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0214",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with double grave",
- "alternative": "latin capital letter u double grave",
- "short": "cap u double grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0216",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with inverted breve",
- "alternative": "latin capital letter u inverted breve",
- "short": "cap u inverted breve"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0218",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with comma below",
- "alternative": "latin capital letter s comma below",
- "short": "cap s comma below"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "021A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t with comma below",
- "alternative": "latin capital letter t comma below",
- "short": "cap t comma below"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "021E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h caron",
- "alternative": "",
- "short": "cap h caron"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0226",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with dot above",
- "alternative": "latin capital letter a overdot",
- "short": "cap a overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0228",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with cedilla",
- "alternative": "latin capital letter e cedilla",
- "short": "cap e cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "022E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with dot above",
- "alternative": "latin capital letter o overdot",
- "short": "cap o overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "0232",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with macron",
- "alternative": "latin capital letter y overbar",
- "short": "cap y overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E00",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with ring below",
- "alternative": "latin capital letter a ring below",
- "short": "cap a ring below"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E02",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter b with dot above",
- "alternative": "latin capital letter b overdot",
- "short": "cap b overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E04",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter b with dot below",
- "alternative": "latin capital letter b underdot",
- "short": "cap b underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E06",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter b with line below",
- "alternative": "latin capital letter b underbar",
- "short": "cap b underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E0A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter d with dot above",
- "alternative": "latin capital letter d overdot",
- "short": "cap d overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E0C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter d with dot below",
- "alternative": "latin capital letter d underdot",
- "short": "cap d underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E0E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter d with line below",
- "alternative": "latin capital letter d underbar",
- "short": "cap d underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E10",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter d with cedilla",
- "alternative": "latin capital letter d cedilla",
- "short": "cap d cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E12",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter d with circumflex below",
- "alternative": "latin capital letter d underhat",
- "short": "cap d underhat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E18",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with circumflex below",
- "alternative": "latin capital letter e underhat",
- "short": "cap e underhat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E1A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with tilde below",
- "alternative": "latin capital letter e tilde below",
- "short": "cap e tilde below"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E1E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter f with dot above",
- "alternative": "latin capital letter f overdot",
- "short": "cap f overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E20",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter g with macron",
- "alternative": "latin capital letter g overbar",
- "short": "cap g overbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E22",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h with dot above",
- "alternative": "latin capital letter h overdot",
- "short": "cap h overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E24",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h with dot below",
- "alternative": "latin capital letter h underdot",
- "short": "cap h underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E26",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h with diaeresis",
- "alternative": "latin capital letter h double overdot",
- "short": "cap h double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E28",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h with cedilla",
- "alternative": "latin capital letter h cedilla",
- "short": "cap h cedilla"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E2A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter h with breve below",
- "alternative": "latin capital letter h breve below",
- "short": "cap h breve below"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E2C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with tilde below",
- "alternative": "latin capital letter i tilde below",
- "short": "cap i tilde below"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E30",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter k with acute",
- "alternative": "latin capital letter k acute",
- "short": "cap k acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E32",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter k with dot below",
- "alternative": "latin capital letter k underdot",
- "short": "cap k underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E34",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter k with line below",
- "alternative": "latin capital letter k underbar",
- "short": "cap k underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E36",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with dot below",
- "alternative": "latin capital letter l underdot",
- "short": "cap l underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E3A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with line below",
- "alternative": "latin capital letter l underbar",
- "short": "cap l underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E3C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter l with circumflex below",
- "alternative": "latin capital letter l underhat",
- "short": "cap l underhat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E3E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter m with acute",
- "alternative": "latin capital letter m acute",
- "short": "cap m acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E40",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter m with dot above",
- "alternative": "latin capital letter m overdot",
- "short": "cap m overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E42",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter m with dot below",
- "alternative": "latin capital letter m underdot",
- "short": "cap m underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E44",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with dot above",
- "alternative": "latin capital letter n overdot",
- "short": "cap n overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E46",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with dot below",
- "alternative": "latin capital letter n underdot",
- "short": "cap n underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E48",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with line below",
- "alternative": "latin capital letter n underbar",
- "short": "cap n underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E4A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter n with circumflex below",
- "alternative": "latin capital letter n underhat",
- "short": "cap n underhat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E54",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter p with acute",
- "alternative": "latin capital letter p acute",
- "short": "cap p acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E56",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter p with dot above",
- "alternative": "latin capital letter p overdot",
- "short": "cap p overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E58",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with dot above",
- "alternative": "latin capital letter r overdot",
- "short": "cap r overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E5A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with dot below",
- "alternative": "latin capital letter r underdot",
- "short": "cap r underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E5E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter r with line below",
- "alternative": "latin capital letter r underbar",
- "short": "cap r underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E60",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with dot above",
- "alternative": "latin capital letter s overdot",
- "short": "cap s overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E62",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter s with dot below",
- "alternative": "latin capital letter s underdot",
- "short": "cap s underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E6A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t with dot above",
- "alternative": "latin capital letter t overdot",
- "short": "cap t overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E6C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t with dot below",
- "alternative": "latin capital letter t underdot",
- "short": "cap t underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E6E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t with line below",
- "alternative": "latin capital letter t underbar",
- "short": "cap t underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E70",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter t with circumflex below",
- "alternative": "latin capital letter t underhat",
- "short": "cap t underhat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E72",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with diaeresis below",
- "alternative": "latin capital letter u double underdot",
- "short": "cap u double underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E74",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with tilde below",
- "alternative": "latin capital letter u tilde below",
- "short": "cap u tilde below"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E76",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with circumflex below",
- "alternative": "latin capital letter u underhat",
- "short": "cap u underhat"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E7C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter v with tilde",
- "alternative": "latin capital letter v tilde",
- "short": "cap v tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E7E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter v with dot below",
- "alternative": "latin capital letter v underdot",
- "short": "cap v underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E80",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter w with grave",
- "alternative": "latin capital letter w grave",
- "short": "cap w grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E82",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter w with acute",
- "alternative": "latin capital letter w acute",
- "short": "cap w acute"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E84",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter w with diaeresis",
- "alternative": "latin capital letter w double overdot",
- "short": "cap w double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E86",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter w with dot above",
- "alternative": "latin capital letter w overdot",
- "short": "cap w overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E88",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter w with dot below",
- "alternative": "latin capital letter w underdot",
- "short": "cap w underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E8A",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter x with dot above",
- "alternative": "latin capital letter x overdot",
- "short": "cap x overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E8C",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter x with diaeresis",
- "alternative": "latin capital letter x double overdot",
- "short": "cap x double overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E8E",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with dot above",
- "alternative": "latin capital letter y overdot",
- "short": "cap y overdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E90",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter z with circumflex",
- "alternative": "latin capital letter z circumflex",
- "short": "cap z circumflex"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E92",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter z with dot below",
- "alternative": "latin capital letter z underdot",
- "short": "cap z underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1E94",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter z with line below",
- "alternative": "latin capital letter z underbar",
- "short": "cap z underbar"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EA0",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter with a dot below",
- "alternative": "latin capital letter with a underdot",
- "short": "cap a underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EA2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter a with hook above",
- "alternative": "latin capital letter a hook",
- "short": "cap a hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EB8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with dot below",
- "alternative": "latin capital letter e underdot",
- "short": "cap e underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EBA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with hook above",
- "alternative": "latin capital letter e hook",
- "short": "cap e hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EBC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter e with tilde",
- "alternative": "latin capital letter e tilde",
- "short": "cap e tilde"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EC8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with hook above",
- "alternative": "latin capital letter i hook",
- "short": "cap i hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ECA",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter i with dot below",
- "alternative": "latin capital letter i underdot",
- "short": "cap i underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ECC",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with dot below",
- "alternative": "latin capital letter o underdot",
- "short": "cap o underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1ECE",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter o with hook above",
- "alternative": "latin capital letter o hook",
- "short": "cap o hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EE4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with dot below",
- "alternative": "latin capital letter u underdot",
- "short": "cap u underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EE6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter u with hook above",
- "alternative": "latin capital letter u hook",
- "short": "cap u hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EF2",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with grave",
- "alternative": "latin capital letter y grave",
- "short": "cap y grave"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EF4",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with dot below",
- "alternative": "latin capital letter y underdot",
- "short": "cap y underdot"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EF6",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with hook above",
- "alternative": "latin capital letter y hook",
- "short": "cap y hook"
- }}},
-{"category": "Lu",
- "names": [],
- "key": "1EF8",
- "active": true,
- "mappings": {
- "default": {
- "default": "latin capital letter y with tilde",
- "alternative": "latin capital letter y tilde",
- "short": "cap y tilde"
- }}}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_angles.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_angles.json
deleted file mode 100644
index fd9192d453b..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_angles.json
+++ /dev/null
@@ -1,194 +0,0 @@
-[
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right angle with arc"
- }
- },
- "key": "22BE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right angle with downwards zigzag arrow"
- }
- },
- "key": "237C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "three dimensional angle"
- }
- },
- "key": "27C0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle opening left"
- }
- },
- "key": "299B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right angle variant with square"
- }
- },
- "key": "299C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured right angle with dot"
- }
- },
- "key": "299D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "angle with s inside"
- }
- },
- "key": "299E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "acute angle"
- }
- },
- "key": "299F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "spherical angle opening left"
- }
- },
- "key": "29A0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "spherical angle opening up"
- }
- },
- "key": "29A1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "turned angle"
- }
- },
- "key": "29A2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reversed angle"
- }
- },
- "key": "29A3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "angle with underbar"
- }
- },
- "key": "29A4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reversed angle with underbar"
- }
- },
- "key": "29A5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "oblique angle opening up"
- }
- },
- "key": "29A6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "oblique angle opening down"
- }
- },
- "key": "29A7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing up and right"
- }
- },
- "key": "29A8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing up and left"
- }
- },
- "key": "29A9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing down and right"
- }
- },
- "key": "29AA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing down and left"
- }
- },
- "key": "29AB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing right and up"
- }
- },
- "key": "29AC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing left and up"
- }
- },
- "key": "29AD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing right and down"
- }
- },
- "key": "29AE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle with open arm ending in arrow pointing left and down"
- }
- },
- "key": "29AF"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_arrows.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_arrows.json
deleted file mode 100644
index 0c21734bccf..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_arrows.json
+++ /dev/null
@@ -1,2677 +0,0 @@
-[
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow",
- "short": "left arrow"
- }
- },
- "key": "2190"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards arrow",
- "short": "up arrow"
- }
- },
- "key": "2191"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow",
- "short": "right arrow"
- }
- },
- "key": "2192"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards arrow",
- "short": "down arrow"
- }
- },
- "key": "2193"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right arrow"
- }
- },
- "key": "2194"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up down arrow"
- }
- },
- "key": "2195"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north west arrow",
- "short": "upper left arrow"
- }
- },
- "key": "2196"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north east arrow",
- "short": "upper right arrow"
- }
- },
- "key": "2197"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south east arrow",
- "short": "lower right arrow"
- }
- },
- "key": "2198"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south west arrow",
- "short": "lower left arrow"
- }
- },
- "key": "2199"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow with stroke",
- "short": "left arrow with stroke"
- }
- },
- "key": "219A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with stroke",
- "short": "right arrow with stroke"
- }
- },
- "key": "219B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards wave arrow",
- "short": "left wave arrow"
- }
- },
- "key": "219C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards wave arrow",
- "short": "right wave arrow"
- }
- },
- "key": "219D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards two headed arrow",
- "alternative": "left two headed arrow",
- "short": "two headed left arrow"
- }
- },
- "key": "219E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards two headed arrow",
- "alternative": "up two headed arrow",
- "short": "two headed up arrow"
- }
- },
- "key": "219F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed arrow",
- "alternative": "right two headed arrow",
- "short": "two headed right arrow"
- }
- },
- "key": "21A0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards two headed arrow",
- "alternative": "down two headed arrow",
- "short": "two headed down arrow"
- }
- },
- "key": "21A1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow with tail",
- "short": "left arrow with tail"
- }
- },
- "key": "21A2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with tail",
- "short": "right arrow with tail"
- }
- },
- "key": "21A3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow from bar",
- "short": "left arrow from bar"
- }
- },
- "key": "21A4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards arrow from bar",
- "short": "up arrow from bar"
- }
- },
- "key": "21A5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow from bar",
- "short": "right arrow from bar"
- }
- },
- "key": "21A6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards arrow from bar",
- "short": "down arrow from bar"
- }
- },
- "key": "21A7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up down arrow with base"
- }
- },
- "key": "21A8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow with hook",
- "short": "left arrow with hook"
- }
- },
- "key": "21A9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards arrow with hook",
- "short": "right arrow with hook"
- }
- },
- "key": "21AA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow with loop",
- "short": "left arrow with loop"
- }
- },
- "key": "21AB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards arrow with loop",
- "short": "right arrow with loop"
- }
- },
- "key": "21AC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left right wave arrow"
- }
- },
- "key": "21AD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right arrow with stroke"
- }
- },
- "key": "21AE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards zigzag arrow",
- "short": "down zigzag arrow"
- }
- },
- "key": "21AF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards arrow with tip leftwards",
- "short": "up arrow with tip left"
- }
- },
- "key": "21B0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards arrow with tip rightwards",
- "short": "up arrow with tip right"
- }
- },
- "key": "21B1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards arrow with tip leftwards",
- "short": "down arrow with tip left"
- }
- },
- "key": "21B2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards arrow with tip rightwards",
- "short": "down arrow with tip right"
- }
- },
- "key": "21B3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards arrow with corner downwards",
- "short": "right arrow with corner down"
- }
- },
- "key": "21B4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards arrow with corner leftwards",
- "short": "down arrow with corner left"
- }
- },
- "key": "21B5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "anticlockwise top semicircle arrow"
- }
- },
- "key": "21B6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "clockwise top semicircle arrow"
- }
- },
- "key": "21B7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north west arrow to long bar",
- "short": "upper left arrow to long bar"
- }
- },
- "key": "21B8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow to bar over rightwards arrow to bar",
- "short": "left arrow to bar over right arrow to bar"
- }
- },
- "key": "21B9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "anticlockwise open circle arrow"
- }
- },
- "key": "21BA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "clockwise open circle arrow"
- }
- },
- "key": "21BB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards arrow over leftwards arrow",
- "short": "right arrow over left arrow"
- }
- },
- "key": "21C4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards arrow leftwards of downwards arrow",
- "short": "up arrow left of down arrow"
- }
- },
- "key": "21C5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow over rightwards arrow",
- "short": "left arrow over right arrow"
- }
- },
- "key": "21C6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards paired arrows",
- "short": "left paired arrows"
- }
- },
- "key": "21C7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards paired arrows",
- "short": "up paired arrows"
- }
- },
- "key": "21C8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards paired arrows",
- "short": "right paired arrows"
- }
- },
- "key": "21C9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards paired arrows",
- "short": "down paired arrows"
- }
- },
- "key": "21CA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards double arrow with stroke",
- "short": "left double arrow with stroke"
- }
- },
- "key": "21CD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right double arrow with stroke"
- }
- },
- "key": "21CE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards double arrow with stroke",
- "short": "right double arrow with stroke"
- }
- },
- "key": "21CF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards double arrow",
- "short": "left double arrow"
- }
- },
- "key": "21D0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards double arrow",
- "short": "up double arrow"
- }
- },
- "key": "21D1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards double arrow",
- "short": "right double arrow"
- }
- },
- "key": "21D2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards double arrow",
- "short": "down double arrow"
- }
- },
- "key": "21D3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right double arrow"
- }
- },
- "key": "21D4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up down double arrow"
- }
- },
- "key": "21D5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north west double arrow",
- "short": "upper left double arrow"
- }
- },
- "key": "21D6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north east double arrow",
- "short": "upper right double arrow"
- }
- },
- "key": "21D7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south east double arrow",
- "short": "lower right double arrow"
- }
- },
- "key": "21D8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south west double arrow",
- "short": "lower left double arrow"
- }
- },
- "key": "21D9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards triple arrow",
- "short": "left triple arrow"
- }
- },
- "key": "21DA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards triple arrow",
- "short": "right triple arrow"
- }
- },
- "key": "21DB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards squiggle arrow",
- "short": "left squiggle arrow"
- }
- },
- "key": "21DC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards squiggle arrow",
- "short": "right squiggle arrow"
- }
- },
- "key": "21DD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards arrow with double stroke",
- "short": "up arrow with double stroke"
- }
- },
- "key": "21DE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards arrow with double stroke",
- "short": "down arrow with double stroke"
- }
- },
- "key": "21DF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards dashed arrow",
- "short": "left dashed arrow"
- }
- },
- "key": "21E0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards dashed arrow",
- "short": "up dashed arrow"
- }
- },
- "key": "21E1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards dashed arrow",
- "short": "right dashed arrow"
- }
- },
- "key": "21E2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards dashed arrow",
- "short": "down dashed arrow"
- }
- },
- "key": "21E3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow to bar",
- "short": "left arrow to bar"
- }
- },
- "key": "21E4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards arrow to bar",
- "short": "right arrow to bar"
- }
- },
- "key": "21E5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards white arrow",
- "short": "white left arrow"
- }
- },
- "key": "21E6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards white arrow",
- "short": "white up arrow"
- }
- },
- "key": "21E7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards white arrow",
- "short": "white right arrow"
- }
- },
- "key": "21E8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards white arrow",
- "short": "white down arrow"
- }
- },
- "key": "21E9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards white arrow from bar",
- "short": "white up arrow from bar"
- }
- },
- "key": "21EA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards white arrow on pedestal",
- "alternative": "up white arrow on pedestal",
- "short": "white up arrow on pedestal"
- }
- },
- "key": "21EB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards white arrow on pedestal with horizontal bar",
- "alternative": "up white arrow on pedestal with horizontal bar",
- "short": "white up arrow on pedestal with horizontal bar"
- }
- },
- "key": "21EC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards white arrow on pedestal with vertical bar",
- "alternative": "up white arrow on pedestal with vertical bar",
- "short": "white up arrow on pedestal with vertical bar"
- }
- },
- "key": "21ED"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards white double arrow",
- "alternative": "up white double arrow",
- "short": "white double up arrow"
- }
- },
- "key": "21EE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards white double arrow on pedestal",
- "alternative": "up white double arrow on pedestal",
- "short": "white double up arrow on pedestal"
- }
- },
- "key": "21EF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards white arrow from wall",
- "alternative": "right white arrow from wall",
- "short": "white right arrow from wall"
- }
- },
- "key": "21F0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north west arrow to corner"
- }
- },
- "key": "21F1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south east arrow to corner"
- }
- },
- "key": "21F2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up down white arrow"
- }
- },
- "key": "21F3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right arrow with small circle"
- }
- },
- "key": "21F4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "down arrow leftwards of upwards arrow",
- "short": "down arrow left of up arrow"
- }
- },
- "key": "21F5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "three rightwards arrows",
- "short": "three right arrows"
- }
- },
- "key": "21F6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow with vertical stroke",
- "short": "left arrow with vertical stroke"
- }
- },
- "key": "21F7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with vertical stroke",
- "short": "right arrow with vertical stroke"
- }
- },
- "key": "21F8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right arrow with vertical stroke"
- }
- },
- "key": "21F9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow with double vertical stroke",
- "short": "left arrow with double vertical stroke"
- }
- },
- "key": "21FA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with double vertical stroke",
- "short": "right arrow with double vertical stroke"
- }
- },
- "key": "21FB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right arrow with double vertical stroke"
- }
- },
- "key": "21FC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards open headed arrow",
- "short": "left open headed arrow"
- }
- },
- "key": "21FD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards open headed arrow",
- "short": "right open headed arrow"
- }
- },
- "key": "21FE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right open headed arrow"
- }
- },
- "key": "21FF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "electric arrow"
- }
- },
- "key": "2301"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up arrowhead"
- }
- },
- "key": "2303"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "down arrowhead"
- }
- },
- "key": "2304"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up arrowhead between two horizontal bars",
- "alternative": "enter key"
- }
- },
- "key": "2324"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "broken circle with northwest arrow"
- }
- },
- "key": "238B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy wide headed rightwards arrow",
- "short": "heavy wide headed right arrow"
- }
- },
- "key": "2794"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy south east arrow",
- "short": "heavy lower right arrow"
- }
- },
- "key": "2798"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy rightwards arrow",
- "short": "heavy right arrow"
- }
- },
- "key": "2799"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy north east arrow",
- "short": "heavy upper right arrow"
- }
- },
- "key": "279A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "drafting point rightwards arrow",
- "short": "drafting point right arrow"
- }
- },
- "key": "279B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy round tipped rightwards arrow",
- "short": "heavy round tipped right arrow"
- }
- },
- "key": "279C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "triangle headed rightwards arrow",
- "short": "triangle headed right arrow"
- }
- },
- "key": "279D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy triangle headed rightwards arrow",
- "short": "heavy triangle headed right arrow"
- }
- },
- "key": "279E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "dashed triangle headed rightwards arrow",
- "short": "dashed triangle headed right arrow"
- }
- },
- "key": "279F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy dashed triangle headed rightwards arrow",
- "short": "heavy dashed triangle headed right arrow"
- }
- },
- "key": "27A0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black rightwards arrow",
- "short": "black right arrow"
- }
- },
- "key": "27A1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "three d top lighted rightwards arrowhead",
- "short": "three d top lighted right arrowhead"
- }
- },
- "key": "27A2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "three d bottom lighted rightwards arrowhead",
- "short": "three d bottom lighted right arrowhead"
- }
- },
- "key": "27A3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black rightwards arrowhead",
- "short": "black right arrowhead"
- }
- },
- "key": "27A4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy black curved downwards and rightwards arrow",
- "short": "heavy black curved down and right arrow"
- }
- },
- "key": "27A5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy black curved upwards and rightwards arrow",
- "short": "heavy black curved up and right arrow"
- }
- },
- "key": "27A6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "squat black rightwards arrow",
- "short": "squat black right arrow"
- }
- },
- "key": "27A7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy concave pointed black rightwards arrow",
- "short": "heavy concave pointed black right arrow"
- }
- },
- "key": "27A8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "right shaded white rightwards arrow",
- "short": "right shaded white right arrow"
- }
- },
- "key": "27A9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left shaded white rightwards arrow",
- "short": "left shaded white right arrow"
- }
- },
- "key": "27AA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "back tilted shadowed white rightwards arrow",
- "short": "back tilted shadowed white right arrow"
- }
- },
- "key": "27AB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "front tilted shadowed white rightwards arrow",
- "short": "front tilted shadowed white right arrow"
- }
- },
- "key": "27AC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy lower right shadowed white rightwards arrow",
- "short": "heavy lower right shadowed white right arrow"
- }
- },
- "key": "27AD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy upper right shadowed white rightwards arrow",
- "short": "heavy upper right shadowed white right arrow"
- }
- },
- "key": "27AE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "notched lower right shadowed white rightwards arrow",
- "short": "notched lower right shadowed white right arrow"
- }
- },
- "key": "27AF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "notched upper right shadowed white rightwards arrow",
- "short": "notched upper right shadowed white right arrow"
- }
- },
- "key": "27B1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circled heavy white rightwards arrow",
- "short": "circled heavy white right arrow"
- }
- },
- "key": "27B2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white feathered rightwards arrow",
- "short": "white feathered right arrow"
- }
- },
- "key": "27B3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black feathered south east arrow",
- "short": "black feathered lower right arrow"
- }
- },
- "key": "27B4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black feathered rightwards arrow",
- "short": "black feathered right arrow"
- }
- },
- "key": "27B5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black feathered north east arrow",
- "short": "black feathered upper right arrow"
- }
- },
- "key": "27B6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy black feathered south east arrow",
- "short": "heavy black feathered lower right arrow"
- }
- },
- "key": "27B7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy black feathered rightwards arrow",
- "short": "heavy black feathered right arrow"
- }
- },
- "key": "27B8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy black feathered north east arrow",
- "short": "heavy black feathered upper right arrow"
- }
- },
- "key": "27B9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "teardrop barbed rightwards arrow",
- "short": "teardrop barbed right arrow"
- }
- },
- "key": "27BA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy teardrop shanked rightwards arrow",
- "short": "heavy teardrop shanked right arrow"
- }
- },
- "key": "27BB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "wedge tailed rightwards arrow",
- "short": "wedge tailed right arrow"
- }
- },
- "key": "27BC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy wedge tailed rightwards arrow",
- "short": "heavy wedge tailed right arrow"
- }
- },
- "key": "27BD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "open outlined rightwards arrow",
- "short": "open outlined right arrow"
- }
- },
- "key": "27BE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards quadruple arrow",
- "short": "up quadruple arrow"
- }
- },
- "key": "27F0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards quadruple arrow",
- "short": "down quadruple arrow"
- }
- },
- "key": "27F1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "anticlockwise gapped circle arrow"
- }
- },
- "key": "27F2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "clockwise gapped circle arrow"
- }
- },
- "key": "27F3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right arrow with circled plus"
- }
- },
- "key": "27F4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long leftwards arrow",
- "short": "long left arrow"
- }
- },
- "key": "27F5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long rightwards arrow",
- "short": "long right arrow"
- }
- },
- "key": "27F6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long left right arrow"
- }
- },
- "key": "27F7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long leftwards double arrow",
- "short": "long left double arrow"
- }
- },
- "key": "27F8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long rightwards double arrow",
- "short": "long right double arrow"
- }
- },
- "key": "27F9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long left right double arrow"
- }
- },
- "key": "27FA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long leftwards arrow from bar",
- "short": "long left arrow from bar"
- }
- },
- "key": "27FB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long rightwards arrow from bar",
- "short": "long right arrow from bar"
- }
- },
- "key": "27FC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long leftwards double arrow from bar"
- }
- },
- "key": "27FD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long rightwards double arrow from bar",
- "short": "long right double arrow from bar"
- }
- },
- "key": "27FE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long rightwards squiggle arrow",
- "short": "long right squiggle arrow"
- }
- },
- "key": "27FF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed arrow with vertical stroke",
- "alternative": "right two headed arrow with vertical stroke",
- "short": "two headed right arrow with vertical stroke"
- }
- },
- "key": "2900"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed arrow with double vertical stroke",
- "alternative": "right two headed arrow with double vertical stroke",
- "short": "two headed right arrow with double vertical stroke"
- }
- },
- "key": "2901"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards double arrow with vertical stroke",
- "alternative": "left double arrow with vertical stroke",
- "short": "double left arrow with vertical stroke"
- }
- },
- "key": "2902"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards double arrow with vertical stroke",
- "alternative": "right double arrow with vertical stroke",
- "short": "double right arrow with vertical stroke"
- }
- },
- "key": "2903"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right double arrow with vertical stroke",
- "short": "double left right arrow with vertical stroke"
- }
- },
- "key": "2904"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed arrow from bar",
- "alternative": "right two headed arrow from bar",
- "short": "two headed right arrow from bar"
- }
- },
- "key": "2905"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards double arrow from bar",
- "alternative": "left double arrow from bar",
- "short": "double left arrow from bar"
- }
- },
- "key": "2906"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards double arrow from bar",
- "alternative": "right double arrow from bar",
- "short": "double right arrow from bar"
- }
- },
- "key": "2907"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards arrow with horizontal stroke",
- "alternative": "down arrow with horizontal stroke",
- "short": "arrow down with horizontal stroke"
- }
- },
- "key": "2908"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards arrow with horizontal stroke",
- "short": "up arrow with horizontal stroke"
- }
- },
- "key": "2909"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards triple arrow",
- "short": "up triple arrow"
- }
- },
- "key": "290A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards triple arrow",
- "short": "down triple arrow"
- }
- },
- "key": "290B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards double dash arrow",
- "short": "left double dash arrow"
- }
- },
- "key": "290C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards double dash arrow",
- "short": "right double dash arrow"
- }
- },
- "key": "290D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards triple dash arrow",
- "short": "left triple dash arrow"
- }
- },
- "key": "290E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards triple dash arrow",
- "short": "right triple dash arrow"
- }
- },
- "key": "290F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed triple dash arrow",
- "short": "right two headed triple dash arrow"
- }
- },
- "key": "2910"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with dotted stem",
- "short": "right arrow with dotted stem"
- }
- },
- "key": "2911"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards arrow to bar",
- "short": "up arrow to bar"
- }
- },
- "key": "2912"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards arrow to bar",
- "short": "down arrow to bar"
- }
- },
- "key": "2913"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with tail with vertical stroke",
- "short": "right arrow with tail with vertical stroke"
- }
- },
- "key": "2914"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with tail with double vertical stroke",
- "short": "right arrow with tail with double vertical stroke"
- }
- },
- "key": "2915"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed arrow with tail",
- "short": "right two headed arrow with tail"
- }
- },
- "key": "2916"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed arrow with tail with vertical stroke",
- "short": "right two headed arrow with tail with vertical stroke"
- }
- },
- "key": "2917"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards two headed arrow with tail with double vertical stroke",
- "short": "right two headed arrow with tail with double vertical stroke"
- }
- },
- "key": "2918"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow tail",
- "short": "left arrow tail"
- }
- },
- "key": "2919"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow tail",
- "short": "right arrow tail"
- }
- },
- "key": "291A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards double arrow tail",
- "short": "left double arrow tail"
- }
- },
- "key": "291B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards double arrow tail",
- "short": "right double arrow tail"
- }
- },
- "key": "291C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow to black diamond",
- "short": "left arrow to black diamond"
- }
- },
- "key": "291D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow to black diamond",
- "short": "right arrow to black diamond"
- }
- },
- "key": "291E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow from bar to black diamond",
- "short": "left arrow from bar to black diamond"
- }
- },
- "key": "291F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow from bar to black diamond"
- }
- },
- "key": "2920"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north west and south east arrow"
- }
- },
- "key": "2921"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north east and south west arrow"
- }
- },
- "key": "2922"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north west arrow with hook"
- }
- },
- "key": "2923"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north east arrow with hook"
- }
- },
- "key": "2924"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "south east arrow with hook"
- }
- },
- "key": "2925"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "south west arrow with hook"
- }
- },
- "key": "2926"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north west arrow and north east arrow"
- }
- },
- "key": "2927"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north east arrow and south east arrow"
- }
- },
- "key": "2928"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "south east arrow and south west arrow"
- }
- },
- "key": "2929"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "south west arrow and north west arrow"
- }
- },
- "key": "292A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "south east arrow crossing north east arrow"
- }
- },
- "key": "292D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north east arrow crossing south east arrow"
- }
- },
- "key": "292E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "falling diagonal crossing north east arrow"
- }
- },
- "key": "292F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rising diagonal crossing south east arrow"
- }
- },
- "key": "2930"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north east arrow crossing north west arrow"
- }
- },
- "key": "2931"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "north west arrow crossing north east arrow"
- }
- },
- "key": "2932"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "wave arrow pointing directly right"
- }
- },
- "key": "2933"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "arrow pointing rightwards then curving upwards",
- "short": "arrow pointing right then curving up"
- }
- },
- "key": "2934"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "arrow pointing rightwards then curving downwards",
- "short": "arrow pointing right then curving down"
- }
- },
- "key": "2935"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "arrow pointing downwards then curving leftwards",
- "short": "arrow pointing down then curving left"
- }
- },
- "key": "2936"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "arrow pointing downwards then curving rightwards",
- "short": "arrow pointing down then curving right"
- }
- },
- "key": "2937"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right side arc clockwise arrow"
- }
- },
- "key": "2938"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left side arc anticlockwise arrow"
- }
- },
- "key": "2939"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "top arc anticlockwise arrow"
- }
- },
- "key": "293A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bottom arc anticlockwise arrow"
- }
- },
- "key": "293B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "top arc clockwise arrow with minus"
- }
- },
- "key": "293C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "top arc anticlockwise arrow with plus"
- }
- },
- "key": "293D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "lower right semicircular clockwise arrow"
- }
- },
- "key": "293E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "lower left semicircular anticlockwise arrow"
- }
- },
- "key": "293F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "anticlockwise closed circle arrow"
- }
- },
- "key": "2940"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "clockwise closed circle arrow"
- }
- },
- "key": "2941"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow above short leftwards arrow",
- "short": "right arrow above short left arrow"
- }
- },
- "key": "2942"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow above short rightwards arrow",
- "short": "left arrow above short right arrow"
- }
- },
- "key": "2943"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "short rightwards arrow above leftwards arrow",
- "short": "short right arrow above left arrow"
- }
- },
- "key": "2944"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow with plus below",
- "short": "right arrow with plus below"
- }
- },
- "key": "2945"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow with plus below",
- "short": "left arrow with plus below"
- }
- },
- "key": "2946"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow through x",
- "short": "right arrow through x"
- }
- },
- "key": "2947"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left right arrow through small circle"
- }
- },
- "key": "2948"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards two headed arrow from small circle",
- "short": "up two headed arrow from small circle"
- }
- },
- "key": "2949"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right double arrow with rounded head"
- }
- },
- "key": "2970"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign above rightwards arrow",
- "short": "equals sign above right arrow"
- }
- },
- "key": "2971"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tilde operator above rightwards arrow",
- "short": "tilde operator above right arrow"
- }
- },
- "key": "2972"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow above tilde operator",
- "short": "left arrow above tilde operator"
- }
- },
- "key": "2973"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow above tilde operator",
- "short": "right arrow above tilde operator"
- }
- },
- "key": "2974"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow above almost equal to",
- "short": "right arrow above almost equal to"
- }
- },
- "key": "2975"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than above leftwards arrow",
- "short": "less than above left arrow"
- }
- },
- "key": "2976"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow through less than",
- "short": "left arrow through less than"
- }
- },
- "key": "2977"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than above rightwards arrow",
- "short": "greater than above right arrow"
- }
- },
- "key": "2978"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset above rightwards arrow",
- "short": "subset above right arrow"
- }
- },
- "key": "2979"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow through subset",
- "short": "left arrow through subset"
- }
- },
- "key": "297A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset above leftwards arrow",
- "short": "superset above left arrow"
- }
- },
- "key": "297B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "empty set with right arrow above"
- }
- },
- "key": "29B3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "empty set with left arrow above"
- }
- },
- "key": "29B4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up arrow through circle"
- }
- },
- "key": "29BD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "black diamond with down arrow"
- }
- },
- "key": "29EA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white circle with down arrow"
- }
- },
- "key": "29EC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "black circle with down arrow"
- }
- },
- "key": "29ED"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral with leftwards arrow with hook",
- "short": "integral with left arrow with hook"
- }
- },
- "key": "2A17"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north east white arrow"
- }
- },
- "key": "2B00"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north west white arrow"
- }
- },
- "key": "2B01"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south east white arrow"
- }
- },
- "key": "2B02"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south west white arrow"
- }
- },
- "key": "2B03"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left right white arrow"
- }
- },
- "key": "2B04"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards black arrow",
- "short": "left black arrow"
- }
- },
- "key": "2B05"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards black arrow",
- "short": "up black arrow"
- }
- },
- "key": "2B06"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards black arrow",
- "short": "down black arrow"
- }
- },
- "key": "2B07"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north east black arrow"
- }
- },
- "key": "2B08"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "north west black arrow"
- }
- },
- "key": "2B09"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south east black arrow"
- }
- },
- "key": "2B0A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "south west black arrow"
- }
- },
- "key": "2B0B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left right black arrow"
- }
- },
- "key": "2B0C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up down black arrow"
- }
- },
- "key": "2B0D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards arrow with tip downwards",
- "short": "right arrow with tip down"
- }
- },
- "key": "2B0E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards arrow with tip upwards",
- "short": "right arrow with tip up"
- }
- },
- "key": "2B0F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow with tip downwards",
- "short": "left arrow with tip down"
- }
- },
- "key": "2B10"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards arrow with tip upwards",
- "short": "left arrow with tip up"
- }
- },
- "key": "2B11"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left arrow with small circle"
- }
- },
- "key": "2B30"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "three leftwards arrows",
- "short": "three left arrows"
- }
- },
- "key": "2B31"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left arrow with circled plus"
- }
- },
- "key": "2B32"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long leftwards squiggle arrow",
- "short": "long left squiggle arrow"
- }
- },
- "key": "2B33"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards two headed arrow with vertical stroke",
- "short": "left two headed arrow with vertical stroke"
- }
- },
- "key": "2B34"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards two headed arrow with double vertical stroke",
- "short": "left two headed arrow with double vertical stroke"
- }
- },
- "key": "2B35"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards two headed arrow from bar",
- "short": "left two headed arrow from bar"
- }
- },
- "key": "2B36"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards two headed triple dash arrow",
- "short": "left two headed triple dash arrow"
- }
- },
- "key": "2B37"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow with dotted stem",
- "short": "left arrow with dotted stem"
- }
- },
- "key": "2B38"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow with tail with vertical stroke",
- "short": "left arrow with tail with vertical stroke"
- }
- },
- "key": "2B39"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow with tail with double vertical stroke",
- "short": "left arrow with tail with double vertical stroke"
- }
- },
- "key": "2B3A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards two headed arrow with tail",
- "short": "left two headed arrow with tail"
- }
- },
- "key": "2B3B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards two headed arrow with tail with vertical stroke",
- "short": "left two headed arrow with tail with vertical stroke"
- }
- },
- "key": "2B3C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards two headed arrow with tail with double vertical stroke",
- "short": "left two headed arrow with tail with double vertical stroke"
- }
- },
- "key": "2B3D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow through x",
- "short": "left arrow through x"
- }
- },
- "key": "2B3E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "wave arrow pointing directly left"
- }
- },
- "key": "2B3F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign above leftwards arrow",
- "short": "equals sign above left arrow"
- }
- },
- "key": "2B40"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reverse tilde operator above leftwards arrow",
- "short": "reverse tilde operator above left arrow"
- }
- },
- "key": "2B41"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow above reverse almost equal to",
- "short": "left arrow above reverse almost equal to"
- }
- },
- "key": "2B42"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow through greater than",
- "short": "right arrow through greater than"
- }
- },
- "key": "2B43"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow through superset",
- "short": "right arrow through superset"
- }
- },
- "key": "2B44"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards quadruple arrow",
- "short": "left quadruple arrow"
- }
- },
- "key": "2B45"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards quadruple arrow",
- "short": "right quadruple arrow"
- }
- },
- "key": "2B46"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reverse tilde operator above rightwards arrow",
- "short": "reverse tilde operator above right arrow"
- }
- },
- "key": "2B47"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow above reverse almost equal to",
- "short": "right arrow above reverse almost equal to"
- }
- },
- "key": "2B48"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tilde operator above leftwards arrow",
- "short": "tilde operator above left arrow"
- }
- },
- "key": "2B49"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow above almost equal to",
- "short": "left arrow above almost equal to"
- }
- },
- "key": "2B4A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards arrow above reverse tilde operator",
- "short": "left arrow above reverse tilde operator"
- }
- },
- "key": "2B4B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards arrow above reverse tilde operator",
- "short": "right arrow above reverse tilde operator"
- }
- },
- "key": "2B4C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "halfwidth leftwards arrow",
- "short": "halfwidth left arrow"
- }
- },
- "key": "FFE9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "halfwidth upwards arrow",
- "short": "halfwidth up arrow"
- }
- },
- "key": "FFEA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "halfwidth rightwards arrow",
- "short": "halfwidth right arrow"
- }
- },
- "key": "FFEB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "halfwidth downwards arrow",
- "short": "halfwidth down arrow"
- }
- },
- "key": "FFEC"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_characters.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_characters.json
deleted file mode 100644
index cd94688cec4..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_characters.json
+++ /dev/null
@@ -1,350 +0,0 @@
-[
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "mathematical double struck capital c",
- "alternative": "double struck capital c",
- "short": "double struck cap c"
- }
- },
- "key": "2102"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "script small g",
- "short": "script g"
- }
- },
- "key": "210A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital h",
- "alternative": "script h",
- "short": "script cap h"
- }
- },
- "key": "210B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "black letter capital h",
- "alternative": "black letter h",
- "short": "black letter cap h"
- }
- },
- "key": "210C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital h",
- "alternative": "double struck h",
- "short": "double struck cap h"
- }
- },
- "key": "210D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small h",
- "alternative": "italic small h",
- "short": "italic h"
- },
- "physics": {
- "default": "planck constant"
- }
- },
- "key": "210E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital i",
- "alternative": "script i",
- "short": "script cap i"
- }
- },
- "key": "2110"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "black letter capital i",
- "alternative": "black letter i",
- "short": "black letter cap i"
- }
- },
- "key": "2111"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital l",
- "alternative": "script l",
- "short": "script cap l"
- }
- },
- "key": "2112"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "script small l",
- "short": "script l"
- }
- },
- "key": "2113"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital n",
- "alternative": "double struck n",
- "short": "double struck cap n"
- }
- },
- "key": "2115"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "script capital p",
- "alternative": "script p",
- "short": "script cap p"
- }
- },
- "key": "2118"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital p",
- "alternative": "double struck p",
- "short": "double struck cap p"
- }
- },
- "key": "2119"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital q",
- "alternative": "double struck q",
- "short": "double struck cap q"
- }
- },
- "key": "211A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital r",
- "alternative": "script r",
- "short": "script cap r"
- }
- },
- "key": "211B"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "black letter capital r",
- "alternative": "black letter r",
- "short": "black letter cap r"
- }
- },
- "key": "211C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital r",
- "alternative": "double struck r",
- "short": "double struck cap r"
- }
- },
- "key": "211D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital z",
- "alternative": "double struck z",
- "short": "double struck cap z"
- }
- },
- "key": "2124"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "black letter capital z",
- "alternative": "black letter z",
- "short": "black letter cap z"
- }
- },
- "key": "2128"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital b",
- "alternative": "script b",
- "short": "script cap b"
- }
- },
- "key": "212C"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "black letter capital c",
- "alternative": "black letter c",
- "short": "black letter cap c"
- }
- },
- "key": "212D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "script small e",
- "short": "script e"
- }
- },
- "key": "212F"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital e",
- "alternative": "script e",
- "short": "script cap e"
- }
- },
- "key": "2130"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital f",
- "alternative": "script f",
- "short": "script cap f"
- }
- },
- "key": "2131"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "script capital m",
- "alternative": "script m",
- "short": "script cap m"
- }
- },
- "key": "2133"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "script small o",
- "short": "script o"
- }
- },
- "key": "2134"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "double struck small pi",
- "short": "double struck pi"
- }
- },
- "key": "213C"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "double struck small gamma",
- "short": "double struck gamma"
- }
- },
- "key": "213D"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital gamma",
- "short": "double struck cap gamma"
- }
- },
- "key": "213E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck capital pi",
- "short": "double struck cap pi"
- }
- },
- "key": "213F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double struck n ary summation"
- }
- },
- "key": "2140"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "double struck italic capital d",
- "short": "double struck italic cap d"
- }
- },
- "key": "2145"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "double struck italic small d",
- "short": "double struck italic d"
- }
- },
- "key": "2146"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "double struck italic small e",
- "short": "double struck italic e"
- }
- },
- "key": "2147"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "double struck italic small i",
- "short": "double struck italic i"
- }
- },
- "key": "2148"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "double struck italic small j",
- "short": "double struck italic j"
- }
- },
- "key": "2149"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_delimiters.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_delimiters.json
deleted file mode 100644
index 0773abe4b1e..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_delimiters.json
+++ /dev/null
@@ -1,1514 +0,0 @@
-[
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left parenthesis",
- "alternative": "opening parenthesis"
- }
- },
- "key": "0028"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right parenthesis",
- "alternative": "closing parenthesis"
- }
- },
- "key": "0029"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left square bracket",
- "alternative": "opening square bracket"
- }
- },
- "key": "005B"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right square bracket",
- "alternative": "closing square bracket"
- }
- },
- "key": "005D"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left curly bracket",
- "alternative": "opening curly bracket"
- }
- },
- "key": "007B"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right curly bracket",
- "alternative": "closing curly bracket"
- }
- },
- "key": "007D"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left square bracket with quill"
- }
- },
- "key": "2045"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right square bracket with quill"
- }
- },
- "key": "2046"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left ceiling"
- }
- },
- "key": "2308"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right ceiling"
- }
- },
- "key": "2309"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left floor"
- }
- },
- "key": "230A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right floor"
- }
- },
- "key": "230B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "bottom right crop"
- }
- },
- "key": "230C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "bottom left crop"
- }
- },
- "key": "230D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "top right crop"
- }
- },
- "key": "230E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "top left crop"
- }
- },
- "key": "230F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "top left corner"
- }
- },
- "key": "231C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "top right corner"
- }
- },
- "key": "231D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "bottom left corner"
- }
- },
- "key": "231E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "bottom right corner"
- }
- },
- "key": "231F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "top half integral"
- }
- },
- "key": "2320"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bottom half integral"
- }
- },
- "key": "2321"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left pointing angle bracket",
- "alternative": "bra"
- }
- },
- "key": "2329"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right pointing angle bracket",
- "alternative": "ket"
- }
- },
- "key": "232A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left parenthesis upper hook"
- }
- },
- "key": "239B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left parenthesis extension"
- }
- },
- "key": "239C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left parenthesis lower hook"
- }
- },
- "key": "239D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right parenthesis upper hook"
- }
- },
- "key": "239E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right parenthesis extension"
- }
- },
- "key": "239F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right parenthesis lower hook"
- }
- },
- "key": "23A0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left square bracket upper corner"
- }
- },
- "key": "23A1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left square bracket extension"
- }
- },
- "key": "23A2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left square bracket lower corner"
- }
- },
- "key": "23A3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right square bracket upper corner"
- }
- },
- "key": "23A4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right square bracket extension"
- }
- },
- "key": "23A5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right square bracket lower corner"
- }
- },
- "key": "23A6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left curly bracket upper hook"
- }
- },
- "key": "23A7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left curly bracket middle piece"
- }
- },
- "key": "23A8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left curly bracket lower hook"
- }
- },
- "key": "23A9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "curly bracket extension"
- }
- },
- "key": "23AA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right curly bracket upper hook"
- }
- },
- "key": "23AB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right curly bracket middle piece"
- }
- },
- "key": "23AC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right curly bracket lower hook"
- }
- },
- "key": "23AD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral extension"
- }
- },
- "key": "23AE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "horizontal line extension"
- }
- },
- "key": "23AF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upper left or lower right curly bracket section"
- }
- },
- "key": "23B0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upper right or lower left curly bracket section"
- }
- },
- "key": "23B1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "summation top"
- }
- },
- "key": "23B2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "summation bottom"
- }
- },
- "key": "23B3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "top square bracket"
- }
- },
- "key": "23B4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "bottom square bracket"
- }
- },
- "key": "23B5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "bottom square bracket over top square bracket"
- }
- },
- "key": "23B6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "radical symbol bottom"
- }
- },
- "key": "23B7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left vertical box line"
- }
- },
- "key": "23B8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "right vertical box line"
- }
- },
- "key": "23B9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "top parenthesis"
- }
- },
- "key": "23DC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bottom parenthesis"
- }
- },
- "key": "23DD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "top curly bracket"
- }
- },
- "key": "23DE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bottom curly bracket"
- }
- },
- "key": "23DF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "top tortoise shell bracket"
- }
- },
- "key": "23E0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bottom tortoise shell bracket"
- }
- },
- "key": "23E1"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "medium left parenthesis ornament"
- }
- },
- "key": "2768"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "medium right parenthesis ornament"
- }
- },
- "key": "2769"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "medium flattened left parenthesis ornament"
- }
- },
- "key": "276A"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "medium flattened right parenthesis ornament"
- }
- },
- "key": "276B"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "medium left pointing angle bracket ornament"
- }
- },
- "key": "276C"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "medium right pointing angle bracket ornament"
- }
- },
- "key": "276D"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "heavy left pointing angle quotation mark ornament"
- }
- },
- "key": "276E"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "heavy right pointing angle quotation mark ornament"
- }
- },
- "key": "276F"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "heavy left pointing angle bracket ornament"
- }
- },
- "key": "2770"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "heavy right pointing angle bracket ornament"
- }
- },
- "key": "2771"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "light left tortoise shell bracket ornament"
- }
- },
- "key": "2772"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "light right tortoise shell bracket ornament"
- }
- },
- "key": "2773"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "medium left curly bracket ornament"
- }
- },
- "key": "2774"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "medium right curly bracket ornament"
- }
- },
- "key": "2775"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left s shaped bag delimiter"
- }
- },
- "key": "27C5"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right s shaped bag delimiter"
- }
- },
- "key": "27C6"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "mathematical left white square bracket"
- }
- },
- "key": "27E6"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "mathematical right white square bracket"
- }
- },
- "key": "27E7"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "mathematical left angle bracket"
- }
- },
- "key": "27E8"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "mathematical right angle bracket"
- }
- },
- "key": "27E9"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "mathematical left double angle bracket"
- }
- },
- "key": "27EA"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "mathematical right double angle bracket"
- }
- },
- "key": "27EB"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "mathematical left white tortoise shell bracket"
- }
- },
- "key": "27EC"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "mathematical right white tortoise shell bracket"
- }
- },
- "key": "27ED"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "mathematical left flattened parenthesis"
- }
- },
- "key": "27EE"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "mathematical right flattened parenthesis"
- }
- },
- "key": "27EF"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left white curly bracket"
- }
- },
- "key": "2983"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right white curly bracket"
- }
- },
- "key": "2984"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left white parenthesis"
- }
- },
- "key": "2985"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right white parenthesis"
- }
- },
- "key": "2986"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "z notation left image bracket"
- }
- },
- "key": "2987"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "z notation right image bracket"
- }
- },
- "key": "2988"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "z notation left binding bracket"
- }
- },
- "key": "2989"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "z notation right binding bracket"
- }
- },
- "key": "298A"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left square bracket with underbar"
- }
- },
- "key": "298B"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right square bracket with underbar"
- }
- },
- "key": "298C"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left square bracket with tick in top corner"
- }
- },
- "key": "298D"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right square bracket with tick in bottom corner"
- }
- },
- "key": "298E"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left square bracket with tick in bottom corner"
- }
- },
- "key": "298F"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right square bracket with tick in top corner"
- }
- },
- "key": "2990"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left angle bracket with dot"
- }
- },
- "key": "2991"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right angle bracket with dot"
- }
- },
- "key": "2992"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left arc less than bracket"
- }
- },
- "key": "2993"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right arc greater than bracket"
- }
- },
- "key": "2994"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "double left arc greater than bracket"
- }
- },
- "key": "2995"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "double right arc less than bracket"
- }
- },
- "key": "2996"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left black tortoise shell bracket"
- }
- },
- "key": "2997"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right black tortoise shell bracket"
- }
- },
- "key": "2998"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left wiggly fence"
- }
- },
- "key": "29D8"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right wiggly fence"
- }
- },
- "key": "29D9"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left double wiggly fence"
- }
- },
- "key": "29DA"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right double wiggly fence"
- }
- },
- "key": "29DB"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left pointing curved angle bracket"
- }
- },
- "key": "29FC"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right pointing curved angle bracket"
- }
- },
- "key": "29FD"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "top left half bracket"
- }
- },
- "key": "2E22"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "top right half bracket"
- }
- },
- "key": "2E23"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "bottom left half bracket"
- }
- },
- "key": "2E24"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "bottom right half bracket"
- }
- },
- "key": "2E25"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left sideways u bracket"
- }
- },
- "key": "2E26"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right sideways u bracket"
- }
- },
- "key": "2E27"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left double parenthesis"
- }
- },
- "key": "2E28"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right double parenthesis"
- }
- },
- "key": "2E29"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left angle bracket",
- "alternative": "opening angle bracket"
- }
- },
- "key": "3008"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right angle bracket",
- "alternative": "closing angle bracket"
- }
- },
- "key": "3009"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left double angle bracket",
- "alternative": "opening double angle bracket"
- }
- },
- "key": "300A"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right double angle bracket",
- "alternative": "closing double angle bracket"
- }
- },
- "key": "300B"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left corner bracket",
- "alternative": "opening corner bracket"
- }
- },
- "key": "300C"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right corner bracket",
- "alternative": "closing corner bracket"
- }
- },
- "key": "300D"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left white corner bracket",
- "alternative": "opening white corner bracket"
- }
- },
- "key": "300E"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right white corner bracket",
- "alternative": "closing white corner bracket"
- }
- },
- "key": "300F"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left black lenticular bracket",
- "alternative": "opening black lenticular bracket"
- }
- },
- "key": "3010"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right black lenticular bracket",
- "alternative": "closing black lenticular bracket"
- }
- },
- "key": "3011"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left tortoise shell bracket",
- "alternative": "opening tortoise shell bracket"
- }
- },
- "key": "3014"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right tortoise shell bracket",
- "alternative": "closing tortoise shell bracket"
- }
- },
- "key": "3015"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left white lenticular bracket",
- "alternative": "opening white lenticular bracket"
- }
- },
- "key": "3016"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right white lenticular bracket",
- "alternative": "closing white lenticular bracket"
- }
- },
- "key": "3017"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left white tortoise shell bracket",
- "alternative": "opening white tortoise shell bracket"
- }
- },
- "key": "3018"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right white tortoise shell bracket",
- "alternative": "closing white tortoise shell bracket"
- }
- },
- "key": "3019"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "left white square bracket",
- "alternative": "opening white square bracket"
- }
- },
- "key": "301A"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "right white square bracket",
- "alternative": "closing white square bracket"
- }
- },
- "key": "301B"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "reversed double prime quotation mark"
- }
- },
- "key": "301D"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "double prime quotation mark"
- }
- },
- "key": "301E"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "low double prime quotation mark"
- }
- },
- "key": "301F"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "ornate left parenthesis"
- }
- },
- "key": "FD3E"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "ornate right parenthesis"
- }
- },
- "key": "FD3F"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left white lenticular bracket"
- }
- },
- "key": "FE17"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right white lenticular brakcet"
- }
- },
- "key": "FE18"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left parenthesis",
- "alternative": "glyph for vertical opening parenthesis"
- }
- },
- "key": "FE35"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right parenthesis",
- "alternative": "glyph for vertical closing parenthesis"
- }
- },
- "key": "FE36"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left curly bracket",
- "alternative": "glyph for vertical opening curly bracket"
- }
- },
- "key": "FE37"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right curly bracket",
- "alternative": "glyph for vertical closing curly bracket"
- }
- },
- "key": "FE38"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left tortoise shell bracket",
- "alternative": "glyph for vertical opening tortoise shell bracket"
- }
- },
- "key": "FE39"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right tortoise shell bracket",
- "alternative": "glyph for vertical closing tortoise shell bracket"
- }
- },
- "key": "FE3A"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left black lenticular bracket",
- "alternative": "glyph for vertical opening black lenticular bracket"
- }
- },
- "key": "FE3B"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right black lenticular bracket",
- "alternative": "glyph for vertical closing black lenticular bracket"
- }
- },
- "key": "FE3C"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left double angle bracket",
- "alternative": "glyph for vertical opening double angle bracket"
- }
- },
- "key": "FE3D"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right double angle bracket",
- "alternative": "glyph for vertical closing double angle bracket"
- }
- },
- "key": "FE3E"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left angle bracket",
- "alternative": "glyph for vertical opening angle bracket"
- }
- },
- "key": "FE3F"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right angle bracket",
- "alternative": "glyph for vertical closing angle bracket"
- }
- },
- "key": "FE40"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left corner bracket",
- "alternative": "glyph for vertical opening corner bracket"
- }
- },
- "key": "FE41"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right corner bracket",
- "alternative": "glyph for vertical closing corner bracket"
- }
- },
- "key": "FE42"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left white corner bracket",
- "alternative": "glyph for vertical opening white corner bracket"
- }
- },
- "key": "FE43"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right white corner bracket",
- "alternative": "glyph for vertical closing white corner bracket"
- }
- },
- "key": "FE44"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "presentation form for vertical left square bracket"
- }
- },
- "key": "FE47"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "presentation form for vertical right square bracket"
- }
- },
- "key": "FE48"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "small left parenthesis",
- "alternative": "small opening parenthesis"
- }
- },
- "key": "FE59"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "small right parenthesis",
- "alternative": "small closing parenthesis"
- }
- },
- "key": "FE5A"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "small left curly bracket",
- "alternative": "small opening curly bracket"
- }
- },
- "key": "FE5B"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "small right curly bracket",
- "alternative": "small closing curly bracket"
- }
- },
- "key": "FE5C"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "small left tortoise shell bracket",
- "alternative": "small opening tortoise shell bracket"
- }
- },
- "key": "FE5D"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "small right tortoise shell bracket",
- "alternative": "small closing tortoise shell bracket"
- }
- },
- "key": "FE5E"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "fullwidth left parenthesis",
- "alternative": "fullwidth opening parenthesis"
- }
- },
- "key": "FF08"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "fullwidth right parenthesis",
- "alternative": "fullwidth closing parenthesis"
- }
- },
- "key": "FF09"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "fullwidth left square bracket",
- "alternative": "fullwidth opening square bracket"
- }
- },
- "key": "FF3B"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "fullwidth right square bracket",
- "alternative": "fullwidth closing square bracket"
- }
- },
- "key": "FF3D"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "fullwidth left curly bracket",
- "alternative": "fullwidth opening curly bracket"
- }
- },
- "key": "FF5B"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "fullwidth right curly bracket",
- "alternative": "fullwidth closing curly bracket"
- }
- },
- "key": "FF5D"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "fullwidth left white parenthesis"
- }
- },
- "key": "FF5F"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "fullwidth right white parenthesis"
- }
- },
- "key": "FF60"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "halfwidth left corner bracket",
- "alternative": "halfwidth opening corner bracket"
- }
- },
- "key": "FF62"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "halfwidth right corner bracket",
- "alternative": "halfwidth closing corner bracket"
- }
- },
- "key": "FF63"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_digits.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_digits.json
deleted file mode 100644
index ac0adccbf69..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_digits.json
+++ /dev/null
@@ -1,2575 +0,0 @@
-[
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit zero",
- "short": "zero"
- }
- },
- "key": "0030"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit one",
- "short": "one"
- }
- },
- "key": "0031"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit two",
- "short": "two"
- }
- },
- "key": "0032"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit three",
- "short": "three"
- }
- },
- "key": "0033"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit four",
- "short": "four"
- }
- },
- "key": "0034"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit five",
- "short": "five"
- }
- },
- "key": "0035"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit six",
- "short": "six"
- }
- },
- "key": "0036"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit seven",
- "short": "seven"
- }
- },
- "key": "0037"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit eight",
- "short": "eight"
- }
- },
- "key": "0038"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "digit nine",
- "short": "nine"
- }
- },
- "key": "0039"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit two",
- "alternative": "superscript two",
- "short": "square"
- }
- },
- "key": "00B2"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit three",
- "alternative": "superscript three",
- "short": "cube"
- }
- },
- "key": "00B3"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit one",
- "alternative": "superscript one",
- "short": "super one"
- }
- },
- "key": "00B9"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one quarter",
- "alternative": "fraction one quarter",
- "short": "one quarter"
- }
- },
- "key": "00BC"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one half",
- "alternative": "fraction one half",
- "short": "one half"
- }
- },
- "key": "00BD"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction three quarters",
- "alternative": "fraction three quarters",
- "short": "three quarters"
- }
- },
- "key": "00BE"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript zero",
- "short": "super zero"
- }
- },
- "key": "2070"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit four",
- "alternative": "superscript four",
- "short": "super four"
- }
- },
- "key": "2074"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit five",
- "alternative": "superscript five",
- "short": "super five"
- }
- },
- "key": "2075"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit six",
- "alternative": "superscript six",
- "short": "super six"
- }
- },
- "key": "2076"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit seven",
- "alternative": "superscript seven",
- "short": "super seven"
- }
- },
- "key": "2077"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit eight",
- "alternative": "superscript eight",
- "short": "super eight"
- }
- },
- "key": "2078"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "superscript digit nine",
- "alternative": "superscript nine",
- "short": "super nine"
- }
- },
- "key": "2079"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit zero",
- "alternative": "subscript zero",
- "short": "sub zero"
- }
- },
- "key": "2080"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit one",
- "alternative": "subscript one",
- "short": "sub one"
- }
- },
- "key": "2081"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit two",
- "alternative": "subscript two",
- "short": "sub two"
- }
- },
- "key": "2082"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit three",
- "alternative": "subscript three",
- "short": "sub three"
- }
- },
- "key": "2083"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit four",
- "alternative": "subscript four",
- "short": "sub four"
- }
- },
- "key": "2084"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit five",
- "alternative": "subscript five",
- "short": "sub five"
- }
- },
- "key": "2085"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit six",
- "alternative": "subscript six",
- "short": "sub six"
- }
- },
- "key": "2086"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit seven",
- "alternative": "subscript seven",
- "short": "sub seven"
- }
- },
- "key": "2087"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit eight",
- "alternative": "subscript eight",
- "short": "sub eight"
- }
- },
- "key": "2088"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "subscript digit nine",
- "alternative": "subscript nine",
- "short": "sub nine"
- }
- },
- "key": "2089"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one seventh",
- "short": "one seventh"
- }
- },
- "key": "2150"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one ninth",
- "short": "one ninth"
- }
- },
- "key": "2151"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one tenth",
- "short": "one tenth"
- }
- },
- "key": "2152"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one third",
- "alternative": "fraction one third",
- "short": "one third"
- }
- },
- "key": "2153"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction two thirds",
- "alternative": "fraction two thirds",
- "short": "two thirds"
- }
- },
- "key": "2154"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one fifth",
- "alternative": "fraction one fifth",
- "short": "one fifth"
- }
- },
- "key": "2155"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction two fifths",
- "alternative": "fraction two fifths",
- "short": "two fifths"
- }
- },
- "key": "2156"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction three fifths",
- "alternative": "fraction three fifths",
- "short": "three fifths"
- }
- },
- "key": "2157"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction four fifths",
- "alternative": "fraction four fifths",
- "short": "four fifths"
- }
- },
- "key": "2158"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one sixth",
- "alternative": "fraction one sixth",
- "short": "one sixth"
- }
- },
- "key": "2159"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction five sixths",
- "alternative": "fraction five sixths",
- "short": "five sixths"
- }
- },
- "key": "215A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction one eighth",
- "alternative": "fraction one eighth",
- "short": "one eighth"
- }
- },
- "key": "215B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction three eighths",
- "alternative": "fraction three eighths",
- "short": "three eighths"
- }
- },
- "key": "215C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction five eighths",
- "alternative": "fraction five eighths",
- "short": "five eighths"
- }
- },
- "key": "215D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction seven eighths",
- "alternative": "fraction seven eighths",
- "short": "seven eighths"
- }
- },
- "key": "215E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "fraction numerator one",
- "short": "numerator one"
- }
- },
- "key": "215F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "vulgar fraction zero thirds",
- "short": "zero thirds"
- }
- },
- "key": "2189"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit one",
- "short": "circled one"
- }
- },
- "key": "2460"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit two",
- "short": "circled two"
- }
- },
- "key": "2461"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit three",
- "short": "circled three"
- }
- },
- "key": "2462"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit four",
- "short": "circled four"
- }
- },
- "key": "2463"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit five",
- "short": "circled five"
- }
- },
- "key": "2464"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit six",
- "short": "circled six"
- }
- },
- "key": "2465"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit seven",
- "short": "circled seven"
- }
- },
- "key": "2466"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit eight",
- "short": "circled eight"
- }
- },
- "key": "2467"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit nine",
- "short": "circled nine"
- }
- },
- "key": "2468"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number ten",
- "short": "circled ten"
- }
- },
- "key": "2469"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number eleven",
- "short": "circled eleven"
- }
- },
- "key": "246A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twelve",
- "short": "circled twelve"
- }
- },
- "key": "246B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirteen",
- "short": "circled thirteen"
- }
- },
- "key": "246C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number fourteen",
- "short": "circled fourteen"
- }
- },
- "key": "246D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number fifteen",
- "short": "circled fifteen"
- }
- },
- "key": "246E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number sixteen",
- "short": "circled sixteen"
- }
- },
- "key": "246F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number seventeen",
- "short": "circled seventeen"
- }
- },
- "key": "2470"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number eighteen",
- "short": "circled eighteen"
- }
- },
- "key": "2471"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number nineteen",
- "short": "circled nineteen"
- }
- },
- "key": "2472"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty",
- "short": "circled twenty"
- }
- },
- "key": "2473"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit one",
- "short": "parenthesized one"
- }
- },
- "key": "2474"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit two",
- "short": "parenthesized two"
- }
- },
- "key": "2475"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit three",
- "short": "parenthesized three"
- }
- },
- "key": "2476"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit four",
- "short": "parenthesized four"
- }
- },
- "key": "2477"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit five",
- "short": "parenthesized five"
- }
- },
- "key": "2478"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit six",
- "short": "parenthesized six"
- }
- },
- "key": "2479"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit seven",
- "short": "parenthesized seven"
- }
- },
- "key": "247A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit eight",
- "short": "parenthesized eight"
- }
- },
- "key": "247B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized digit nine",
- "short": "parenthesized nine"
- }
- },
- "key": "247C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number ten",
- "short": "parenthesized ten"
- }
- },
- "key": "247D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number eleven",
- "short": "parenthesized eleven"
- }
- },
- "key": "247E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number twelve",
- "short": "parenthesized twelve"
- }
- },
- "key": "247F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number thirteen",
- "short": "parenthesized thirteen"
- }
- },
- "key": "2480"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number fourteen",
- "short": "parenthesized fourteen"
- }
- },
- "key": "2481"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number fifteen",
- "short": "parenthesized fifteen"
- }
- },
- "key": "2482"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number sixteen",
- "short": "parenthesized sixteen"
- }
- },
- "key": "2483"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number seventeen",
- "short": "parenthesized seventeen"
- }
- },
- "key": "2484"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number eighteen",
- "short": "parenthesized eighteen"
- }
- },
- "key": "2485"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number nineteen",
- "short": "parenthesized nineteen"
- }
- },
- "key": "2486"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "parenthesized number twenty",
- "short": "parenthesized twenty"
- }
- },
- "key": "2487"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit one full stop",
- "alternative": "digit one period",
- "short": "one period"
- }
- },
- "key": "2488"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit two full stop",
- "alternative": "digit two period",
- "short": "two period"
- }
- },
- "key": "2489"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit three full stop",
- "alternative": "digit three period",
- "short": "three period"
- }
- },
- "key": "248A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit four full stop",
- "alternative": "digit four period",
- "short": "four period"
- }
- },
- "key": "248B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit five full stop",
- "alternative": "digit five period",
- "short": "five period"
- }
- },
- "key": "248C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit six full stop",
- "alternative": "digit six period",
- "short": "six period"
- }
- },
- "key": "248D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit seven full stop",
- "alternative": "digit seven period",
- "short": "seven period"
- }
- },
- "key": "248E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit eight full stop",
- "alternative": "digit eight period",
- "short": "eight period"
- }
- },
- "key": "248F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit nine full stop",
- "alternative": "digit nine period",
- "short": "nine period"
- }
- },
- "key": "2490"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number ten full stop",
- "alternative": "number ten period",
- "short": "ten period"
- }
- },
- "key": "2491"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number eleven full stop",
- "alternative": "number eleven period",
- "short": "eleven period"
- }
- },
- "key": "2492"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number twelve full stop",
- "alternative": "number twelve period",
- "short": "twelve period"
- }
- },
- "key": "2493"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number thirteen full stop",
- "alternative": "number thirteen period",
- "short": "thirteen period"
- }
- },
- "key": "2494"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number fourteen full stop",
- "alternative": "number fourteen period",
- "short": "fourteen period"
- }
- },
- "key": "2495"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number fifteen full stop",
- "alternative": "number fifteen period",
- "short": "fifteen period"
- }
- },
- "key": "2496"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number sixteen full stop",
- "alternative": "number sixteen period",
- "short": "sixteen period"
- }
- },
- "key": "2497"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number seventeen full stop",
- "alternative": "number seventeen period",
- "short": "seventeen period"
- }
- },
- "key": "2498"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number eighteen full stop",
- "alternative": "number eighteen period",
- "short": "eighteen period"
- }
- },
- "key": "2499"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number nineteen full stop",
- "alternative": "number nineteen period",
- "short": "nineteen period"
- }
- },
- "key": "249A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "number twenty full stop",
- "alternative": "number twenty period",
- "short": "twenty period"
- }
- },
- "key": "249B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled digit zero",
- "short": "circled zero"
- }
- },
- "key": "24EA"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number eleven",
- "short": "negative circled eleven"
- }
- },
- "key": "24EB"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number twelve",
- "short": "negative circled twelve"
- }
- },
- "key": "24EC"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number thirteen",
- "short": "negative circled thirteen"
- }
- },
- "key": "24ED"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number fourteen",
- "short": "negative circled fourteen"
- }
- },
- "key": "24EE"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number fifteen",
- "short": "negative circled fifteen"
- }
- },
- "key": "24EF"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number sixteen",
- "short": "negative circled sixteen"
- }
- },
- "key": "24F0"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number seventeen",
- "short": "negative circled seventeen"
- }
- },
- "key": "24F1"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number eighteen",
- "short": "negative circled eighteen"
- }
- },
- "key": "24F2"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number nineteen",
- "short": "negative circled nineteen"
- }
- },
- "key": "24F3"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled number twenty",
- "short": "negative circled twenty"
- }
- },
- "key": "24F4"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit one",
- "short": "double circled one"
- }
- },
- "key": "24F5"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit two",
- "short": "double circled two"
- }
- },
- "key": "24F6"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit three",
- "short": "double circled three"
- }
- },
- "key": "24F7"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit four",
- "short": "double circled four"
- }
- },
- "key": "24F8"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit five",
- "short": "double circled five"
- }
- },
- "key": "24F9"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit six",
- "short": "double circled six"
- }
- },
- "key": "24FA"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit seven",
- "short": "double circled seven"
- }
- },
- "key": "24FB"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit eight",
- "short": "double circled eight"
- }
- },
- "key": "24FC"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled digit nine",
- "short": "double circled nine"
- }
- },
- "key": "24FD"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "double circled number ten",
- "short": "double circled ten"
- }
- },
- "key": "24FE"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "negative circled digit zero",
- "short": "negative circled zero"
- }
- },
- "key": "24FF"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit one",
- "alternative": "inverse circled digit one",
- "short": "inverse circled one"
- }
- },
- "key": "2776"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit two",
- "alternative": "inverse circled digit two",
- "short": "inverse circled two"
- }
- },
- "key": "2777"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit three",
- "alternative": "inverse circled digit three",
- "short": "inverse circled three"
- }
- },
- "key": "2778"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit four",
- "alternative": "inverse circled digit four",
- "short": "inverse circled four"
- }
- },
- "key": "2779"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit five",
- "alternative": "inverse circled digit five",
- "short": "inverse circled five"
- }
- },
- "key": "277A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit six",
- "alternative": "inverse circled digit six",
- "short": "inverse circled six"
- }
- },
- "key": "277B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit seven",
- "alternative": "inverse circled digit seven",
- "short": "inverse circled seven"
- }
- },
- "key": "277C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit eight",
- "alternative": "inverse circled digit eight",
- "short": "inverse circled eight"
- }
- },
- "key": "277D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled digit nine",
- "alternative": "inverse circled digit nine",
- "short": "inverse circled nine"
- }
- },
- "key": "277E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled number ten",
- "alternative": "inverse circled number ten",
- "short": "inverse circled ten"
- }
- },
- "key": "277F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit one",
- "alternative": "circled sans serif digit one",
- "short": "circled one"
- }
- },
- "key": "2780"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit two",
- "alternative": "circled sans serif digit two",
- "short": "circled two"
- }
- },
- "key": "2781"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit three",
- "alternative": "circled sans serif digit three",
- "short": "circled three"
- }
- },
- "key": "2782"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit four",
- "alternative": "circled sans serif digit four",
- "short": "circled four"
- }
- },
- "key": "2783"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit five",
- "alternative": "circled sans serif digit five",
- "short": "circled five"
- }
- },
- "key": "2784"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit six",
- "alternative": "circled sans serif digit six",
- "short": "circled six"
- }
- },
- "key": "2785"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit seven",
- "alternative": "circled sans serif digit seven",
- "short": "circled seven"
- }
- },
- "key": "2786"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit eight",
- "alternative": "circled sans serif digit eight",
- "short": "circled eight"
- }
- },
- "key": "2787"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif digit nine",
- "alternative": "circled sans serif digit nine",
- "short": "circled nine"
- }
- },
- "key": "2788"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat circled sans serif number ten",
- "alternative": "circled sans serif number ten",
- "short": "circled ten"
- }
- },
- "key": "2789"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit one",
- "alternative": "inverse circled sans serif digit one",
- "short": "inverse circled one"
- }
- },
- "key": "278A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit two",
- "alternative": "inverse circled sans serif digit two",
- "short": "inverse circled two"
- }
- },
- "key": "278B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit three",
- "alternative": "inverse circled sans serif digit three",
- "short": "inverse circled three"
- }
- },
- "key": "278C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit four",
- "alternative": "inverse circled sans serif digit four",
- "short": "inverse circled four"
- }
- },
- "key": "278D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit five",
- "alternative": "inverse circled sans serif digit five",
- "short": "inverse circled five"
- }
- },
- "key": "278E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit six",
- "alternative": "inverse circled sans serif digit six",
- "short": "inverse circled six"
- }
- },
- "key": "278F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit seven",
- "alternative": "inverse circled sans serif digit seven",
- "short": "inverse circled seven"
- }
- },
- "key": "2790"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit eight",
- "alternative": "inverse circled sans serif digit eight",
- "short": "inverse circled eight"
- }
- },
- "key": "2791"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif digit nine",
- "alternative": "inverse circled sans serif digit nine",
- "short": "inverse circled nine"
- }
- },
- "key": "2792"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "dingbat negative circled sans serif number ten",
- "alternative": "inverse circled sans serif number ten",
- "short": "inverse circled ten"
- }
- },
- "key": "2793"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number ten on black square",
- "short": "circled ten on black square"
- }
- },
- "key": "3248"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty on black square",
- "short": "circled twenty on black square"
- }
- },
- "key": "3249"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty on black square",
- "short": "circled thirty on black square"
- }
- },
- "key": "324A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty on black square",
- "short": "circled forty on black square"
- }
- },
- "key": "324B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number fifty on black square",
- "short": "circled fifty on black square"
- }
- },
- "key": "324C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number sixty on black square",
- "short": "circled sixty on black square"
- }
- },
- "key": "324D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number seventy on black square",
- "short": "circled seventy on black square"
- }
- },
- "key": "324E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number eighty on black square",
- "short": "circled eighty on black square"
- }
- },
- "key": "324F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty one",
- "short": "circled twenty one"
- }
- },
- "key": "3251"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty two",
- "short": "circled twenty two"
- }
- },
- "key": "3252"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty three",
- "short": "circled twenty three"
- }
- },
- "key": "3253"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty four",
- "short": "circled twenty four"
- }
- },
- "key": "3254"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty five",
- "short": "circled twenty five"
- }
- },
- "key": "3255"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty six",
- "short": "circled twenty six"
- }
- },
- "key": "3256"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty seven",
- "short": "circled twenty seven"
- }
- },
- "key": "3257"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty eight",
- "short": "circled twenty eight"
- }
- },
- "key": "3258"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number twenty nine",
- "short": "circled twenty nine"
- }
- },
- "key": "3259"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty",
- "short": "circled thirty"
- }
- },
- "key": "325A"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty one",
- "short": "circled thirty one"
- }
- },
- "key": "325B"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty two",
- "short": "circled thirty two"
- }
- },
- "key": "325C"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty three",
- "short": "circled thirty three"
- }
- },
- "key": "325D"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty four",
- "short": "circled thirty four"
- }
- },
- "key": "325E"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty five",
- "short": "circled thirty five"
- }
- },
- "key": "325F"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty six",
- "short": "circled thirty six"
- }
- },
- "key": "32B1"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty seven",
- "short": "circled thirty seven"
- }
- },
- "key": "32B2"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty eight",
- "short": "circled thirty eight"
- }
- },
- "key": "32B3"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number thirty nine",
- "short": "circled thirty nine"
- }
- },
- "key": "32B4"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty",
- "short": "circled forty"
- }
- },
- "key": "32B5"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty one",
- "short": "circled forty one"
- }
- },
- "key": "32B6"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty two",
- "short": "circled forty two"
- }
- },
- "key": "32B7"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty three",
- "short": "circled forty three"
- }
- },
- "key": "32B8"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty four",
- "short": "circled forty four"
- }
- },
- "key": "32B9"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty five",
- "short": "circled forty five"
- }
- },
- "key": "32BA"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty six",
- "short": "circled forty six"
- }
- },
- "key": "32BB"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty seven",
- "short": "circled forty seven"
- }
- },
- "key": "32BC"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty eight",
- "short": "circled forty eight"
- }
- },
- "key": "32BD"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number forty nine",
- "short": "circled forty nine"
- }
- },
- "key": "32BE"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "circled number fifty",
- "short": "circled fifty"
- }
- },
- "key": "32BF"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit zero",
- "short": "zero"
- }
- },
- "key": "FF10"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit one",
- "short": "one"
- }
- },
- "key": "FF11"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit two",
- "short": "two"
- }
- },
- "key": "FF12"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit three",
- "short": "three"
- }
- },
- "key": "FF13"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit four",
- "short": "four"
- }
- },
- "key": "FF14"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit five",
- "short": "five"
- }
- },
- "key": "FF15"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit six",
- "short": "six"
- }
- },
- "key": "FF16"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit seven",
- "short": "seven"
- }
- },
- "key": "FF17"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit eight",
- "short": "eight"
- }
- },
- "key": "FF18"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "fullwidth digit nine",
- "short": "nine"
- }
- },
- "key": "FF19"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit zero",
- "alternative": "bold digit zero",
- "short": "bold zero"
- }
- },
- "key": "1D7CE"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit one",
- "alternative": "bold digit one",
- "short": "bold one"
- }
- },
- "key": "1D7CF"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit two",
- "alternative": "bold digit two",
- "short": "bold two"
- }
- },
- "key": "1D7D0"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit three",
- "alternative": "bold digit three",
- "short": "bold three"
- }
- },
- "key": "1D7D1"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit four",
- "alternative": "bold digit four",
- "short": "bold four"
- }
- },
- "key": "1D7D2"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit five",
- "alternative": "bold digit five",
- "short": "bold five"
- }
- },
- "key": "1D7D3"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit six",
- "alternative": "bold digit six",
- "short": "bold six"
- }
- },
- "key": "1D7D4"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit seven",
- "alternative": "bold digit seven",
- "short": "bold seven"
- }
- },
- "key": "1D7D5"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit eight",
- "alternative": "bold digit eight",
- "short": "bold eight"
- }
- },
- "key": "1D7D6"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical bold digit nine",
- "alternative": "bold digit nine",
- "short": "bold nine"
- }
- },
- "key": "1D7D7"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit zero",
- "alternative": "double struck zero",
- "short": "blackboard zero"
- }
- },
- "key": "1D7D8"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit one",
- "alternative": "double struck one",
- "short": "blackboard one"
- }
- },
- "key": "1D7D9"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit two",
- "alternative": "double struck two",
- "short": "blackboard two"
- }
- },
- "key": "1D7DA"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit three",
- "alternative": "double struck three",
- "short": "blackboard three"
- }
- },
- "key": "1D7DB"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit four",
- "alternative": "double struck four",
- "short": "blackboard four"
- }
- },
- "key": "1D7DC"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit five",
- "alternative": "double struck five",
- "short": "blackboard five"
- }
- },
- "key": "1D7DD"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit six",
- "alternative": "double struck six",
- "short": "blackboard six"
- }
- },
- "key": "1D7DE"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit seven",
- "alternative": "double struck seven",
- "short": "blackboard seven"
- }
- },
- "key": "1D7DF"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit eight",
- "alternative": "double struck eight",
- "short": "blackboard eight"
- }
- },
- "key": "1D7E0"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical double struck digit nine",
- "alternative": "double struck nine",
- "short": "blackboard nine"
- }
- },
- "key": "1D7E1"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit zero",
- "alternative": "sans serif digit zero",
- "short": "sans serif zero"
- }
- },
- "key": "1D7E2"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit one",
- "alternative": "sans serif digit one",
- "short": "sans serif one"
- }
- },
- "key": "1D7E3"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit two",
- "alternative": "sans serif digit two",
- "short": "sans serif two"
- }
- },
- "key": "1D7E4"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit three",
- "alternative": "sans serif digit three",
- "short": "sans serif three"
- }
- },
- "key": "1D7E5"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit four",
- "alternative": "sans serif digit four",
- "short": "sans serif four"
- }
- },
- "key": "1D7E6"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit five",
- "alternative": "sans serif digit five",
- "short": "sans serif five"
- }
- },
- "key": "1D7E7"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit six",
- "alternative": "sans serif digit six",
- "short": "sans serif six"
- }
- },
- "key": "1D7E8"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit seven",
- "alternative": "sans serif digit seven",
- "short": "sans serif seven"
- }
- },
- "key": "1D7E9"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit eight",
- "alternative": "sans serif digit eight",
- "short": "sans serif eight"
- }
- },
- "key": "1D7EA"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif digit nine",
- "alternative": "sans serif digit nine",
- "short": "sans serif nine"
- }
- },
- "key": "1D7EB"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit zero",
- "alternative": "sans serif bold digit zero",
- "short": "sans serif bold zero"
- }
- },
- "key": "1D7EC"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit one",
- "alternative": "sans serif bold digit one",
- "short": "sans serif bold one"
- }
- },
- "key": "1D7ED"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit two",
- "alternative": "sans serif bold digit two",
- "short": "sans serif bold two"
- }
- },
- "key": "1D7EE"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit three",
- "alternative": "sans serif bold digit three",
- "short": "sans serif bold three"
- }
- },
- "key": "1D7EF"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit four",
- "alternative": "sans serif bold digit four",
- "short": "sans serif bold four"
- }
- },
- "key": "1D7F0"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit five",
- "alternative": "sans serif bold digit five",
- "short": "sans serif bold five"
- }
- },
- "key": "1D7F1"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit six",
- "alternative": "sans serif bold digit six",
- "short": "sans serif bold six"
- }
- },
- "key": "1D7F2"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit seven",
- "alternative": "sans serif bold digit seven",
- "short": "sans serif bold seven"
- }
- },
- "key": "1D7F3"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit eight",
- "alternative": "sans serif bold digit eight",
- "short": "sans serif bold eight"
- }
- },
- "key": "1D7F4"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical sans serif bold digit nine",
- "alternative": "sans serif bold digit nine",
- "short": "sans serif bold nine"
- }
- },
- "key": "1D7F5"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit zero",
- "alternative": "monospace zero",
- "short": "thin zero"
- }
- },
- "key": "1D7F6"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit one",
- "alternative": "monospace one",
- "short": "thin one"
- }
- },
- "key": "1D7F7"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit two",
- "alternative": "monospace two",
- "short": "thin two"
- }
- },
- "key": "1D7F8"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit three",
- "alternative": "monospace three",
- "short": "thin three"
- }
- },
- "key": "1D7F9"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit four",
- "alternative": "monospace four",
- "short": "thin four"
- }
- },
- "key": "1D7FA"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit five",
- "alternative": "monospace five",
- "short": "thin five"
- }
- },
- "key": "1D7FB"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit six",
- "alternative": "monospace six",
- "short": "thin six"
- }
- },
- "key": "1D7FC"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit seven",
- "alternative": "monospace seven",
- "short": "thin seven"
- }
- },
- "key": "1D7FD"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit eight",
- "alternative": "monospace eight",
- "short": "thin eight"
- }
- },
- "key": "1D7FE"
-},
-{"category": "Nd",
- "mappings": {
- "default": {
- "default": "mathematical monospace digit nine",
- "alternative": "monospace nine",
- "short": "thin nine"
- }
- },
- "key": "1D7FF"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit zero full stop",
- "short": "zero full stop"
- }
- },
- "key": "1F100"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit zero comma",
- "short": "zero comma"
- }
- },
- "key": "1F101"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit one comma",
- "short": "one comma"
- }
- },
- "key": "1F102"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit two comma",
- "short": "two comma"
- }
- },
- "key": "1F103"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit three comma",
- "short": "three comma"
- }
- },
- "key": "1F104"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit four comma",
- "short": "four comma"
- }
- },
- "key": "1F105"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit five comma",
- "short": "five comma"
- }
- },
- "key": "1F106"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit six comma",
- "short": "six comma"
- }
- },
- "key": "1F107"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit seven comma",
- "short": "seven comma"
- }
- },
- "key": "1F108"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit eight comma",
- "short": "eight comma"
- }
- },
- "key": "1F109"
-},
-{"category": "No",
- "mappings": {
- "default": {
- "default": "digit nine comma",
- "short": "nine comma"
- }
- },
- "key": "1F10A"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_geometry.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_geometry.json
deleted file mode 100644
index d2e158cea15..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_geometry.json
+++ /dev/null
@@ -1,2523 +0,0 @@
-[
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light horizontal",
- "alternative": "forms light horizontal"
- }
- },
- "key": "2500"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy horizontal",
- "alternative": "forms heavy horizontal"
- }
- },
- "key": "2501"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light vertical",
- "alternative": "forms light vertical"
- }
- },
- "key": "2502"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy vertical",
- "alternative": "forms heavy vertical"
- }
- },
- "key": "2503"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light triple dash horizontal",
- "alternative": "forms light triple dash horizontal"
- }
- },
- "key": "2504"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy triple dash horizontal",
- "alternative": "forms heavy triple dash horizontal"
- }
- },
- "key": "2505"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light triple dash vertical",
- "alternative": "forms light triple dash vertical"
- }
- },
- "key": "2506"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy triple dash vertical",
- "alternative": "forms heavy triple dash vertical"
- }
- },
- "key": "2507"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light quadruple dash horizontal",
- "alternative": "forms light quadruple dash horizontal"
- }
- },
- "key": "2508"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy quadruple dash horizontal",
- "alternative": "forms heavy quadruple dash horizontal"
- }
- },
- "key": "2509"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light quadruple dash vertical",
- "alternative": "forms light quadruple dash vertical"
- }
- },
- "key": "250A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy quadruple dash vertical",
- "alternative": "forms heavy quadruple dash vertical"
- }
- },
- "key": "250B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light down and right",
- "alternative": "forms light down and right"
- }
- },
- "key": "250C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down light and right heavy",
- "alternative": "forms down light and right heavy"
- }
- },
- "key": "250D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down heavy and right light",
- "alternative": "forms down heavy and right light"
- }
- },
- "key": "250E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy down and right",
- "alternative": "forms heavy down and right"
- }
- },
- "key": "250F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light down and left",
- "alternative": "forms light down and left"
- }
- },
- "key": "2510"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down light and left heavy",
- "alternative": "forms down light and left heavy"
- }
- },
- "key": "2511"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down heavy and left light",
- "alternative": "forms down heavy and left light"
- }
- },
- "key": "2512"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy down and left",
- "alternative": "forms heavy down and left"
- }
- },
- "key": "2513"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light up and right",
- "alternative": "forms light up and right"
- }
- },
- "key": "2514"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up light and right heavy",
- "alternative": "forms up light and right heavy"
- }
- },
- "key": "2515"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up heavy and right light",
- "alternative": "forms up heavy and right light"
- }
- },
- "key": "2516"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy up and right",
- "alternative": "forms heavy up and right"
- }
- },
- "key": "2517"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light up and left",
- "alternative": "forms light up and left"
- }
- },
- "key": "2518"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up light and left heavy",
- "alternative": "forms up light and left heavy"
- }
- },
- "key": "2519"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up heavy and left light",
- "alternative": "forms up heavy and left light"
- }
- },
- "key": "251A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy up and left",
- "alternative": "forms heavy up and left"
- }
- },
- "key": "251B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light vertical and right",
- "alternative": "forms light vertical and right"
- }
- },
- "key": "251C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical light and right heavy",
- "alternative": "forms vertical light and right heavy"
- }
- },
- "key": "251D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up heavy and right down light",
- "alternative": "forms up heavy and right down light"
- }
- },
- "key": "251E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down heavy and right up light",
- "alternative": "forms down heavy and right up light"
- }
- },
- "key": "251F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical heavy and right light",
- "alternative": "forms vertical heavy and right light"
- }
- },
- "key": "2520"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down light and right up heavy",
- "alternative": "forms down light and right up heavy"
- }
- },
- "key": "2521"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up light and right down heavy",
- "alternative": "forms up light and right down heavy"
- }
- },
- "key": "2522"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy vertical and right",
- "alternative": "forms heavy vertical and right"
- }
- },
- "key": "2523"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light vertical and left",
- "alternative": "forms light vertical and left"
- }
- },
- "key": "2524"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical light and left heavy",
- "alternative": "forms vertical light and left heavy"
- }
- },
- "key": "2525"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up heavy and left down light",
- "alternative": "forms up heavy and left down light"
- }
- },
- "key": "2526"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down heavy and left up light",
- "alternative": "forms down heavy and left up light"
- }
- },
- "key": "2527"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical heavy and left light",
- "alternative": "forms vertical heavy and left light"
- }
- },
- "key": "2528"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down light and left up heavy",
- "alternative": "forms down light and left up heavy"
- }
- },
- "key": "2529"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up light and left down heavy",
- "alternative": "forms up light and left down heavy"
- }
- },
- "key": "252A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy vertical and left",
- "alternative": "forms heavy vertical and left"
- }
- },
- "key": "252B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light down and horizontal",
- "alternative": "forms light down and horizontal"
- }
- },
- "key": "252C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left heavy and right down light",
- "alternative": "forms left heavy and right down light"
- }
- },
- "key": "252D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right heavy and left down light",
- "alternative": "forms right heavy and left down light"
- }
- },
- "key": "252E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down light and horizontal heavy",
- "alternative": "forms down light and horizontal heavy"
- }
- },
- "key": "252F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down heavy and horizontal light",
- "alternative": "forms down heavy and horizontal light"
- }
- },
- "key": "2530"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right light and left down heavy",
- "alternative": "forms right light and left down heavy"
- }
- },
- "key": "2531"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left light and right down heavy",
- "alternative": "forms left light and right down heavy"
- }
- },
- "key": "2532"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy down and horizontal",
- "alternative": "forms heavy down and horizontal"
- }
- },
- "key": "2533"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light up and horizontal",
- "alternative": "forms light up and horizontal"
- }
- },
- "key": "2534"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left heavy and right up light",
- "alternative": "forms left heavy and right up light"
- }
- },
- "key": "2535"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right heavy and left up light",
- "alternative": "forms right heavy and left up light"
- }
- },
- "key": "2536"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up light and horizontal heavy",
- "alternative": "forms up light and horizontal heavy"
- }
- },
- "key": "2537"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up heavy and horizontal light",
- "alternative": "forms up heavy and horizontal light"
- }
- },
- "key": "2538"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right light and left up heavy",
- "alternative": "forms right light and left up heavy"
- }
- },
- "key": "2539"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left light and right up heavy",
- "alternative": "forms left light and right up heavy"
- }
- },
- "key": "253A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy up and horizontal",
- "alternative": "forms heavy up and horizontal"
- }
- },
- "key": "253B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light vertical and horizontal",
- "alternative": "forms light vertical and horizontal"
- }
- },
- "key": "253C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left heavy and right vertical light",
- "alternative": "forms left heavy and right vertical light"
- }
- },
- "key": "253D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right heavy and left vertical light",
- "alternative": "forms right heavy and left vertical light"
- }
- },
- "key": "253E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical light and horizontal heavy",
- "alternative": "forms vertical light and horizontal heavy"
- }
- },
- "key": "253F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up heavy and down horizontal light",
- "alternative": "forms up heavy and down horizontal light"
- }
- },
- "key": "2540"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down heavy and up horizontal light",
- "alternative": "forms down heavy and up horizontal light"
- }
- },
- "key": "2541"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical heavy and horizontal light",
- "alternative": "forms vertical heavy and horizontal light"
- }
- },
- "key": "2542"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left up heavy and right down light",
- "alternative": "forms left up heavy and right down light"
- }
- },
- "key": "2543"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right up heavy and left down light",
- "alternative": "forms right up heavy and left down light"
- }
- },
- "key": "2544"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left down heavy and right up light",
- "alternative": "forms left down heavy and right up light"
- }
- },
- "key": "2545"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right down heavy and left up light",
- "alternative": "forms right down heavy and left up light"
- }
- },
- "key": "2546"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down light and up horizontal heavy",
- "alternative": "forms down light and up horizontal heavy"
- }
- },
- "key": "2547"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up light and down horizontal heavy",
- "alternative": "forms up light and down horizontal heavy"
- }
- },
- "key": "2548"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings right light and left vertical heavy",
- "alternative": "forms right light and left vertical heavy"
- }
- },
- "key": "2549"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings left light and right vertical heavy",
- "alternative": "forms left light and right vertical heavy"
- }
- },
- "key": "254A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy vertical and horizontal",
- "alternative": "forms heavy vertical and horizontal"
- }
- },
- "key": "254B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light double dash horizontal",
- "alternative": "forms light double dash horizontal"
- }
- },
- "key": "254C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy double dash horizontal",
- "alternative": "forms heavy double dash horizontal"
- }
- },
- "key": "254D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light double dash vertical",
- "alternative": "forms light double dash vertical"
- }
- },
- "key": "254E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy double dash vertical",
- "alternative": "forms heavy double dash vertical"
- }
- },
- "key": "254F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double horizontal",
- "alternative": "forms double horizontal"
- }
- },
- "key": "2550"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double vertical",
- "alternative": "forms double vertical"
- }
- },
- "key": "2551"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down single and right double",
- "alternative": "forms down single and right double"
- }
- },
- "key": "2552"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down double and right single",
- "alternative": "forms down double and right single"
- }
- },
- "key": "2553"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double down and right",
- "alternative": "forms double down and right"
- }
- },
- "key": "2554"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down single and left double",
- "alternative": "forms down single and left double"
- }
- },
- "key": "2555"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down double and left single",
- "alternative": "forms down double and left single"
- }
- },
- "key": "2556"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double down and left",
- "alternative": "forms double down and left"
- }
- },
- "key": "2557"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up single and right double",
- "alternative": "forms up single and right double"
- }
- },
- "key": "2558"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up double and right single",
- "alternative": "forms up double and right single"
- }
- },
- "key": "2559"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double up and right",
- "alternative": "forms double up and right"
- }
- },
- "key": "255A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up single and left double",
- "alternative": "forms up single and left double"
- }
- },
- "key": "255B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up double and left single",
- "alternative": "forms up double and left single"
- }
- },
- "key": "255C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double up and left",
- "alternative": "forms double up and left"
- }
- },
- "key": "255D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical single and right double",
- "alternative": "forms vertical single and right double"
- }
- },
- "key": "255E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical double and right single",
- "alternative": "forms vertical double and right single"
- }
- },
- "key": "255F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double vertical and right",
- "alternative": "forms double vertical and right"
- }
- },
- "key": "2560"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical single and left double",
- "alternative": "forms vertical single and left double"
- }
- },
- "key": "2561"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical double and left single",
- "alternative": "forms vertical double and left single"
- }
- },
- "key": "2562"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double vertical and left",
- "alternative": "forms double vertical and left"
- }
- },
- "key": "2563"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down single and horizontal double",
- "alternative": "forms down single and horizontal double"
- }
- },
- "key": "2564"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings down double and horizontal single",
- "alternative": "forms down double and horizontal single"
- }
- },
- "key": "2565"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double down and horizontal",
- "alternative": "forms double down and horizontal"
- }
- },
- "key": "2566"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up single and horizontal double",
- "alternative": "forms up single and horizontal double"
- }
- },
- "key": "2567"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings up double and horizontal single",
- "alternative": "forms up double and horizontal single"
- }
- },
- "key": "2568"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double up and horizontal",
- "alternative": "forms double up and horizontal"
- }
- },
- "key": "2569"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical single and horizontal double",
- "alternative": "forms vertical single and horizontal double"
- }
- },
- "key": "256A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings vertical double and horizontal single",
- "alternative": "forms vertical double and horizontal single"
- }
- },
- "key": "256B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings double vertical and horizontal",
- "alternative": "forms double vertical and horizontal"
- }
- },
- "key": "256C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light arc down and right",
- "alternative": "forms light arc down and right"
- }
- },
- "key": "256D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light arc down and left",
- "alternative": "forms light arc down and left"
- }
- },
- "key": "256E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light arc up and left",
- "alternative": "forms light arc up and left"
- }
- },
- "key": "256F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light arc up and right",
- "alternative": "forms light arc up and right"
- }
- },
- "key": "2570"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light diagonal upper right to lower left",
- "alternative": "forms light diagonal upper right to lower left"
- }
- },
- "key": "2571"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light diagonal upper left to lower right",
- "alternative": "forms light diagonal upper left to lower right"
- }
- },
- "key": "2572"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light diagonal cross",
- "alternative": "forms light diagonal cross"
- }
- },
- "key": "2573"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light left",
- "alternative": "forms light left"
- }
- },
- "key": "2574"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light up",
- "alternative": "forms light up"
- }
- },
- "key": "2575"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light right",
- "alternative": "forms light right"
- }
- },
- "key": "2576"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light down",
- "alternative": "forms light down"
- }
- },
- "key": "2577"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy left",
- "alternative": "forms heavy left"
- }
- },
- "key": "2578"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy up",
- "alternative": "forms heavy up"
- }
- },
- "key": "2579"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy right",
- "alternative": "forms heavy right"
- }
- },
- "key": "257A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy down",
- "alternative": "forms heavy down"
- }
- },
- "key": "257B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light left and heavy right",
- "alternative": "forms light left and heavy right"
- }
- },
- "key": "257C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings light up and heavy down",
- "alternative": "forms light up and heavy down"
- }
- },
- "key": "257D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy left and light right",
- "alternative": "forms heavy left and light right"
- }
- },
- "key": "257E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "box drawings heavy up and light down",
- "alternative": "forms heavy up and light down"
- }
- },
- "key": "257F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upper half block"
- }
- },
- "key": "2580"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower one eighth block"
- }
- },
- "key": "2581"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower one quarter block"
- }
- },
- "key": "2582"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower three eighths block"
- }
- },
- "key": "2583"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower half block"
- }
- },
- "key": "2584"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower five eighths block"
- }
- },
- "key": "2585"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower three quarters block",
- "alternative": "lower three quarter block"
- }
- },
- "key": "2586"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower seven eighths block"
- }
- },
- "key": "2587"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "full block"
- }
- },
- "key": "2588"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left seven eighths block"
- }
- },
- "key": "2589"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left three quarters block",
- "alternative": "left three quarter block"
- }
- },
- "key": "258A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left five eighths block"
- }
- },
- "key": "258B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left half block"
- }
- },
- "key": "258C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left three eighths block"
- }
- },
- "key": "258D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left one quarter block"
- }
- },
- "key": "258E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left one eighth block"
- }
- },
- "key": "258F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "right half block"
- }
- },
- "key": "2590"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "light shade"
- }
- },
- "key": "2591"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "medium shade"
- }
- },
- "key": "2592"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "dark shade"
- }
- },
- "key": "2593"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upper one eighth block"
- }
- },
- "key": "2594"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "right one eighth block"
- }
- },
- "key": "2595"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant lower left"
- }
- },
- "key": "2596"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant lower right"
- }
- },
- "key": "2597"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper left"
- }
- },
- "key": "2598"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper left and lower left and lower right"
- }
- },
- "key": "2599"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper left and lower right"
- }
- },
- "key": "259A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper left and upper right and lower left"
- }
- },
- "key": "259B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper left and upper right and lower right"
- }
- },
- "key": "259C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper right"
- }
- },
- "key": "259D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper right and lower left"
- }
- },
- "key": "259E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "quadrant upper right and lower left and lower right"
- }
- },
- "key": "259F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black square"
- }
- },
- "key": "25A0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square"
- }
- },
- "key": "25A1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square with rounded corners"
- }
- },
- "key": "25A2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square containing black small square"
- }
- },
- "key": "25A3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with horizontal fill"
- }
- },
- "key": "25A4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with vertical fill"
- }
- },
- "key": "25A5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with orthogonal crosshatch fill"
- }
- },
- "key": "25A6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with upper left to lower right fill"
- }
- },
- "key": "25A7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with upper right to lower left fill"
- }
- },
- "key": "25A8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with diagonal crosshatch fill"
- }
- },
- "key": "25A9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black small square"
- }
- },
- "key": "25AA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white small square"
- }
- },
- "key": "25AB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black rectangle"
- }
- },
- "key": "25AC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white rectangle"
- }
- },
- "key": "25AD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black vertical rectangle"
- }
- },
- "key": "25AE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white vertical rectangle"
- }
- },
- "key": "25AF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black parallelogram"
- }
- },
- "key": "25B0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white parallelogram"
- }
- },
- "key": "25B1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black up pointing triangle",
- "alternative": "black up pointing triangle"
- }
- },
- "key": "25B2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white up pointing triangle",
- "alternative": "white up pointing triangle"
- }
- },
- "key": "25B3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black up pointing small triangle",
- "alternative": "black up pointing small triangle"
- }
- },
- "key": "25B4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white up pointing small triangle",
- "alternative": "white up pointing small triangle"
- }
- },
- "key": "25B5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black right pointing triangle",
- "alternative": "black right pointing triangle"
- }
- },
- "key": "25B6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white right pointing triangle",
- "alternative": "white right pointing triangle"
- }
- },
- "key": "25B7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black right pointing small triangle",
- "alternative": "black right pointing small triangle"
- }
- },
- "key": "25B8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white right pointing small triangle",
- "alternative": "white right pointing small triangle"
- }
- },
- "key": "25B9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black right pointing pointer",
- "alternative": "black right pointing pointer"
- }
- },
- "key": "25BA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white right pointing pointer",
- "alternative": "white right pointing pointer"
- }
- },
- "key": "25BB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black down pointing triangle",
- "alternative": "black down pointing triangle"
- }
- },
- "key": "25BC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white down pointing triangle",
- "alternative": "white down pointing triangle"
- }
- },
- "key": "25BD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black down pointing small triangle",
- "alternative": "black down pointing small triangle"
- }
- },
- "key": "25BE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white down pointing small triangle",
- "alternative": "white down pointing small triangle"
- }
- },
- "key": "25BF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black left pointing triangle",
- "alternative": "black left pointing triangle"
- }
- },
- "key": "25C0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white left pointing triangle",
- "alternative": "white left pointing triangle"
- }
- },
- "key": "25C1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black left pointing small triangle",
- "alternative": "black left pointing small triangle"
- }
- },
- "key": "25C2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white left pointing small triangle",
- "alternative": "white left pointing small triangle"
- }
- },
- "key": "25C3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black left pointing pointer",
- "alternative": "black left pointing pointer"
- }
- },
- "key": "25C4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white left pointing pointer",
- "alternative": "white left pointing pointer"
- }
- },
- "key": "25C5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black diamond"
- }
- },
- "key": "25C6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white diamond"
- }
- },
- "key": "25C7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white diamond containing black small diamond"
- }
- },
- "key": "25C8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "fisheye"
- }
- },
- "key": "25C9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lozenge"
- }
- },
- "key": "25CA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white circle"
- }
- },
- "key": "25CB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "dotted circle"
- }
- },
- "key": "25CC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circle with vertical fill"
- }
- },
- "key": "25CD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "bullseye"
- }
- },
- "key": "25CE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black circle"
- }
- },
- "key": "25CF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circle with left half black"
- }
- },
- "key": "25D0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circle with right half black"
- }
- },
- "key": "25D1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circle with lower half black"
- }
- },
- "key": "25D2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circle with upper half black"
- }
- },
- "key": "25D3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circle with upper right quadrant black"
- }
- },
- "key": "25D4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circle with all but upper left quadrant black"
- }
- },
- "key": "25D5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "left half black circle"
- }
- },
- "key": "25D6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "right half black circle"
- }
- },
- "key": "25D7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "inverse bullet"
- }
- },
- "key": "25D8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "inverse white circle"
- }
- },
- "key": "25D9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upper half inverse white circle"
- }
- },
- "key": "25DA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower half inverse white circle"
- }
- },
- "key": "25DB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upper left quadrant circular arc"
- }
- },
- "key": "25DC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upper right quadrant circular arc"
- }
- },
- "key": "25DD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower right quadrant circular arc"
- }
- },
- "key": "25DE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower left quadrant circular arc"
- }
- },
- "key": "25DF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upper half circle"
- }
- },
- "key": "25E0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "lower half circle"
- }
- },
- "key": "25E1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black lower right triangle"
- }
- },
- "key": "25E2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black lower left triangle"
- }
- },
- "key": "25E3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black upper left triangle"
- }
- },
- "key": "25E4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black upper right triangle"
- }
- },
- "key": "25E5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white bullet"
- }
- },
- "key": "25E6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with left half black"
- }
- },
- "key": "25E7"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with right half black"
- }
- },
- "key": "25E8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with upper left diagonal half black"
- }
- },
- "key": "25E9"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with lower right diagonal half black"
- }
- },
- "key": "25EA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square with vertical bisecting line"
- }
- },
- "key": "25EB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white up pointing triangle with dot",
- "alternative": "white up pointing triangle with dot"
- }
- },
- "key": "25EC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up pointing triangle with left half black",
- "alternative": "up pointing triangle with left half black"
- }
- },
- "key": "25ED"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "up pointing triangle with right half black",
- "alternative": "up pointing triangle with right half black"
- }
- },
- "key": "25EE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "large circle"
- }
- },
- "key": "25EF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square with upper left quadrant"
- }
- },
- "key": "25F0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square with lower left quadrant"
- }
- },
- "key": "25F1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square with lower right quadrant"
- }
- },
- "key": "25F2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white square with upper right quadrant"
- }
- },
- "key": "25F3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white circle with upper left quadrant"
- }
- },
- "key": "25F4"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white circle with lower left quadrant"
- }
- },
- "key": "25F5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white circle with lower right quadrant"
- }
- },
- "key": "25F6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white circle with upper right quadrant"
- }
- },
- "key": "25F7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upper left triangle"
- }
- },
- "key": "25F8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upper right triangle"
- }
- },
- "key": "25F9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "lower left triangle"
- }
- },
- "key": "25FA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white medium square"
- }
- },
- "key": "25FB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "black medium square"
- }
- },
- "key": "25FC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white medium small square"
- }
- },
- "key": "25FD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "black medium small square"
- }
- },
- "key": "25FE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "lower right triangle"
- }
- },
- "key": "25FF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with top half black"
- }
- },
- "key": "2B12"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with bottom half black"
- }
- },
- "key": "2B13"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with upper right diagonal half black"
- }
- },
- "key": "2B14"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square with lower left diagonal half black"
- }
- },
- "key": "2B15"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "diamond with left half black"
- }
- },
- "key": "2B16"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "diamond with right half black"
- }
- },
- "key": "2B17"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "diamond with top half black"
- }
- },
- "key": "2B18"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "diamond with bottom half black"
- }
- },
- "key": "2B19"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "dotted square"
- }
- },
- "key": "2B1A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black large square"
- }
- },
- "key": "2B1B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white large square"
- }
- },
- "key": "2B1C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black very small square"
- }
- },
- "key": "2B1D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white very small square"
- }
- },
- "key": "2B1E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black pentagon"
- }
- },
- "key": "2B1F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white pentagon"
- }
- },
- "key": "2B20"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white hexagon"
- }
- },
- "key": "2B21"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black hexagon"
- }
- },
- "key": "2B22"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "horizontal black hexagon"
- }
- },
- "key": "2B23"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black large circle"
- }
- },
- "key": "2B24"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black medium diamond"
- }
- },
- "key": "2B25"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white medium diamond"
- }
- },
- "key": "2B26"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black medium lozenge"
- }
- },
- "key": "2B27"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white medium lozenge"
- }
- },
- "key": "2B28"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black small diamond"
- }
- },
- "key": "2B29"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black small lozenge"
- }
- },
- "key": "2B2A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white small lozenge"
- }
- },
- "key": "2B2B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black horizontal ellipse"
- }
- },
- "key": "2B2C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white horizontal ellipse"
- }
- },
- "key": "2B2D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black vertical ellipse"
- }
- },
- "key": "2B2E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white vertical ellipse"
- }
- },
- "key": "2B2F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white medium star"
- }
- },
- "key": "2B50"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black small star"
- }
- },
- "key": "2B51"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white small star"
- }
- },
- "key": "2B52"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black right pointing pentagon"
- }
- },
- "key": "2B53"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white right pointing pentagon"
- }
- },
- "key": "2B54"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy large circle"
- }
- },
- "key": "2B55"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy oval with oval inside"
- }
- },
- "key": "2B56"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy circle with circle inside"
- }
- },
- "key": "2B57"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy circle"
- }
- },
- "key": "2B58"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy circled saltire"
- }
- },
- "key": "2B59"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_harpoons.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_harpoons.json
deleted file mode 100644
index efb92974b2b..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_harpoons.json
+++ /dev/null
@@ -1,458 +0,0 @@
-[
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb upwards",
- "short": "left harpoon with barb up"
- }
- },
- "key": "21BC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb downwards",
- "short": "left harpoon with barb down"
- }
- },
- "key": "21BD"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb rightwards",
- "short": "up harpoon with barb right"
- }
- },
- "key": "21BE"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb leftwards",
- "short": "up harpoon with barb left"
- }
- },
- "key": "21BF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb upwards",
- "short": "right harpoon with barb up"
- }
- },
- "key": "21C0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb downwards",
- "short": "right harpoon with barb down"
- }
- },
- "key": "21C1"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb rightwards",
- "short": "down harpoon with barb right"
- }
- },
- "key": "21C2"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb leftwards",
- "short": "down harpoon with barb left"
- }
- },
- "key": "21C3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "leftwards harpoon over rightwards harpoon",
- "short": "left harpoon over right harpoon"
- }
- },
- "key": "21CB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rightwards harpoon over leftwards harpoon",
- "short": "right harpoon over left harpoon"
- }
- },
- "key": "21CC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left barb up right barb down harpoon"
- }
- },
- "key": "294A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left barb down right barb up harpoon"
- }
- },
- "key": "294B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up barb right down barb left harpoon"
- }
- },
- "key": "294C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up barb left down barb right harpoon"
- }
- },
- "key": "294D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left barb up right barb up harpoon"
- }
- },
- "key": "294E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up barb right down barb right harpoon"
- }
- },
- "key": "294F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left barb down right barb down harpoon"
- }
- },
- "key": "2950"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up barb left down barb left harpoon"
- }
- },
- "key": "2951"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb up to bar",
- "short": "left harpoon with barb up to bar"
- }
- },
- "key": "2952"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb up to bar",
- "short": "right harpoon with barb up to bar"
- }
- },
- "key": "2953"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb right to bar",
- "short": "up harpoon with barb right to bar"
- }
- },
- "key": "2954"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb right to bar",
- "short": "down harpoon with barb right to bar"
- }
- },
- "key": "2955"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb down to bar",
- "short": "left harpoon with barb down to bar"
- }
- },
- "key": "2956"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb down to bar",
- "short": "right harpoon with barb down to bar"
- }
- },
- "key": "2957"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb left to bar",
- "short": "up harpoon with barb left to bar"
- }
- },
- "key": "2958"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb left to bar",
- "short": "down harpoon with barb left to bar"
- }
- },
- "key": "2959"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb up from bar",
- "short": "left harpoon with barb up from bar"
- }
- },
- "key": "295A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb up from bar",
- "short": "right harpoon with barb up from bar"
- }
- },
- "key": "295B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb right from bar",
- "short": "up harpoon with barb right from bar"
- }
- },
- "key": "295C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb right from bar",
- "short": "down harpoon with barb right from bar"
- }
- },
- "key": "295D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb down from bar",
- "short": "left harpoon with barb down from bar"
- }
- },
- "key": "295E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb down from bar",
- "short": "right harpoon with barb down from bar"
- }
- },
- "key": "295F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb left from bar",
- "short": "up harpoon with barb left from bar"
- }
- },
- "key": "2960"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb left from bar",
- "short": "down harpoon with barb left from bar"
- }
- },
- "key": "2961"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb up above leftwards harpoon with barb down",
- "short": "left harpoon with barb up above left harpoon with barb down"
- }
- },
- "key": "2962"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb left beside upwards harpoon with barb right",
- "short": "up harpoon with barb left beside up harpoon with barb right"
- }
- },
- "key": "2963"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb up above rightwards harpoon with barb down",
- "short": "right harpoon with barb up above right harpoon with barb down"
- }
- },
- "key": "2964"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb left beside downwards harpoon with barb right",
- "short": "down harpoon with barb left beside down harpoon with barb right"
- }
- },
- "key": "2965"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb up above rightwards harpoon with barb up",
- "short": "left harpoon with barb up above right harpoon with barb up"
- }
- },
- "key": "2966"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb down above rightwards harpoon with barb down",
- "short": "left harpoon with barb down above right harpoon with barb down"
- }
- },
- "key": "2967"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb up above leftwards harpoon with barb up",
- "short": "right harpoon with barb up above left harpoon with barb up"
- }
- },
- "key": "2968"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb down above leftwards harpoon with barb down",
- "short": "right harpoon with barb down above left harpoon with barb down"
- }
- },
- "key": "2969"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb up above long dash",
- "short": "left harpoon with barb up above long dash"
- }
- },
- "key": "296A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "leftwards harpoon with barb down below long dash",
- "short": "left harpoon with barb down below long dash"
- }
- },
- "key": "296B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb up above long dash",
- "short": "right harpoon with barb up above long dash"
- }
- },
- "key": "296C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rightwards harpoon with barb down below long dash",
- "short": "right harpoon with barb down below long dash"
- }
- },
- "key": "296D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upwards harpoon with barb left beside downwards harpoon with barb right",
- "short": "up harpoon with barb left beside down harpoon with barb right"
- }
- },
- "key": "296E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "downwards harpoon with barb left beside upwards harpoon with barb right",
- "short": "down harpoon with barb left beside up harpoon with barb right"
- }
- },
- "key": "296F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left fish tail"
- }
- },
- "key": "297C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right fish tail"
- }
- },
- "key": "297D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up fish tail"
- }
- },
- "key": "297E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "down fish tail"
- }
- },
- "key": "297F"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_non_characters.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_non_characters.json
deleted file mode 100644
index bf17090695d..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_non_characters.json
+++ /dev/null
@@ -1,224 +0,0 @@
-[
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "mathematical italic small h over two time greek letter pi",
- "alternative": "italic small h over two pi",
- "short": "italic h over two pi"
- },
- "physics": {
- "default": "planck constant over two pi",
- "alternative": "planck constant over 2 pi"
- }
- },
- "key": "210F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "l b bar symbol",
- "short": "l b bar"
- }
- },
- "key": "2114"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "numero sign",
- "alternative": "numero",
- "short": "numero"
- }
- },
- "key": "2116"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "sound recording copyright"
- }
- },
- "key": "2117"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "prescription take"
- }
- },
- "key": "211E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "response"
- }
- },
- "key": "211F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "service mark"
- }
- },
- "key": "2120"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "telephone sign",
- "alternative": "t e l symbol"
- }
- },
- "key": "2121"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "trade mark sign",
- "alternative": "trademark",
- "short": "trade mark"
- }
- },
- "key": "2122"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "versicle"
- }
- },
- "key": "2123"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "ounce sign",
- "alternative": "ounce",
- "short": "ounce"
- }
- },
- "key": "2125"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "ohm sign",
- "alternative": "ohm",
- "short": "ohm"
- }
- },
- "key": "2126"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "inverted ohm sign",
- "alternative": "mho",
- "short": "inverted ohm"
- }
- },
- "key": "2127"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "kelvin sign",
- "alternative": "degrees kelvin",
- "short": "kelvin"
- }
- },
- "key": "212A"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "angstrom sign",
- "alternative": "angstrom unit",
- "short": "angstrom"
- }
- },
- "key": "212B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "estimated symbol",
- "short": "estimated"
- }
- },
- "key": "212E"
-},
-{"category": "Lu",
- "mappings": {
- "default": {
- "default": "turned capital f",
- "alternative": "turned f",
- "short": "turned cap f"
- }
- },
- "key": "2132"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "information source"
- }
- },
- "key": "2139"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "rotated capital q",
- "short": "rotated cap q"
- }
- },
- "key": "213A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "facsimile sign"
- }
- },
- "key": "213B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "turned sans serif capital g",
- "short": "turned sans serif cap g"
- }
- },
- "key": "2141"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "turned sans serif capital l",
- "short": "turned sans serif cap l"
- }
- },
- "key": "2142"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reversed sans serif capital l",
- "short": "reversed sans serif cap l"
- }
- },
- "key": "2143"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "turned sans serif capital y",
- "short": "turned sans serif cap y"
- }
- },
- "key": "2144"
-}
-] \ No newline at end of file
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_symbols.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_symbols.json
deleted file mode 100644
index fd243b77ae1..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_symbols.json
+++ /dev/null
@@ -1,6988 +0,0 @@
-[
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "factorial operator",
- "alternative": "exclamation mark",
- "short": "factorial"
- }
- },
- "key": "0021"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "quotation mark"
- }
- },
- "key": "0022"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "number sign",
- "alternative": "hash",
- "short": "number"
- }
- },
- "key": "0023"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "dollar sign",
- "short": "dollar"
- }
- },
- "key": "0024"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "percent sign",
- "short": "percent"
- }
- },
- "key": "0025"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "ampersand"
- }
- },
- "key": "0026"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "apostrophe",
- "alternative": "apostrophe quote"
- }
- },
- "key": "0027"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "asterisk"
- }
- },
- "key": "002A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign",
- "short": "plus"
- }
- },
- "key": "002B"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "comma"
- }
- },
- "key": "002C"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "hyphen minus",
- "short": "minus"
- }
- },
- "key": "002D"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "full stop",
- "alternative": "period"
- }
- },
- "key": "002E"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "solidus",
- "alternative": "slash"
- }
- },
- "key": "002F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "colon"
- }
- },
- "key": "003A"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "semicolon"
- }
- },
- "key": "003B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than sign",
- "short": "less than"
- }
- },
- "key": "003C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign",
- "short": "equals"
- }
- },
- "key": "003D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than sign",
- "short": "greater than"
- }
- },
- "key": "003E"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "question mark"
- }
- },
- "key": "003F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "commercial at",
- "short": "at"
- }
- },
- "key": "0040"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "reverse solidus",
- "alternative": "backslash"
- }
- },
- "key": "005C"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "circumflex accent",
- "alternative": "spacing circumflex",
- "short": "hat"
- }
- },
- "key": "005E"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "low line",
- "alternative": "spacing underscore"
- }
- },
- "key": "005F"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "grave accent",
- "alternative": "spacing grave",
- "short": "grave"
- }
- },
- "key": "0060"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical line",
- "alternative": "vertical bar"
- }
- },
- "key": "007C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tilde"
- }
- },
- "key": "007E"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "inverted exclamation mark"
- }
- },
- "key": "00A1"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "cent sign",
- "short": "cent"
- }
- },
- "key": "00A2"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "pound sign",
- "short": "pound"
- }
- },
- "key": "00A3"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "currency sign",
- "short": "currency"
- }
- },
- "key": "00A4"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "yen sign",
- "short": "yen"
- }
- },
- "key": "00A5"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "broken bar",
- "alternative": "broken vertical bar"
- }
- },
- "key": "00A6"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "section sign",
- "short": "section"
- }
- },
- "key": "00A7"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "diaeresis",
- "alternative": "spacing diaeresis",
- "short": "double dot"
- }
- },
- "key": "00A8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "copyright sign",
- "short": "copyright"
- }
- },
- "key": "00A9"
-},
-{"category": "Lo",
- "mappings": {
- "default": {
- "default": "feminine ordinal indicator"
- }
- },
- "key": "00AA"
-},
-{"category": "Pi",
- "mappings": {
- "default": {
- "default": "left pointing double angle quotation mark",
- "alternative": "left pointing guillemet"
- }
- },
- "key": "00AB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not sign",
- "short": "not"
- }
- },
- "key": "00AC"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "registered sign",
- "alternative": "registered trade mark sign",
- "short": "registered"
- }
- },
- "key": "00AE"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "macron",
- "alternative": "spacing macron"
- }
- },
- "key": "00AF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "degree sign",
- "short": "degree"
- }
- },
- "key": "00B0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus minus sign",
- "alternative": "plus or minus sign",
- "short": "plus minus"
- }
- },
- "key": "00B1"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "acute accent",
- "alternative": "spacing acute",
- "short": "acute"
- }
- },
- "key": "00B4"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "micro sign",
- "short": "micro"
- }
- },
- "key": "00B5"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "pilcrow sign",
- "alternative": "paragraph sign",
- "short": "pilcrow"
- }
- },
- "key": "00B6"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "middle dot"
- }
- },
- "key": "00B7"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "cedilla",
- "alternative": "spacing cedilla"
- }
- },
- "key": "00B8"
-},
-{"category": "Lo",
- "mappings": {
- "default": {
- "default": "masculine ordinal indicator"
- }
- },
- "key": "00BA"
-},
-{"category": "Pf",
- "mappings": {
- "default": {
- "default": "right pointing double angle quotation mark",
- "alternative": "right pointing guillemet"
- }
- },
- "key": "00BB"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "inverted question mark"
- }
- },
- "key": "00BF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiplication sign",
- "short": "multiplication"
- }
- },
- "key": "00D7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "division sign",
- "short": "division"
- }
- },
- "key": "00F7"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "breve",
- "alternative": "spacing breve"
- }
- },
- "key": "02D8"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "dot above",
- "alternative": "spacing dot above"
- }
- },
- "key": "02D9"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "ring above",
- "alternative": "spacing ring above"
- }
- },
- "key": "02DA"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "ogonek",
- "alternative": "spacing ogonek"
- }
- },
- "key": "02DB"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "small tilde",
- "alternative": "spacing tilde"
- }
- },
- "key": "02DC"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "double acute accent",
- "alternative": "spacing double acute"
- }
- },
- "key": "02DD"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "hyphen"
- }
- },
- "key": "2010"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "non breaking hyphen"
- }
- },
- "key": "2011"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "figure dash"
- }
- },
- "key": "2012"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "en dash"
- }
- },
- "key": "2013"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "em dash"
- }
- },
- "key": "2014"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "horizontal bar",
- "alternative": "quotation dash"
- }
- },
- "key": "2015"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "double vertical line",
- "alternative": "double vertical bar"
- }
- },
- "key": "2016"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "double low line",
- "alternative": "spacing double underscore"
- }
- },
- "key": "2017"
-},
-{"category": "Pi",
- "mappings": {
- "default": {
- "default": "left single quotation mark",
- "alternative": "single turned comma quotation mark"
- }
- },
- "key": "2018"
-},
-{"category": "Pf",
- "mappings": {
- "default": {
- "default": "right single quotation mark",
- "alternative": "single comma quotation mark"
- }
- },
- "key": "2019"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "single low 9 quotation mark",
- "alternative": "low single comma quotation mark"
- }
- },
- "key": "201A"
-},
-{"category": "Pi",
- "mappings": {
- "default": {
- "default": "single high reversed 9 quotation mark",
- "alternative": "single reversed comma quotation mark"
- }
- },
- "key": "201B"
-},
-{"category": "Pi",
- "mappings": {
- "default": {
- "default": "left double quotation mark",
- "alternative": "double turned comma quotation mark"
- }
- },
- "key": "201C"
-},
-{"category": "Pf",
- "mappings": {
- "default": {
- "default": "right double quotation mark",
- "alternative": "double comma quotation mark"
- }
- },
- "key": "201D"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "double low 9 quotation mark",
- "alternative": "low double comma quotation mark"
- }
- },
- "key": "201E"
-},
-{"category": "Pi",
- "mappings": {
- "default": {
- "default": "double high reversed 9 quotation mark",
- "alternative": "double reversed comma quotation mark"
- }
- },
- "key": "201F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "dagger"
- }
- },
- "key": "2020"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "double dagger"
- }
- },
- "key": "2021"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "bullet"
- }
- },
- "key": "2022"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "triangular bullet"
- }
- },
- "key": "2023"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "one dot leader"
- }
- },
- "key": "2024"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "two dot leader"
- }
- },
- "key": "2025"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "horizontal ellipsis"
- }
- },
- "key": "2026"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "hyphenation point"
- }
- },
- "key": "2027"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "per mille sign",
- "short": "per mille"
- }
- },
- "key": "2030"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "per ten thousand sign",
- "short": "per ten thousand"
- }
- },
- "key": "2031"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "prime"
- }
- },
- "key": "2032"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "double prime"
- }
- },
- "key": "2033"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "triple prime"
- }
- },
- "key": "2034"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "reversed prime"
- }
- },
- "key": "2035"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "reversed double prime"
- }
- },
- "key": "2036"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "reversed triple prime"
- }
- },
- "key": "2037"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "caret"
- }
- },
- "key": "2038"
-},
-{"category": "Pi",
- "mappings": {
- "default": {
- "default": "single left pointing angle quotation mark",
- "alternative": "left pointing single guillemet"
- }
- },
- "key": "2039"
-},
-{"category": "Pf",
- "mappings": {
- "default": {
- "default": "single right pointing angle quotation mark",
- "alternative": "right pointing single guillemet"
- }
- },
- "key": "203A"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "reference mark"
- }
- },
- "key": "203B"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "double exclamation mark"
- }
- },
- "key": "203C"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "interrobang"
- }
- },
- "key": "203D"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "overline",
- "alternative": "spacing overscore"
- }
- },
- "key": "203E"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "undertie"
- }
- },
- "key": "203F"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "character tie"
- }
- },
- "key": "2040"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "caret insertion point"
- }
- },
- "key": "2041"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "asterism"
- }
- },
- "key": "2042"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "hyphen bullet"
- }
- },
- "key": "2043"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fraction slash"
- }
- },
- "key": "2044"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "double question mark"
- }
- },
- "key": "2047"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "question exclamation mark"
- }
- },
- "key": "2048"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "exclamation question mark"
- }
- },
- "key": "2049"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "reversed pilcrow sign",
- "short": "reversed pilcrow"
- }
- },
- "key": "204B"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "black leftwards bullet"
- }
- },
- "key": "204C"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "black rightwards bullet"
- }
- },
- "key": "204D"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "low asterisk"
- }
- },
- "key": "204E"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "reversed semicolon"
- }
- },
- "key": "204F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "close up"
- }
- },
- "key": "2050"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "two asterisks aligned vertically"
- }
- },
- "key": "2051"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "commercial minus sign",
- "short": "commercial minus"
- }
- },
- "key": "2052"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "swung dash"
- }
- },
- "key": "2053"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "inverted undertie"
- }
- },
- "key": "2054"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "flower punctuation mark"
- }
- },
- "key": "2055"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "three dot punctuation"
- }
- },
- "key": "2056"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "quadruple prime"
- }
- },
- "key": "2057"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "four dot punctuation"
- }
- },
- "key": "2058"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "five dot punctuation"
- }
- },
- "key": "2059"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "two dot punctuation"
- }
- },
- "key": "205A"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "four dot mark"
- }
- },
- "key": "205B"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "dotted cross"
- }
- },
- "key": "205C"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "tricolon"
- }
- },
- "key": "205D"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "vertical four dots"
- }
- },
- "key": "205E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superscript plus sign",
- "short": "superscript plus"
- }
- },
- "key": "207A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superscript minus",
- "alternative": "superscript hyphen minus"
- }
- },
- "key": "207B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superscript equals sign",
- "short": "superscript equals"
- }
- },
- "key": "207C"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "superscript left parenthesis",
- "alternative": "superscript opening parenthesis"
- }
- },
- "key": "207D"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "superscript right parenthesis",
- "alternative": "superscript closing parenthesis"
- }
- },
- "key": "207E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subscript plus sign",
- "short": "subscript plus"
- }
- },
- "key": "208A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subscript minus",
- "alternative": "subscript hyphen minus"
- }
- },
- "key": "208B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subscript equals sign",
- "short": "subscript equals"
- }
- },
- "key": "208C"
-},
-{"category": "Ps",
- "mappings": {
- "default": {
- "default": "subscript left parenthesis",
- "alternative": "subscript opening parenthesis"
- }
- },
- "key": "208D"
-},
-{"category": "Pe",
- "mappings": {
- "default": {
- "default": "subscript right parenthesis",
- "alternative": "subscript closing parenthesis"
- }
- },
- "key": "208E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "property line"
- }
- },
- "key": "214A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "turned ampersand"
- }
- },
- "key": "214B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "per sign",
- "short": "per"
- }
- },
- "key": "214C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "aktieselskab"
- }
- },
- "key": "214D"
-},
-{"category": "Ll",
- "mappings": {
- "default": {
- "default": "turned small f"
- }
- },
- "key": "214E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "for all"
- }
- },
- "key": "2200"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "complement"
- }
- },
- "key": "2201"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "partial differential"
- }
- },
- "key": "2202"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "there exists"
- }
- },
- "key": "2203"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "there does not exist"
- }
- },
- "key": "2204"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "empty set"
- }
- },
- "key": "2205"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "increment"
- }
- },
- "key": "2206"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "nabla"
- }
- },
- "key": "2207"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of"
- }
- },
- "key": "2208"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not an element of"
- }
- },
- "key": "2209"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small element of"
- }
- },
- "key": "220A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "contains as member"
- }
- },
- "key": "220B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not contain as member"
- }
- },
- "key": "220C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small contains as member"
- }
- },
- "key": "220D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "end of proof"
- }
- },
- "key": "220E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary product"
- }
- },
- "key": "220F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary coproduct"
- }
- },
- "key": "2210"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary summation"
- }
- },
- "key": "2211"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus sign",
- "short": "minus"
- }
- },
- "key": "2212"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus or plus sign",
- "short": "minus or plus"
- }
- },
- "key": "2213"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "dot plus"
- }
- },
- "key": "2214"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "division slash"
- }
- },
- "key": "2215"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "set minus"
- }
- },
- "key": "2216"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "asterisk operator"
- }
- },
- "key": "2217"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "ring operator"
- }
- },
- "key": "2218"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bullet operator"
- }
- },
- "key": "2219"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square root"
- }
- },
- "key": "221A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "cube root"
- }
- },
- "key": "221B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fourth root"
- }
- },
- "key": "221C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "proportional to"
- }
- },
- "key": "221D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "infinity"
- }
- },
- "key": "221E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right angle"
- }
- },
- "key": "221F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "angle"
- }
- },
- "key": "2220"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured angle"
- }
- },
- "key": "2221"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "spherical angle"
- }
- },
- "key": "2222"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "divides",
- "short": "bar"
- }
- },
- "key": "2223"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not divide"
- }
- },
- "key": "2224"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "parallel to"
- }
- },
- "key": "2225"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not parallel to"
- }
- },
- "key": "2226"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical and"
- }
- },
- "key": "2227"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical or"
- }
- },
- "key": "2228"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intersection"
- }
- },
- "key": "2229"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "union"
- }
- },
- "key": "222A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral"
- }
- },
- "key": "222B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double integral"
- }
- },
- "key": "222C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple integral"
- }
- },
- "key": "222D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "contour integral"
- }
- },
- "key": "222E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "surface integral"
- }
- },
- "key": "222F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "volume integral"
- }
- },
- "key": "2230"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "clockwise integral"
- }
- },
- "key": "2231"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "clockwise contour integral"
- }
- },
- "key": "2232"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "anticlockwise contour integral"
- }
- },
- "key": "2233"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "therefore"
- }
- },
- "key": "2234"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "because"
- }
- },
- "key": "2235"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "ratio"
- }
- },
- "key": "2236"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "proportion"
- }
- },
- "key": "2237"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "dot minus"
- }
- },
- "key": "2238"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "excess"
- }
- },
- "key": "2239"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "geometric proportion"
- }
- },
- "key": "223A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "homothetic"
- }
- },
- "key": "223B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tilde operator"
- }
- },
- "key": "223C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reversed tilde"
- }
- },
- "key": "223D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "inverted lazy s"
- }
- },
- "key": "223E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "sine wave"
- }
- },
- "key": "223F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "wreath product"
- }
- },
- "key": "2240"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not tilde"
- }
- },
- "key": "2241"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus tilde"
- }
- },
- "key": "2242"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "asymptotically equal to"
- }
- },
- "key": "2243"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not asymptotically equal to"
- }
- },
- "key": "2244"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "approximately equal to"
- }
- },
- "key": "2245"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "approximately but not actually equal to"
- }
- },
- "key": "2246"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither approximately nor actually equal to"
- }
- },
- "key": "2247"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "almost equal to"
- }
- },
- "key": "2248"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not almost equal to"
- }
- },
- "key": "2249"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "almost equal or equal to"
- }
- },
- "key": "224A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple tilde"
- }
- },
- "key": "224B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "all equal to"
- }
- },
- "key": "224C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equivalent to"
- }
- },
- "key": "224D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "geometrically equivalent to"
- }
- },
- "key": "224E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "difference between"
- }
- },
- "key": "224F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "approaches the limit"
- }
- },
- "key": "2250"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "geometrically equal to"
- }
- },
- "key": "2251"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "approximately equal to or the image of"
- }
- },
- "key": "2252"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "image of or approximately equal to"
- }
- },
- "key": "2253"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "colon equals",
- "alternative": "colon equal"
- }
- },
- "key": "2254"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals colon",
- "alternative": "equal colon"
- }
- },
- "key": "2255"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "ring in equal to"
- }
- },
- "key": "2256"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "ring equal to"
- }
- },
- "key": "2257"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "corresponds to"
- }
- },
- "key": "2258"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "estimates"
- }
- },
- "key": "2259"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equiangular to"
- }
- },
- "key": "225A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "star equals"
- }
- },
- "key": "225B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "delta equal to"
- }
- },
- "key": "225C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equal to by definition"
- }
- },
- "key": "225D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "measured by"
- }
- },
- "key": "225E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "questioned equal to"
- }
- },
- "key": "225F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not equal to"
- }
- },
- "key": "2260"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "identical to"
- }
- },
- "key": "2261"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not identical to"
- }
- },
- "key": "2262"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "strictly equivalent to"
- }
- },
- "key": "2263"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or equal to",
- "alternative": "less than or equal to"
- }
- },
- "key": "2264"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or equal to",
- "alternative": "greater than or equal to"
- }
- },
- "key": "2265"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than over equal to",
- "alternative": "less than over equal to"
- }
- },
- "key": "2266"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than over equal to",
- "alternative": "greater than over equal to"
- }
- },
- "key": "2267"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than but not equal to",
- "alternative": "less than but not equal to"
- }
- },
- "key": "2268"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than but not equal to",
- "alternative": "greater than but not equal to"
- }
- },
- "key": "2269"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "much less than",
- "alternative": "much less than"
- }
- },
- "key": "226A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "much greater than",
- "alternative": "much greater than"
- }
- },
- "key": "226B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "between"
- }
- },
- "key": "226C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not equivalent to"
- }
- },
- "key": "226D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not less than",
- "alternative": "not less than"
- }
- },
- "key": "226E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not greater than",
- "alternative": "not greater than"
- }
- },
- "key": "226F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither less than nor equal to",
- "alternative": "neither less than nor equal to"
- }
- },
- "key": "2270"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither greater than nor equal to",
- "alternative": "neither greater than nor equal to"
- }
- },
- "key": "2271"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or equivalent to",
- "alternative": "less than or equivalent to"
- }
- },
- "key": "2272"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or equivalent to",
- "alternative": "greater than or equivalent to"
- }
- },
- "key": "2273"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither less than nor equivalent to",
- "alternative": "neither less than nor equivalent to"
- }
- },
- "key": "2274"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither greater than nor equivalent to",
- "alternative": "neither greater than nor equivalent to"
- }
- },
- "key": "2275"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or greater than",
- "alternative": "less than or greater than"
- }
- },
- "key": "2276"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or less than",
- "alternative": "greater than or less than"
- }
- },
- "key": "2277"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither less than nor greater than",
- "alternative": "neither less than nor greater than"
- }
- },
- "key": "2278"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither greater than nor less than",
- "alternative": "neither greater than nor less than"
- }
- },
- "key": "2279"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes"
- }
- },
- "key": "227A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds"
- }
- },
- "key": "227B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes or equal to"
- }
- },
- "key": "227C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds or equal to"
- }
- },
- "key": "227D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes or equivalent to"
- }
- },
- "key": "227E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds or equivalent to"
- }
- },
- "key": "227F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not precede"
- }
- },
- "key": "2280"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not succeed"
- }
- },
- "key": "2281"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of"
- }
- },
- "key": "2282"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of"
- }
- },
- "key": "2283"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not a subset of"
- }
- },
- "key": "2284"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not a superset of"
- }
- },
- "key": "2285"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of or equal to"
- }
- },
- "key": "2286"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of or equal to"
- }
- },
- "key": "2287"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither a subset of nor equal to"
- }
- },
- "key": "2288"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "neither a superset of nor equal to"
- }
- },
- "key": "2289"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of with not equal to",
- "alternative": "subset of or not equal to",
- "short": "subset of or not equal to"
- }
- },
- "key": "228A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of with not equal to",
- "alternative": "superset of or not equal to",
- "short": "superset of or not equal to"
- }
- },
- "key": "228B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiset"
- }
- },
- "key": "228C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiset multiplication"
- }
- },
- "key": "228D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiset union"
- }
- },
- "key": "228E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square image of"
- }
- },
- "key": "228F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square original of"
- }
- },
- "key": "2290"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square image of or equal to"
- }
- },
- "key": "2291"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square original of or equal to"
- }
- },
- "key": "2292"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square cap"
- }
- },
- "key": "2293"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square cup"
- }
- },
- "key": "2294"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled plus"
- }
- },
- "key": "2295"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled minus"
- }
- },
- "key": "2296"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled times"
- }
- },
- "key": "2297"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled division slash"
- }
- },
- "key": "2298"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled dot operator"
- }
- },
- "key": "2299"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled ring operator"
- }
- },
- "key": "229A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled asterisk operator"
- }
- },
- "key": "229B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled equals"
- }
- },
- "key": "229C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled dash"
- }
- },
- "key": "229D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared plus"
- }
- },
- "key": "229E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared minus"
- }
- },
- "key": "229F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared times"
- }
- },
- "key": "22A0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared dot operator"
- }
- },
- "key": "22A1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right tack"
- }
- },
- "key": "22A2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left tack"
- }
- },
- "key": "22A3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "down tack"
- }
- },
- "key": "22A4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up tack"
- }
- },
- "key": "22A5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "assertion"
- }
- },
- "key": "22A6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "models"
- }
- },
- "key": "22A7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "true"
- }
- },
- "key": "22A8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "forces"
- }
- },
- "key": "22A9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple vertical bar right turnstile"
- }
- },
- "key": "22AA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double vertical bar double right turnstile"
- }
- },
- "key": "22AB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not prove"
- }
- },
- "key": "22AC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not true"
- }
- },
- "key": "22AD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not force"
- }
- },
- "key": "22AE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "negated double vertical bar double right turnstile"
- }
- },
- "key": "22AF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes under relation"
- }
- },
- "key": "22B0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds under relation"
- }
- },
- "key": "22B1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "normal subgroup of"
- }
- },
- "key": "22B2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "contains as normal subgroup"
- }
- },
- "key": "22B3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "normal subgroup of or equal to"
- }
- },
- "key": "22B4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "contains as normal subgroup or equal to"
- }
- },
- "key": "22B5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "original of"
- }
- },
- "key": "22B6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "image of"
- }
- },
- "key": "22B7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multimap"
- }
- },
- "key": "22B8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "hermitian conjugate matrix"
- }
- },
- "key": "22B9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intercalate"
- }
- },
- "key": "22BA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "xor"
- }
- },
- "key": "22BB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "nand"
- }
- },
- "key": "22BC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "nor"
- }
- },
- "key": "22BD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right triangle"
- }
- },
- "key": "22BF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary logical and"
- }
- },
- "key": "22C0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary logical or"
- }
- },
- "key": "22C1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary intersection"
- }
- },
- "key": "22C2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary union"
- }
- },
- "key": "22C3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "diamond operator"
- }
- },
- "key": "22C4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "dot operator"
- }
- },
- "key": "22C5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "star operator"
- }
- },
- "key": "22C6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "division times"
- }
- },
- "key": "22C7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bowtie"
- }
- },
- "key": "22C8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left normal factor semidirect product"
- }
- },
- "key": "22C9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right normal factor semidirect product"
- }
- },
- "key": "22CA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left semidirect product"
- }
- },
- "key": "22CB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right semidirect product"
- }
- },
- "key": "22CC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reversed tilde equals"
- }
- },
- "key": "22CD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "curly logical or"
- }
- },
- "key": "22CE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "curly logical and"
- }
- },
- "key": "22CF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double subset"
- }
- },
- "key": "22D0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double superset"
- }
- },
- "key": "22D1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double intersection"
- }
- },
- "key": "22D2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double union"
- }
- },
- "key": "22D3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "pitchfork"
- }
- },
- "key": "22D4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equal and parallel to"
- }
- },
- "key": "22D5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than with dot",
- "alternative": "less than with dot",
- "short": "less than dot"
- }
- },
- "key": "22D6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than with dot",
- "alternative": "greater than with dot",
- "short": "greater than dot"
- }
- },
- "key": "22D7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "very much less than",
- "alternative": "very much less than"
- }
- },
- "key": "22D8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "very much greater than",
- "alternative": "very much greater than"
- }
- },
- "key": "22D9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than equal to or greater than",
- "alternative": "less than equal to or greater than"
- }
- },
- "key": "22DA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than equal to or less than",
- "alternative": "greater than equal to or less than"
- }
- },
- "key": "22DB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equal to or less than",
- "alternative": "equal to or less than"
- }
- },
- "key": "22DC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equal to or greater than",
- "alternative": "equal to or greater than"
- }
- },
- "key": "22DD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equal to or precedes"
- }
- },
- "key": "22DE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equal to or succeeds"
- }
- },
- "key": "22DF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not precede or equal"
- }
- },
- "key": "22E0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not succeed or equal"
- }
- },
- "key": "22E1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not square image of or equal to"
- }
- },
- "key": "22E2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not square original of or equal to"
- }
- },
- "key": "22E3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square image of or not equal to"
- }
- },
- "key": "22E4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square original of or not equal to"
- }
- },
- "key": "22E5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than but not equivalent to",
- "alternative": "less than but not equivalent to"
- }
- },
- "key": "22E6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than but not equivalent to",
- "alternative": "greater than but not equivalent to"
- }
- },
- "key": "22E7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes but not equivalent to"
- }
- },
- "key": "22E8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds but not equivalent to"
- }
- },
- "key": "22E9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not normal subgroup of"
- }
- },
- "key": "22EA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not contain as normal subgroup"
- }
- },
- "key": "22EB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "not normal subgroup of or equal to"
- }
- },
- "key": "22EC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not contain as normal subgroup or equal"
- }
- },
- "key": "22ED"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical ellipsis"
- }
- },
- "key": "22EE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "midline horizontal ellipsis"
- }
- },
- "key": "22EF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up right diagonal ellipsis"
- }
- },
- "key": "22F0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "down right diagonal ellipsis"
- }
- },
- "key": "22F1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of with long horizontal stroke"
- }
- },
- "key": "22F2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of with vertical bar at end of horizontal stroke"
- }
- },
- "key": "22F3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small element of with vertical bar at end of horizontal stroke"
- }
- },
- "key": "22F4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of with dot above"
- }
- },
- "key": "22F5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of with overbar"
- }
- },
- "key": "22F6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small element of with overbar"
- }
- },
- "key": "22F7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of with underbar"
- }
- },
- "key": "22F8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of with two horizontal strokes"
- }
- },
- "key": "22F9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "contains with long horizontal stroke"
- }
- },
- "key": "22FA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "contains with vertical bar at end of horizontal stroke"
- }
- },
- "key": "22FB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small contains with vertical bar at end of horizontal stroke"
- }
- },
- "key": "22FC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "contains with overbar"
- }
- },
- "key": "22FD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small contains with overbar"
- }
- },
- "key": "22FE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation bag membership"
- }
- },
- "key": "22FF"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "diameter sign",
- "short": "diameter"
- }
- },
- "key": "2300"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "house"
- }
- },
- "key": "2302"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "projective"
- }
- },
- "key": "2305"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "perspective"
- }
- },
- "key": "2306"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "wavy line"
- }
- },
- "key": "2307"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "reversed not sign",
- "short": "reversed not"
- }
- },
- "key": "2310"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "square lozenge"
- }
- },
- "key": "2311"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "arc"
- }
- },
- "key": "2312"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "segment"
- }
- },
- "key": "2313"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "sector"
- }
- },
- "key": "2314"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy plus sign",
- "alternative": "heavy plus",
- "short": "bold plus"
- }
- },
- "key": "2795"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy minus sign",
- "alternative": "heavy minus",
- "short": "bold minus"
- }
- },
- "key": "2796"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy division sign",
- "alternative": "heavy division",
- "short": "bold division"
- }
- },
- "key": "2797"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "curly loop"
- }
- },
- "key": "27B0"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "double curly loop"
- }
- },
- "key": "27BF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white triangle containing small white triangle"
- }
- },
- "key": "27C1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "perpendicular"
- }
- },
- "key": "27C2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "open subset"
- }
- },
- "key": "27C3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "open superset"
- }
- },
- "key": "27C4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "or with dot inside"
- }
- },
- "key": "27C7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reverse solidus preceding subset"
- }
- },
- "key": "27C8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset preceding solidus"
- }
- },
- "key": "27C9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical bar with horizontal stroke"
- }
- },
- "key": "27CA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical rising diagonal"
- }
- },
- "key": "27CB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long division"
- }
- },
- "key": "27CC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "mathematical falling diagonal"
- }
- },
- "key": "27CD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared logical and"
- }
- },
- "key": "27CE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared logical or"
- }
- },
- "key": "27CF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white diamond with centered dot"
- }
- },
- "key": "27D0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "and with dot"
- }
- },
- "key": "27D1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of opening upwards"
- }
- },
- "key": "27D2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "lower right corner with dot"
- }
- },
- "key": "27D3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "upper left corner with dot"
- }
- },
- "key": "27D4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left outer join"
- }
- },
- "key": "27D5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right outer join"
- }
- },
- "key": "27D6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "full outer join"
- }
- },
- "key": "27D7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "large up tack"
- }
- },
- "key": "27D8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "large down tack"
- }
- },
- "key": "27D9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left and right double turnstile"
- }
- },
- "key": "27DA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left and right tack"
- }
- },
- "key": "27DB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left multimap"
- }
- },
- "key": "27DC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long right tack"
- }
- },
- "key": "27DD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long left tack"
- }
- },
- "key": "27DE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "up tack with circle above"
- }
- },
- "key": "27DF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "lozenge divided by horizontal rule"
- }
- },
- "key": "27E0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white concave sided diamond"
- }
- },
- "key": "27E1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white concave sided diamond with leftwards tick"
- }
- },
- "key": "27E2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white concave sided diamond with rightwards tick"
- }
- },
- "key": "27E3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white square with leftwards tick"
- }
- },
- "key": "27E4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white square with rightwards tick"
- }
- },
- "key": "27E5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rising diagonal crossing falling diagonal"
- }
- },
- "key": "292B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "falling diagonal crossing rising diagonal"
- }
- },
- "key": "292C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple vertical bar delimiter"
- }
- },
- "key": "2980"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation spot"
- }
- },
- "key": "2981"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation type colon"
- }
- },
- "key": "2982"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "dotted fence"
- }
- },
- "key": "2999"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical zigzag line"
- }
- },
- "key": "299A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reversed empty set"
- }
- },
- "key": "29B0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "empty set with overbar"
- }
- },
- "key": "29B1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "empty set with small circle above"
- }
- },
- "key": "29B2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circle with horizontal bar"
- }
- },
- "key": "29B5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled vertical bar"
- }
- },
- "key": "29B6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled parallel"
- }
- },
- "key": "29B7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled reverse solidus"
- }
- },
- "key": "29B8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled perpendicular"
- }
- },
- "key": "29B9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circle divided by horizontal bar and top half divided by vertical bar"
- }
- },
- "key": "29BA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circle with superimposed x"
- }
- },
- "key": "29BB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled anticlockwise rotated division sign",
- "short": "circled anticlockwise rotated division"
- }
- },
- "key": "29BC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled white bullet"
- }
- },
- "key": "29BE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled bullet"
- }
- },
- "key": "29BF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled less than"
- }
- },
- "key": "29C0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled greater than"
- }
- },
- "key": "29C1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circle with small circle to the right"
- }
- },
- "key": "29C2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circle with two horizontal strokes to the right"
- }
- },
- "key": "29C3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared rising diagonal slash"
- }
- },
- "key": "29C4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared falling diagonal slash"
- }
- },
- "key": "29C5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared asterisk"
- }
- },
- "key": "29C6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared small circle"
- }
- },
- "key": "29C7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "squared square"
- }
- },
- "key": "29C8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "two joined squares"
- }
- },
- "key": "29C9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triangle with dot above"
- }
- },
- "key": "29CA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triangle with underbar"
- }
- },
- "key": "29CB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "s in triangle"
- }
- },
- "key": "29CC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triangle with serifs at bottom"
- }
- },
- "key": "29CD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "right triangle above left triangle"
- }
- },
- "key": "29CE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "left triangle beside vertical bar"
- }
- },
- "key": "29CF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical bar beside right triangle"
- }
- },
- "key": "29D0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bowtie with left half black"
- }
- },
- "key": "29D1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "bowtie with right half black"
- }
- },
- "key": "29D2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "black bowtie"
- }
- },
- "key": "29D3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "times with left half black"
- }
- },
- "key": "29D4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "times with right half black"
- }
- },
- "key": "29D5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white hourglass"
- }
- },
- "key": "29D6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "black hourglass"
- }
- },
- "key": "29D7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "incomplete infinity"
- }
- },
- "key": "29DC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tie over infinity"
- }
- },
- "key": "29DD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "infinity negated with vertical bar"
- }
- },
- "key": "29DE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double ended multimap"
- }
- },
- "key": "29DF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square with contoured outline"
- }
- },
- "key": "29E0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "increases as"
- }
- },
- "key": "29E1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "shuffle product"
- }
- },
- "key": "29E2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign and slanted parallel"
- }
- },
- "key": "29E3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign and slanted parallel with tilde above"
- }
- },
- "key": "29E4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "identical to and slanted parallel"
- }
- },
- "key": "29E5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "gleich stark"
- }
- },
- "key": "29E6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "thermodynamic"
- }
- },
- "key": "29E7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "down pointing triangle with left half black"
- }
- },
- "key": "29E8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "down pointing triangle with right half black"
- }
- },
- "key": "29E9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "black lozenge"
- }
- },
- "key": "29EB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "error barred white square"
- }
- },
- "key": "29EE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "error barred black square"
- }
- },
- "key": "29EF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "error barred white diamond"
- }
- },
- "key": "29F0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "error barred black diamond"
- }
- },
- "key": "29F1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "error barred white circle"
- }
- },
- "key": "29F2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "error barred black circle"
- }
- },
- "key": "29F3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "rule delayed"
- }
- },
- "key": "29F4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reverse solidus operator"
- }
- },
- "key": "29F5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "solidus with overbar"
- }
- },
- "key": "29F6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reverse solidus with horizontal stroke"
- }
- },
- "key": "29F7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "big solidus"
- }
- },
- "key": "29F8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "big reverse solidus"
- }
- },
- "key": "29F9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double plus"
- }
- },
- "key": "29FA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple plus"
- }
- },
- "key": "29FB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tiny"
- }
- },
- "key": "29FE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "miny"
- }
- },
- "key": "29FF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary circled dot operator"
- }
- },
- "key": "2A00"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary circled plus operator"
- }
- },
- "key": "2A01"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary circled times operator"
- }
- },
- "key": "2A02"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary union operator with dot"
- }
- },
- "key": "2A03"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary union operator with plus"
- }
- },
- "key": "2A04"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary square intersection operator"
- }
- },
- "key": "2A05"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary square union operator"
- }
- },
- "key": "2A06"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "two logical and operator"
- }
- },
- "key": "2A07"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "two logical or operator"
- }
- },
- "key": "2A08"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary times operator"
- }
- },
- "key": "2A09"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "modulo two sum"
- }
- },
- "key": "2A0A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "summation with integral"
- }
- },
- "key": "2A0B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "quadruple integral operator"
- }
- },
- "key": "2A0C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "finite part integral"
- }
- },
- "key": "2A0D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral with double stroke"
- }
- },
- "key": "2A0E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral average with slash"
- }
- },
- "key": "2A0F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circulation function"
- }
- },
- "key": "2A10"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "anticlockwise integration"
- }
- },
- "key": "2A11"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "line integration with rectangular path around pole"
- }
- },
- "key": "2A12"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "line integration with semicircular path around pole"
- }
- },
- "key": "2A13"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "line integration not including the pole"
- }
- },
- "key": "2A14"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral around a point operator"
- }
- },
- "key": "2A15"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "quaternion integral operator"
- }
- },
- "key": "2A16"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral with times sign",
- "short": "integral with times"
- }
- },
- "key": "2A18"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral with intersection"
- }
- },
- "key": "2A19"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral with union"
- }
- },
- "key": "2A1A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral with overbar"
- }
- },
- "key": "2A1B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "integral with underbar"
- }
- },
- "key": "2A1C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "join"
- }
- },
- "key": "2A1D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "large left triangle operator"
- }
- },
- "key": "2A1E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation schema composition"
- }
- },
- "key": "2A1F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation schema piping"
- }
- },
- "key": "2A20"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation schema projection"
- }
- },
- "key": "2A21"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign with small circle above",
- "short": "plus with circle above"
- }
- },
- "key": "2A22"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign with circumflex accent above",
- "short": "plus hat"
- }
- },
- "key": "2A23"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign with tilde above",
- "short": "plus tilde"
- }
- },
- "key": "2A24"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign with dot below",
- "short": "plus underdot"
- }
- },
- "key": "2A25"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign with tilde below"
- }
- },
- "key": "2A26"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign with subscript two"
- }
- },
- "key": "2A27"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign with black triangle"
- }
- },
- "key": "2A28"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus sign with comma above"
- }
- },
- "key": "2A29"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus sign with dot below"
- }
- },
- "key": "2A2A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus sign with falling dots"
- }
- },
- "key": "2A2B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus sign with rising dots"
- }
- },
- "key": "2A2C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign in left half circle"
- }
- },
- "key": "2A2D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign in right half circle"
- }
- },
- "key": "2A2E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vector or cross product"
- }
- },
- "key": "2A2F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiplication sign with dot above"
- }
- },
- "key": "2A30"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiplication sign with underbar"
- }
- },
- "key": "2A31"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "semidirect product with bottom closed"
- }
- },
- "key": "2A32"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "smash product"
- }
- },
- "key": "2A33"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiplication sign in left half circle"
- }
- },
- "key": "2A34"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiplication sign in right half circle"
- }
- },
- "key": "2A35"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled multiplication sign with circumflex accent"
- }
- },
- "key": "2A36"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiplication sign in double circle"
- }
- },
- "key": "2A37"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "circled division sign",
- "short": "circled division"
- }
- },
- "key": "2A38"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign in triangle"
- }
- },
- "key": "2A39"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "minus sign in triangle"
- }
- },
- "key": "2A3A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "multiplication sign in triangle"
- }
- },
- "key": "2A3B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "interior product"
- }
- },
- "key": "2A3C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "righthand interior product"
- }
- },
- "key": "2A3D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation relational composition"
- }
- },
- "key": "2A3E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "amalgamation or coproduct"
- }
- },
- "key": "2A3F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intersection with dot"
- }
- },
- "key": "2A40"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "union with minus sign",
- "short": "union with minus"
- }
- },
- "key": "2A41"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "union with overbar"
- }
- },
- "key": "2A42"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intersection with overbar"
- }
- },
- "key": "2A43"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intersection with logical and"
- }
- },
- "key": "2A44"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "union with logical or"
- }
- },
- "key": "2A45"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "union above intersection"
- }
- },
- "key": "2A46"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intersection above union"
- }
- },
- "key": "2A47"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "union above bar above intersection"
- }
- },
- "key": "2A48"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intersection above bar above union"
- }
- },
- "key": "2A49"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "union beside and joined with union"
- }
- },
- "key": "2A4A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "intersection beside and joined with intersection"
- }
- },
- "key": "2A4B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "closed union with serifs"
- }
- },
- "key": "2A4C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "closed intersection with serifs"
- }
- },
- "key": "2A4D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double square intersection"
- }
- },
- "key": "2A4E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double square union"
- }
- },
- "key": "2A4F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "closed union with serifs and smash product"
- }
- },
- "key": "2A50"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical and with dot above"
- }
- },
- "key": "2A51"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical or with dot above"
- }
- },
- "key": "2A52"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double logical and"
- }
- },
- "key": "2A53"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double logical or"
- }
- },
- "key": "2A54"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "two intersecting logical and"
- }
- },
- "key": "2A55"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "two intersecting logical or"
- }
- },
- "key": "2A56"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "sloping large or"
- }
- },
- "key": "2A57"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "sloping large and"
- }
- },
- "key": "2A58"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical or overlapping logical and"
- }
- },
- "key": "2A59"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical and with middle stem"
- }
- },
- "key": "2A5A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical or with middle stem"
- }
- },
- "key": "2A5B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical and with horizontal dash"
- }
- },
- "key": "2A5C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical or with horizontal dash"
- }
- },
- "key": "2A5D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical and with double overbar"
- }
- },
- "key": "2A5E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical and with underbar"
- }
- },
- "key": "2A5F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical and with double underbar"
- }
- },
- "key": "2A60"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small vee with underbar"
- }
- },
- "key": "2A61"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical or with double overbar"
- }
- },
- "key": "2A62"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "logical or with double underbar"
- }
- },
- "key": "2A63"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation domain antirestriction"
- }
- },
- "key": "2A64"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "z notation range antirestriction"
- }
- },
- "key": "2A65"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign with dot below"
- }
- },
- "key": "2A66"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "identical with dot above"
- }
- },
- "key": "2A67"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple horizontal bar with double vertical stroke"
- }
- },
- "key": "2A68"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple horizontal bar with triple vertical stroke"
- }
- },
- "key": "2A69"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tilde operator with dot above"
- }
- },
- "key": "2A6A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "tilde operator with rising dots"
- }
- },
- "key": "2A6B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "similar minus similar"
- }
- },
- "key": "2A6C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "congruent with dot above"
- }
- },
- "key": "2A6D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals with asterisk"
- }
- },
- "key": "2A6E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "almost equal to with circumflex accent",
- "short": "almost equal hat"
- }
- },
- "key": "2A6F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "approximately equal or equal to"
- }
- },
- "key": "2A70"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign above plus sign",
- "short": "equals above plus"
- }
- },
- "key": "2A71"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "plus sign above equals sign",
- "short": "plus above equals"
- }
- },
- "key": "2A72"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign above tilde operator",
- "short": "equals above tilde operator"
- }
- },
- "key": "2A73"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double colon equal"
- }
- },
- "key": "2A74"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "two consecutive equals signs",
- "short": "two consecutive equals"
- }
- },
- "key": "2A75"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "three consecutive equals signs",
- "short": "three consecutive equals"
- }
- },
- "key": "2A76"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign with two dots above and two dots below"
- }
- },
- "key": "2A77"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equivalent with four dots above"
- }
- },
- "key": "2A78"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than with circle inside"
- }
- },
- "key": "2A79"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than with circle inside"
- }
- },
- "key": "2A7A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than with question mark above"
- }
- },
- "key": "2A7B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than with question mark above"
- }
- },
- "key": "2A7C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or slanted equal to"
- }
- },
- "key": "2A7D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or slanted equal to"
- }
- },
- "key": "2A7E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or slanted equal to with dot inside"
- }
- },
- "key": "2A7F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or slanted equal to with dot inside"
- }
- },
- "key": "2A80"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or slanted equal to with dot above"
- }
- },
- "key": "2A81"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or slanted equal to with dot above"
- }
- },
- "key": "2A82"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or slanted equal to with dot above right"
- }
- },
- "key": "2A83"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or slanted equal to with dot above left"
- }
- },
- "key": "2A84"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than or approximate"
- }
- },
- "key": "2A85"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than or approximate"
- }
- },
- "key": "2A86"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than and single line not equal to"
- }
- },
- "key": "2A87"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than and single line not equal to"
- }
- },
- "key": "2A88"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than and not approximate"
- }
- },
- "key": "2A89"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than and not approximate"
- }
- },
- "key": "2A8A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than above double line equal above greater than"
- }
- },
- "key": "2A8B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than above double line equal above less than"
- }
- },
- "key": "2A8C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than above similar or equal"
- }
- },
- "key": "2A8D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than above similar or equal"
- }
- },
- "key": "2A8E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than above similar above greater than"
- }
- },
- "key": "2A8F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than above similar above less than"
- }
- },
- "key": "2A90"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than above greater than above double line equal"
- }
- },
- "key": "2A91"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than above less than above double line equal"
- }
- },
- "key": "2A92"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than above slanted equal above greater than above slanted equal"
- }
- },
- "key": "2A93"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than above slanted equal above less than above slanted equal"
- }
- },
- "key": "2A94"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "slanted equal to or less than"
- }
- },
- "key": "2A95"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "slanted equal to or greater than"
- }
- },
- "key": "2A96"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "slanted equal to or less than with dot inside"
- }
- },
- "key": "2A97"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "slanted equal to or greater than with dot inside"
- }
- },
- "key": "2A98"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double line equal to or less than"
- }
- },
- "key": "2A99"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double line equal to or greater than"
- }
- },
- "key": "2A9A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double line slanted equal to or less than"
- }
- },
- "key": "2A9B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double line slanted equal to or greater than"
- }
- },
- "key": "2A9C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "similar or less than"
- }
- },
- "key": "2A9D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "similar or greater than"
- }
- },
- "key": "2A9E"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "similar above less than above equals sign"
- }
- },
- "key": "2A9F"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "similar above greater than above equals sign"
- }
- },
- "key": "2AA0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double nested less than"
- }
- },
- "key": "2AA1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double nested greater than"
- }
- },
- "key": "2AA2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double nested less than with underbar"
- }
- },
- "key": "2AA3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than overlapping less than"
- }
- },
- "key": "2AA4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than beside less than"
- }
- },
- "key": "2AA5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than closed by curve"
- }
- },
- "key": "2AA6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than closed by curve"
- }
- },
- "key": "2AA7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "less than closed by curve above slanted equal"
- }
- },
- "key": "2AA8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "greater than closed by curve above slanted equal"
- }
- },
- "key": "2AA9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "smaller than"
- }
- },
- "key": "2AAA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "larger than"
- }
- },
- "key": "2AAB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "smaller than or equal to"
- }
- },
- "key": "2AAC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "larger than or equal to"
- }
- },
- "key": "2AAD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "equals sign with bumpy above"
- }
- },
- "key": "2AAE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes above single line equals sign"
- }
- },
- "key": "2AAF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds above single line equals sign"
- }
- },
- "key": "2AB0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes above single line not equal to"
- }
- },
- "key": "2AB1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds above single line not equal to"
- }
- },
- "key": "2AB2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes above equals sign"
- }
- },
- "key": "2AB3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds above equals sign"
- }
- },
- "key": "2AB4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes above not equal to"
- }
- },
- "key": "2AB5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds above not equal to"
- }
- },
- "key": "2AB6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes above almost equal to"
- }
- },
- "key": "2AB7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds above almost equal to"
- }
- },
- "key": "2AB8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "precedes above not almost equal to"
- }
- },
- "key": "2AB9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "succeeds above not almost equal to"
- }
- },
- "key": "2ABA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double precedes"
- }
- },
- "key": "2ABB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double succeeds"
- }
- },
- "key": "2ABC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset with dot"
- }
- },
- "key": "2ABD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset with dot"
- }
- },
- "key": "2ABE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset with plus sign below"
- }
- },
- "key": "2ABF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset with plus sign below"
- }
- },
- "key": "2AC0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset with multiplication sign below"
- }
- },
- "key": "2AC1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset with multiplication sign below"
- }
- },
- "key": "2AC2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of or equal to with dot above"
- }
- },
- "key": "2AC3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of or equal to with dot above"
- }
- },
- "key": "2AC4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of above equals sign"
- }
- },
- "key": "2AC5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of above equals sign"
- }
- },
- "key": "2AC6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of above tilde operator"
- }
- },
- "key": "2AC7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of above tilde operator"
- }
- },
- "key": "2AC8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of above almost equal to"
- }
- },
- "key": "2AC9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of above almost equal to"
- }
- },
- "key": "2ACA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset of above not equal to"
- }
- },
- "key": "2ACB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset of above not equal to"
- }
- },
- "key": "2ACC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square left open box operator"
- }
- },
- "key": "2ACD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "square right open box operator"
- }
- },
- "key": "2ACE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "closed subset"
- }
- },
- "key": "2ACF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "closed superset"
- }
- },
- "key": "2AD0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "closed subset or equal to"
- }
- },
- "key": "2AD1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "closed superset or equal to"
- }
- },
- "key": "2AD2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset above superset"
- }
- },
- "key": "2AD3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset above subset"
- }
- },
- "key": "2AD4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "subset above subset"
- }
- },
- "key": "2AD5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset above superset"
- }
- },
- "key": "2AD6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset beside subset"
- }
- },
- "key": "2AD7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "superset beside and joined by dash with subset"
- }
- },
- "key": "2AD8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "element of opening downwards"
- }
- },
- "key": "2AD9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "pitchfork with tee top"
- }
- },
- "key": "2ADA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "transversal intersection"
- }
- },
- "key": "2ADB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "forking"
- }
- },
- "key": "2ADC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "nonforking"
- }
- },
- "key": "2ADD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "short left tack"
- }
- },
- "key": "2ADE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "short down tack"
- }
- },
- "key": "2ADF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "short up tack"
- }
- },
- "key": "2AE0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "perpendicular with s"
- }
- },
- "key": "2AE1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical bar triple right turnstile"
- }
- },
- "key": "2AE2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double vertical bar left turnstile"
- }
- },
- "key": "2AE3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical bar double left turnstile"
- }
- },
- "key": "2AE4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double vertical bar double left turnstile"
- }
- },
- "key": "2AE5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "long dash from left member of double vertical"
- }
- },
- "key": "2AE6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "short down tack with overbar"
- }
- },
- "key": "2AE7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "short up tack with underbar"
- }
- },
- "key": "2AE8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "short up tack above short down tack"
- }
- },
- "key": "2AE9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double down tack"
- }
- },
- "key": "2AEA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double up tack"
- }
- },
- "key": "2AEB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double stroke not sign"
- }
- },
- "key": "2AEC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "reversed double stroke not sign"
- }
- },
- "key": "2AED"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "does not divide with reversed negation slash"
- }
- },
- "key": "2AEE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical line with circle above"
- }
- },
- "key": "2AEF"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "vertical line with circle below"
- }
- },
- "key": "2AF0"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "down tack with circle below"
- }
- },
- "key": "2AF1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "parallel with horizontal stroke"
- }
- },
- "key": "2AF2"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "parallel with tilde operator"
- }
- },
- "key": "2AF3"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple vertical bar binary relation"
- }
- },
- "key": "2AF4"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple vertical bar with horizontal stroke"
- }
- },
- "key": "2AF5"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple colon operator"
- }
- },
- "key": "2AF6"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple nested less than"
- }
- },
- "key": "2AF7"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple nested greater than"
- }
- },
- "key": "2AF8"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double line slanted less than or equal to"
- }
- },
- "key": "2AF9"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double line slanted greater than or equal to"
- }
- },
- "key": "2AFA"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "triple solidus binary relation"
- }
- },
- "key": "2AFB"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "large triple vertical bar operator"
- }
- },
- "key": "2AFC"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "double solidus operator"
- }
- },
- "key": "2AFD"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "white vertical bar"
- }
- },
- "key": "2AFE"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "n ary white vertical bar"
- }
- },
- "key": "2AFF"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "wave dash"
- }
- },
- "key": "301C"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "presentation form for vertical comma"
- }
- },
- "key": "FE10"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "presentation form for vertical colon"
- }
- },
- "key": "FE13"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "presentation form for vertical semicolon"
- }
- },
- "key": "FE14"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "presentation form for vertical exclamation mark"
- }
- },
- "key": "FE15"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "presentation form for vertical question mark"
- }
- },
- "key": "FE16"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "presentation form for vertical horizontal ellipsis"
- }
- },
- "key": "FE19"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "presentation form for vertical two dot leader",
- "alternative": "glyph for vertical two dot leader"
- }
- },
- "key": "FE30"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "presentation form for vertical em dash",
- "alternative": "glyph for vertical em dash"
- }
- },
- "key": "FE31"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "presentation form for vertical en dash",
- "alternative": "glyph for vertical en dash"
- }
- },
- "key": "FE32"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "presentation form for vertical low line",
- "alternative": "glyph for vertical spacing underscore"
- }
- },
- "key": "FE33"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "presentation form for vertical wavy low line",
- "alternative": "glyph for vertical spacing wavy underscore"
- }
- },
- "key": "FE34"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "sesame dot"
- }
- },
- "key": "FE45"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "white sesame dot"
- }
- },
- "key": "FE46"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "dashed overline",
- "alternative": "spacing dashed overscore"
- }
- },
- "key": "FE49"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "centerline overline",
- "alternative": "spacing centerline overscore"
- }
- },
- "key": "FE4A"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "wavy overline",
- "alternative": "spacing wavy overscore"
- }
- },
- "key": "FE4B"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "double wavy overline",
- "alternative": "spacing double wavy overscore"
- }
- },
- "key": "FE4C"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "dashed low line",
- "alternative": "spacing dashed underscore"
- }
- },
- "key": "FE4D"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "centerline low line",
- "alternative": "spacing centerline underscore"
- }
- },
- "key": "FE4E"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "wavy low line",
- "alternative": "spacing wavy underscore"
- }
- },
- "key": "FE4F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small comma"
- }
- },
- "key": "FE50"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small full stop",
- "alternative": "small period"
- }
- },
- "key": "FE52"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small semicolon"
- }
- },
- "key": "FE54"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small colon"
- }
- },
- "key": "FE55"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small question mark"
- }
- },
- "key": "FE56"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small exclamation mark"
- }
- },
- "key": "FE57"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "small em dash"
- }
- },
- "key": "FE58"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small number sign"
- }
- },
- "key": "FE5F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small ampersand"
- }
- },
- "key": "FE60"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small asterisk"
- }
- },
- "key": "FE61"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small plus sign"
- }
- },
- "key": "FE62"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "small hyphen minus"
- }
- },
- "key": "FE63"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small less than sign"
- }
- },
- "key": "FE64"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small greater than sign"
- }
- },
- "key": "FE65"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "small equals sign"
- }
- },
- "key": "FE66"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small reverse solidus",
- "alternative": "small backslash"
- }
- },
- "key": "FE68"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "small dollar sign"
- }
- },
- "key": "FE69"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small percent sign"
- }
- },
- "key": "FE6A"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "small commercial at"
- }
- },
- "key": "FE6B"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth exclamation mark"
- }
- },
- "key": "FF01"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth quotation mark"
- }
- },
- "key": "FF02"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth number sign"
- }
- },
- "key": "FF03"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "fullwidth dollar sign"
- }
- },
- "key": "FF04"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth percent sign"
- }
- },
- "key": "FF05"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth ampersand"
- }
- },
- "key": "FF06"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth apostrophe"
- }
- },
- "key": "FF07"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth asterisk"
- }
- },
- "key": "FF0A"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fullwidth plus sign"
- }
- },
- "key": "FF0B"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth comma"
- }
- },
- "key": "FF0C"
-},
-{"category": "Pd",
- "mappings": {
- "default": {
- "default": "fullwidth hyphen minus"
- }
- },
- "key": "FF0D"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth full stop",
- "alternative": "fullwidth period"
- }
- },
- "key": "FF0E"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth solidus",
- "alternative": "fullwidth slash"
- }
- },
- "key": "FF0F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth colon"
- }
- },
- "key": "FF1A"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth semicolon"
- }
- },
- "key": "FF1B"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fullwidth less than sign"
- }
- },
- "key": "FF1C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fullwidth equals sign"
- }
- },
- "key": "FF1D"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fullwidth greater than sign"
- }
- },
- "key": "FF1E"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth question mark"
- }
- },
- "key": "FF1F"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth commercial at"
- }
- },
- "key": "FF20"
-},
-{"category": "Po",
- "mappings": {
- "default": {
- "default": "fullwidth reverse solidus",
- "alternative": "fullwidth backslash"
- }
- },
- "key": "FF3C"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "fullwidth circumflex accent",
- "alternative": "fullwidth spacing circumflex"
- }
- },
- "key": "FF3E"
-},
-{"category": "Pc",
- "mappings": {
- "default": {
- "default": "fullwidth low line",
- "alternative": "fullwidth spacing underscore"
- }
- },
- "key": "FF3F"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "fullwidth grave accent",
- "alternative": "fullwidth spacing grave"
- }
- },
- "key": "FF40"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fullwidth vertical line",
- "alternative": "fullwidth vertical bar"
- }
- },
- "key": "FF5C"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fullwidth tilde",
- "alternative": "fullwidth spacing tilde"
- }
- },
- "key": "FF5E"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "fullwidth cent sign"
- }
- },
- "key": "FFE0"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "fullwidth pound sign"
- }
- },
- "key": "FFE1"
-},
-{"category": "Sm",
- "mappings": {
- "default": {
- "default": "fullwidth not sign"
- }
- },
- "key": "FFE2"
-},
-{"category": "Sk",
- "mappings": {
- "default": {
- "default": "fullwidth macron",
- "alternative": "fullwidth spacing macron"
- }
- },
- "key": "FFE3"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "fullwidth broken bar",
- "alternative": "fullwidth broken vertical bar"
- }
- },
- "key": "FFE4"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "fullwidth yen sign"
- }
- },
- "key": "FFE5"
-},
-{"category": "Sc",
- "mappings": {
- "default": {
- "default": "fullwidth won sign"
- }
- },
- "key": "FFE6"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "halfwidth forms light vertical"
- }
- },
- "key": "FFE8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "halfwidth black square"
- }
- },
- "key": "FFED"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "halfwidth white circle"
- }
- },
- "key": "FFEE"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_whitespace.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_whitespace.json
deleted file mode 100644
index 85537d08e8f..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/math_whitespace.json
+++ /dev/null
@@ -1,354 +0,0 @@
-[
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "space",
- "short": ""
- }
- },
- "key": "0020"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "no break space",
- "alternative": "non breaking space",
- "short": "space"
- }
- },
- "key": "00A0"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "soft hyphen",
- "short": ""
- }
- },
- "key": "00AD"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "en quad",
- "short": ""
- }
- },
- "key": "2000"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "em quad",
- "short": ""
- }
- },
- "key": "2001"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "en space",
- "short": ""
- }
- },
- "key": "2002"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "em space",
- "short": ""
- }
- },
- "key": "2003"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "three per em space",
- "short": ""
- }
- },
- "key": "2004"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "four per em space",
- "short": ""
- }
- },
- "key": "2005"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "six per em space",
- "short": ""
- }
- },
- "key": "2006"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "figure space",
- "short": ""
- }
- },
- "key": "2007"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "punctuation space",
- "short": ""
- }
- },
- "key": "2008"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "thin space",
- "short": ""
- }
- },
- "key": "2009"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "hair space",
- "short": ""
- }
- },
- "key": "200A"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "zero width space",
- "short": ""
- }
- },
- "key": "200B"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "zero width non joiner",
- "short": ""
- }
- },
- "key": "200C"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "zero width joiner"
- }
- },
- "key": "200D"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "left to right mark"
- }
- },
- "key": "200E"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "right to left mark"
- }
- },
- "key": "200F"
-},
-{"category": "Zl",
- "mappings": {
- "default": {
- "default": "line separator"
- }
- },
- "key": "2028"
-},
-{"category": "Zp",
- "mappings": {
- "default": {
- "default": "paragraph separator"
- }
- },
- "key": "2029"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "left to right embedding"
- }
- },
- "key": "202A"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "right to left embedding"
- }
- },
- "key": "202B"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "pop directional formatting"
- }
- },
- "key": "202C"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "left to right override"
- }
- },
- "key": "202D"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "right to left override"
- }
- },
- "key": "202E"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "narrow no break space",
- "short": ""
- }
- },
- "key": "202F"
-},
-{"category": "Zs",
- "mappings": {
- "default": {
- "default": "medium mathematical space",
- "short": ""
- }
- },
- "key": "205F"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "word joiner"
- }
- },
- "key": "2060"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "function application",
- "short": "of"
- }
- },
- "key": "2061"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "invisible times",
- "short": "times"
- }
- },
- "key": "2062"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "invisible separator",
- "short": "separator"
- }
- },
- "key": "2063"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "invisible plus",
- "short": "plus"
- }
- },
- "key": "2064"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "inhibit symmetric swapping"
- }
- },
- "key": "206A"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "activate symmetric swapping"
- }
- },
- "key": "206B"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "national digit shapes"
- }
- },
- "key": "206E"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "nominal digit shapes"
- }
- },
- "key": "206F"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "zero width no break space",
- "alternative": "byte order mark"
- }
- },
- "key": "FEFF"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "interlinear annotation anchor"
- }
- },
- "key": "FFF9"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "interlinear annotation separator"
- }
- },
- "key": "FFFA"
-},
-{"category": "Cf",
- "mappings": {
- "default": {
- "default": "interlinear annotation terminator"
- }
- },
- "key": "FFFB"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/other_stars.json b/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/other_stars.json
deleted file mode 100644
index 23b96aa6b01..00000000000
--- a/chromium/chrome/browser/resources/chromeos/chromevox/chromevox/background/mathmaps/symbols/other_stars.json
+++ /dev/null
@@ -1,471 +0,0 @@
-[
-{"category": "So",
- "mappings": {
- "default": {
- "default": "decimal exponent symbol"
- }
- },
- "key": "23E8"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black star"
- }
- },
- "key": "2605"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white star"
- }
- },
- "key": "2606"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "medium white circle",
- "short": "white circle"
- }
- },
- "key": "26AA"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "medium black circle",
- "short": "black circle"
- }
- },
- "key": "26AB"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white heavy check mark",
- "short": "white check"
- }
- },
- "key": "2705"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "check mark",
- "short": "check"
- }
- },
- "key": "2713"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy check mark",
- "short": "heavy check"
- }
- },
- "key": "2714"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "multiplication x"
- }
- },
- "key": "2715"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy multiplication x"
- }
- },
- "key": "2716"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "ballot x"
- }
- },
- "key": "2717"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy ballot x"
- }
- },
- "key": "2718"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "open center cross"
- }
- },
- "key": "271B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy open center cross"
- }
- },
- "key": "271C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "maltese cross"
- }
- },
- "key": "2720"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "star of david"
- }
- },
- "key": "2721"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "four teardrop spoked asterisk"
- }
- },
- "key": "2722"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "four balloon spoked asterisk"
- }
- },
- "key": "2723"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy four balloon spoked asterisk"
- }
- },
- "key": "2724"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "four club spoked asterisk"
- }
- },
- "key": "2725"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black four pointed star"
- }
- },
- "key": "2726"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white four pointed star"
- }
- },
- "key": "2727"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "sparkles"
- }
- },
- "key": "2728"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "stress outlined white star"
- }
- },
- "key": "2729"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circled white star"
- }
- },
- "key": "272A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "open center black star"
- }
- },
- "key": "272B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black center white star"
- }
- },
- "key": "272C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "outlined black star"
- }
- },
- "key": "272D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy outlined black star"
- }
- },
- "key": "272E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "pinwheel star"
- }
- },
- "key": "272F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "shadowed white star"
- }
- },
- "key": "2730"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy asterisk"
- }
- },
- "key": "2731"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "open center asterisk"
- }
- },
- "key": "2732"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "eight spoked asterisk"
- }
- },
- "key": "2733"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "eight pointed black star"
- }
- },
- "key": "2734"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "eight pointed pinwheel star"
- }
- },
- "key": "2735"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "six pointed black star"
- }
- },
- "key": "2736"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "twelve pointed black star"
- }
- },
- "key": "2739"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "sixteen pointed asterisk"
- }
- },
- "key": "273A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "teardrop spoked asterisk"
- }
- },
- "key": "273B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "open center teardrop spoked asterisk"
- }
- },
- "key": "273C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy teardrop spoked asterisk"
- }
- },
- "key": "273D"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "six petalled black and white florette"
- }
- },
- "key": "273E"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "black florette"
- }
- },
- "key": "273F"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "white florette"
- }
- },
- "key": "2740"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "eight petalled outlined black florette"
- }
- },
- "key": "2741"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "circled open center eight pointed star"
- }
- },
- "key": "2742"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy teardrop spoked pinwheel asterisk"
- }
- },
- "key": "2743"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "snowflake"
- }
- },
- "key": "2744"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "tight trifoliate snowflake"
- }
- },
- "key": "2745"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy chevron snowflake"
- }
- },
- "key": "2746"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "sparkle"
- }
- },
- "key": "2747"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy sparkle"
- }
- },
- "key": "2748"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "balloon spoked asterisk"
- }
- },
- "key": "2749"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "eight teardrop spoked propeller asterisk"
- }
- },
- "key": "274A"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "heavy eight teardrop spoked propeller asterisk"
- }
- },
- "key": "274B"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "cross mark"
- }
- },
- "key": "274C"
-},
-{"category": "So",
- "mappings": {
- "default": {
- "default": "shadowed white circle"
- }
- },
- "key": "274D"
-}
-]
diff --git a/chromium/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd b/chromium/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd
index fbfd79f6574..ca7916e07bb 100644
--- a/chromium/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd
+++ b/chromium/chrome/browser/resources/chromeos/chromevox/strings/chromevox_strings.grd
@@ -162,6 +162,12 @@
<message desc='The description of the nextGranularity key. Navigation granularity can be e.g. "sentence level", "word level". Granularity is also referred as "level of detail". c.f. http://chromevox.com/tutorial/text_navigation.html Displayed in the Options page.' name="IDS_CHROMEVOX_NEXT_GRANULARITY">
Increase navigation granularity
</message>
+ <message desc="The description of the previousAtGranularity gesture. Displayed in the Options page." name="IDS_CHROMEVOX_PREVIOUS_AT_GRANULARITY">
+ Move to previous at granularity
+ </message>
+ <message desc='The description of the nextGranularity gesture. Navigation granularity can be e.g. "word level". Granularity is also referred as "level of detail". c.f. http://chromevox.com/tutorial/text_navigation.html Displayed in the Options page.' name="IDS_CHROMEVOX_NEXT_AT_GRANULARITY">
+ Move to next at granularity
+ </message>
<message desc="The description of the actOnCurrentItem key. The current item is the HTML element which has focus. Taking action is similar to using the mouse to click on the element. Displayed in the Options page." name="IDS_CHROMEVOX_ACT_ON_CURRENT_ITEM">
Take action on current item
</message>
@@ -559,9 +565,33 @@
<message desc="An option for setting the key combination that will be used as the ChromeVox modifier key (aka, the 'Cvox' key)." name="IDS_CHROMEVOX_OPTIONS_CVOX_MODIFIER_KEY">
ChromeVox modifier key
</message>
+ <message desc="List of chromevox developer options." name="IDS_CHROMEVOX_OPTIONS_DEVELOPER_OPTIONS">
+ Developer Options
+ </message>
+ <message desc="Enable chromevox earcon logging." name="IDS_CHROMEVOX_OPTIONS_DEVELOPER_EARCON_LOGGING">
+ Enable earcon logging
+ </message>
+ <message desc="Enable chromevox speech logging." name="IDS_CHROMEVOX_OPTIONS_DEVELOPER_SPEECH_LOGGING">
+ Enable speech logging
+ </message>
+ <message desc="Enable event stream logging in chromevox for developer options." name="IDS_CHROMEVOX_OPTIONS_EVENT_STREAM_LOGGING">
+ Enable event stream logging
+ </message>
+ <message desc="Show event stream filters options for event stream logging." name="IDS_CHROMEVOX_OPTIONS_SHOW_EVENT_STREAM_FILTERS">
+ Show event stream filters
+ </message>
+ <message desc="Hide event stream filters options for event stream logging." name="IDS_CHROMEVOX_OPTIONS_HIDE_EVENT_STREAM_FILTERS">
+ Hide event stream filters
+ </message>
+ <message desc="Enable chromevox braille logging." name="IDS_CHROMEVOX_OPTIONS_DEVELOPER_BRAILLE_LOGGING">
+ Enable braille logging
+ </message>
<message desc="The title of ChromeVox Learn Mode page. The keyboard explorer voices the name of each key when the user presses it." name="IDS_CHROMEVOX_KBEXPLORER_TITLE">
ChromeVox Learn Mode
</message>
+ <message desc="The title of ChromeVox Log page." name="IDS_CHROMEVOX_LOG_TITLE">
+ ChromeVox Log
+ </message>
<message desc="The instructions for ChromeVox Learn Mode. The keyboard explorer voices the name of each key when the user presses it. * These instructions describe how to use the keyboard explorer." name="IDS_CHROMEVOX_KBEXPLORER_INSTRUCTIONS">
Press any key to learn its name. Ctrl+W will close learn mode.
</message>
@@ -2996,6 +3026,18 @@ If you're done with the tutorial, use ChromeVox to navigate to the Close button
<message desc="A hint to the user for how to interact with math content using the keyboard." name="IDS_CHROMEVOX_HINT_MATH_KEYBOARD">
Press up, down, left, or right to explore math.
</message>
+ <message desc="Voice name for the system default Text-to-Speech voice" name="IDS_CHROMEVOX_SYSTEM_VOICE">
+ System Text-to-Speech voice
+ </message>
+ <message desc="Menu item text for a command to open the text to speech settings page" name="IDS_CHROMEVOX_SHOW_TTS_SETTINGS">
+ Open text-to-speech settings
+ </message>
+ <message desc="A hint to the user on how to interact with the virtual on screen keyboard." name="IDS_CHROMEVOX_HINT_TOUCH_TYPE">
+ Find a key, then lift to type
+ </message>
+ <message desc="Hint for how to start editing a text field while exploring the screen using touch exploration." name="IDS_CHROMEVOX_HINT_DOUBLE_TAP_TO_EDIT">
+ Double tap to start editing
+ </message>
</messages>
</release>
</grit>
diff --git a/chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn b/chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn
index 971547a1544..e830c7e2b8a 100644
--- a/chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn
@@ -9,6 +9,7 @@ optimize_webui("build") {
host = "internet_config_dialog"
html_in_files = [ "internet_config_dialog.html" ]
html_out_files = [ "vulcanized.html" ]
+ html_out_files_polymer2 = [ "vulcanized.p2.html" ]
input = rebase_path(".", root_build_dir)
js_out_files = [ "crisper.js" ]
diff --git a/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn b/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn
index 1e2e0b8c698..b171f2055aa 100644
--- a/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn
@@ -9,6 +9,7 @@ optimize_webui("build") {
host = "internet_detail_dialog"
html_in_files = [ "internet_detail_dialog.html" ]
html_out_files = [ "vulcanized.html" ]
+ html_out_files_polymer2 = [ "vulcanized.p2.html" ]
input = rebase_path(".", root_build_dir)
js_out_files = [ "crisper.js" ]
diff --git a/chromium/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn b/chromium/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn
index 85e0b24caad..1000b332bd1 100644
--- a/chromium/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/multidevice_setup/BUILD.gn
@@ -8,7 +8,9 @@ js_type_check("closure_compile") {
deps = [
":button_bar",
":fake_mojo_service",
+ ":mojo_api_behavior",
":multidevice_setup",
+ ":multidevice_setup_browser_proxy",
":multidevice_setup_dialog",
":setup_failed_page",
":setup_succeeded_page",
@@ -18,6 +20,12 @@ js_type_check("closure_compile") {
]
}
+js_library("multidevice_setup_browser_proxy") {
+ deps = [
+ "//ui/webui/resources/js:cr",
+ ]
+}
+
js_library("button_bar") {
}
@@ -25,18 +33,49 @@ js_library("fake_mojo_service") {
deps = [
"//ui/webui/resources/js:cr",
]
+
+ extra_deps = [
+ "//chromeos/services/device_sync/public/mojom:mojom_js",
+ "//chromeos/services/multidevice_setup/public/mojom:mojom_js",
+ "//mojo/public/mojom/base:base_js",
+ ]
+
+ externs_list = [
+ "$root_gen_dir/chromeos/services/device_sync/public/mojom/device_sync.mojom.externs.js",
+ "$root_gen_dir/chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.externs.js",
+ "$root_gen_dir/mojo/public/mojom/base/time.mojom.externs.js",
+ "$externs_path/mojo.js",
+ ]
+}
+
+js_library("mojo_api_behavior") {
}
js_library("multidevice_setup") {
deps = [
":button_bar",
":fake_mojo_service",
+ ":mojo_api_behavior",
+ ":password_page",
":setup_failed_page",
":setup_succeeded_page",
":start_setup_page",
":ui_mode",
"//ui/webui/resources/js:cr",
]
+
+ extra_deps = [
+ "//chromeos/services/device_sync/public/mojom:mojom_js",
+ "//chromeos/services/multidevice_setup/public/mojom:mojom_js",
+ "//mojo/public/mojom/base:base_js",
+ ]
+
+ externs_list = [
+ "$root_gen_dir/chromeos/services/device_sync/public/mojom/device_sync.mojom.externs.js",
+ "$root_gen_dir/chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.externs.js",
+ "$root_gen_dir/mojo/public/mojom/base/time.mojom.externs.js",
+ "$externs_path/mojo.js",
+ ]
}
js_library("multidevice_setup_dialog") {
@@ -47,6 +86,16 @@ js_library("multidevice_setup_dialog") {
]
}
+js_library("password_page") {
+ deps = [
+ ":ui_page_container_behavior",
+ "//ui/webui/resources/cr_elements/cr_input:cr_input",
+ "//ui/webui/resources/js:cr",
+ ]
+ externs_list = [ "$externs_path/quick_unlock_private.js" ]
+ extra_sources = [ "$interfaces_path/quick_unlock_private_interface.js" ]
+}
+
js_library("setup_failed_page") {
deps = [
":ui_page_container_behavior",
diff --git a/chromium/chrome/browser/resources/chromeos/multidevice_setup/multidevice_setup_resources.grd b/chromium/chrome/browser/resources/chromeos/multidevice_setup/multidevice_setup_resources.grd
index 796c78be0b7..13d1b247f3a 100644
--- a/chromium/chrome/browser/resources/chromeos/multidevice_setup/multidevice_setup_resources.grd
+++ b/chromium/chrome/browser/resources/chromeos/multidevice_setup/multidevice_setup_resources.grd
@@ -11,7 +11,19 @@
<output filename="multidevice_setup_resources.pak" type="data_package" />
</outputs>
<release seq="1">
+ <includes>
+ <include name="IDR_MULTIDEVICE_SETUP_START_SETUP_ICON_1X_PNG" file="start_setup_icon_1x.png" type="BINDATA" />
+ <include name="IDR_MULTIDEVICE_SETUP_START_SETUP_ICON_2X_PNG" file="start_setup_icon_2x.png" type="BINDATA" />
+ <include name="IDR_MULTIDEVICE_SETUP_SETUP_SUCCEEDED_ICON_1X_PNG" file="setup_succeeded_icon_1x.png" type="BINDATA" />
+ <include name="IDR_MULTIDEVICE_SETUP_SETUP_SUCCEEDED_ICON_2X_PNG" file="setup_succeeded_icon_2x.png" type="BINDATA" />
+ </includes>
<structures>
+ <structure name="IDR_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_BROWSER_PROXY_HTML"
+ file="multidevice_setup_browser_proxy.html"
+ type="chrome_html" />
+ <structure name="IDR_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_BROWSER_PROXY_JS"
+ file="multidevice_setup_browser_proxy.js"
+ type="chrome_html" />
<structure name="IDR_MULTIDEVICE_SETUP_BUTTON_BAR_HTML"
file="button_bar.html"
type="chrome_html" />
@@ -30,6 +42,12 @@
<structure name="IDR_MULTIDEVICE_SETUP_ICONS_HTML"
file="icons.html"
type="chrome_html" />
+ <structure name="IDR_MULTIDEVICE_SETUP_MOJO_API_BEHAVIOR_HTML"
+ file="mojo_api_behavior.html"
+ type="chrome_html" />
+ <structure name="IDR_MULTIDEVICE_SETUP_MOJO_API_BEHAVIOR_JS"
+ file="mojo_api_behavior.js"
+ type="chrome_html" />
<structure name="IDR_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_DIALOG_HTML"
file="multidevice_setup_dialog.html"
flattenhtml="true"
@@ -47,6 +65,12 @@
<structure name="IDR_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_SHARED_CSS_HTML"
file="multidevice_setup_shared_css.html"
type="chrome_html" />
+ <structure name="IDR_MULTIDEVICE_SETUP_PASSWORD_PAGE_HTML"
+ file="password_page.html"
+ type="chrome_html" />
+ <structure name="IDR_MULTIDEVICE_SETUP_PASSWORD_PAGE_JS"
+ file="password_page.js"
+ type="chrome_html" />
<structure name="IDR_MULTIDEVICE_SETUP_SETUP_FAILED_PAGE_HTML"
file="setup_failed_page.html"
type="chrome_html" />
diff --git a/chromium/chrome/browser/resources/chromeos/network_ui/BUILD.gn b/chromium/chrome/browser/resources/chromeos/network_ui/BUILD.gn
index 11ee6d85d1e..7f938a87a77 100644
--- a/chromium/chrome/browser/resources/chromeos/network_ui/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/network_ui/BUILD.gn
@@ -12,7 +12,7 @@ js_type_check("closure_compile") {
js_library("network_ui") {
deps = [
- "//ui/webui/resources/cr_elements/chromeos/network:cr_network_icon_externs",
+ "//ui/webui/resources/cr_elements/chromeos/network:cr_network_icon",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util",
diff --git a/chromium/chrome/browser/resources/chromeos/select_to_speak/BUILD.gn b/chromium/chrome/browser/resources/chromeos/select_to_speak/BUILD.gn
index ec43146604a..2324b147ed8 100644
--- a/chromium/chrome/browser/resources/chromeos/select_to_speak/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/select_to_speak/BUILD.gn
@@ -40,7 +40,9 @@ run_jsbundler("select_to_speak_copied_files") {
"options.css",
"options.html",
"paragraph_utils.js",
+ "prefs_manager.js",
"rect_utils.js",
+ "select_to_speak-2x.svg",
"select_to_speak.js",
"select_to_speak_gdocs_script.js",
"select_to_speak_main.js",
@@ -146,6 +148,7 @@ test("select_to_speak_extension_tests") {
"//chrome/third_party/mock4js/",
"//third_party/accessibility-audit/axs_testing.js",
"//third_party/chaijs/chai.js",
+ "//ui/webui/resources/js/cr.js",
]
}
@@ -154,13 +157,19 @@ js2gtest("select_to_speak_extjs_tests") {
sources = [
"select_to_speak_keystroke_selection_test.extjs",
"select_to_speak_mouse_selection_test.extjs",
+ "select_to_speak_prefs_test.extjs",
]
gen_include_files = [
"../chromevox/testing/callback_helper.js",
+ "mock_storage.js",
"mock_tts.js",
"select_to_speak_e2e_test_base.js",
"pipe.jpg",
]
+ extra_js_files = [
+ "//chrome/test/data/webui/settings/fake_settings_private.js",
+ "//chrome/test/data/webui/fake_chrome_event.js",
+ ]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
}
@@ -175,6 +184,7 @@ js_type_check("closure_compile") {
":metrics_utils",
":node_utils",
":paragraph_utils",
+ ":prefs_manager",
":rect_utils",
":select_to_speak",
":select_to_speak_options",
@@ -190,6 +200,7 @@ js_library("select_to_speak") {
":metrics_utils",
":node_utils",
":paragraph_utils",
+ ":prefs_manager",
":rect_utils",
":word_utils",
]
@@ -199,13 +210,14 @@ js_library("select_to_speak") {
"$externs_path/chrome_extensions.js",
"$externs_path/clipboard.js",
"$externs_path/command_line_private.js",
- "externs.js",
]
}
js_library("select_to_speak_options") {
+ deps = [
+ ":prefs_manager",
+ ]
externs_list = [
- "externs.js",
"$externs_path/accessibility_private.js",
"$externs_path/automation.js",
"$externs_path/chrome_extensions.js",
@@ -218,25 +230,18 @@ js_library("node_utils") {
":paragraph_utils",
":rect_utils",
]
- externs_list = [
- "externs.js",
- "$externs_path/automation.js",
- ]
+ externs_list = [ "$externs_path/automation.js" ]
}
js_library("word_utils") {
deps = [
":paragraph_utils",
]
- externs_list = [
- "externs.js",
- "$externs_path/automation.js",
- ]
+ externs_list = [ "$externs_path/automation.js" ]
}
js_library("paragraph_utils") {
externs_list = [
- "externs.js",
"$externs_path/accessibility_private.js",
"$externs_path/automation.js",
"$externs_path/chrome_extensions.js",
@@ -252,7 +257,14 @@ js_library("input_handler") {
js_library("rect_utils") {
}
+js_library("prefs_manager") {
+ externs_list = [ "$externs_path/settings_private.js" ]
+}
+
js_library("metrics_utils") {
+ deps = [
+ ":prefs_manager",
+ ]
externs_list = [ "$externs_path/metrics_private.js" ]
}
diff --git a/chromium/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd b/chromium/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd
index f9f539640d4..cc90b3ef0c2 100644
--- a/chromium/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd
+++ b/chromium/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd
@@ -121,26 +121,17 @@
Select-to-speak
</message>
<message desc="The description for Select-to-speak." name="IDS_SELECT_TO_SPEAK_DESCRIPTION">
-
+
</message>
<message desc="The title of the Select-to-speak options page." name="IDS_SELECT_TO_SPEAK_OPTIONS_PAGE_TITLE">
Select-to-speak Settings
- </message>
+ </message>
<message desc="Section of the Select-to-speak options dialog where the user can adjust synthesized speech properties." name="IDS_SELECT_TO_SPEAK_OPTIONS_SPEECH">
Speech
</message>
<message desc="Label for the control in the Select-to-speak options dialog where the user can choose a voice from a list." name="IDS_SELECT_TO_SPEAK_OPTIONS_VOICES_DESCRIPTION">
Select a voice:
</message>
- <message desc="Label for the control in the Select-to-speak options dialog where the user can choose the rate/speed of synthesized speech." name="IDS_SELECT_TO_SPEAK_OPTIONS_RATE_DESCRIPTION">
- Select a speech rate:
- </message>
- <message desc="Label for the slowest synthesized speech rate in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_RATE_SLOWEST">
- Slowest
- </message>
- <message desc="Label for the fastest synthesized speech rate in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_RATE_FASTEST">
- Fastest
- </message>
<message desc="Group of options controlling highlighting." name="IDS_SELECT_TO_SPEAK_OPTIONS_HIGHLIGHT">
Highlighting
</message>
@@ -171,26 +162,14 @@
<message desc="Example of a word highlight on a light background in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_HIGHLIGHT_LIGHT">
Light background
</message>
- <message desc="Label for the control in the Select-to-speak options dialog where the user can choose the pitch of synthesized speech." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_DESCRIPTION">
- Select a speech pitch:
- </message>
- <message desc="Label for the lowest synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_LOWEST">
- Lowest
- </message>
- <message desc="Label forer low synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_LOWER">
- Lower
- </message>
- <message desc="Label for low synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_LOW">
- Low
- </message>
- <message desc="Label for a normal synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_NORMAL">
- Normal
+ <message desc="Link to the Text-to-Speech settings page." name="IDS_SELECT_TO_SPEAK_OPTIONS_TEXT_TO_SPEECH_SETTINGS">
+ Personalize Text-to-Speech settings
</message>
- <message desc="Label for high synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_HIGH">
- High
+ <message desc="Link to the Text-to-Speech settings page." name="IDS_SELECT_TO_SPEAK_OPTIONS_TEXT_TO_SPEECH_SETTINGS_LINK">
+ Text-to-Speech settings
</message>
- <message desc="Label for highest synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_HIGHEST">
- Highest
+ <message desc="Voice name for the system default Text-to-Speech voice" name="IDS_SELECT_TO_SPEAK_SYSTEM_VOICE">
+ System Text-to-Speech voice
</message>
</messages>
</release>
diff --git a/chromium/chrome/browser/resources/chromeos/switch_access/BUILD.gn b/chromium/chrome/browser/resources/chromeos/switch_access/BUILD.gn
index 96141a849ed..edff3b013ab 100644
--- a/chromium/chrome/browser/resources/chromeos/switch_access/BUILD.gn
+++ b/chromium/chrome/browser/resources/chromeos/switch_access/BUILD.gn
@@ -26,9 +26,11 @@ run_jsbundler("switch_access_copied_files") {
mode = "copy"
dest_dir = switch_access_dir
sources = [
+ "../chromevox/cvox2/background/constants.js",
+ "../chromevox/cvox2/background/tree_walker.js",
+ "../select_to_speak/closure_shim.js",
"auto_scan_manager.js",
"automation_manager.js",
- "automation_predicate.js",
"background.js",
"commands.js",
"keyboard_handler.js",
@@ -37,11 +39,13 @@ run_jsbundler("switch_access_copied_files") {
"options.js",
"prefs.js",
"switch_access.js",
- "tree_walker.js",
+ "switch_access_predicate.js",
]
rewrite_rules = [
rebase_path(".", root_build_dir) + ":",
rebase_path(closure_library_dir, root_build_dir) + ":closure",
+ rebase_path("../chromevox/cvox2/background", root_build_dir) + ":",
+ rebase_path("../select_to_speak", root_build_dir) + ":",
]
}
@@ -56,14 +60,12 @@ js2gtest("switch_access_webuijs_tests") {
test_type = "webui"
sources = [
"auto_scan_manager_unittest.gtestjs",
- "automation_predicate_unittest.gtestjs",
- "tree_walker_unittest.gtestjs",
+ "switch_access_predicate_unittest.gtestjs",
]
extra_js_files = [
"auto_scan_manager.js",
- "automation_predicate.js",
+ "switch_access_predicate.js",
"test_support.js",
- "tree_walker.js",
]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
}
@@ -113,16 +115,18 @@ js_type_check("closure_compile") {
deps = [
":auto_scan_manager",
":automation_manager",
- ":automation_predicate",
":background",
":commands",
":keyboard_handler",
":options",
":prefs",
+ ":switch_access_predicate",
+ "../chromevox:constants",
+ "../chromevox:tree_walker",
+ "../select_to_speak:closure_shim",
# ":switch_access",
":switch_access_interface",
- ":tree_walker",
]
}
@@ -134,8 +138,9 @@ js_library("auto_scan_manager") {
js_library("automation_manager") {
deps = [
- ":automation_predicate",
- ":tree_walker",
+ ":switch_access_predicate",
+ "../chromevox:constants",
+ "../chromevox:tree_walker",
]
externs_list = [
"$externs_path/accessibility_private.js",
@@ -143,7 +148,7 @@ js_library("automation_manager") {
]
}
-js_library("automation_predicate") {
+js_library("switch_access_predicate") {
externs_list = [ "$externs_path/automation.js" ]
}
@@ -198,7 +203,3 @@ js_library("switch_access") {
js_library("switch_access_interface") {
}
-
-js_library("tree_walker") {
- externs_list = [ "$externs_path/automation.js" ]
-}
diff --git a/chromium/chrome/browser/resources/component_extension_resources.grd b/chromium/chrome/browser/resources/component_extension_resources.grd
index e904516cd97..23ce86a4ee1 100644
--- a/chromium/chrome/browser/resources/component_extension_resources.grd
+++ b/chromium/chrome/browser/resources/component_extension_resources.grd
@@ -97,7 +97,7 @@
<include name="IDR_PDF_INDEX_HTML" file="pdf/index.html" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PDF_INDEX_CSS" file="pdf/index.css" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PDF_MAIN_JS" file="pdf/main.js" type="BINDATA" />
- <include name="IDR_PDF_PDF_JS" file="pdf/pdf.js" type="BINDATA" />
+ <include name="IDR_PDF_PDF_VIEWER_JS" file="pdf/pdf_viewer.js" type="BINDATA" />
<include name="IDR_PDF_UI_MANAGER_JS" file="pdf/toolbar_manager.js" type="BINDATA" />
<include name="IDR_PDF_PDF_FITTING_TYPE_JS" file="pdf/pdf_fitting_type.js" type="BINDATA" />
<include name="IDR_PDF_VIEWPORT_JS" file="pdf/viewport.js" type="BINDATA" />
diff --git a/chromium/chrome/browser/resources/components.css b/chromium/chrome/browser/resources/components.css
index 70475b77ad8..e0a7ee20231 100644
--- a/chromium/chrome/browser/resources/components.css
+++ b/chromium/chrome/browser/resources/components.css
@@ -13,12 +13,12 @@ a {
}
#header {
- -webkit-padding-start: 0;
background: url(../../../ui/webui/resources/images/extension.svg)
left center / 48px no-repeat;
box-sizing: border-box;
margin-bottom: 1.05em;
overflow: hidden;
+ padding-inline-start: 0;
position: relative;
}
@@ -27,8 +27,8 @@ html[dir=rtl] #header {
}
#header h1 {
- -webkit-padding-start: 51px;
line-height: 48px;
+ padding-inline-start: 51px;
}
h1 {
@@ -53,11 +53,11 @@ h1 {
}
.section-header {
- -webkit-padding-start: 5px;
background: rgb(235, 239, 249);
border-top: 1px solid rgb(181, 199, 222);
font-size: 99%;
padding-bottom: 2px;
+ padding-inline-start: 5px;
padding-top: 3px;
width: 100%;
}
@@ -91,7 +91,7 @@ h1 {
}
#top {
- -webkit-padding-end: 5px;
+ padding-inline-end: 5px;
}
.show-in-tmi-mode {
@@ -139,11 +139,11 @@ body.show-tmi-mode .show-in-tmi-mode {
}
.tmi-mode {
- -webkit-padding-start: 10px;
background: rgb(244, 246, 252);
border-bottom: 1px solid rgb(237, 239, 245);
font-size: 89%;
padding-bottom: 0.8em;
+ padding-inline-start: 10px;
padding-top: 0.8em;
width: 100%;
}
@@ -179,7 +179,7 @@ body.show-tmi-mode .show-in-tmi-mode {
/* Indent the text related to each plug-in. */
.component-text {
- -webkit-padding-start: 5px;
+ padding-inline-start: 5px;
}
.component-name {
@@ -199,7 +199,7 @@ body.show-tmi-mode .show-in-tmi-mode {
}
.plugin-details {
- -webkit-padding-start: 1em;
+ padding-inline-start: 1em;
}
/* Separate the inital line, Description, Location, and MIME Types lines. */
@@ -214,7 +214,7 @@ body.show-tmi-mode .show-in-tmi-mode {
/* Separate columns by 1em for the most part. */
.plugin-details td+td {
- -webkit-padding-start: 1em;
+ padding-inline-start: 1em;
}
/* Make the MIME Types tables smaller. */
@@ -230,18 +230,18 @@ body.show-tmi-mode .show-in-tmi-mode {
/* Separate the columns for tables used for horizontal listings only a bit. */
.hlisting td+td {
- -webkit-padding-start: 0.4em;
+ padding-inline-start: 0.4em;
}
/* Match the indentation of .plugin-text. */
.component-actions {
- -webkit-padding-start: 5px;
margin-bottom: 0.2em;
margin-top: 0.2em;
+ padding-inline-start: 5px;
}
.always-allow {
- -webkit-margin-start: 30px;
+ margin-inline-start: 30px;
}
button {
diff --git a/chromium/chrome/browser/resources/conflicts/about_conflicts.html b/chromium/chrome/browser/resources/conflicts/about_conflicts.html
index 70a1ca722bc..db0ff4d6739 100644
--- a/chromium/chrome/browser/resources/conflicts/about_conflicts.html
+++ b/chromium/chrome/browser/resources/conflicts/about_conflicts.html
@@ -15,12 +15,12 @@ a {
}
#header {
- -webkit-padding-start: 0;
background: url(../../../../ui/webui/resources/images/warning.svg)
left center / 48px no-repeat;
box-sizing: border-box;
margin-bottom: 1.05em;
overflow: hidden;
+ padding-inline-start: 0;
position: relative;
}
@@ -29,8 +29,8 @@ html[dir=rtl] #header {
}
#header h1 {
- -webkit-padding-start: 51px;
line-height: 48px;
+ padding-inline-start: 51px;
}
h1 {
@@ -55,11 +55,11 @@ div.content {
}
.section-header {
- -webkit-padding-start: 5px;
background: rgb(235, 239, 249);
border-top: 1px solid rgb(181, 199, 222);
font-size: 99%;
padding-bottom: 2px;
+ padding-inline-start: 5px;
padding-top: 3px;
width: 100%;
}
@@ -88,7 +88,7 @@ div.content {
}
#top {
- -webkit-padding-end: 5px;
+ padding-inline-end: 5px;
}
.module-loaded > td {
diff --git a/chromium/chrome/browser/resources/device_log_ui/device_log_ui.css b/chromium/chrome/browser/resources/device_log_ui/device_log_ui.css
index e4dc5da42b6..ff0510a1b18 100644
--- a/chromium/chrome/browser/resources/device_log_ui/device_log_ui.css
+++ b/chromium/chrome/browser/resources/device_log_ui/device_log_ui.css
@@ -24,7 +24,7 @@ body {
}
#log-checkbox-container button {
- -webkit-margin-end: 8px;
+ margin-inline-end: 8px;
}
#log-checkbox-container label {
@@ -60,11 +60,11 @@ body {
/* Log Level tags */
.level-tag {
- -webkit-margin-end: 5px;
border: 1px solid;
border-radius: 2px;
float: left;
height: 14px;
+ margin-inline-end: 5px;
margin-top: 2px;
padding: 0 4px 2px 4px;
width: 50px;
@@ -89,12 +89,12 @@ body {
/* Log Type tags */
.type-tag {
- -webkit-margin-end: 5px;
border: 1px solid;
border-radius: 2px;
float: left;
font-weight: bold;
height: 14px;
+ margin-inline-end: 5px;
margin-top: 2px;
padding: 0 4px 2px 4px;
width: 65px;
diff --git a/chromium/chrome/browser/resources/discards/discards.css b/chromium/chrome/browser/resources/discards/discards.css
index 9263f8844a1..efe83795a3a 100644
--- a/chromium/chrome/browser/resources/discards/discards.css
+++ b/chromium/chrome/browser/resources/discards/discards.css
@@ -14,9 +14,9 @@ table th {
}
table th {
- -webkit-padding-end: 16px;
background: rgb(224, 236, 255);
padding-bottom: 4px;
+ padding-inline-end: 16px;
padding-top: 4px;
white-space: nowrap;
}
diff --git a/chromium/chrome/browser/resources/discards/discards.js b/chromium/chrome/browser/resources/discards/discards.js
index aa3fbc12fb3..f6b550322f5 100644
--- a/chromium/chrome/browser/resources/discards/discards.js
+++ b/chromium/chrome/browser/resources/discards/discards.js
@@ -42,6 +42,17 @@ cr.define('discards', function() {
}
/**
+ * Determines if the provided state is related to discarding.
+ * @param {state} The discard state.
+ * @return {boolean} True if the state is related to discarding, false
+ * otherwise.
+ */
+ function isDiscardRelatedState(state) {
+ return state == mojom.LifecycleUnitState.PENDING_DISCARD ||
+ state == mojom.LifecycleUnitState.DISCARDED;
+ }
+
+ /**
* Compares two TabDiscardsInfos based on the data in the provided sort-key.
* @param {string} sortKey The key of the sort. See the "data-sort-key"
* attribute of the table headers for valid sort-keys.
@@ -70,13 +81,23 @@ cr.define('discards', function() {
return val1 ? 1 : -1;
}
+ // Compare lifecycle state. This is actually a compound key.
+ if (sortKey == 'state') {
+ // If the keys are discarding state, then break ties using the discard
+ // reason.
+ if (val1 == val2 && isDiscardRelatedState(val1)) {
+ val1 = a['discardReason'];
+ val2 = b['discardReason'];
+ }
+ return val1 - val2;
+ }
+
// Compares numeric fields.
// NOTE: visibility, loadingState and state are represented as a numeric
// value.
if ([
'visibility',
'loadingState',
- 'state',
'discardCount',
'utilityRank',
'reactivationScore',
@@ -196,14 +217,14 @@ cr.define('discards', function() {
*/
function visibilityToString(visibility) {
switch (visibility) {
- case 0:
+ case mojom.LifecycleUnitVisibility.HIDDEN:
return 'hidden';
- case 1:
+ case mojom.LifecycleUnitVisibility.OCCLUDED:
return 'occluded';
- case 2:
+ case mojom.LifecycleUnitVisibility.VISIBLE:
return 'visible';
}
- assertNotReached('Unsupported visibility: ' + visibility);
+ assertNotReached('Unknown visibility: ' + visibility);
}
/**
@@ -214,34 +235,74 @@ cr.define('discards', function() {
*/
function loadingStateToString(loadingState) {
switch (loadingState) {
- case 0:
+ case mojom.LifecycleUnitLoadingState.UNLOADED:
return 'unloaded';
- case 1:
+ case mojom.LifecycleUnitLoadingState.LOADING:
return 'loading';
- case 2:
+ case mojom.LifecycleUnitLoadingState.LOADED:
return 'loaded';
}
- assertNotReached('Unsupport loadingState: ' + loadingState);
+ assertNotReached('Unknown loadingState: ' + loadingState);
}
- function lifecycleStateToString(state) {
+ /**
+ * Returns a string representation of a discard reason.
+ * @param {mojom.LifecycleUnitDiscardReason} reason The discard reason.
+ * @return {string} A string representation of the discarding reason.
+ */
+ function discardReasonToString(reason) {
+ switch (reason) {
+ case mojom.LifecycleUnitDiscardReason.EXTERNAL:
+ return 'external';
+ case mojom.LifecycleUnitDiscardReason.PROACTIVE:
+ return 'proactive';
+ case mojom.LifecycleUnitDiscardReason.URGENT:
+ return 'urgent';
+ }
+ assertNotReached('Unknown discard reason: ' + reason);
+ }
+
+ /**
+ * Returns a string representation of a lifecycle state.
+ * @param {mojom.LifecycleUnitState} state The lifecycle state.
+ * @param {mojom.LifecycleUnitDiscardReason} reason The discard reason. This
+ * is only used if the state is discard related.
+ * @param {int} visibility A value in LifecycleUnitVisibility.
+ * @param {boolean} hasFocus Whether or not the tab has input focus.
+ * @return {string} A string representation of the lifecycle state, augmented
+ * with the discard reason if appropriate.
+ */
+ function lifecycleStateToString(state, reason, visibility, hasFocus) {
+ let pageLifecycleStateFromVisibilityAndFocus = function() {
+ switch (visibility) {
+ case mojom.LifecycleUnitVisibility.HIDDEN:
+ case mojom.LifecycleUnitVisibility.OCCLUDED:
+ // An occluded page is also considered hidden.
+ return 'hidden';
+ case mojom.LifecycleUnitVisibility.VISIBLE:
+ return hasFocus ? 'active' : 'passive';
+ }
+ assertNotReached('Unknown visibility: ' + visibility);
+ };
+
switch (state) {
case mojom.LifecycleUnitState.ACTIVE:
- return 'active';
+ return pageLifecycleStateFromVisibilityAndFocus();
case mojom.LifecycleUnitState.THROTTLED:
- return 'throttled';
+ return pageLifecycleStateFromVisibilityAndFocus() + ' (throttled)';
case mojom.LifecycleUnitState.PENDING_FREEZE:
- return 'pending frozen';
+ return pageLifecycleStateFromVisibilityAndFocus() + ' (pending frozen)';
case mojom.LifecycleUnitState.FROZEN:
return 'frozen';
case mojom.LifecycleUnitState.PENDING_DISCARD:
- return 'pending discard';
+ return pageLifecycleStateFromVisibilityAndFocus() +
+ ' (pending discard (' + discardReasonToString(reason) + '))';
case mojom.LifecycleUnitState.DISCARDED:
- return 'discarded';
+ return 'discarded (' + discardReasonToString(reason) + ')';
case mojom.LifecycleUnitState.PENDING_UNFREEZE:
- return 'pending unfreeze';
+ return 'frozen (pending unfreeze)';
}
- assertNotReached('Unsupported lifecycle state: ' + state);
+ assertNotReached('Unknown lifecycle state: ' + state);
}
/**
@@ -351,10 +412,12 @@ cr.define('discards', function() {
boolToString(info.canFreeze);
row.querySelector('.can-discard-div').textContent =
boolToString(info.canDiscard);
- // The lifecycle state is meaningless for 'unloaded' tabs.
+ // The lifecycle state is meaningless for tabs that have never been loaded.
row.querySelector('.state-cell').textContent =
- (info.loadingState != mojom.LifecycleUnitLoadingState.UNLOADED) ?
- lifecycleStateToString(info.state) :
+ (info.loadingState != mojom.LifecycleUnitLoadingState.UNLOADED ||
+ info.discardCount > 0) ?
+ lifecycleStateToString(
+ info.state, info.discardReason, info.visibility, info.hasFocus) :
'';
row.querySelector('.discard-count-cell').textContent =
info.discardCount.toString();
@@ -371,9 +434,11 @@ cr.define('discards', function() {
row.querySelector('.is-auto-discardable-link').removeAttribute('disabled');
setActionLinkEnabled(
- row.querySelector('.can-freeze-link'), !info.canFreeze);
+ row.querySelector('.can-freeze-link'),
+ (!info.canFreeze && info.cannotFreezeReasons.length > 0));
setActionLinkEnabled(
- row.querySelector('.can-discard-link'), !info.canDiscard);
+ row.querySelector('.can-discard-link'),
+ (!info.canDiscard && info.cannotDiscardReasons.length > 0));
let loadLink = row.querySelector('.load-link');
let freezeLink = row.querySelector('.freeze-link');
let discardLink = row.querySelector('.discard-link');
@@ -388,7 +453,9 @@ cr.define('discards', function() {
let discardUrgentEnabled = false;
if (info.loadingState == mojom.LifecycleUnitLoadingState.UNLOADED) {
loadEnabled = true;
- } else if (info.visibility == 0) {
+ } else if (
+ info.visibility == mojom.LifecycleUnitVisibility.HIDDEN ||
+ info.visibility == mojom.LifecycleUnitVisibility.OCCLUDED) {
// Only tabs that aren't visible can be frozen or discarded for now.
freezeEnabled = true;
discardEnabled = true;
diff --git a/chromium/chrome/browser/resources/feedback/css/feedback.css b/chromium/chrome/browser/resources/feedback/css/feedback.css
index 336d30ccc5b..f14cab2376b 100644
--- a/chromium/chrome/browser/resources/feedback/css/feedback.css
+++ b/chromium/chrome/browser/resources/feedback/css/feedback.css
@@ -35,7 +35,7 @@ body {
.title-bar #page-title {
-webkit-flex: 1 1 auto;
- -webkit-margin-start: 20px;
+ margin-inline-start: 20px;
}
.title-bar .button-bar {
@@ -60,15 +60,15 @@ body {
}
.content #additional-info-label {
- -webkit-margin-start: 10px;
+ margin-inline-start: 10px;
}
.content .text-field-container {
-webkit-align-items: center;
- -webkit-padding-start: 10px;
display: -webkit-flex;
height: 29px;
margin-top: 10px;
+ padding-inline-start: 10px;
}
.content .text-field-container > label {
@@ -77,20 +77,20 @@ body {
}
.content .text-field-container > select {
- -webkit-padding-start: 5px;
border: 1px solid #c8c8c8;
color: #585858;
flex: 1 1 auto;
height: 100%;
+ padding-inline-start: 5px;
}
.content .text-field-container > input[type=text] {
-webkit-flex: 1 1 auto;
- -webkit-padding-start: 5px;
border: 1px solid;
border-color: #c8c8c8;
color: #585858;
height: 100%;
+ padding-inline-start: 5px;
}
.content .text-field-container > input[type=checkbox] {
@@ -108,16 +108,16 @@ body {
}
.content #screenshot-image {
- -webkit-margin-end: 25px;
display: block;
height: 60px;
+ margin-inline-end: 25px;
margin-top: 40px;
transition: all 250ms ease;
}
.content #screenshot-image:hover {
- -webkit-margin-end: 0;
height: 125px;
+ margin-inline-end: 0;
margin-top: 80px;
z-index: 1;
}
@@ -160,7 +160,6 @@ body {
}
.content .remove-file-button {
- -webkit-margin-start: 5px;
background-color: transparent;
background-image: -webkit-image-set(
url(chrome://resources/images/apps/button_butter_bar_close.png) 1x,
@@ -169,6 +168,7 @@ body {
background-repeat: no-repeat;
border: none;
height: 16px;
+ margin-inline-start: 5px;
pointer-events: auto;
width: 16px;
}
@@ -186,8 +186,8 @@ body {
}
.content #attach-file-note {
- -webkit-margin-start: 112px;
margin-bottom: 10px;
+ margin-inline-start: 112px;
margin-top: 10px;
}
@@ -197,8 +197,8 @@ body {
}
button.white-button {
- -webkit-margin-end: 10px;
color: #000;
+ margin-inline-end: 10px;
}
button.blue-button {
@@ -207,11 +207,11 @@ button.blue-button {
}
.srt-image {
- -webkit-margin-end: auto;
- -webkit-margin-start: 40px;
display: block;
height: 50px;
margin-bottom: 20px;
+ margin-inline-end: auto;
+ margin-inline-start: 40px;
margin-top: 120px;
}
diff --git a/chromium/chrome/browser/resources/feedback/js/feedback.js b/chromium/chrome/browser/resources/feedback/js/feedback.js
index 9f61d4a9c6c..e0bfd6ce903 100644
--- a/chromium/chrome/browser/resources/feedback/js/feedback.js
+++ b/chromium/chrome/browser/resources/feedback/js/feedback.js
@@ -100,6 +100,20 @@ const cantConnectRegEx = new RegExp(
'i');
/**
+ * Regular expression to check for "tether" or "tethering". Case insensitive
+ * matching.
+ * @type {RegExp}
+ */
+const tetherRegEx = new RegExp('tether(ing)?', 'i');
+
+/**
+ * Regular expression to check for "Smart (Un)lock" or "Easy (Un)lock" with or
+ * without space between the words. Case insensitive matching.
+ * @type {RegExp}
+ */
+const smartLockRegEx = new RegExp('(smart|easy)[ ]?(un)?lock', 'i');
+
+/**
* The callback used by the sys_info_page to receive the event that the system
* information is ready.
* @type {function(sysInfo)}
@@ -187,7 +201,9 @@ function openSlowTraceWindow() {
*/
function checkForBluetoothKeywords(inputEvent) {
var isRelatedToBluetooth = btRegEx.test(inputEvent.target.value) ||
- cantConnectRegEx.test(inputEvent.target.value);
+ cantConnectRegEx.test(inputEvent.target.value) ||
+ tetherRegEx.test(inputEvent.target.value) ||
+ smartLockRegEx.test(inputEvent.target.value);
$('bluetooth-checkbox-container').hidden = !isRelatedToBluetooth;
}
diff --git a/chromium/chrome/browser/resources/hangout_services/manifest.json b/chromium/chrome/browser/resources/hangout_services/manifest.json
index 712e83a89b4..9a8ec04ea3a 100644
--- a/chromium/chrome/browser/resources/hangout_services/manifest.json
+++ b/chromium/chrome/browser/resources/hangout_services/manifest.json
@@ -5,7 +5,7 @@
"name": "Google Hangouts",
// Note: Always update the version number when this file is updated. Chrome
// triggers extension preferences update on the version increase.
- "version": "1.3.8",
+ "version": "1.3.10",
"manifest_version": 2,
"externally_connectable": {
"matches": [
@@ -21,6 +21,7 @@
"incognito": "split",
"permissions": [
"desktopCapture",
+ "enterprise.hardwarePlatform",
"processes",
"system.cpu",
"webrtcAudioPrivate",
diff --git a/chromium/chrome/browser/resources/hangout_services/thunk.js b/chromium/chrome/browser/resources/hangout_services/thunk.js
index 645a7eb64e3..55d3e530274 100644
--- a/chromium/chrome/browser/resources/hangout_services/thunk.js
+++ b/chromium/chrome/browser/resources/hangout_services/thunk.js
@@ -182,8 +182,9 @@ chrome.runtime.onMessageExternal.addListener(function(
} else if (method == 'logging.startEventLogging') {
var peerConnectionId = message['peerConnectionId'] || '';
var maxLogSizeBytes = message['maxLogSizeBytes'] || 0;
+ var webAppId = message['webAppId'] || 0;
chrome.webrtcLoggingPrivate.startEventLogging(
- requestInfo, origin, peerConnectionId, maxLogSizeBytes,
+ requestInfo, origin, peerConnectionId, maxLogSizeBytes, webAppId,
doSendResponse);
return true;
} else if (method == 'setAudioExperiments') {
@@ -191,6 +192,10 @@ chrome.runtime.onMessageExternal.addListener(function(
chrome.webrtcAudioPrivate.setAudioExperiments(
requestInfo, origin, experiments, doSendResponse);
return true;
+ } else if (method == 'getHardwarePlatformInfo') {
+ chrome.enterprise.hardwarePlatform.getHardwarePlatformInfo(
+ doSendResponse);
+ return true;
}
throw new Error('Unknown method: ' + method);
diff --git a/chromium/chrome/browser/resources/inline_login/inline_login.html b/chromium/chrome/browser/resources/inline_login/inline_login.html
index e7c5f0b7e51..1354e2afd60 100644
--- a/chromium/chrome/browser/resources/inline_login/inline_login.html
+++ b/chromium/chrome/browser/resources/inline_login/inline_login.html
@@ -3,10 +3,10 @@
<head>
<title>$i18n{title}</title>
<link rel="import" href="chrome://resources/html/polymer.html">
+ <link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
- <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
- <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://resources/css/spinner.css">
+ <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://chrome-signin/inline_login.css">
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
@@ -24,7 +24,7 @@
</div>
</div>
<paper-icon-button id="navigation-button"
- icon="icons:close"></paper-icon-button>
+ icon="cr:close"></paper-icon-button>
<script src="chrome://resources/js/i18n_template.js"></script>
</body>
</html>
diff --git a/chromium/chrome/browser/resources/inline_login/inline_login.js b/chromium/chrome/browser/resources/inline_login/inline_login.js
index a29c409ddf7..76af8b57c18 100644
--- a/chromium/chrome/browser/resources/inline_login/inline_login.js
+++ b/chromium/chrome/browser/resources/inline_login/inline_login.js
@@ -117,7 +117,7 @@ cr.define('inline.login', function() {
function showBackButton() {
$('navigation-button').icon =
- isRTL() ? 'icons:arrow-forward' : 'icons:arrow-back';
+ isRTL() ? 'cr:arrow-forward' : 'cr:arrow-back';
$('navigation-button')
.setAttribute(
@@ -125,7 +125,7 @@ cr.define('inline.login', function() {
}
function showCloseButton() {
- $('navigation-button').icon = 'icons:close';
+ $('navigation-button').icon = 'cr:close';
$('navigation-button').classList.add('enabled');
$('navigation-button')
.setAttribute(
diff --git a/chromium/chrome/browser/resources/inspect/inspect.css b/chromium/chrome/browser/resources/inspect/inspect.css
index eefce85827b..64084cd0f18 100644
--- a/chromium/chrome/browser/resources/inspect/inspect.css
+++ b/chromium/chrome/browser/resources/inspect/inspect.css
@@ -71,12 +71,12 @@ img {
}
.tab-header {
- -webkit-border-start: 6px solid transparent;
+ border-inline-start: 6px solid transparent;
padding-left: 15px;
}
.tab-header.selected {
- -webkit-border-start-color: rgb(78, 87, 100);
+ border-inline-start-color: rgb(78, 87, 100);
}
.tab-header > button {
diff --git a/chromium/chrome/browser/resources/interventions_internals/OWNERS b/chromium/chrome/browser/resources/interventions_internals/OWNERS
index 0957d79411d..fd70f95f7d4 100644
--- a/chromium/chrome/browser/resources/interventions_internals/OWNERS
+++ b/chromium/chrome/browser/resources/interventions_internals/OWNERS
@@ -1,3 +1,3 @@
file://components/previews/OWNERS
-# COMPONENT: UI>Browser>Previews
+# COMPONENT: Blink>Previews
diff --git a/chromium/chrome/browser/resources/local_discovery/local_discovery.css b/chromium/chrome/browser/resources/local_discovery/local_discovery.css
index e485382669b..bae41d1fd09 100644
--- a/chromium/chrome/browser/resources/local_discovery/local_discovery.css
+++ b/chromium/chrome/browser/resources/local_discovery/local_discovery.css
@@ -11,7 +11,7 @@ h1 {
}
h2 {
- margin: 23px 0 0 0;
+ margin: 23px 0 0 0;
}
header {
@@ -27,12 +27,12 @@ header {
}
html[dir='rtl'] .device {
- background-position: right top;
+ background-position: right top;
}
.device .device-info {
- -webkit-padding-start: 40px;
float: left;
+ padding-inline-start: 40px;
}
.printer {
@@ -85,7 +85,7 @@ html[dir='rtl'] .controls {
}
.controls .subline {
- -webkit-margin-start: 10px;
+ margin-inline-start: 10px;
}
.login-promo {
@@ -94,7 +94,7 @@ html[dir='rtl'] .controls {
}
.inline-login-promo {
- display: inline;
+ display: inline;
}
.inline-spinner {
@@ -111,7 +111,7 @@ section {
}
.dialog-contents {
- padding-left: 17px;
+ padding-left: 17px;
}
#back-link {
diff --git a/chromium/chrome/browser/resources/local_ntp/OWNERS b/chromium/chrome/browser/resources/local_ntp/OWNERS
index 9c2e2d6a1f3..d03792ddfbf 100644
--- a/chromium/chrome/browser/resources/local_ntp/OWNERS
+++ b/chromium/chrome/browser/resources/local_ntp/OWNERS
@@ -1,7 +1,6 @@
-jeremycho@chromium.org
mathp@chromium.org
fserb@chromium.org
-huangs@chromium.org
+kristipark@chromium.org
treib@chromium.org
# TEAM: ntp-dev@chromium.org
diff --git a/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.css b/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.css
index 2ade069b693..2a4a2e322fe 100644
--- a/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.css
+++ b/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.css
@@ -32,11 +32,11 @@ html[dir=rtl] #edit-bg {
}
#edit-bg:hover {
- background-color: rgb(241, 243, 244);
+ background-color: rgba(32, 33, 36, .1);
}
-.non-white-bg #edit-bg:hover {
- background-color: rgba(255, 255, 255, .1);
+#edit-bg:active {
+ background-color: rgba(32, 33, 36, .16);
}
.using-mouse-nav .bg-option:focus {
@@ -68,9 +68,13 @@ html[dir=rtl] #edit-bg {
bottom: 44px;
box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
left: auto;
- padding: 0 0 16px 0;
+ padding: 0;
position: fixed;
right: 16px;
+}
+
+#edit-bg-menu {
+ padding: 0 0 16px 0;
width: 325px;
}
@@ -122,6 +126,10 @@ html[dir=rtl] .bg-option-img {
opacity: 0.28;
}
+.bg-option.bg-option-disabled:focus {
+ outline: none;
+}
+
.bg-option.bg-option-disabled:hover {
background-color: transparent;
}
@@ -204,12 +212,19 @@ html[dir=rtl] .bg-option-text {
}
@media (max-width: 356px) {
- #bg-sel-menu,
- #edit-bg-dialog {
+ #bg-sel-menu {
width: 188px;
}
}
+/* The width is decided by the longest text length plus 16px margin on the
+right, so that every text can stay on its row even on the smallest window */
+@media (max-width: 356px) {
+ #edit-bg-menu {
+ width: 232px;
+ }
+}
+
#bg-sel-tiles {
height: 284px;
overflow-y: scroll;
@@ -240,6 +255,7 @@ html[dir=rtl] #bg-sel-tiles {
height: 51px;
line-height: 52px;
text-align: center;
+ user-select: none;
}
#bg-sel-back {
@@ -330,28 +346,37 @@ html[dir=rtl] .is-img-sel #bg-sel-title {
height: 64px;
padding-left: 0;
position: absolute;
+ user-select: none;
width: 100%;
}
.bg-sel-footer-button {
+ border: none;
border-radius: 4px;
bottom: 16px;
font-family: 'Roboto', arial, sans-serif;
- font-size: 13px;
+ font-size: 12px;
font-weight: 500;
+ height: 32px;
line-height: normal;
+ min-width: 60px;
+ padding: 0 16px;
position: absolute;
text-align: center;
+ transition-duration: 200ms;
+ transition-property: background-color, color, box-shadow, border;
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
vertical-align: middle;
}
+.bg-sel-footer-button:disabled {
+ transition: none;
+}
+
#bg-sel-footer-done {
background-color: rgb(241, 243, 244);
color: rgb(128, 134, 139);
- height: 24px;
- padding-top: 9px;
right: 16px;
- width: 62px;
}
html[dir=rtl] #bg-sel-footer-done {
@@ -360,14 +385,11 @@ html[dir=rtl] #bg-sel-footer-done {
}
#bg-sel-footer-cancel {
- background-color: #fff;
+ background-color: white;
border: 1px solid rgb(218, 220, 224);
color: rgb(26, 115, 232);
- height: 23px;
margin-right: 8px;
- padding-top: 8px;
right: 78px;
- width: 66px;
}
html[dir=rtl] #bg-sel-footer-cancel {
@@ -377,23 +399,31 @@ html[dir=rtl] #bg-sel-footer-cancel {
}
#bg-sel-footer-cancel:hover {
- background-color: rgb(154, 160, 166, 0.04);
+ background-color: rgba(66, 133, 244, 0.04);
+ border-color: rgb(210, 227, 252);
}
#bg-sel-footer-cancel:active {
- background-color: #fff;
- box-shadow: 0 1px 1px 0 rgba(60, 64, 67, 0.3), 0 1px 1px 1px rgba(60, 64, 67, 0.15);
- outline: none;
+ background-color: white;
+ border-color: white;
+ box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3),
+ 0 3px 6px 2px rgba(60, 64, 67, 0.15);
}
#bg-sel-footer-done.done-available:active {
- box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
- outline: none;
+ box-shadow: 0 1px 2px 0 rgba(66, 133, 244, 0.3),
+ 0 3px 6px 2px rgba(66, 133, 244, 0.15);
+}
+
+#bg-sel-footer-done.done-available:hover {
+ background-color: rgb(41, 123, 231);
+ box-shadow: 0 1px 2px 0 rgba(66, 133, 244, 0.3),
+ 0 1px 3px 1px rgba(66, 133, 244, 0.15);
}
#bg-sel-footer-done.done-available {
background-color: rgb(26, 115, 232);
- color: #FFF;
+ color: white;
}
#bg-sel-footer-toggle-text {
@@ -401,7 +431,19 @@ html[dir=rtl] #bg-sel-footer-cancel {
}
.bg-sel-tile {
- background-color: rgba(32, 33, 36, .06);
+ background-size: cover;
+ height: 100%;
+ opacity: 0;
+ transition: opacity 700ms;
+ width: 100%;
+}
+
+html[dir=rtl] .bg-sel-tile-bg {
+ margin: 6px 8px 0 0;
+}
+
+.bg-sel-tile-bg {
+ background-color: rgb(241, 243, 244);
background-size: cover;
display: inline-block;
height: 117px;
@@ -410,10 +452,6 @@ html[dir=rtl] #bg-sel-footer-cancel {
width: 156px;
}
-html[dir=rtl] .bg-sel-tile {
- margin: 6px 8px 0 0;
-}
-
.bg-selected {
border-radius: 4px;
}
@@ -467,6 +505,7 @@ html[dir=rtl] .selected-check {
padding: 8px 16px 0 16px;
position: absolute;
text-overflow: ellipsis;
+ user-select: none;
vertical-align: middle;
white-space: nowrap;
width: 124px;
diff --git a/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.js b/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.js
index 2c37b6a71df..b258fffe112 100644
--- a/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.js
+++ b/chromium/chrome/browser/resources/local_ntp/custom_backgrounds.js
@@ -81,6 +81,7 @@ customBackgrounds.IDS = {
EDIT_BG_DIALOG: 'edit-bg-dialog',
EDIT_BG_DIVIDER: 'edit-bg-divider',
EDIT_BG_GEAR: 'edit-bg-gear',
+ EDIT_BG_MENU: 'edit-bg-menu',
MSG_BOX: 'message-box',
MSG_BOX_MSG: 'message-box-message',
MSG_BOX_LINK: 'message-box-link',
@@ -110,12 +111,14 @@ customBackgrounds.CLASSES = {
COLLECTION_DIALOG: 'is-col-sel',
COLLECTION_SELECTED: 'bg-selected', // Highlight selected tile
COLLECTION_TILE: 'bg-sel-tile', // Preview tile for background customization
+ COLLECTION_TILE_BG: 'bg-sel-tile-bg',
COLLECTION_TITLE: 'bg-sel-tile-title', // Title of a background image
DONE_AVAILABLE: 'done-available',
FLOAT_UP: 'float-up',
HAS_LINK: 'has-link',
HIDE_MSG_BOX: 'message-box-hide',
IMAGE_DIALOG: 'is-img-sel',
+ OPTION: 'bg-option',
OPTION_DISABLED: 'bg-option-disabled', // The menu option is disabled.
PLUS_ICON: 'plus-icon',
MOUSE_NAV: 'using-mouse-nav',
@@ -144,8 +147,8 @@ customBackgrounds.SOURCES = {
customBackgrounds.MENU_ENTRIES = {
CHROME_BACKGROUNDS: 0,
UPLOAD_IMAGE: 1,
- RESTORE_DEFAULT: 2,
- CUSTOM_LINKS_RESTORE_DEFAULT: 3,
+ CUSTOM_LINKS_RESTORE_DEFAULT: 2,
+ RESTORE_DEFAULT: 3,
};
customBackgrounds.CUSTOM_BACKGROUND_OVERLAY =
@@ -167,6 +170,13 @@ customBackgrounds.selectedTile = null;
*/
customBackgrounds.dialogCollectionsSource = customBackgrounds.SOURCES.NONE;
+/*
+ * Called when the error notification should be shown.
+ * @type {?Function}
+ * @private
+ */
+customBackgrounds.showErrorNotification;
+
/**
* Alias for document.getElementById.
* @param {string} id The ID of the element to find.
@@ -302,10 +312,11 @@ customBackgrounds.setBackground = function(
* Create a tile for a Chrome Backgrounds collection.
*/
customBackgrounds.createChromeBackgroundTile = function(data) {
- var tile = document.createElement('div');
+ let tile = document.createElement('div');
tile.style.backgroundImage = 'url(' + data.previewImageUrl + ')';
tile.dataset.id = data.collectionId;
tile.dataset.name = data.collectionName;
+ fadeInImageTile(tile, data.previewImageUrl);
return tile;
};
@@ -313,11 +324,12 @@ customBackgrounds.createChromeBackgroundTile = function(data) {
* Create a tile for a Google Photos album.
*/
customBackgrounds.createAlbumTile = function(data) {
- var tile = document.createElement('div');
+ let tile = document.createElement('div');
tile.style.backgroundImage = 'url(' + data.previewImageUrl + ')';
tile.dataset.id = data.albumId;
tile.dataset.name = data.albumName;
tile.dataset.photoContainerId = data.photoContainerId;
+ fadeInImageTile(tile, data.previewImageUrl);
return tile;
};
@@ -409,6 +421,9 @@ customBackgrounds.showCollectionSelectionDialog = function(collectionsSource) {
// Create dialog tiles.
for (var i = 0; i < collData.length; ++i) {
+ let tileBackground = document.createElement('div');
+ tileBackground.classList.add(
+ customBackgrounds.CLASSES.COLLECTION_TILE_BG);
var tile = null;
if (sourceIsChromeBackgrounds) {
tile = customBackgrounds.createChromeBackgroundTile(collData[i]);
@@ -419,6 +434,8 @@ customBackgrounds.showCollectionSelectionDialog = function(collectionsSource) {
tile.id = 'coll_tile_' + i;
tile.dataset.tile_num = i;
tile.tabIndex = -1;
+ // Accessibility support for screen readers.
+ tile.setAttribute('role', 'button');
var title = document.createElement('div');
title.classList.add(customBackgrounds.CLASSES.COLLECTION_TITLE);
@@ -464,47 +481,69 @@ customBackgrounds.showCollectionSelectionDialog = function(collectionsSource) {
photos[0].photoContainerId == tile.dataset.photoContainerId);
}
- // Dependent upon the succces of the load, populate the image selection
+ // Dependent upon the success of the load, populate the image selection
// dialog or close the current dialog.
- customBackgrounds.resetSelectionDialog();
if (imageDataLoaded) {
+ customBackgrounds.resetSelectionDialog();
customBackgrounds.showImageSelectionDialog(tile.dataset.name);
} else {
- let source = customBackgrounds.dialogCollectionsSource;
- customBackgrounds.closeCollectionDialog(menu);
-
- let errors = source ? coll_img_errors : photos_errors;
+ let errors =
+ (collectionsSource ==
+ customBackgrounds.SOURCES.CHROME_BACKGROUNDS ?
+ coll_img_errors :
+ photos_errors);
+ // If an auth error occurs leave the dialog open and redirect the
+ // user to sign-in again. Then they can return to the same place in
+ // the customization flow.
+ if (!errors.auth_error) {
+ customBackgrounds.closeCollectionDialog(menu);
+ }
customBackgrounds.handleError(errors);
}
};
};
tile.onclick = tileInteraction;
- tile.onkeyup = function(event) {
- event.preventDefault();
- event.stopPropagation();
+ tile.onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.ENTER) {
+ event.preventDefault();
+ event.stopPropagation();
tileInteraction(event);
}
-
- var target = null;
- if (event.keyCode == customBackgrounds.KEYCODES.LEFT) {
- target = customBackgrounds.getNextTile(-1, 0, this.dataset.tile_num);
- } else if (event.keyCode == customBackgrounds.KEYCODES.UP) {
- target = customBackgrounds.getNextTile(0, -1, this.dataset.tile_num);
- } else if (event.keyCode == customBackgrounds.KEYCODES.RIGHT) {
- target = customBackgrounds.getNextTile(1, 0, this.dataset.tile_num);
- } else if (event.keyCode == customBackgrounds.KEYCODES.DOWN) {
- target = customBackgrounds.getNextTile(0, 1, this.dataset.tile_num);
- }
- if (target) {
- target.focus();
+ // Handle arrow key navigation.
+ else if (
+ event.keyCode === customBackgrounds.KEYCODES.LEFT ||
+ event.keyCode === customBackgrounds.KEYCODES.UP ||
+ event.keyCode === customBackgrounds.KEYCODES.RIGHT ||
+ event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ let target = null;
+ if (event.keyCode === customBackgrounds.KEYCODES.LEFT) {
+ target = customBackgrounds.getNextTile(
+ document.documentElement.classList.contains('rtl') ? 1 : -1, 0,
+ this.dataset.tile_num);
+ } else if (event.keyCode === customBackgrounds.KEYCODES.UP) {
+ target = customBackgrounds.getNextTile(0, -1, this.dataset.tile_num);
+ } else if (event.keyCode === customBackgrounds.KEYCODES.RIGHT) {
+ target = customBackgrounds.getNextTile(
+ document.documentElement.classList.contains('rtl') ? -1 : 1, 0,
+ this.dataset.tile_num);
+ } else if (event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ target = customBackgrounds.getNextTile(0, 1, this.dataset.tile_num);
+ }
+ if (target)
+ target.focus();
+ else
+ this.focus();
}
};
tile.appendChild(title);
- tileContainer.appendChild(tile);
+ tileBackground.appendChild(tile);
+ tileContainer.appendChild(tileBackground);
}
$(customBackgrounds.IDS.TILES).focus();
@@ -567,8 +606,13 @@ customBackgrounds.showImageSelectionDialog = function(dialogTitle) {
}
for (var i = 0; i < imageData.length; ++i) {
+ let tileBackground = document.createElement('div');
+ tileBackground.classList.add(
+ customBackgrounds.CLASSES.COLLECTION_TILE_BG);
var tile = document.createElement('div');
tile.classList.add(customBackgrounds.CLASSES.COLLECTION_TILE);
+ // Accessibility support for screen readers.
+ tile.setAttribute('role', 'button');
// Set the background image, the name of the source variable differs
// depending on if it's coming from Chrome Backgrounds or Google Photos.
@@ -581,21 +625,25 @@ customBackgrounds.showImageSelectionDialog = function(dialogTitle) {
'url(' + imageData[i].thumbnailImageUrl + ')'
].join(',').trim();
tile.style.backgroundImage = imageWithOverlay;
+ tile.dataset.attributionLine1 = '';
+ tile.dataset.attributionLine2 = '';
+ tile.dataset.attributionActionUrl = '';
} else {
tile.style.backgroundImage =
'url(' + imageData[i].thumbnailImageUrl + ')';
- }
- tile.dataset.url = imageData[i].imageUrl;
- tile.dataset.attributionLine1 =
+ tile.dataset.attributionLine1 =
(imageData[i].attributions[0] != undefined ?
imageData[i].attributions[0] :
'');
- tile.dataset.attributionLine2 =
+ tile.dataset.attributionLine2 =
(imageData[i].attributions[1] != undefined ?
imageData[i].attributions[1] :
'');
- tile.dataset.attributionActionUrl = imageData[i].attributionActionUrl;
+ tile.dataset.attributionActionUrl = imageData[i].attributionActionUrl;
+ }
tile.setAttribute('aria-label', imageData[i].attributions[0]);
+ tile.dataset.url = imageData[i].imageUrl;
+ fadeInImageTile(tile, imageData[i].thumbnailImageUrl);
} else {
tile.style.backgroundImage =
'url(' + imageData[i].thumbnailPhotoUrl + ')';
@@ -604,6 +652,7 @@ customBackgrounds.showImageSelectionDialog = function(dialogTitle) {
tile.dataset.attributionLine2 = '';
tile.dataset.attributionActionUrl = '';
tile.setAttribute('aria-label', configData.translatedStrings.photoLabel);
+ fadeInImageTile(tile, imageData[i].thumbnailPhotoUrl);
}
tile.id = 'img_tile_' + i;
@@ -631,48 +680,68 @@ customBackgrounds.showImageSelectionDialog = function(dialogTitle) {
tile.onclick = function(event) {
let clickCount = event.detail;
- if (clickCount == 1) {
+ // Control + option + space will fire the onclick event with 0 clickCount.
+ if (clickCount <= 1) {
tileInteraction(event);
- } else if (clickCount == 2) {
- customBackgrounds.setBackground(
- this.dataset.url, this.dataset.attributionLine1,
- this.dataset.attributionLine2, this.dataset.attributionActionUrl);
+ } else if (clickCount == 2 && customBackgrounds.selectedTile == this) {
+ customBackgrounds.setBackground(this.dataset.url,
+ this.dataset.attributionLine1, this.dataset.attributionLine2,
+ this.dataset.attributionActionUrl);
}
};
- tile.onkeyup = function(event) {
- event.preventDefault();
- event.stopPropagation();
+ tile.onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.ENTER) {
+ event.preventDefault();
+ event.stopPropagation();
tileInteraction(event);
}
-
- var target = null;
- if (event.keyCode == customBackgrounds.KEYCODES.LEFT) {
- target = customBackgrounds.getNextTile(-1, 0, this.dataset.tile_num);
- } else if (event.keyCode == customBackgrounds.KEYCODES.UP) {
- target = customBackgrounds.getNextTile(0, -1, this.dataset.tile_num);
- } else if (event.keyCode == customBackgrounds.KEYCODES.RIGHT) {
- target = customBackgrounds.getNextTile(1, 0, this.dataset.tile_num);
- } else if (event.keyCode == customBackgrounds.KEYCODES.DOWN) {
- target = customBackgrounds.getNextTile(0, 1, this.dataset.tile_num);
- }
- if (target) {
- target.focus();
+ // Handle arrow key navigation.
+ else if (
+ event.keyCode === customBackgrounds.KEYCODES.LEFT ||
+ event.keyCode === customBackgrounds.KEYCODES.UP ||
+ event.keyCode === customBackgrounds.KEYCODES.RIGHT ||
+ event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
+ event.stopPropagation();
+
+ let target = null;
+ if (event.keyCode == customBackgrounds.KEYCODES.LEFT) {
+ target = customBackgrounds.getNextTile(-1, 0, this.dataset.tile_num);
+ } else if (event.keyCode == customBackgrounds.KEYCODES.UP) {
+ target = customBackgrounds.getNextTile(0, -1, this.dataset.tile_num);
+ } else if (event.keyCode == customBackgrounds.KEYCODES.RIGHT) {
+ target = customBackgrounds.getNextTile(1, 0, this.dataset.tile_num);
+ } else if (event.keyCode == customBackgrounds.KEYCODES.DOWN) {
+ target = customBackgrounds.getNextTile(0, 1, this.dataset.tile_num);
+ }
+ if (target)
+ target.focus();
+ else
+ this.focus();
}
};
- tileContainer.appendChild(tile);
+ tileBackground.appendChild(tile);
+ tileContainer.appendChild(tileBackground);
}
$(customBackgrounds.IDS.TILES).focus();
};
+let fadeInImageTile = (tile, imageUrl) => {
+ let image = new Image();
+ image.onload = () => {
+ tile.style.opacity = '1';
+ };
+ image.src = imageUrl;
+};
+
/**
* Load the NTPBackgroundCollections script. It'll create a global
* variable name "coll" which is a dict of background collections data.
* @private
*/
-customBackgrounds.loadCollections = function() {
+customBackgrounds.loadChromeBackgrounds = function() {
var collElement = $('ntp-collection-loader');
if (collElement) {
collElement.parentNode.removeChild(collElement);
@@ -682,7 +751,14 @@ customBackgrounds.loadCollections = function() {
collScript.src = 'chrome-search://local-ntp/ntp-background-collections.js?' +
'collection_type=background';
document.body.appendChild(collScript);
+};
+/**
+ * Load the NTPGooglePhotoAlbums script. It'll create a global
+ * variable name "albums" which is a dict of album data.
+ * @private
+ */
+customBackgrounds.loadGooglePhotosAlbums = function() {
var albumElement = $('ntp-album-loader');
if (albumElement) {
albumElement.parentNode.removeChild(albumElement);
@@ -711,8 +787,8 @@ customBackgrounds.getNextOption = function(current_index, deltaY) {
var entries = [];
entries.push($(customBackgrounds.IDS.DEFAULT_WALLPAPERS));
entries.push($(customBackgrounds.IDS.UPLOAD_IMAGE));
- entries.push($(customBackgrounds.IDS.RESTORE_DEFAULT));
entries.push($(customBackgrounds.IDS.CUSTOM_LINKS_RESTORE_DEFAULT));
+ entries.push($(customBackgrounds.IDS.RESTORE_DEFAULT));
var idx = current_index;
do {
@@ -721,9 +797,9 @@ customBackgrounds.getNextOption = function(current_index, deltaY) {
idx = 3;
if (idx === 4)
idx = 0;
- } while (entries[idx].hidden ||
+ } while (idx !== current_index && (entries[idx].hidden ||
entries[idx].classList.contains(
- customBackgrounds.CLASSES.OPTION_DISABLED));
+ customBackgrounds.CLASSES.OPTION_DISABLED)));
return entries[idx];
};
@@ -737,8 +813,10 @@ customBackgrounds.networkStateChanged = function(online) {
/**
* Initialize the settings menu, custom backgrounds dialogs, and custom links
* menu items. Set the text and event handlers for the various elements.
+ * @param {?Function} showErrorNotification Called when the error notification
+ * should be displayed
*/
-customBackgrounds.init = function() {
+customBackgrounds.init = function(showErrorNotification) {
ntpApiHandle = window.chrome.embeddedSearch.newTabPage;
let editDialog = $(customBackgrounds.IDS.EDIT_BG_DIALOG);
let menu = $(customBackgrounds.IDS.MENU);
@@ -752,28 +830,35 @@ customBackgrounds.init = function() {
// Edit gear icon interaction events.
let editBackgroundInteraction = function() {
- customBackgrounds.loadCollections();
editDialog.showModal();
};
$(customBackgrounds.IDS.EDIT_BG).onclick = function(event) {
editDialog.classList.add(customBackgrounds.CLASSES.MOUSE_NAV);
editBackgroundInteraction();
};
- $(customBackgrounds.IDS.EDIT_BG).onkeyup = function(event) {
+
+ // Find the first menu option that is not hidden or disabled.
+ let findFirstMenuOption = () => {
+ let editMenu = $(customBackgrounds.IDS.EDIT_BG_MENU);
+ for (let i = 1; i < editMenu.children.length; i++) {
+ let option = editMenu.children[i];
+ if (option.classList.contains(customBackgrounds.CLASSES.OPTION)
+ && !option.hidden && !option.classList.contains(
+ customBackgrounds.CLASSES.OPTION_DISABLED)) {
+ option.focus();
+ return;
+ }
+ }
+ };
+
+ $(customBackgrounds.IDS.EDIT_BG).onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.ENTER ||
event.keyCode === customBackgrounds.KEYCODES.SPACE) {
+ // no default behavior for ENTER
+ event.preventDefault();
editDialog.classList.remove(customBackgrounds.CLASSES.MOUSE_NAV);
editBackgroundInteraction();
- // Find the first menu option that is not hidden or disabled.
- for (let i = 1; i < editDialog.children.length; i++) {
- let option = editDialog.children[i];
- if (!option.hidden &&
- !option.classList.contains(
- customBackgrounds.CLASSES.OPTION_DISABLED)) {
- option.focus();
- return;
- }
- }
+ findFirstMenuOption();
}
};
@@ -788,20 +873,33 @@ customBackgrounds.init = function() {
editDialog.close();
};
editDialog.onclick = function(event) {
- if (event.target == editDialog)
+ editDialog.classList.add(customBackgrounds.CLASSES.MOUSE_NAV);
+ if (event.target === editDialog)
editDialogInteraction();
};
- editDialog.onkeyup = function(event) {
+ editDialog.onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.ESC) {
editDialogInteraction();
}
+ // When using tab in mouse navigation mode, select the first option available.
+ else if (editDialog.classList.contains(customBackgrounds.CLASSES.MOUSE_NAV)
+ && (event.keyCode === customBackgrounds.KEYCODES.TAB || event.keyCode
+ === customBackgrounds.KEYCODES.UP || event.keyCode
+ === customBackgrounds.KEYCODES.DOWN)) {
+ event.preventDefault();
+ findFirstMenuOption();
+ editDialog.classList.remove(customBackgrounds.CLASSES.MOUSE_NAV);
+ }
// If keyboard navigation is attempted, remove mouse-only mode.
- else if (
- event.keyCode === customBackgrounds.KEYCODES.TAB ||
+ else if (event.keyCode === customBackgrounds.KEYCODES.TAB) {
+ editDialog.classList.remove(customBackgrounds.CLASSES.MOUSE_NAV);
+ }
+ else if(
event.keyCode === customBackgrounds.KEYCODES.LEFT ||
event.keyCode === customBackgrounds.KEYCODES.UP ||
event.keyCode === customBackgrounds.KEYCODES.RIGHT ||
event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
editDialog.classList.remove(customBackgrounds.CLASSES.MOUSE_NAV);
}
};
@@ -809,7 +907,7 @@ customBackgrounds.init = function() {
if (configData.isCustomLinksEnabled)
customBackgrounds.initCustomLinksItems();
if (configData.isCustomBackgroundsEnabled)
- customBackgrounds.initCustomBackgrounds();
+ customBackgrounds.initCustomBackgrounds(showErrorNotification);
};
/**
@@ -830,20 +928,26 @@ customBackgrounds.initCustomLinksItems = function() {
ntpApiHandle.logEvent(BACKGROUND_CUSTOMIZATION_LOG_TYPE
.NTP_CUSTOMIZE_RESTORE_SHORTCUTS_CLICKED);
};
- $(customBackgrounds.IDS.CUSTOM_LINKS_RESTORE_DEFAULT).onclick =
- customLinksRestoreDefaultInteraction;
- $(customBackgrounds.IDS.CUSTOM_LINKS_RESTORE_DEFAULT).onkeyup = function(
+ $(customBackgrounds.IDS.CUSTOM_LINKS_RESTORE_DEFAULT).onclick = () => {
+ if (!$(customBackgrounds.IDS.CUSTOM_LINKS_RESTORE_DEFAULT).classList.
+ contains(customBackgrounds.CLASSES.OPTION_DISABLED)) {
+ customLinksRestoreDefaultInteraction();
+ }
+ };
+ $(customBackgrounds.IDS.CUSTOM_LINKS_RESTORE_DEFAULT).onkeydown = function(
event) {
if (event.keyCode === customBackgrounds.KEYCODES.ENTER) {
customLinksRestoreDefaultInteraction(event);
}
// Handle arrow key navigation.
else if (event.keyCode === customBackgrounds.KEYCODES.UP) {
+ event.preventDefault();
customBackgrounds
.getNextOption(
customBackgrounds.MENU_ENTRIES.CUSTOM_LINKS_RESTORE_DEFAULT, -1)
.focus();
} else if (event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
customBackgrounds
.getNextOption(
customBackgrounds.MENU_ENTRIES.CUSTOM_LINKS_RESTORE_DEFAULT, 1)
@@ -855,8 +959,12 @@ customBackgrounds.initCustomLinksItems = function() {
/**
* Initialize the settings menu and custom backgrounds dialogs. Set the
* text and event handlers for the various elements.
+ * @param {?Function} showErrorNotification Called when the error notification
+ * should be displayed
*/
-customBackgrounds.initCustomBackgrounds = function() {
+customBackgrounds.initCustomBackgrounds = function(showErrorNotification) {
+ customBackgrounds.showErrorNotification = showErrorNotification;
+
var editDialog = $(customBackgrounds.IDS.EDIT_BG_DIALOG);
var menu = $(customBackgrounds.IDS.MENU);
@@ -899,19 +1007,26 @@ customBackgrounds.initCustomBackgrounds = function() {
BACKGROUND_CUSTOMIZATION_LOG_TYPE.NTP_CUSTOMIZE_LOCAL_IMAGE_CLICKED);
};
- $(customBackgrounds.IDS.UPLOAD_IMAGE).onclick = uploadImageInteraction;
- $(customBackgrounds.IDS.UPLOAD_IMAGE).onkeyup = function(event) {
+ $(customBackgrounds.IDS.UPLOAD_IMAGE).onclick = () => {
+ if (!$(customBackgrounds.IDS.UPLOAD_IMAGE).classList.contains(
+ customBackgrounds.CLASSES.OPTION_DISABLED)) {
+ uploadImageInteraction();
+ }
+ } ;
+ $(customBackgrounds.IDS.UPLOAD_IMAGE).onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.ENTER) {
uploadImageInteraction(event);
}
// Handle arrow key navigation.
if (event.keyCode === customBackgrounds.KEYCODES.UP) {
+ event.preventDefault();
customBackgrounds
.getNextOption(customBackgrounds.MENU_ENTRIES.UPLOAD_IMAGE, -1)
.focus();
}
if (event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
customBackgrounds
.getNextOption(customBackgrounds.MENU_ENTRIES.UPLOAD_IMAGE, 1)
.focus();
@@ -926,19 +1041,26 @@ customBackgrounds.initCustomBackgrounds = function() {
ntpApiHandle.logEvent(BACKGROUND_CUSTOMIZATION_LOG_TYPE
.NTP_CUSTOMIZE_RESTORE_BACKGROUND_CLICKED);
};
- $(customBackgrounds.IDS.RESTORE_DEFAULT).onclick = restoreDefaultInteraction;
- $(customBackgrounds.IDS.RESTORE_DEFAULT).onkeyup = function(event) {
+ $(customBackgrounds.IDS.RESTORE_DEFAULT).onclick = () => {
+ if (!$(customBackgrounds.IDS.RESTORE_DEFAULT).classList.contains(
+ customBackgrounds.CLASSES.OPTION_DISABLED)) {
+ restoreDefaultInteraction();
+ }
+ };
+ $(customBackgrounds.IDS.RESTORE_DEFAULT).onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.ENTER) {
restoreDefaultInteraction(event);
}
// Handle arrow key navigation.
if (event.keyCode === customBackgrounds.KEYCODES.UP) {
+ event.preventDefault();
customBackgrounds
.getNextOption(customBackgrounds.MENU_ENTRIES.RESTORE_DEFAULT, -1)
.focus();
}
if (event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
customBackgrounds
.getNextOption(customBackgrounds.MENU_ENTRIES.RESTORE_DEFAULT, 1)
.focus();
@@ -947,13 +1069,16 @@ customBackgrounds.initCustomBackgrounds = function() {
// Interactions with the "Chrome backgrounds" option.
var defaultWallpapersInteraction = function(event) {
- editDialog.close();
- if (typeof coll != 'undefined' && coll.length > 0) {
- customBackgrounds.showCollectionSelectionDialog(
- customBackgrounds.SOURCES.CHROME_BACKGROUNDS);
- } else {
- customBackgrounds.handleError(coll_errors);
- }
+ customBackgrounds.loadChromeBackgrounds();
+ $('ntp-collection-loader').onload = function() {
+ editDialog.close();
+ if (typeof coll != 'undefined' && coll.length > 0) {
+ customBackgrounds.showCollectionSelectionDialog(
+ customBackgrounds.SOURCES.CHROME_BACKGROUNDS);
+ } else {
+ customBackgrounds.handleError(coll_errors);
+ }
+ };
ntpApiHandle.logEvent(BACKGROUND_CUSTOMIZATION_LOG_TYPE
.NTP_CUSTOMIZE_CHROME_BACKGROUNDS_CLICKED);
};
@@ -962,7 +1087,7 @@ customBackgrounds.initCustomBackgrounds = function() {
.classList.add(customBackgrounds.CLASSES.MOUSE_NAV);
defaultWallpapersInteraction(event);
};
- $(customBackgrounds.IDS.DEFAULT_WALLPAPERS).onkeyup = function(event) {
+ $(customBackgrounds.IDS.DEFAULT_WALLPAPERS).onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.ENTER) {
$(customBackgrounds.IDS.MENU)
.classList.remove(customBackgrounds.CLASSES.MOUSE_NAV);
@@ -971,11 +1096,13 @@ customBackgrounds.initCustomBackgrounds = function() {
// Handle arrow key navigation.
if (event.keyCode === customBackgrounds.KEYCODES.UP) {
+ event.preventDefault();
customBackgrounds
.getNextOption(customBackgrounds.MENU_ENTRIES.CHROME_BACKGROUNDS, -1)
.focus();
}
if (event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
customBackgrounds
.getNextOption(customBackgrounds.MENU_ENTRIES.CHROME_BACKGROUNDS, 1)
.focus();
@@ -1009,13 +1136,6 @@ customBackgrounds.initCustomBackgrounds = function() {
}
};
- // Clicks that happen outside of the dialog.
- menu.onclick = function(event) {
- if (event.target == menu) {
- customBackgrounds.closeCollectionDialog(menu);
- }
- };
-
// Interactions with the back arrow on the image selection dialog.
var backInteraction = function(event) {
customBackgrounds.resetSelectionDialog();
@@ -1049,7 +1169,6 @@ customBackgrounds.initCustomBackgrounds = function() {
.classList.contains(customBackgrounds.CLASSES.DONE_AVAILABLE)) {
return;
}
-
customBackgrounds.setBackground(
customBackgrounds.selectedTile.dataset.url,
customBackgrounds.selectedTile.dataset.attributionLine1,
@@ -1074,11 +1193,12 @@ customBackgrounds.initCustomBackgrounds = function() {
};
// On any arrow key event in the tiles area, focus the first tile.
- $(customBackgrounds.IDS.TILES).onkeyup = function(event) {
+ $(customBackgrounds.IDS.TILES).onkeydown = function(event) {
if (event.keyCode === customBackgrounds.KEYCODES.LEFT ||
event.keyCode === customBackgrounds.KEYCODES.UP ||
event.keyCode === customBackgrounds.KEYCODES.RIGHT ||
event.keyCode === customBackgrounds.KEYCODES.DOWN) {
+ event.preventDefault();
if ($(customBackgrounds.IDS.MENU)
.classList.contains(
customBackgrounds.CLASSES.COLLECTION_DIALOG)) {
@@ -1090,73 +1210,33 @@ customBackgrounds.initCustomBackgrounds = function() {
};
};
-customBackgrounds.hideMessageBox = function() {
- let message = $(customBackgrounds.IDS.MSG_BOX_CONTAINER);
- if (!message.classList.contains(customBackgrounds.CLASSES.FLOAT_UP)) {
- return;
- }
- window.clearTimeout(customBackgrounds.delayedHideNotification);
- message.classList.remove(customBackgrounds.CLASSES.FLOAT_UP);
-
- let afterHide = (event) => {
- if (event.propertyName == 'bottom') {
- $(IDS.MSG_BOX).classList.add(customBackgrounds.CLASSES.HIDE_MSG_BOX);
- $(IDS.MSG_BOX).classList.remove(customBackgrounds.CLASSES.HAS_LINK);
- notification.removeEventListener('transitionend', afterHide);
- }
- };
-};
-
-customBackgrounds.showMessageBox = function() {
- $(customBackgrounds.IDS.MSG_BOX_CONTAINER)
- .classList.remove(customBackgrounds.CLASSES.HIDE_MSG_BOX);
- // Timeout is required for the "float up" transition to work. Modifying the
- // "display" property prevents transitions from activating.
- window.setTimeout(() => {
- $(customBackgrounds.IDS.MSG_BOX_CONTAINER)
- .classList.add(customBackgrounds.CLASSES.FLOAT_UP);
- }, 20);
-
- // Automatically hide the notification after a period of time.
- customBackgrounds.delayedHideNotification = window.setTimeout(() => {
- customBackgrounds.hideMessageBox();
- }, customBackgrounds.NOTIFICATION_TIMEOUT);
-};
-
customBackgrounds.handleError = function(errors) {
- var msgBox = $(customBackgrounds.IDS.MSG_BOX_MSG);
- var msgBoxLink = $(customBackgrounds.IDS.MSG_BOX_LINK);
var unavailableString = configData.translatedStrings.backgroundsUnavailable;
if (errors != 'undefined') {
// Network errors.
if (errors.net_error) {
if (errors.net_error_no != 0) {
- msgBox.textContent = configData.translatedStrings.connectionError;
- msgBoxLink.textContent = configData.translatedStrings.moreInfo;
- msgBoxLink.classList.add(customBackgrounds.CLASSES.HAS_LINK);
- msgBoxLink.onclick = function() {
+ let onClick = () => {
window.open(
'https://chrome://network-error/' + errors.net_error_no,
'_blank');
};
+ customBackgrounds.showErrorNotification(
+ configData.translatedStrings.connectionError,
+ configData.translatedStrings.moreInfo, onClick);
} else {
- msgBox.textContent =
- configData.translatedStrings.connectionErrorNoPeriod;
+ customBackgrounds.showErrorNotification(
+ configData.translatedStrings.connectionErrorNoPeriod);
}
- customBackgrounds.showMessageBox();
- // Auth errors (Google Photos only).
- } else if (errors.auth_error) {
+ } else if (errors.auth_error) { // Auth errors (Google Photos only).
window.open('https://photos.google.com/login', '_blank');
- // Service errors.
- } else if (errors.service_error) {
- msgBox.textContent = unavailableString;
- customBackgrounds.showMessageBox();
+ } else if (errors.service_error) { // Service errors.
+ customBackgrounds.showErrorNotification(unavailableString);
}
return;
}
// Generic error when we can't tell what went wrong.
- msgBox.textContent = unavailableString;
- customBackgrounds.showMessageBox();
+ customBackgrounds.showErrorNotification(unavailableString);
};
diff --git a/chromium/chrome/browser/resources/local_ntp/custom_links_edit.css b/chromium/chrome/browser/resources/local_ntp/custom_links_edit.css
index ed12b1aa529..8dd247103e0 100644
--- a/chromium/chrome/browser/resources/local_ntp/custom_links_edit.css
+++ b/chromium/chrome/browser/resources/local_ntp/custom_links_edit.css
@@ -46,7 +46,7 @@ body {
}
.field-title {
- color: rgb(154, 160, 166);
+ color: rgb(95, 99, 104);
font-size: 10px;
font-weight: 500;
margin-bottom: 4px;
@@ -57,7 +57,7 @@ body {
}
input {
- background-color: rgb(232, 234, 237);
+ background-color: rgb(241, 243, 244);
border: none;
border-radius: 4px;
caret-color: rgb(26, 115, 232);
@@ -72,7 +72,7 @@ input {
width: calc(100% - 16px);
}
-#url-field:not(.text-modified) {
+input::placeholder {
color: rgba(32, 33, 36, 0.38);
}
diff --git a/chromium/chrome/browser/resources/local_ntp/custom_links_edit.html b/chromium/chrome/browser/resources/local_ntp/custom_links_edit.html
index ee8874e8d89..71e8e903dd1 100644
--- a/chromium/chrome/browser/resources/local_ntp/custom_links_edit.html
+++ b/chromium/chrome/browser/resources/local_ntp/custom_links_edit.html
@@ -17,15 +17,15 @@
<label id="title-field-name" class="field-title"></label>
<div class="input-container">
<input id="title-field" class="field-input" type="text"
- autocomplete="off" tabindex="0" required></input>
+ autocomplete="off" tabindex="0"></input>
<div class="underline"></div>
</div>
</div>
<div id="url" class="field-container">
<label id="url-field-name" class="field-title"></label>
<div class="input-container">
- <input id="url-field" class="field-input" type="text" value="https://"
- autocomplete="off" tabindex="0" required></input>
+ <input id="url-field" class="field-input" type="text" autocomplete="off"
+ spellcheck="false" tabindex="0" required></input>
<div class="underline"></div>
</div>
<div id="invalid-url" class="error-msg"></div>
diff --git a/chromium/chrome/browser/resources/local_ntp/custom_links_edit.js b/chromium/chrome/browser/resources/local_ntp/custom_links_edit.js
index 4c4f06e2b4e..f9d7a71e8bc 100644
--- a/chromium/chrome/browser/resources/local_ntp/custom_links_edit.js
+++ b/chromium/chrome/browser/resources/local_ntp/custom_links_edit.js
@@ -36,17 +36,6 @@ const IDS = {
/**
- * Enum for classes.
- * @enum {string}
- * @const
- */
-const CLASSES = {
- // Applied if the input field has been modified.
- TEXT_MODIFIED: 'text-modified',
-};
-
-
-/**
* Enum for key codes.
* @enum {int}
* @const
@@ -106,26 +95,6 @@ let deleteLinkTitle = '';
/**
- * True if keyboard navigation should start at the first input field.
- * @type {boolean}
- */
-let startKeyboardAtFirstField = false;
-
-
-/**
- * True if the provided url is valid.
- * @type {string}
- */
-function isValidURL(url) {
- let a = document.createElement('a');
- a.href = url;
- // Invalid URLs will not match the current host.
- let isValid = a.host && a.host != window.location.host;
- return isValid;
-}
-
-
-/**
* Handler for the 'linkData' message from the host page. Pre-populates the url
* and title fields with link's data obtained using the rid. Called if we are
* editing an existing link.
@@ -142,7 +111,6 @@ function prepopulateFields(rid) {
prepopulatedLink.rid = rid;
$(IDS.TITLE_FIELD).value = prepopulatedLink.title = data.title;
$(IDS.URL_FIELD).value = prepopulatedLink.url = data.url;
- $(IDS.URL_FIELD).classList.add(CLASSES.TEXT_MODIFIED);
// Set accessibility names.
$(IDS.DELETE).setAttribute('aria-label', deleteLinkTitle + ' ' + data.title);
@@ -182,20 +150,25 @@ function showInvalidUrlUntilTextInput() {
* completed. If the fields were unchanged, does not update the link data.
*/
function finishEditLink() {
- // Show error message for invalid urls.
- if (!isValidURL($(IDS.URL_FIELD).value)) {
- showInvalidUrlUntilTextInput();
- disableSubmitUntilTextInput();
- return;
- }
-
let newUrl = '';
let newTitle = '';
- if ($(IDS.URL_FIELD).value != prepopulatedLink.url &&
- $(IDS.URL_FIELD).value != 'https://')
- newUrl = $(IDS.URL_FIELD).value;
- if ($(IDS.TITLE_FIELD).value != prepopulatedLink.title)
- newTitle = $(IDS.TITLE_FIELD).value;
+
+ const urlValue = $(IDS.URL_FIELD).value;
+ if (urlValue != prepopulatedLink.url) {
+ newUrl = chrome.embeddedSearch.newTabPage.fixupAndValidateUrl(urlValue);
+ // Show error message for invalid urls.
+ if (!newUrl) {
+ showInvalidUrlUntilTextInput();
+ disableSubmitUntilTextInput();
+ return;
+ }
+ }
+
+ const titleValue = $(IDS.TITLE_FIELD).value;
+ if (!titleValue) // Set the URL input as the title if no title is provided.
+ newTitle = urlValue;
+ else if (titleValue != prepopulatedLink.title)
+ newTitle = titleValue;
// Update the link only if a field was changed.
if (!!newUrl || !!newTitle) {
@@ -223,16 +196,14 @@ function deleteLink(event) {
function closeDialog() {
window.parent.postMessage({cmd: 'closeDialog'}, DOMAIN_ORIGIN);
// Small delay to allow the dialog close before cleaning up.
- window.setTimeout(function() {
+ window.setTimeout(() => {
$(IDS.FORM).reset();
$(IDS.URL_FIELD_CONTAINER).classList.remove('invalid');
- $(IDS.URL_FIELD).classList.remove(CLASSES.TEXT_MODIFIED);
$(IDS.DELETE).disabled = false;
$(IDS.DONE).disabled = false;
prepopulatedLink.rid = -1;
prepopulatedLink.title = '';
prepopulatedLink.url = '';
- startKeyboardAtFirstField = false;
}, 10);
}
@@ -245,7 +216,6 @@ function handlePostMessage(event) {
let cmd = event.data.cmd;
let args = event.data;
if (cmd === 'linkData') {
- startKeyboardAtFirstField = true;
if (args.tid) { // We are editing a link, prepopulate the link data.
document.title = editLinkTitle;
$(IDS.DIALOG_TITLE).textContent = editLinkTitle;
@@ -259,6 +229,11 @@ function handlePostMessage(event) {
$(IDS.DONE).setAttribute('aria-label', addLinkTitle);
$(IDS.DONE).title = addLinkTitle;
}
+ // Timeout is required to allow the iframe to become visible before focusing
+ // the first input field.
+ window.setTimeout(() => {
+ $(IDS.TITLE_FIELD).select();
+ }, 10);
}
}
@@ -323,18 +298,8 @@ function init() {
// Close the iframe instead of just this dialog.
event.preventDefault();
closeDialog();
- } else if (event.keyCode === KEYCODES.TAB && startKeyboardAtFirstField) {
- // Start keyboard navigation at the first input field when the dialog
- // opens.
- event.preventDefault();
- $(IDS.TITLE_FIELD).focus();
- startKeyboardAtFirstField = false;
}
};
- $(IDS.URL_FIELD).addEventListener('input', (event) => {
- if (!$(IDS.URL_FIELD).classList.contains(CLASSES.TEXT_MODIFIED))
- $(IDS.URL_FIELD).classList.add(CLASSES.TEXT_MODIFIED);
- });
$(IDS.DELETE).addEventListener('click', deleteLink);
$(IDS.CANCEL).addEventListener('click', closeDialog);
$(IDS.FORM).addEventListener('submit', (event) => {
diff --git a/chromium/chrome/browser/resources/local_ntp/local_ntp.css b/chromium/chrome/browser/resources/local_ntp/local_ntp.css
index aa54733c1ef..383e99b0d63 100644
--- a/chromium/chrome/browser/resources/local_ntp/local_ntp.css
+++ b/chromium/chrome/browser/resources/local_ntp/local_ntp.css
@@ -68,7 +68,6 @@ body {
font-size: small;
margin: 0;
min-height: 100%;
- overflow-x: hidden;
}
body.inited {
@@ -554,7 +553,7 @@ html[dir=rtl] #mv-notice-x {
bottom: 0;
}
-.md-icons #mv-notice-container.mv-notice-hide {
+.md-icons #mv-notice-container.notice-hide {
display: none;
}
@@ -571,7 +570,7 @@ html[dir=rtl] #mv-notice-x {
border: 1px solid rgb(218, 220, 224);
/* Necessary for a "pill" shape. Using 50% creates an oval. */
border-radius: 500px;
- font-family: 'Roboto';
+ font-family: 'Roboto', arial, sans-serif;
font-weight: normal;
height: 32px;
margin: 0 auto;
@@ -596,19 +595,20 @@ html[dir=rtl] #mv-notice-x {
/* Links in the notification. */
#mv-notice-links span {
- -webkit-margin-start: 6px;
color: var(--text-color-link);
cursor: pointer;
+ margin-inline-start: 6px;
outline: none;
padding: 0 4px;
}
.md-icons #mv-notice-links span {
- -webkit-margin-start: 0;
/* Necessary for a "pill" shape. Using 50% creates an oval. */
border-radius: 500px;
- color: rgb(26,115,232);
+ color: rgb(26, 115, 232);
+ margin-inline-start: 0;
padding: 0 16px;
+ position: relative;
}
#mv-notice-links span:hover,
@@ -645,7 +645,7 @@ html[dir=rtl] #mv-notice-x {
transition-property: opacity;
}
-#mv-notice.mv-notice-hide {
+#mv-notice.notice-hide {
display: none;
}
@@ -704,9 +704,11 @@ html[dir=rtl] #attribution,
#one-google {
position: absolute;
- right: 0;
top: 0;
transition: opacity 130ms;
+ /* One Google Bar can automatically align to left and right
+ based on the profile language preference */
+ width: 100%;
}
#one-google.hidden {
@@ -714,14 +716,22 @@ html[dir=rtl] #attribution,
}
.ripple-container {
+ height: 100%;
+ left: 0;
+ pointer-events: none;
+ position: absolute;
+ top: 0;
+ width: 100%;
+ z-index: 100;
+}
+
+.ripple-effect-mask {
height: 0;
left: 0;
overflow: hidden;
- pointer-events: none;
position: absolute;
top: 0;
width: 0;
- z-index: 100;
}
.ripple-effect {
@@ -797,56 +807,94 @@ input:checked + .toggle::before {
transform: translateX(26px);
}
-#message-box-container {
+#error-notice-container {
bottom: -50px;
margin-bottom: 16px;
position: fixed;
transition: bottom 400ms;
- vertical-align: middle;
- visibility: hidden;
+ user-select: none;
width: 100%;
}
-#message-box {
+#error-notice-container.float-up {
+ bottom: 0;
+}
+
+#error-notice {
background-color: white;
border: 1px solid rgb(218, 220, 224);
- border-radius: 16px;
- color: rgb(255, 0, 0);
+ /* Necessary for a "pill" shape. Using 50% creates an oval. */
+ border-radius: 500px;
+ color: rgb(217, 48, 37);
font-family: 'Roboto', arial, sans-serif;
font-size: 12px;
+ font-weight: normal;
height: 32px;
- left: 50%;
margin: 0 auto;
- padding: 0 16px 0 4px;
- text-align: center;
- visibility: visible;
+ opacity: 1;
+ padding: 0;
width: fit-content;
}
-#message-box-container.float-up {
- bottom: 0;
+#error-notice.notice-hide {
+ display: none;
}
-#message-box-container.message-box-hide {
- display: none;
+#error-notice-icon-container {
+ position: relative;
}
-#message-box-icon {
+#error-notice-icon {
background: url(../../../../ui/webui/resources/images/error.svg) no-repeat center;
- height: 18px;
- margin-right: 4px;
+ background-size: 18px 18px;
+ height: 32px;
+ margin-left: 8px;
+ position: absolute;
width: 18px;
}
-#message-box-link.has-link {
- color: rgb(66, 133, 244);
- margin-left: 6px;
+#error-notice-msg {
+ cursor: default;
+ padding: 0 16px 0 36px;
+}
+
+#error-notice.has-link #error-notice-msg {
+ padding-right: 0;
}
-#message-box-message,
-#message-box-link,
-#message-box-icon {
- vertical-align: middle;
+#error-notice span:not(#error-notice-icon-container) {
display: inline-block;
+ height: auto;
line-height: 32px;
+ vertical-align: unset;
+}
+
+#error-notice-link {
+ /* Necessary for a "pill" shape. Using 50% creates an oval. */
+ border-radius: 500px;
+ color: rgb(26, 115, 232);
+ cursor: pointer;
+ display: none;
+ outline: none;
+ padding: 0 16px;
+}
+
+#error-notice:not(.has-link) #error-notice-link {
+ display: none;
+}
+
+#error-notice.has-link #error-notice-link {
+ display: inline;
+}
+
+#error-notice-link:hover,
+#error-notice-link:focus {
+ text-decoration: underline;
+}
+
+#error-notice-link:hover,
+#error-notice-link:active {
+ background-color: rgba(26,115,232, 0.1);
+ text-decoration: none;
+ transition: background-color 200ms;
}
diff --git a/chromium/chrome/browser/resources/local_ntp/local_ntp.html b/chromium/chrome/browser/resources/local_ntp/local_ntp.html
index ede17e6bd6e..2d7e23135af 100644
--- a/chromium/chrome/browser/resources/local_ntp/local_ntp.html
+++ b/chromium/chrome/browser/resources/local_ntp/local_ntp.html
@@ -8,14 +8,17 @@
<link rel="stylesheet" href="chrome-search://local-ntp/local-ntp.css"></link>
<link rel="stylesheet" href="chrome-search://local-ntp/voice.css"></link>
<link rel="stylesheet" href="chrome-search://local-ntp/custom-backgrounds.css"></link>
- <script src="chrome-search://local-ntp/local-ntp.js"
- {{LOCAL_NTP_INTEGRITY}}></script>
- <script src="chrome-search://local-ntp/voice.js"
- {{LOCAL_NTP_VOICE_INTEGRITY}}></script>
+ <meta http-equiv="Content-Security-Policy"
+ content="{{CONTENT_SECURITY_POLICY}}">
+ <script src="chrome-search://local-ntp/config.js"
+ {{CONFIG_DATA_INTEGRITY}}></script>
<script src="chrome-search://local-ntp/custom-backgrounds.js"
{{LOCAL_NTP_CUSTOM_BG_INTEGRITY}}></script>
+ <script src="chrome-search://local-ntp/local-ntp.js"
+ {{LOCAL_NTP_INTEGRITY}}></script>
<meta charset="utf-8">
<meta name="google" value="notranslate">
+ <meta name="referrer" content="strict-origin">
</head>
<!-- Remember to update the test HTML files in chrome/test/data/local_ntp/
whenever making changes to this file.-->
@@ -61,7 +64,7 @@
<div id="mv-tiles"></div>
<!-- Notification shown when a tile is blacklisted. -->
<div id="mv-notice-container">
- <div id="mv-notice" class="mv-notice-hide" role="alert">
+ <div id="mv-notice" class="notice-hide" role="alert">
<span id="mv-msg"></span>
<!-- Links in the notification. -->
<span id="mv-notice-links">
@@ -75,39 +78,44 @@
</div>
<div id="attribution"><div id="attribution-text"></div></div>
- <div id="edit-bg" tabindex="0" hidden>
- <button id="edit-bg-gear" tabindex="-1"></button>
+ <div id="error-notice-container">
+ <div id="error-notice" class="notice-hide" role="alert">
+ <span id="error-notice-icon-container">
+ <div id="error-notice-icon"></div>
+ </span>
+ <span id="error-notice-msg"></span>
+ <span id="error-notice-link" class="ripple" tabindex="0" role="button"></span>
+ </div>
</div>
- <div id="message-box-container" class="message-box-hide">
- <div id="message-box">
- <div id="message-box-icon"></div>
- <div id="message-box-message"></div>
- <div id="message-box-link" class="ripple"></div>
- </div>
+ <div id="edit-bg" tabindex="0" hidden>
+ <div id="edit-bg-gear" tabindex="-1" role="button"></div>
</div>
+
<div id="custom-bg-attr"></div>
</div>
<dialog div id="edit-bg-dialog">
- <div id="edit-bg-title"></div>
- <div id="edit-bg-default-wallpapers" class="bg-option" tabindex="0">
- <div class="bg-option-img"></div>
- <div id="edit-bg-default-wallpapers-text" class="bg-option-text">
+ <div id="edit-bg-menu">
+ <div id="edit-bg-title"></div>
+ <div id="edit-bg-default-wallpapers" class="bg-option" tabindex="0">
+ <div class="bg-option-img"></div>
+ <div id="edit-bg-default-wallpapers-text" class="bg-option-text">
+ </div>
+ </div>
+ <div id="edit-bg-upload-image" class="bg-option" tabindex="0">
+ <div class="bg-option-img"></div>
+ <div id="edit-bg-upload-image-text" class="bg-option-text"></div>
+ </div>
+ <div id="edit-bg-divider"></div>
+ <div id="custom-links-restore-default" class="bg-option bg-option-disabled" tabindex="0">
+ <div class="bg-option-img"></div>
+ <div id="custom-links-restore-default-text" class="bg-option-text"></div>
+ </div>
+ <div id="edit-bg-restore-default" class="bg-option bg-option-disabled" tabindex="0">
+ <div class="bg-option-img"></div>
+ <div id="edit-bg-restore-default-text" class="bg-option-text"></div>
</div>
- </div>
- <div id="edit-bg-upload-image" class="bg-option" tabindex="0">
- <div class="bg-option-img"></div>
- <div id="edit-bg-upload-image-text" class="bg-option-text"></div>
- </div>
- <div id="edit-bg-divider"></div>
- <div id="custom-links-restore-default" class="bg-option bg-option-disabled" tabindex="0">
- <div class="bg-option-img"></div>
- <div id="custom-links-restore-default-text" class="bg-option-text"></div>
- </div>
- <div id="edit-bg-restore-default" class="bg-option bg-option-disabled" tabindex="0">
- <div class="bg-option-img"></div>
- <div id="edit-bg-restore-default-text" class="bg-option-text"></div>
</div>
</dialog>
@@ -125,8 +133,8 @@
<span class="toggle"></span>
</label>
<div id="bg-sel-refresh-text"></div>
- <div id="bg-sel-footer-cancel" class="bg-sel-footer-button ripple" tabindex="0"></div>
- <div id="bg-sel-footer-done" class="bg-sel-footer-button ripple" tabindex="-1"></div>
+ <button id="bg-sel-footer-cancel" class="bg-sel-footer-button ripple" tabindex="0"></button>
+ <button id="bg-sel-footer-done" class="bg-sel-footer-button ripple" tabindex="-1"></button>
</div>
</dialog>
@@ -162,5 +170,8 @@
</dialog>
<div id="one-google-end-of-body"></div>
+
+ <script defer src="chrome-search://local-ntp/voice.js"
+ {{LOCAL_NTP_VOICE_INTEGRITY}}></script>
</body>
</html>
diff --git a/chromium/chrome/browser/resources/local_ntp/local_ntp.js b/chromium/chrome/browser/resources/local_ntp/local_ntp.js
index f8cfcfc7bb9..4cf6e899c74 100644
--- a/chromium/chrome/browser/resources/local_ntp/local_ntp.js
+++ b/chromium/chrome/browser/resources/local_ntp/local_ntp.js
@@ -24,6 +24,15 @@ var onDdllogResponse = null;
/**
+ * Whether the Most Visited and edit custom link iframes should be created while
+ * running tests. Currently the SimpleJavascriptTests are flaky due to some
+ * raciness in the creation/destruction of the iframe. crbug.com/786313.
+ * @type {boolean}
+ */
+let iframesDisabledForTesting = false;
+
+
+/**
* Controls rendering the new tab page for InstantExtended.
* @return {Object} A limited interface for testing the local NTP.
*/
@@ -32,6 +41,15 @@ function LocalNTP() {
/**
+ * Called by tests to disable the creation of Most Visited and edit custom link
+ * iframes.
+ */
+function disableIframesForTesting() {
+ iframesDisabledForTesting = true;
+}
+
+
+/**
* Alias for document.getElementById.
* @param {string} id The ID of the element to find.
* @return {HTMLElement} The found element or null if not found.
@@ -83,11 +101,14 @@ var CLASSES = {
// Applies ripple animation to the element on click
RIPPLE: 'ripple',
RIPPLE_CONTAINER: 'ripple-container',
+ RIPPLE_EFFECT_MASK: 'ripple-effect-mask',
RIPPLE_EFFECT: 'ripple-effect',
// Applies drag focus style to the fakebox
FAKEBOX_DRAG_FOCUS: 'fakebox-drag-focused',
+ // Applies a different style to the error notification if a link is present.
+ HAS_LINK: 'has-link',
HIDE_FAKEBOX: 'hide-fakebox',
- HIDE_NOTIFICATION: 'mv-notice-hide',
+ HIDE_NOTIFICATION: 'notice-hide',
INITED: 'inited', // Reveals the <body> once init() is done.
LEFT_ALIGN_ATTRIBUTION: 'left-align-attribution',
MATERIAL_DESIGN: 'md', // Applies Material Design styles to the page
@@ -111,6 +132,10 @@ var IDS = {
ATTRIBUTION_TEXT: 'attribution-text',
CUSTOM_LINKS_EDIT_IFRAME: 'custom-links-edit',
CUSTOM_LINKS_EDIT_IFRAME_DIALOG: 'custom-links-edit-dialog',
+ ERROR_NOTIFICATION: 'error-notice',
+ ERROR_NOTIFICATION_CONTAINER: 'error-notice-container',
+ ERROR_NOTIFICATION_LINK: 'error-notice-link',
+ ERROR_NOTIFICATION_MSG: 'error-notice-msg',
FAKEBOX: 'fakebox',
FAKEBOX_INPUT: 'fakebox-input',
FAKEBOX_TEXT: 'fakebox-text',
@@ -245,11 +270,11 @@ var lastBlacklistedTile = null;
/**
- * The timeout id for automatically hiding the Most Visited notification.
- * Invalid ids will silently do nothing.
- * @type {number}
+ * The timeout function for automatically hiding the pop-up notification. Only
+ * set if a notification is visible.
+ * @type {?Object}
*/
-let delayedHideNotification = -1;
+let delayedHideNotification;
/**
@@ -260,6 +285,26 @@ var ntpApiHandle;
/**
+ * Returns a timeout that can be executed early.
+ * @param {!Function} timeout The timeout function.
+ * @param {number} delay The timeout delay.
+ * @return {Object}
+ */
+function createExecutableTimeout(timeout, delay) {
+ let timeoutId = window.setTimeout(timeout, delay);
+ return {
+ clear: () => {
+ window.clearTimeout(timeoutId);
+ },
+ trigger: () => {
+ window.clearTimeout(timeoutId);
+ return timeout();
+ }
+ };
+}
+
+
+/**
* Returns theme background info, first checking for history.state.notheme. If
* the page has notheme set, returns a fallback light-colored theme.
*/
@@ -353,6 +398,7 @@ function renderTheme() {
window.setTimeout(function() {
$('custom-bg').style.backgroundImage = '';
}, 1000);
+ customBackgrounds.clearAttribution();
}
$(customBackgrounds.IDS.RESTORE_DEFAULT)
@@ -550,7 +596,10 @@ function reloadTiles() {
* @param {string} success True if the link was successfully added.
*/
function onAddCustomLinkDone(success) {
- showNotification(configData.translatedStrings.linkAddedMsg);
+ if (success)
+ showNotification(configData.translatedStrings.linkAddedMsg);
+ else
+ showErrorNotification(configData.translatedStrings.linkCantCreate);
ntpApiHandle.logEvent(LOG_TYPE.NTP_CUSTOMIZE_SHORTCUT_DONE);
}
@@ -562,7 +611,10 @@ function onAddCustomLinkDone(success) {
* @param {string} success True if the link was successfully updated.
*/
function onUpdateCustomLinkDone(success) {
- showNotification(configData.translatedStrings.linkEditedMsg);
+ if (success)
+ showNotification(configData.translatedStrings.linkEditedMsg);
+ else
+ showErrorNotification(configData.translatedStrings.linkCantEdit);
}
@@ -573,30 +625,23 @@ function onUpdateCustomLinkDone(success) {
* @param {string} success True if the link was successfully deleted.
*/
function onDeleteCustomLinkDone(success) {
- showNotification(configData.translatedStrings.linkRemovedMsg);
+ if (success)
+ showNotification(configData.translatedStrings.linkRemovedMsg);
+ else
+ showErrorNotification(configData.translatedStrings.linkCantRemove);
}
/**
- * Shows the pop-up notification and triggers a delay to hide it. The message
- * will be set to |msg|.
+ * Shows the Most Visited pop-up notification and triggers a delay to hide it.
+ * The message will be set to |msg|.
* @param {string} msg The notification message.
*/
function showNotification(msg) {
$(IDS.NOTIFICATION_MESSAGE).textContent = msg;
- if (configData.isMDIconsEnabled || configData.isMDUIEnabled) {
- $(IDS.NOTIFICATION).classList.remove(CLASSES.HIDE_NOTIFICATION);
- // Timeout is required for the "float up" transition to work. Modifying the
- // "display" property prevents transitions from activating.
- window.setTimeout(() => {
- $(IDS.NOTIFICATION_CONTAINER).classList.add(CLASSES.FLOAT_UP);
- }, 20);
-
- // Automatically hide the notification after a period of time.
- delayedHideNotification = window.setTimeout(() => {
- hideNotification();
- }, NOTIFICATION_TIMEOUT);
+ if (configData.isMDIconsEnabled && configData.isGooglePage) {
+ floatUpNotification($(IDS.NOTIFICATION), $(IDS.NOTIFICATION_CONTAINER));
} else {
var notification = $(IDS.NOTIFICATION);
notification.classList.remove(CLASSES.HIDE_NOTIFICATION);
@@ -608,24 +653,11 @@ function showNotification(msg) {
/**
- * Hides the pop-up notification.
+ * Hides the Most Visited pop-up notification.
*/
function hideNotification() {
- if (configData.isMDIconsEnabled || configData.isMDUIEnabled) {
- let notification = $(IDS.NOTIFICATION_CONTAINER);
- if (!notification.classList.contains(CLASSES.FLOAT_UP)) {
- return;
- }
- window.clearTimeout(delayedHideNotification);
- notification.classList.remove(CLASSES.FLOAT_UP);
-
- let afterHide = (event) => {
- if (event.propertyName == 'bottom') {
- $(IDS.NOTIFICATION).classList.add(CLASSES.HIDE_NOTIFICATION);
- notification.removeEventListener('transitionend', afterHide);
- }
- };
- notification.addEventListener('transitionend', afterHide);
+ if (configData.isMDIconsEnabled && configData.isGooglePage) {
+ floatDownNotification($(IDS.NOTIFICATION), $(IDS.NOTIFICATION_CONTAINER));
} else {
var notification = $(IDS.NOTIFICATION);
notification.classList.add(CLASSES.HIDE_NOTIFICATION);
@@ -635,6 +667,87 @@ function hideNotification() {
/**
+ * Shows the error pop-up notification and triggers a delay to hide it. The
+ * message will be set to |msg|. If |linkName| and |linkOnClick| are present,
+ * shows an error link with text set to |linkName| and onclick handled by
+ * |linkOnClick|.
+ * @param {string} msg The notification message.
+ * @param {?string} linkName The error link text.
+ * @param {?Function} linkOnClick The error link onclick handler.
+ */
+function showErrorNotification(msg, linkName, linkOnClick) {
+ let notification = $(IDS.ERROR_NOTIFICATION);
+ $(IDS.ERROR_NOTIFICATION_MSG).textContent = msg;
+ if (linkName && linkOnClick) {
+ let notificationLink = $(IDS.ERROR_NOTIFICATION_LINK);
+ notificationLink.textContent = linkName;
+ notificationLink.onclick = linkOnClick;
+ notification.classList.add(CLASSES.HAS_LINK);
+ } else {
+ notification.classList.remove(CLASSES.HAS_LINK);
+ }
+ floatUpNotification(notification, $(IDS.ERROR_NOTIFICATION_CONTAINER));
+}
+
+
+/**
+ * Animates the specified notification to float up. Automatically hides any
+ * pre-existing notification and sets a delayed timer to hide the new
+ * notification.
+ * @param {!Element} notification The notification element.
+ * @param {!Element} notificationContainer The notification container element.
+ */
+function floatUpNotification(notification, notificationContainer) {
+ // Hide any pre-existing notification.
+ if (delayedHideNotification) {
+ delayedHideNotification.trigger();
+ delayedHideNotification = null;
+ }
+
+ notification.classList.remove(CLASSES.HIDE_NOTIFICATION);
+ // Timeout is required for the "float up" transition to work. Modifying the
+ // "display" property prevents transitions from activating.
+ window.setTimeout(() => {
+ notificationContainer.classList.add(CLASSES.FLOAT_UP);
+ }, 20);
+
+ // Automatically hide the notification after a period of time.
+ delayedHideNotification = createExecutableTimeout(() => {
+ floatDownNotification(notification, notificationContainer);
+ }, NOTIFICATION_TIMEOUT);
+}
+
+
+/**
+ * Animates the pop-up notification to float down, and clears the timeout to
+ * hide the notification.
+ * @param {!Element} notification The notification element.
+ * @param {!Element} notificationContainer The notification container element.
+ */
+function floatDownNotification(notification, notificationContainer) {
+ if (!notificationContainer.classList.contains(CLASSES.FLOAT_UP))
+ return;
+
+ // Clear the timeout to hide the notification.
+ if (delayedHideNotification) {
+ delayedHideNotification.clear();
+ delayedHideNotification = null;
+ }
+
+ // Reset notification visibility once the animation is complete.
+ notificationContainer.classList.remove(CLASSES.FLOAT_UP);
+ let afterHide = (event) => {
+ if (event.propertyName == 'bottom') {
+ notification.classList.add(CLASSES.HIDE_NOTIFICATION);
+ notification.classList.remove(CLASSES.HAS_LINK);
+ notificationContainer.removeEventListener('transitionend', afterHide);
+ }
+ };
+ notificationContainer.addEventListener('transitionend', afterHide);
+}
+
+
+/**
* Handles a click on the notification undo link by hiding the notification and
* informing Chrome.
*/
@@ -769,7 +882,12 @@ function handlePostMessage(event) {
(args.showRestoreDefault ? 0 : -1);
}
} else if (cmd === 'tileBlacklisted') {
- showNotification(configData.translatedStrings.linkRemovedMsg);
+ if (configData.isCustomLinksEnabled) {
+ showNotification(configData.translatedStrings.linkRemovedMsg);
+ } else {
+ showNotification(
+ configData.translatedStrings.thumbnailRemovedNotification);
+ }
lastBlacklistedTile = args.tid;
ntpApiHandle.deleteMostVisitedItem(args.tid);
@@ -795,26 +913,28 @@ function handlePostMessage(event) {
/**
- * Enables Material Design styles for all of NTP.
+ * Enables Material Design styles for the Most Visited section. Implicitly
+ * enables Material Design for the rest of NTP.
*/
-function enableMD() {
- document.body.classList.add(CLASSES.MATERIAL_DESIGN);
- enableMDIcons();
+function enableMDIcons() {
+ $(IDS.MOST_VISITED).classList.add(CLASSES.MATERIAL_DESIGN_ICONS);
+ $(IDS.TILES).classList.add(CLASSES.MATERIAL_DESIGN_ICONS);
+ enableMD();
+ addRippleAnimations();
}
/**
- * Enables Material Design styles for the Most Visited section.
+ * Enables Material Design styles for all NTP components except Most Visited.
*/
-function enableMDIcons() {
- $(IDS.MOST_VISITED).classList.add(CLASSES.MATERIAL_DESIGN_ICONS);
- $(IDS.TILES).classList.add(CLASSES.MATERIAL_DESIGN_ICONS);
- addRippleAnimations();
+function enableMD() {
+ document.body.classList.add(CLASSES.MATERIAL_DESIGN);
}
/**
- * Enables ripple animations for elements with CLASSES.RIPPLE.
+ * Enables ripple animations for elements with CLASSES.RIPPLE. The target
+ * element must have position relative or absolute.
* TODO(kristipark): Remove after migrating to WebUI.
*/
function addRippleAnimations() {
@@ -843,22 +963,22 @@ function addRippleAnimations() {
Math.min(RIPPLE_MAX_RADIUS_PX, Math.max.apply(Math, cornerDistances));
let ripple = document.createElement('div');
+ let rippleMask = document.createElement('div');
let rippleContainer = document.createElement('div');
ripple.classList.add(CLASSES.RIPPLE_EFFECT);
+ rippleMask.classList.add(CLASSES.RIPPLE_EFFECT_MASK);
rippleContainer.classList.add(CLASSES.RIPPLE_CONTAINER);
- rippleContainer.appendChild(ripple);
+ rippleMask.appendChild(ripple);
+ rippleContainer.appendChild(rippleMask);
target.appendChild(rippleContainer);
// Ripple start location
ripple.style.marginLeft = x + 'px';
ripple.style.marginTop = y + 'px';
- rippleContainer.style.left = rect.left + 'px';
- rippleContainer.style.top = rect.top + 'px';
- rippleContainer.style.width = target.offsetWidth + 'px';
- rippleContainer.style.height = target.offsetHeight + 'px';
- rippleContainer.style.borderRadius =
+ rippleMask.style.width = target.offsetWidth + 'px';
+ rippleMask.style.height = target.offsetHeight + 'px';
+ rippleMask.style.borderRadius =
window.getComputedStyle(target).borderRadius;
- rippleContainer.style.position = 'fixed';
// Start transition/ripple
ripple.style.width = radius * 2 + 'px';
@@ -869,6 +989,7 @@ function addRippleAnimations() {
window.setTimeout(function() {
ripple.remove();
+ rippleMask.remove();
rippleContainer.remove();
}, RIPPLE_DURATION_MS);
};
@@ -948,10 +1069,10 @@ function init() {
var searchboxApiHandle = embeddedSearchApiHandle.searchBox;
if (configData.isGooglePage) {
- if (configData.isMDUIEnabled) {
- enableMD();
- } else if (configData.isMDIconsEnabled) {
+ if (configData.isMDIconsEnabled || configData.isCustomLinksEnabled) {
enableMDIcons();
+ } else if (configData.isMDUIEnabled) {
+ enableMD();
}
if (configData.isCustomLinksEnabled) {
@@ -962,7 +1083,7 @@ function init() {
if (configData.isCustomBackgroundsEnabled ||
configData.isCustomLinksEnabled) {
- customBackgrounds.init();
+ customBackgrounds.init(showErrorNotification);
}
@@ -1080,9 +1201,23 @@ function init() {
document.documentElement.classList.add(CLASSES.RTL);
}
+ if (!iframesDisabledForTesting) {
+ createIframes();
+ }
+
+ document.body.classList.add(CLASSES.INITED);
+}
+
+
+/**
+ * Create the Most Visited and edit custom links iframes.
+ */
+function createIframes() {
// Collect arguments for the most visited iframe.
var args = [];
+ var searchboxApiHandle = window.chrome.embeddedSearch.searchBox;
+
if (searchboxApiHandle.rtl)
args.push('rtl=1');
if (NTP_DESIGN.numTitleLines > 1)
@@ -1169,17 +1304,6 @@ function init() {
}
window.addEventListener('message', handlePostMessage);
-
- document.body.classList.add(CLASSES.INITED);
-}
-
-
-function loadConfig() {
- var configScript = document.createElement('script');
- configScript.type = 'text/javascript';
- configScript.src = 'chrome-search://local-ntp/config.js';
- configScript.onload = init;
- document.head.appendChild(configScript);
}
@@ -1187,7 +1311,7 @@ function loadConfig() {
* Binds event listeners.
*/
function listen() {
- document.addEventListener('DOMContentLoaded', loadConfig);
+ document.addEventListener('DOMContentLoaded', init);
}
@@ -1551,7 +1675,8 @@ var applyDoodleMetadata = function() {
return {
init: init, // Exposed for testing.
- listen: listen
+ listen: listen,
+ disableIframesForTesting: disableIframesForTesting
};
}
diff --git a/chromium/chrome/browser/resources/local_ntp/most_visited_single.css b/chromium/chrome/browser/resources/local_ntp/most_visited_single.css
index 5375b480f7a..b5f5ee668d9 100644
--- a/chromium/chrome/browser/resources/local_ntp/most_visited_single.css
+++ b/chromium/chrome/browser/resources/local_ntp/most_visited_single.css
@@ -15,7 +15,7 @@ html {
--md-menu-size: 12px;
--md-tile-height: 112px;
--md-tile-margin: 16px;
- --md-tile-padding-horizontal: 8px;
+ --md-tile-padding-horizontal: 4px;
--md-tile-padding-vertical: 16px;
--md-tile-width: 112px;
--md-title-font-size: 12px;
@@ -465,7 +465,7 @@ body.dark-theme .md-tile-container:active + .md-menu::after {
.md-fallback-letter {
color: white;
- font-family: sans-serif;
+ font-family: 'Segoe UI', 'Roboto', arial, sans-serif;
font-size: var(--md-fallback-letter-size);
height: var(--md-fallback-letter-size);
line-height: var(--md-fallback-letter-size);
@@ -485,7 +485,7 @@ body.dark-theme .md-tile-container:active + .md-menu::after {
.md-title {
color: rgba(33, 32, 36, 0.86);
- font-family: 'Roboto', arial, sans-serif;
+ font-family: 'Segoe UI', 'Roboto', arial, sans-serif;
font-size: var(--md-title-font-size);
font-weight: 500;
height: var(--md-title-height);
diff --git a/chromium/chrome/browser/resources/local_ntp/most_visited_single.js b/chromium/chrome/browser/resources/local_ntp/most_visited_single.js
index 5bb619a4e71..15707182ac0 100644
--- a/chromium/chrome/browser/resources/local_ntp/most_visited_single.js
+++ b/chromium/chrome/browser/resources/local_ntp/most_visited_single.js
@@ -155,13 +155,6 @@ let isCustomLinksEnabled = false;
/**
- * True if the tiles to be shown are custom links.
- * @type {boolean}
- */
-let tilesAreCustomLinks = false;
-
-
-/**
* Log an event on the NTP.
* @param {number} eventType Event from LOG_TYPE.
*/
@@ -213,19 +206,18 @@ var countLoad = function() {
if (loadedCounter <= 0) {
swapInNewTiles();
logEvent(LOG_TYPE.NTP_ALL_TILES_LOADED);
+ let tilesAreCustomLinks =
+ isCustomLinksEnabled && chrome.embeddedSearch.newTabPage.isCustomLinks;
// Note that it's easiest to capture this when all custom links are loaded,
// rather than when the impression for each link is logged.
- if (isCustomLinksEnabled && tilesAreCustomLinks) {
+ if (tilesAreCustomLinks) {
chrome.embeddedSearch.newTabPage.logEvent(
LOG_TYPE.NTP_SHORTCUT_CUSTOMIZED);
}
// Tell the parent page whether to show the restore default shortcuts option
// in the menu.
window.parent.postMessage(
- {
- cmd: 'loaded',
- showRestoreDefault: (isCustomLinksEnabled && tilesAreCustomLinks)
- },
+ {cmd: 'loaded', showRestoreDefault: tilesAreCustomLinks},
DOMAIN_ORIGIN);
tilesAreCustomLinks = false;
// Reset to 1, so that any further 'show' message will cause us to swap in
@@ -393,7 +385,7 @@ function truncateTitleText(titles) {
const originalTitle = el.innerText;
let truncatedTitle = el.innerText;
while (el.scrollHeight > el.offsetHeight && truncatedTitle.length > 0) {
- el.innerText = (truncatedTitle = truncatedTitle.slice(0, -1)) + '...';
+ el.innerText = (truncatedTitle = truncatedTitle.slice(0, -1)) + '\u2026';
}
if (truncatedTitle.length === 0) {
console.error('Title truncation failed: ' + originalTitle);
@@ -671,9 +663,6 @@ function renderMaterialDesignTile(data) {
}
mdTileContainer.className = CLASSES.MD_TILE_CONTAINER;
- if (data.isCustomLink)
- tilesAreCustomLinks = true;
-
// The tile will be appended to tiles.
const position = tiles.children.length;
// This is set in the load/error event for the favicon image.
@@ -764,6 +753,9 @@ function renderMaterialDesignTile(data) {
let fallbackLetter = document.createElement('div');
fallbackLetter.className = CLASSES.MD_FALLBACK_LETTER;
fallbackLetter.innerText = data.title.charAt(0).toUpperCase();
+ if (navigator.userAgent.indexOf('Windows') > -1) {
+ fallbackLetter.style.fontWeight = 600;
+ }
mdFavicon.classList.add(CLASSES.FAILED_FAVICON);
fallbackBackground.appendChild(fallbackLetter);
@@ -793,6 +785,11 @@ function renderMaterialDesignTile(data) {
mdTitle.className = CLASSES.MD_TITLE;
mdTitle.innerText = data.title;
mdTitle.style.direction = data.direction || 'ltr';
+ // Font weight on Mac and ChromeOS is heavier and needs to be reduced.
+ if (navigator.userAgent.indexOf('Mac') > -1 ||
+ navigator.userAgent.indexOf('CrOS') > -1) {
+ mdTitle.style.fontWeight = 400;
+ }
mdTitleContainer.appendChild(mdTitle);
mdTileInner.appendChild(mdTitleContainer);
mdTile.appendChild(mdTileInner);
diff --git a/chromium/chrome/browser/resources/md_bookmarks/BUILD.gn b/chromium/chrome/browser/resources/md_bookmarks/BUILD.gn
index 0c28dd7d7f7..a479745b971 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/BUILD.gn
+++ b/chromium/chrome/browser/resources/md_bookmarks/BUILD.gn
@@ -9,6 +9,7 @@ optimize_webui("build") {
host = "bookmarks"
html_in_files = [ "bookmarks.html" ]
html_out_files = [ "vulcanized.html" ]
+ html_out_files_polymer2 = [ "vulcanized.p2.html" ]
input = rebase_path(".", root_build_dir)
js_out_files = [ "crisper.js" ]
diff --git a/chromium/chrome/browser/resources/md_bookmarks/app.html b/chromium/chrome/browser/resources/md_bookmarks/app.html
index 16ad17987aa..45d7dab2547 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/app.html
+++ b/chromium/chrome/browser/resources/md_bookmarks/app.html
@@ -47,7 +47,7 @@
#splitter:hover,
#splitter.splitter-active {
- -webkit-border-start: 1px solid rgba(0, 0, 0, 0.1);
+ border-inline-start: 1px solid rgba(0, 0, 0, 0.1);
opacity: 1;
transition: opacity 100ms ease-out;
}
diff --git a/chromium/chrome/browser/resources/md_bookmarks/command_manager.html b/chromium/chrome/browser/resources/md_bookmarks/command_manager.html
index 928540994ea..528aa077bfb 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/command_manager.html
+++ b/chromium/chrome/browser/resources/md_bookmarks/command_manager.html
@@ -19,8 +19,8 @@
}
.sublabel {
- -webkit-margin-start: 8px;
color: var(--cr-secondary-text-color);
+ margin-inline-start: 8px;
text-align: end;
width: 3ch;
}
diff --git a/chromium/chrome/browser/resources/md_bookmarks/dnd_chip.html b/chromium/chrome/browser/resources/md_bookmarks/dnd_chip.html
index bb7c77b69a2..07b9dbf2fe0 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/dnd_chip.html
+++ b/chromium/chrome/browser/resources/md_bookmarks/dnd_chip.html
@@ -41,11 +41,11 @@
}
#title {
- -webkit-margin-end: 8px;
- -webkit-margin-start: 12px;
color: white;
flex: 1;
font-weight: 500;
+ margin-inline-end: 8px;
+ margin-inline-start: 12px;
text-decoration: none;
}
diff --git a/chromium/chrome/browser/resources/md_bookmarks/dnd_manager.js b/chromium/chrome/browser/resources/md_bookmarks/dnd_manager.js
index 330905b542c..248472cade1 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/dnd_manager.js
+++ b/chromium/chrome/browser/resources/md_bookmarks/dnd_manager.js
@@ -874,7 +874,7 @@ cr.define('bookmarks', function() {
* @private
* @param {!BookmarkElement} overElement The element that we are currently
* dragging over.
- * @return {DropPosition} An bit field enumeration of valid drop locations.
+ * @return {number} An bit field enumeration of valid drop locations.
*/
calculateValidDropPositions_: function(overElement) {
const dragInfo = this.dragInfo_;
@@ -910,7 +910,7 @@ cr.define('bookmarks', function() {
/**
* @private
* @param {BookmarkElement} overElement
- * @return {DropPosition}
+ * @return {number}
*/
calculateDropAboveBelow_: function(overElement) {
const dragInfo = this.dragInfo_;
diff --git a/chromium/chrome/browser/resources/md_bookmarks/folder_node.html b/chromium/chrome/browser/resources/md_bookmarks/folder_node.html
index 358e77729f8..8d766470d34 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/folder_node.html
+++ b/chromium/chrome/browser/resources/md_bookmarks/folder_node.html
@@ -24,23 +24,23 @@
}
.menu-label {
- -webkit-margin-start: 16px;
color: var(--folder-inactive-color);
font-weight: 500;
+ margin-inline-start: 16px;
}
#container {
- -webkit-padding-start:
- calc(var(--node-depth, 0) * var(--padding-start-per-depth));
cursor: pointer;
height: 40px;
+ padding-inline-start:
+ calc(var(--node-depth, 0) * var(--padding-start-per-depth));
position: relative;
}
#folder-label {
- -webkit-padding-end: 8px;
color: var(--cr-secondary-text-color);
flex-grow: 1;
+ padding-inline-end: 8px;
}
:host([is-selected-folder_]) .menu-label,
@@ -71,7 +71,7 @@
}
[no-children] {
- -webkit-margin-start: 52px; /* The width of the arrow and its margin */
+ margin-inline-start: 52px; /* The width of the arrow and its margin */
}
</style>
diff --git a/chromium/chrome/browser/resources/md_bookmarks/item.html b/chromium/chrome/browser/resources/md_bookmarks/item.html
index a031adba20a..ad066d68a01 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/item.html
+++ b/chromium/chrome/browser/resources/md_bookmarks/item.html
@@ -11,12 +11,12 @@
<template>
<style include="shared-style">
:host {
- -webkit-padding-start: 20px;
align-items: center;
color: inherit;
display: flex;
flex-direction: row;
height: 40px;
+ padding-inline-start: 20px;
position: relative;
text-decoration: none;
user-select: none;
@@ -27,8 +27,8 @@
}
#website-title {
- -webkit-margin-start: 20px;
flex: 1;
+ margin-inline-start: 20px;
text-decoration: none;
}
@@ -37,11 +37,11 @@
}
#website-url {
- -webkit-margin-start: 20px;
/* Transparent version of --cr-secondary-text-color */
color: rgba(0, 0, 0, 0.54);
display: none;
flex: 1;
+ margin-inline-start: 20px;
min-width: 100px;
}
@@ -55,7 +55,7 @@
}
.more-vert-button {
- -webkit-margin-end: 12px;
+ margin-inline-end: 12px;
}
:host(:focus) {
diff --git a/chromium/chrome/browser/resources/md_bookmarks/list.html b/chromium/chrome/browser/resources/md_bookmarks/list.html
index aaf6e6cd6d6..6001cfae967 100644
--- a/chromium/chrome/browser/resources/md_bookmarks/list.html
+++ b/chromium/chrome/browser/resources/md_bookmarks/list.html
@@ -14,12 +14,12 @@
<template>
<style include="shared-style">
:host {
- -webkit-padding-end: var(--card-padding-side);
- -webkit-padding-start: calc(var(--card-padding-side) -
- var(--splitter-width));
min-width: 300px;
overflow-y: auto;
padding-bottom: 24px;
+ padding-inline-end: var(--card-padding-side);
+ padding-inline-start: calc(var(--card-padding-side) -
+ var(--splitter-width));
padding-top: 24px;
}
diff --git a/chromium/chrome/browser/resources/md_downloads/BUILD.gn b/chromium/chrome/browser/resources/md_downloads/BUILD.gn
index f4aaa1324cf..fffbd84a924 100644
--- a/chromium/chrome/browser/resources/md_downloads/BUILD.gn
+++ b/chromium/chrome/browser/resources/md_downloads/BUILD.gn
@@ -10,6 +10,7 @@ optimize_webui("build") {
host = "downloads"
html_in_files = [ "downloads.html" ]
html_out_files = [ "vulcanized.html" ]
+ html_out_files_polymer2 = [ "vulcanized.p2.html" ]
input = rebase_path(".", root_build_dir)
insert_in_head = "<base href=chrome://downloads>"
js_out_files = [ "crisper.js" ]
diff --git a/chromium/chrome/browser/resources/md_downloads/item.html b/chromium/chrome/browser/resources/md_downloads/item.html
index 42872ca3d18..be618cab570 100644
--- a/chromium/chrome/browser/resources/md_downloads/item.html
+++ b/chromium/chrome/browser/resources/md_downloads/item.html
@@ -33,11 +33,10 @@
}
#date {
- color: var(--google-grey-900);
font-size: 0.875rem;
font-weight: 400;
letter-spacing: .25px;
- margin: 24px auto 10px;
+ margin: 21px auto 6px;
padding-bottom: 4px;
padding-top: 8px;
width: var(--downloads-card-width);
@@ -68,14 +67,14 @@
}
#details {
- -webkit-border-start: 1px #d8d8d8 solid;
- -webkit-padding-end: 16px;
- -webkit-padding-start: var(--downloads-card-margin);
+ border-inline-start: 1px #d8d8d8 solid;
display: flex;
flex: 1;
flex-direction: column;
min-width: 0; /* This allows #url to ellide correctly. */
padding-bottom: 12px;
+ padding-inline-end: 16px;
+ padding-inline-start: var(--downloads-card-margin);
padding-top: 16px;
}
@@ -138,7 +137,7 @@
}
#name {
- -webkit-margin-end: 12px; /* Only really affects #tag. */
+ margin-inline-end: 12px; /* Only really affects #tag. */
}
#tag {
@@ -181,7 +180,7 @@
}
#controlled-by {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
#controlled-by,
@@ -203,10 +202,12 @@
}
#remove-wrapper > paper-icon-button-light {
- -webkit-margin-end: 0;
- -webkit-margin-start: 0;
+ --cr-icon-size: 16px;
color: var(--google-grey-refresh-700);
height: 32px;
+ margin-inline-end: 8px;
+ margin-inline-start: 0;
+ margin-top: 8px;
width: 32px;
}
diff --git a/chromium/chrome/browser/resources/md_downloads/manager.html b/chromium/chrome/browser/resources/md_downloads/manager.html
index cf973f4a434..bd924d8bac0 100644
--- a/chromium/chrome/browser/resources/md_downloads/manager.html
+++ b/chromium/chrome/browser/resources/md_downloads/manager.html
@@ -25,6 +25,8 @@
height: 100%;
overflow: hidden;
z-index: 0;
+
+ @apply --cr-page-host;
}
#toolbar {
diff --git a/chromium/chrome/browser/resources/md_extensions/BUILD.gn b/chromium/chrome/browser/resources/md_extensions/BUILD.gn
index 4edc9f45309..cddcce53381 100644
--- a/chromium/chrome/browser/resources/md_extensions/BUILD.gn
+++ b/chromium/chrome/browser/resources/md_extensions/BUILD.gn
@@ -14,6 +14,7 @@ optimize_webui("build") {
host = "extensions"
html_in_files = [ "extensions.html" ]
html_out_files = [ "vulcanized.html" ]
+ html_out_files_polymer2 = [ "vulcanized.p2.html" ]
insert_in_head = "<base href=\"chrome://extensions\">"
input = rebase_path("$target_gen_dir/$unpak_folder", root_build_dir)
js_out_files = [ "crisper.js" ]
@@ -68,6 +69,8 @@ js_type_check("closure_compile") {
":options_dialog",
":pack_dialog",
":pack_dialog_alert",
+ ":runtime_host_permissions",
+ ":runtime_hosts_dialog",
":service",
":shortcut_input",
":shortcut_util",
@@ -93,6 +96,7 @@ js_library("detail_view") {
":item_util",
":navigation_helper",
"//ui/webui/resources/cr_elements:cr_container_shadow_behavior",
+ "//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
@@ -279,6 +283,22 @@ js_library("pack_dialog_alert") {
externs_list = [ "$externs_path/developer_private.js" ]
}
+js_library("runtime_host_permissions") {
+ deps = [
+ ":item",
+ ":runtime_hosts_dialog",
+ ]
+ externs_list = [ "$externs_path/developer_private.js" ]
+}
+
+js_library("runtime_hosts_dialog") {
+ deps = [
+ "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog",
+ "//ui/webui/resources/cr_elements/cr_input:cr_input",
+ "//ui/webui/resources/js:load_time_data",
+ ]
+}
+
js_library("service") {
deps = [
":error_page",
diff --git a/chromium/chrome/browser/resources/md_extensions/code_section.html b/chromium/chrome/browser/resources/md_extensions/code_section.html
index 5d575bae3f5..22e2c20111e 100644
--- a/chromium/chrome/browser/resources/md_extensions/code_section.html
+++ b/chromium/chrome/browser/resources/md_extensions/code_section.html
@@ -37,9 +37,9 @@
}
#source {
- -webkit-margin-start: 4px;
display: flex;
flex-direction: column;
+ margin-inline-start: 4px;
}
#line-numbers span,
diff --git a/chromium/chrome/browser/resources/md_extensions/detail_view.html b/chromium/chrome/browser/resources/md_extensions/detail_view.html
index 2fc8563086e..7ba50460bcd 100644
--- a/chromium/chrome/browser/resources/md_extensions/detail_view.html
+++ b/chromium/chrome/browser/resources/md_extensions/detail_view.html
@@ -13,7 +13,6 @@
<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
-<link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
@@ -22,12 +21,13 @@
<link rel="import" href="item_behavior.html">
<link rel="import" href="item_util.html">
<link rel="import" href="navigation_helper.html">
+<link rel="import" href="runtime_host_permissions.html">
<link rel="import" href="strings.html">
<link rel="import" href="toggle_row.html">
<dom-module id="extensions-detail-view">
<template>
- <style include="iron-flex cr-shared-style cr-icons action-link md-select paper-button-style">
+ <style include="iron-flex cr-shared-style cr-icons action-link paper-button-style">
:host {
--iron-icon-fill-color: var(--google-grey-refresh-700);
display: block;
@@ -39,7 +39,7 @@
}
#enable-section cr-tooltip-icon {
- -webkit-margin-end: 20px;
+ margin-inline-end: 20px;
}
#enable-section span {
@@ -74,9 +74,9 @@
}
#icon {
- -webkit-margin-end: 12px;
- -webkit-margin-start: 16px;
height: 24px;
+ margin-inline-end: 12px;
+ margin-inline-start: 16px;
width: 24px;
}
@@ -124,11 +124,6 @@
color: var(--cr-secondary-text-color);
}
- .mid-section-header {
- color: var(--cr-primary-text-color);
- margin-top: 12px;
- }
-
.actionable {
cursor: pointer;
}
@@ -155,21 +150,15 @@
.warning-icon {
--iron-icon-fill-color: var(--google-red-700);
- -webkit-margin-end: 8px;
flex-shrink: 0;
height: 18px;
+ margin-inline-end: 8px;
width: 18px;
}
ul {
- -webkit-padding-start: 20px;
margin: 0;
- }
-
- #runtime-host-permissions-mode {
- align-items: center;
- display: flex;
- justify-content: space-between;
+ padding-inline-start: 20px;
}
#options-section .control-line:first-child {
@@ -340,35 +329,11 @@
</template>
</ul>
<template is="dom-if" if="[[showRuntimeHostPermissions_(data.*)]]">
- <div id="runtime-host-permissions">
- <div id="runtime-host-permissions-mode">
- <div class="mid-section-header">
- $i18n{itemHostPermissionsHeading}
- </div>
- <select id="host-access" class="md-select"
- value="[[data.permissions.hostAccess]]"
- on-change="onHostAccessChanged_">
- <option value$="[[HostAccess_.ON_CLICK]]">
- $i18n{itemHostAccessOnClick}
- </option>
- <option value$="[[HostAccess_.ON_SPECIFIC_SITES]]">
- $i18n{itemHostAccessOnSpecificSites}
- </option>
- <option value$="[[HostAccess_.ON_ALL_SITES]]">
- $i18n{itemHostAccessOnAllSites}
- </option>
- </select>
- </div>
- <template is="dom-if" if="[[showSpecificSites_(data.*)]]">
- <div class="mid-section-header">$i18n{itemAllowedHosts}</div>
- <ul id="runtime-hosts">
- <template is="dom-repeat"
- items="[[data.permissions.runtimeHostPermissions]]">
- <li>[[item]]</li>
- </template>
- </ul>
- </template>
- </div>
+ <extensions-runtime-host-permissions
+ permissions="[[data.permissions]]"
+ delegate="[[delegate]]"
+ item-id="[[data.id]]">
+ </extensions-runtime-host-permissions>
</template>
</div>
</div>
diff --git a/chromium/chrome/browser/resources/md_extensions/detail_view.js b/chromium/chrome/browser/resources/md_extensions/detail_view.js
index b6782ba803b..f290ea3ce96 100644
--- a/chromium/chrome/browser/resources/md_extensions/detail_view.js
+++ b/chromium/chrome/browser/resources/md_extensions/detail_view.js
@@ -31,15 +31,6 @@ cr.define('extensions', function() {
/** Whether "allow in incognito" option should be shown. */
incognitoAvailable: Boolean,
-
- /**
- * Proxying the enum to be used easily by the html template.
- * @private
- */
- HostAccess_: {
- type: Object,
- value: chrome.developerPrivate.HostAccess,
- },
},
observers: [
@@ -85,22 +76,6 @@ cr.define('extensions', function() {
},
/**
- * @param {!Event} event
- * @private
- */
- onHostAccessChanged_: function(event) {
- const select = /** @type {!HTMLSelectElement} */ (event.target);
- const access =
- /** @type {chrome.developerPrivate.HostAccess} */ (select.value);
- this.delegate.setItemHostAccess(this.data.id, access);
- // Force the UI to update (in order to potentially hide or show the
- // specific runtime hosts).
- // TODO(devlin): Perhaps this should be handled by the backend updating
- // and sending an onItemStateChanged event?
- this.set('data.permissions.hostAccess', access);
- },
-
- /**
* @return {boolean}
* @private
*/
@@ -318,16 +293,6 @@ cr.define('extensions', function() {
showRuntimeHostPermissions_: function() {
return !!this.data.permissions.hostAccess;
},
-
- /**
- * @return {boolean}
- * @private
- */
- showSpecificSites_: function() {
- return this.data.permissions &&
- this.data.permissions.hostAccess ==
- chrome.developerPrivate.HostAccess.ON_SPECIFIC_SITES;
- },
});
return {DetailView: DetailView};
diff --git a/chromium/chrome/browser/resources/md_extensions/error_page.html b/chromium/chrome/browser/resources/md_extensions/error_page.html
index 51caf62978d..851a7bd3944 100644
--- a/chromium/chrome/browser/resources/md_extensions/error_page.html
+++ b/chromium/chrome/browser/resources/md_extensions/error_page.html
@@ -84,7 +84,7 @@
}
.error-item paper-icon-button-light {
- -webkit-margin-end: 0;
+ margin-inline-end: 0;
}
.error-item.selected {
@@ -100,8 +100,8 @@
}
.error-message {
- -webkit-margin-start: 10px;
flex-grow: 1;
+ margin-inline-start: 10px;
word-break: break-word;
}
@@ -142,23 +142,23 @@
/* TODO(scottchen): extract to shared location from settings. */
.separator {
--separator-gaps: 9px;
- -webkit-border-start: var(--cr-separator-line);
- -webkit-margin-end: var(--cr-section-padding);
+ border-inline-start: var(--cr-separator-line);
+ flex-shrink: 0;
+ height: calc(var(--cr-section-min-height) -
+ var(--separator-gaps));
+ margin-inline-end: var(--cr-section-padding);
+
/**
* Makes the tappable area fill its parent.
* TODO(scottchen): This is an explicit reminder to override once
* .separator styling is extracted from settings.
*/
- -webkit-margin-start: 0;
- flex-shrink: 0;
- height: calc(var(--cr-section-min-height) -
- var(--separator-gaps));
-
+ margin-inline-start: 0;
}
/* TODO(scottchen): extract to shared location from settings. */
.separator + paper-icon-button-light {
- -webkit-margin-start: var(--cr-icon-ripple-margin);
+ margin-inline-start: var(--cr-icon-ripple-margin);
}
:host-context(.focus-outline-visible) .start:focus {
diff --git a/chromium/chrome/browser/resources/md_extensions/extensions_resources.grd b/chromium/chrome/browser/resources/md_extensions/extensions_resources.grd
index 7ae0088239c..43672211ddd 100644
--- a/chromium/chrome/browser/resources/md_extensions/extensions_resources.grd
+++ b/chromium/chrome/browser/resources/md_extensions/extensions_resources.grd
@@ -141,6 +141,18 @@
<structure name="IDR_MD_EXTENSIONS_PACK_DIALOG_ALERT_JS"
file="pack_dialog_alert.js"
type="chrome_html" />
+ <structure name="IDR_MD_EXTENSIONS_RUNTIME_HOST_PERMISSIONS_HMTL"
+ file="runtime_host_permissions.html"
+ type="chrome_html" />
+ <structure name="IDR_MD_EXTENSIONS_RUNTIME_HOST_PERMISSIONS_JS"
+ file="runtime_host_permissions.js"
+ type="chrome_html" />
+ <structure name="IDR_MD_EXTENSIONS_RUNTIME_HOSTS_DIALOG_HTML"
+ file="runtime_hosts_dialog.html"
+ type="chrome_html" />
+ <structure name="IDR_MD_EXTENSIONS_RUNTIME_HOSTS_DIALOG_JS"
+ file="runtime_hosts_dialog.js"
+ type="chrome_html" />
<structure name="IDR_MD_EXTENSIONS_SERVICE_HTML"
file="service.html"
type="chrome_html" />
diff --git a/chromium/chrome/browser/resources/md_extensions/extensions_resources_vulcanized.grd b/chromium/chrome/browser/resources/md_extensions/extensions_resources_vulcanized.grd
index d3cb02311e7..f0c773011c6 100644
--- a/chromium/chrome/browser/resources/md_extensions/extensions_resources_vulcanized.grd
+++ b/chromium/chrome/browser/resources/md_extensions/extensions_resources_vulcanized.grd
@@ -13,6 +13,7 @@
<release seq="1">
<includes>
<include name="IDR_MD_EXTENSIONS_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_extensions\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_MD_EXTENSIONS_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\md_extensions\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_MD_EXTENSIONS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_extensions\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
</includes>
</release>
diff --git a/chromium/chrome/browser/resources/md_extensions/install_warnings_dialog.html b/chromium/chrome/browser/resources/md_extensions/install_warnings_dialog.html
index b65e209bb2c..66289b989d9 100644
--- a/chromium/chrome/browser/resources/md_extensions/install_warnings_dialog.html
+++ b/chromium/chrome/browser/resources/md_extensions/install_warnings_dialog.html
@@ -13,10 +13,10 @@
<template>
<style include="cr-shared-style paper-button-style">
div[slot='body'] ul {
- -webkit-padding-end: 10px;
background-color: var(--paper-red-50);
margin: 0;
padding-bottom: 10px;
+ padding-inline-end: 10px;
padding-top: 10px;
}
</style>
diff --git a/chromium/chrome/browser/resources/md_extensions/item.html b/chromium/chrome/browser/resources/md_extensions/item.html
index a080e0fc0ea..ce73ea1c227 100644
--- a/chromium/chrome/browser/resources/md_extensions/item.html
+++ b/chromium/chrome/browser/resources/md_extensions/item.html
@@ -80,10 +80,10 @@
}
#content {
- -webkit-margin-start: 24px;
display: flex;
flex: 1;
flex-direction: column;
+ margin-inline-start: 24px;
overflow: hidden;
}
@@ -93,7 +93,7 @@
}
#name {
- -webkit-margin-end: 8px;
+ margin-inline-end: 8px;
}
#description {
@@ -108,8 +108,8 @@
#error-icon {
--iron-icon-fill-color: var(--google-red-700);
- -webkit-margin-end: 4px;
height: 18px;
+ margin-inline-end: 4px;
width: 18px;
}
@@ -131,20 +131,20 @@
}
#inspect-views > span {
- -webkit-margin-end: 4px;
+ margin-inline-end: 4px;
}
#button-strip {
- -webkit-padding-end: 20px;
box-sizing: border-box;
flex-shrink: 0;
height: var(--cr-section-min-height);
padding-bottom: 8px;
+ padding-inline-end: 20px;
padding-top: 8px;
}
#button-strip paper-button {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
#learn-more-link {
@@ -153,7 +153,7 @@
}
#source-indicator {
- -webkit-margin-start: 24px;
+ margin-inline-start: 24px;
margin-top: 24px;
position: absolute;
}
@@ -192,7 +192,7 @@
}
#dev-reload-button-container {
- -webkit-margin-end: 12px;
+ margin-inline-end: 12px;
}
#blacklisted-warning:empty {
@@ -319,7 +319,7 @@
<paper-button id="remove-button" on-click="onRemoveTap_"
aria-describedby="a11yAssociation"
hidden="[[isControlled_(data.controlledInfo)]]">
- $i18n{itemRemove}
+ $i18n{remove}
</paper-button>
<template is="dom-if" if="[[shouldShowErrorsButton_(data.*)]]">
<paper-button id="errors-button" on-click="onErrorsTap_"
diff --git a/chromium/chrome/browser/resources/md_extensions/item.js b/chromium/chrome/browser/resources/md_extensions/item.js
index 3dec1563cfd..a951f9dca06 100644
--- a/chromium/chrome/browser/resources/md_extensions/item.js
+++ b/chromium/chrome/browser/resources/md_extensions/item.js
@@ -69,6 +69,20 @@ cr.define('extensions', function() {
* @return {!Promise<string>}
*/
getExtensionSize(id) {}
+
+ /**
+ * @param {string} id
+ * @param {string} host
+ * @return {!Promise<void>}
+ */
+ addRuntimeHostPermission(id, host) {}
+
+ /**
+ * @param {string} id
+ * @param {string} host
+ * @return {!Promise<void>}
+ */
+ removeRuntimeHostPermission(id, host) {}
}
const Item = Polymer({
diff --git a/chromium/chrome/browser/resources/md_extensions/item_list.html b/chromium/chrome/browser/resources/md_extensions/item_list.html
index a5cd827c528..90244de120c 100644
--- a/chromium/chrome/browser/resources/md_extensions/item_list.html
+++ b/chromium/chrome/browser/resources/md_extensions/item_list.html
@@ -53,7 +53,7 @@
}
#app-title {
- @apply --cr-section-text;
+ color: var(--cr-primary-text-color);
font-size: 123%;
font-weight: 400;
letter-spacing: .25px;
diff --git a/chromium/chrome/browser/resources/md_extensions/keyboard_shortcuts.html b/chromium/chrome/browser/resources/md_extensions/keyboard_shortcuts.html
index acf7798210c..e4730605882 100644
--- a/chromium/chrome/browser/resources/md_extensions/keyboard_shortcuts.html
+++ b/chromium/chrome/browser/resources/md_extensions/keyboard_shortcuts.html
@@ -54,8 +54,8 @@
.command-entry .md-select {
/* TODO(scottchen): line-height needs adjustment to fix large fonts. */
- -webkit-margin-start: var(--cr-section-padding);
line-height: 22px;
+ margin-inline-start: var(--cr-section-padding);
}
.card-title {
@@ -68,16 +68,16 @@
}
.icon {
- -webkit-margin-end: 20px;
height: 20px;
+ margin-inline-end: 20px;
width: 20px;
}
.card-controls {
/* We line up the controls with the name, which is after the
20px left padding + 20px icon + 20px margin on the icon. */
- -webkit-margin-end: 20px;
- -webkit-margin-start: 60px;
+ margin-inline-end: 20px;
+ margin-inline-start: 60px;
}
</style>
<div id="container">
diff --git a/chromium/chrome/browser/resources/md_extensions/kiosk_dialog.html b/chromium/chrome/browser/resources/md_extensions/kiosk_dialog.html
index 9b7b54d1b4c..302e64c7730 100644
--- a/chromium/chrome/browser/resources/md_extensions/kiosk_dialog.html
+++ b/chromium/chrome/browser/resources/md_extensions/kiosk_dialog.html
@@ -28,7 +28,7 @@
}
#add-kiosk-app paper-button {
- -webkit-margin-start: 10px;
+ margin-inline-start: 10px;
}
#kiosk-apps-list {
diff --git a/chromium/chrome/browser/resources/md_extensions/load_error.html b/chromium/chrome/browser/resources/md_extensions/load_error.html
index dabad1dbce9..77a0f3d11bd 100644
--- a/chromium/chrome/browser/resources/md_extensions/load_error.html
+++ b/chromium/chrome/browser/resources/md_extensions/load_error.html
@@ -22,7 +22,7 @@
}
paper-spinner-lite {
- -webkit-margin-end: 8px;
+ margin-inline-end: 8px;
}
</style>
<cr-dialog id="dialog" close-text="$i18n{close}">
diff --git a/chromium/chrome/browser/resources/md_extensions/manager.js b/chromium/chrome/browser/resources/md_extensions/manager.js
index 35087d3108a..6b540b13899 100644
--- a/chromium/chrome/browser/resources/md_extensions/manager.js
+++ b/chromium/chrome/browser/resources/md_extensions/manager.js
@@ -229,6 +229,7 @@ cr.define('extensions', function() {
case EventType.WARNINGS_CHANGED:
case EventType.COMMAND_ADDED:
case EventType.COMMAND_REMOVED:
+ case EventType.PERMISSIONS_CHANGED:
// |extensionInfo| can be undefined in the case of an extension
// being unloaded right before uninstallation. There's nothing to do
// here.
diff --git a/chromium/chrome/browser/resources/md_extensions/options_dialog.html b/chromium/chrome/browser/resources/md_extensions/options_dialog.html
index ab4bd4da479..99d583cf70a 100644
--- a/chromium/chrome/browser/resources/md_extensions/options_dialog.html
+++ b/chromium/chrome/browser/resources/md_extensions/options_dialog.html
@@ -10,8 +10,8 @@
<template>
<style>
#icon {
- -webkit-margin-end: 10px;
height: 32px;
+ margin-inline-end: 10px;
width: 32px;
}
@@ -29,10 +29,10 @@
cr-dialog {
--scroll-border: 0;
--cr-dialog-body: {
- -webkit-padding-end: 0;
- -webkit-padding-start: 0;
height: 100%;
padding-bottom: 0;
+ padding-inline-end: 0;
+ padding-inline-start: 0;
padding-top: 0;
};
diff --git a/chromium/chrome/browser/resources/md_extensions/pack_dialog.html b/chromium/chrome/browser/resources/md_extensions/pack_dialog.html
index 498323d8035..d0e24585110 100644
--- a/chromium/chrome/browser/resources/md_extensions/pack_dialog.html
+++ b/chromium/chrome/browser/resources/md_extensions/pack_dialog.html
@@ -20,7 +20,7 @@
}
paper-button[slot='suffix'] {
- -webkit-margin-start: 10px;
+ margin-inline-start: 10px;
}
/* Prevent focus-outline from being chopped by the bottom of dialog body.
diff --git a/chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.html b/chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.html
new file mode 100644
index 00000000000..d2bb9e60e01
--- /dev/null
+++ b/chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.html
@@ -0,0 +1,115 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
+<link rel="import" href="chrome://resources/cr_elements/paper_button_style_css.html">
+<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
+<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
+<link rel="import" href="chrome://resources/html/cr.html">
+<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
+<link rel="import" href="chrome://resources/html/md_select_css.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="runtime_hosts_dialog.html">
+<link rel="import" href="strings.html">
+
+<dom-module id="extensions-runtime-host-permissions">
+ <template>
+ <style include="cr-shared-style md-select paper-button-style">
+ #add-hosts-section {
+ align-items: center;
+ display: flex;
+ justify-content: space-between;
+ margin-top: 10px;
+ }
+
+ #hosts li {
+ align-items: center;
+ display: flex;
+ justify-content: space-between;
+ }
+
+ .mid-section-header {
+ color: var(--cr-primary-text-color);
+ margin-top: 12px;
+ }
+
+ #permissions-mode {
+ align-items: center;
+ display: flex;
+ justify-content: space-between;
+ }
+
+ a[href] {
+ color: var(--google-blue-700);
+ text-decoration: none;
+ }
+ </style>
+ <div id="permissions-mode">
+ <div>
+ <div class="mid-section-header">
+ $i18n{hostPermissionsHeading}
+ </div>
+ <div>
+ $i18nRaw{hostPermissionsLearnMoreLink}
+ </div>
+ </div>
+ <select id="host-access" class="md-select"
+ value="[[permissions.hostAccess]]"
+ on-change="onHostAccessChange_">
+ <option value$="[[HostAccess_.ON_CLICK]]">
+ $i18n{hostAccessOnClick}
+ </option>
+ <option value$="[[HostAccess_.ON_SPECIFIC_SITES]]">
+ $i18n{hostAccessOnSpecificSites}
+ </option>
+ <option value$="[[HostAccess_.ON_ALL_SITES]]">
+ $i18n{hostAccessOnAllSites}
+ </option>
+ </select>
+ </div>
+ <template is="dom-if" if="[[showSpecificSites_(permissions.*)]]">
+ <div id="add-hosts-section">
+ <div class="mid-section-header">
+ $i18n{hostAllowedHosts}
+ </div>
+ <paper-button id="add-host" on-click="onAddHostClick_">
+ $i18n{add}
+ </paper-button>
+ </div>
+ <ul id="hosts">
+ <template is="dom-repeat"
+ items="[[permissions.runtimeHostPermissions]]">
+ <li>
+ <div>[[item]]</div>
+ <paper-icon-button-light class="icon-more-vert">
+ <button class="edit-host"
+ on-click="onEditHostClick_"
+ title="$i18n{hostPermissionsEdit}">
+ </button>
+ </paper-icon-button-light>
+ </li>
+ </template>
+ </ul>
+ </template>
+ <cr-action-menu id="hostActionMenu"
+ on-close="onActionMenuClose_">
+ <button slot="item" class="dropdown-item" id="action-menu-edit"
+ on-click="onActionMenuEditClick_">
+ $i18n{hostPermissionsEdit}
+ </button>
+ <button slot="item" class="dropdown-item" id="action-menu-remove"
+ on-click="onActionMenuRemoveClick_">
+ $i18n{remove}
+ </button>
+ </cr-action-menu>
+ <template is="dom-if" if="[[showHostDialog_]]" restamp>
+ <extensions-runtime-hosts-dialog
+ delegate="[[delegate]]" item-id="[[itemId]]"
+ current-site="[[hostDialogModel_]]"
+ update-host-access="[[dialogShouldUpdateHostAccess_(oldHostAccess_)]]"
+ on-close="onHostDialogClose_"
+ on-cancel="onHostDialogCancel_">
+ </extensions-runtime-hosts-dialog>
+ </template>
+ </template>
+ <script src="runtime_host_permissions.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.js b/chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.js
new file mode 100644
index 00000000000..0463c047cbd
--- /dev/null
+++ b/chromium/chrome/browser/resources/md_extensions/runtime_host_permissions.js
@@ -0,0 +1,234 @@
+// 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.
+
+cr.define('extensions', function() {
+ 'use strict';
+
+ const RuntimeHostPermissions = Polymer({
+ is: 'extensions-runtime-host-permissions',
+
+ properties: {
+ /**
+ * The underlying permissions data.
+ * @type {chrome.developerPrivate.Permissions}
+ */
+ permissions: Object,
+
+ /** @private */
+ itemId: String,
+
+ /** @type {!extensions.ItemDelegate} */
+ delegate: Object,
+
+ /**
+ * Whether the dialog to add a new host permission is shown.
+ * @private
+ */
+ showHostDialog_: Boolean,
+
+ /**
+ * The current site of the entry that the host dialog is editing, if the
+ * dialog is open for editing.
+ * @type {?string}
+ * @private
+ */
+ hostDialogModel_: {
+ type: String,
+ value: null,
+ },
+
+ /**
+ * The element to return focus to once the host dialog closes.
+ * @type {?HTMLElement}
+ * @private
+ */
+ hostDialogAnchorElement_: {
+ type: Object,
+ value: null,
+ },
+
+ /**
+ * If the action menu is open, the site of the entry it is open for.
+ * Otherwise null.
+ * @type {?string}
+ * @private
+ */
+ actionMenuModel_: {
+ type: String,
+ value: null,
+ },
+
+ /**
+ * The element that triggered the action menu, so that the page will
+ * return focus once the action menu (or dialog) closes.
+ * @type {?HTMLElement}
+ * @private
+ */
+ actionMenuAnchorElement_: {
+ type: Object,
+ value: null,
+ },
+
+ /**
+ * The old host access setting; used when we don't immediately commit the
+ * change to host access so that we can reset it if the user cancels.
+ * @type {?string}
+ * @private
+ */
+ oldHostAccess_: {
+ type: String,
+ value: null,
+ },
+
+ /**
+ * Proxying the enum to be used easily by the html template.
+ * @private
+ */
+ HostAccess_: {
+ type: Object,
+ value: chrome.developerPrivate.HostAccess,
+ },
+ },
+
+ /**
+ * @param {!Event} event
+ * @private
+ */
+ onHostAccessChange_: function(event) {
+ const select = /** @type {!HTMLSelectElement} */ (event.target);
+ const access =
+ /** @type {chrome.developerPrivate.HostAccess} */ (select.value);
+
+ if (access == chrome.developerPrivate.HostAccess.ON_SPECIFIC_SITES &&
+ (!this.permissions.runtimeHostPermissions ||
+ this.permissions.runtimeHostPermissions.length == 0)) {
+ // If the user is transitioning to the "on specific sites" option, show
+ // the "add host" dialog. This serves two purposes:
+ // - The user is prompted to add a host immediately, since otherwise
+ // "on specific sites" is meaningless, and
+ // - The way the C++ code differentiates between "on click" and "on
+ // specific sites" is by checking if there are any specific sites.
+ // This ensures there will be at least one, so that the host access
+ // is properly calculated.
+ this.oldHostAccess_ = assert(this.permissions.hostAccess);
+ this.doShowHostDialog_(select, null);
+ } else {
+ this.delegate.setItemHostAccess(this.itemId, access);
+ }
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ showSpecificSites_: function() {
+ return this.permissions &&
+ this.permissions.hostAccess ==
+ chrome.developerPrivate.HostAccess.ON_SPECIFIC_SITES;
+ },
+
+ /**
+ * @param {Event} e
+ * @private
+ */
+ onAddHostClick_: function(e) {
+ const target = /** @type {!HTMLElement} */ (e.target);
+ this.doShowHostDialog_(target, null);
+ },
+
+ /**
+ * @param {!HTMLElement} anchorElement The element to return focus to once
+ * the dialog closes.
+ * @param {?string} currentSite The site entry currently being
+ * edited, or null if this is to add a new entry.
+ * @private
+ */
+ doShowHostDialog_: function(anchorElement, currentSite) {
+ this.hostDialogAnchorElement_ = anchorElement;
+ this.hostDialogModel_ = currentSite;
+ this.showHostDialog_ = true;
+ },
+
+ /** @private */
+ onHostDialogClose_: function() {
+ this.hostDialogModel_ = null;
+ this.showHostDialog_ = false;
+ cr.ui.focusWithoutInk(
+ assert(this.hostDialogAnchorElement_, 'Host Anchor'));
+ this.hostDialogAnchorElement_ = null;
+ },
+
+ /** @private */
+ onHostDialogCancel_: function() {
+ // The user canceled the dialog. Set host-access back to the old value,
+ // if the dialog was shown when just transitioning to a new state.
+ if (this.oldHostAccess_) {
+ assert(this.permissions.hostAccess == this.oldHostAccess_);
+ this.$['host-access'].value = this.oldHostAccess_;
+ this.oldHostAccess_ = null;
+ }
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ dialogShouldUpdateHostAccess_: function() {
+ return !!this.oldHostAccess_;
+ },
+
+ /**
+ * @param {!{
+ * model: !{item: string},
+ * target: !HTMLElement,
+ * }} e
+ * @private
+ */
+ onEditHostClick_: function(e) {
+ this.actionMenuModel_ = e.model.item;
+ this.actionMenuAnchorElement_ = e.target;
+ const actionMenu =
+ /** @type {CrActionMenuElement} */ (this.$.hostActionMenu);
+ actionMenu.showAt(e.target);
+ },
+
+ /** @private */
+ onActionMenuEditClick_: function() {
+ // Cache the site before closing the action menu, since it's cleared.
+ const site = this.actionMenuModel_;
+
+ // Cache and reset actionMenuAnchorElement_ so focus is not returned
+ // to the action menu's trigger (since the dialog will be shown next).
+ // Instead, curry the element to the dialog, so once it closes, focus
+ // will be returned.
+ const anchorElement =
+ assert(this.actionMenuAnchorElement_, 'Menu Anchor');
+ this.actionMenuAnchorElement_ = null;
+ this.closeActionMenu_();
+ this.doShowHostDialog_(anchorElement, site);
+ },
+
+ /** @private */
+ onActionMenuRemoveClick_: function() {
+ this.delegate.removeRuntimeHostPermission(
+ this.itemId, assert(this.actionMenuModel_, 'Action Menu Model'));
+ this.closeActionMenu_();
+ },
+
+ /** @private */
+ closeActionMenu_: function() {
+ const menu = this.$.hostActionMenu;
+ assert(menu.open);
+ menu.close();
+ },
+
+ /** @private */
+ onActionMenuClose_: function() {
+ this.actionMenuModel_ = null;
+ this.actionMenuAnchorElement_ = null;
+ },
+ });
+
+ return {RuntimeHostPermissions: RuntimeHostPermissions};
+});
diff --git a/chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.html b/chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.html
new file mode 100644
index 00000000000..b639ed5754b
--- /dev/null
+++ b/chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.html
@@ -0,0 +1,37 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
+<link rel="import" href="chrome://resources/cr_elements/paper_button_style_css.html">
+<link rel="import" href="chrome://resources/cr_elements/shared_style_css.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="strings.html">
+
+<dom-module id="extensions-runtime-hosts-dialog">
+ <template>
+ <style include="cr-shared-style paper-button-style"></style>
+ <cr-dialog id="dialog" close-text="$i18n{close}">
+ <div slot="title">[[computeDialogTitle_(currentSite)]]</div>
+ <div slot="body">
+ <cr-input id="input" label="$i18n{runtimeHostsDialogInputLabel}"
+ placeholder="http://example.com"
+ value="{{site_}}" on-input="validate_"
+ invalid="[[inputInvalid_]]"
+ error-message="$i18n{runtimeHostsDialogInputError}"
+ spellcheck="false"
+ autofocus>
+ </cr-input>
+ </div>
+ <div slot="button-container">
+ <paper-button class="cancel-button" on-click="onCancelTap_">
+ $i18n{cancel}
+ </paper-button>
+ <paper-button class="action-button" id="submit" on-click="onSubmitTap_"
+ disabled="[[computeSubmitButtonDisabled_(inputInvalid_, site_)]]">
+ [[computeSubmitButtonLabel_(currentSite)]]
+ </paper-button>
+ </div>
+ </cr-dialog>
+ </template>
+ <script src="runtime_hosts_dialog.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.js b/chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.js
new file mode 100644
index 00000000000..3023daddbf0
--- /dev/null
+++ b/chromium/chrome/browser/resources/md_extensions/runtime_hosts_dialog.js
@@ -0,0 +1,222 @@
+// 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.
+
+cr.define('extensions', function() {
+ 'use strict';
+
+ // A RegExp to roughly match acceptable patterns entered by the user.
+ // exec'ing() this RegExp will match the following groups:
+ // 0: Full matched string.
+ // 1: Scheme + scheme separator (e.g., 'https://').
+ // 2: Scheme only (e.g., 'https').
+ // 3: Match subdomains ('*.').
+ // 4: Hostname (e.g., 'example.com').
+ // 5: Port, including ':' separator (e.g., ':80').
+ // 6: Path, include '/' separator (e.g., '/*').
+ const patternRegExp = new RegExp(
+ '^' +
+ // Scheme; optional.
+ '((http|https|\\*)://)?' +
+ // Include subdomains specifier; optional.
+ '(\\*\\.)?' +
+ // Hostname, required.
+ '([a-z0-9\\.-]+\\.[a-z0-9]+)' +
+ // Port, optional.
+ '(:[0-9]+)?' +
+ // Path, optional but if present must be '/' or '/*'.
+ '(\\/\\*|\\/)?' +
+ '$');
+
+ function getPatternFromSite(site) {
+ let res = patternRegExp.exec(site);
+ assert(res);
+ let scheme = res[1] || '*://';
+ let host = (res[3] || '') + res[4];
+ let port = res[5] || '';
+ let path = '/*';
+ return scheme + host + port + path;
+ }
+
+ const RuntimeHostsDialog = Polymer({
+ is: 'extensions-runtime-hosts-dialog',
+
+ properties: {
+ /** @type {!extensions.ItemDelegate} */
+ delegate: Object,
+
+ /** @type {string} */
+ itemId: String,
+
+ /**
+ * The site that this entry is currently managing. Only non-empty if this
+ * is for editing an existing entry.
+ * @type {?string}
+ */
+ currentSite: {
+ type: String,
+ value: null,
+ },
+
+ /**
+ * Whether the dialog should update the host access to be "on specific
+ * sites" before adding a new host permission.
+ */
+ updateHostAccess: {
+ type: Boolean,
+ value: false,
+ },
+
+ /**
+ * The site to add an exception for.
+ * @private
+ */
+ site_: String,
+
+ /**
+ * Whether the currently-entered input is valid.
+ * @private
+ */
+ inputInvalid_: {
+ type: Boolean,
+ value: false,
+ },
+ },
+
+ /** @override */
+ attached: function() {
+ if (this.currentSite !== null) {
+ this.site_ = this.currentSite;
+ this.validate_();
+ }
+ this.$.dialog.showModal();
+ },
+
+ /** @return {boolean} */
+ isOpen: function() {
+ return this.$.dialog.open;
+ },
+
+ /**
+ * Validates that the pattern entered is valid.
+ * @private
+ */
+ validate_: function() {
+ // If input is empty, disable the action button, but don't show the red
+ // invalid message.
+ if (this.site_.trim().length == 0) {
+ this.inputInvalid_ = false;
+ return;
+ }
+
+ let valid = patternRegExp.test(this.site_);
+ this.inputInvalid_ = !valid;
+ },
+
+ /**
+ * @return {string}
+ * @private
+ */
+ computeDialogTitle_: function() {
+ const stringId = this.currentSite === null ? 'runtimeHostsDialogTitle' :
+ 'hostPermissionsEdit';
+ return loadTimeData.getString(stringId);
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ computeSubmitButtonDisabled_: function() {
+ return this.inputInvalid_ || this.site_.trim().length == 0;
+ },
+
+ /**
+ * @return {string}
+ * @private
+ */
+ computeSubmitButtonLabel_: function() {
+ const stringId = this.currentSite === null ? 'add' : 'save';
+ return loadTimeData.getString(stringId);
+ },
+
+ /** @private */
+ onCancelTap_: function() {
+ this.$.dialog.cancel();
+ },
+
+ /**
+ * The tap handler for the submit button (adds the pattern and closes
+ * the dialog).
+ * @private
+ */
+ onSubmitTap_: function() {
+ if (this.currentSite !== null)
+ this.handleEdit_();
+ else
+ this.handleAdd_();
+ },
+
+ /**
+ * Handles adding a new site entry.
+ * @private
+ */
+ handleAdd_: function() {
+ assert(!this.currentSite);
+
+ if (this.updateHostAccess) {
+ this.delegate.setItemHostAccess(
+ this.itemId, chrome.developerPrivate.HostAccess.ON_SPECIFIC_SITES);
+ }
+
+ this.addPermission_();
+ },
+
+ /**
+ * Handles editing an existing site entry.
+ * @private
+ */
+ handleEdit_: function() {
+ assert(this.currentSite);
+ assert(
+ !this.updateHostAccess,
+ 'Editing host permissions should only be possible if the host ' +
+ 'access is already set to specific sites.');
+
+ if (this.currentSite == this.site_) {
+ // No change in values, so no need to update anything.
+ this.$.dialog.close();
+ return;
+ }
+
+ // Editing an existing entry is done by removing the current site entry,
+ // and then adding the new one.
+ this.delegate.removeRuntimeHostPermission(this.itemId, this.currentSite)
+ .then(() => {
+ this.addPermission_();
+ });
+ },
+
+ /**
+ * Adds the runtime host permission through the delegate. If successful,
+ * closes the dialog; otherwise displays the invalid input message.
+ * @private
+ */
+ addPermission_: function() {
+ let pattern = getPatternFromSite(this.site_);
+ this.delegate.addRuntimeHostPermission(this.itemId, pattern)
+ .then(
+ () => {
+ this.$.dialog.close();
+ },
+ () => {
+ this.inputInvalid_ = true;
+ });
+ },
+ });
+
+ return {
+ RuntimeHostsDialog: RuntimeHostsDialog,
+ getPatternFromSite: getPatternFromSite
+ };
+});
diff --git a/chromium/chrome/browser/resources/md_extensions/service.js b/chromium/chrome/browser/resources/md_extensions/service.js
index 2f964b5dabc..0e1646c350f 100644
--- a/chromium/chrome/browser/resources/md_extensions/service.js
+++ b/chromium/chrome/browser/resources/md_extensions/service.js
@@ -67,6 +67,32 @@ cr.define('extensions', function() {
});
}
+ /** @override */
+ addRuntimeHostPermission(id, host) {
+ return new Promise((resolve, reject) => {
+ chrome.developerPrivate.addHostPermission(id, host, () => {
+ if (chrome.runtime.lastError) {
+ reject(chrome.runtime.lastError.message);
+ return;
+ }
+ resolve();
+ });
+ });
+ }
+
+ /** @override */
+ removeRuntimeHostPermission(id, host) {
+ return new Promise((resolve, reject) => {
+ chrome.developerPrivate.removeHostPermission(id, host, () => {
+ if (chrome.runtime.lastError) {
+ reject(chrome.runtime.lastError.message);
+ return;
+ }
+ resolve();
+ });
+ });
+ }
+
/**
* Opens a file browser dialog for the user to select a file (or directory).
* @param {chrome.developerPrivate.SelectType} selectType
diff --git a/chromium/chrome/browser/resources/md_extensions/sidebar.html b/chromium/chrome/browser/resources/md_extensions/sidebar.html
index e243da81060..32cfa03491c 100644
--- a/chromium/chrome/browser/resources/md_extensions/sidebar.html
+++ b/chromium/chrome/browser/resources/md_extensions/sidebar.html
@@ -31,14 +31,14 @@
}
.section-item {
- /* Ensure the focus outline appears correctly (crbug.com/655503). */
- -webkit-margin-end: 4px;
- -webkit-padding-start: 24px;
align-items: center;
color: inherit;
display: flex;
font-weight: 500;
+ /* Ensure the focus outline appears correctly (crbug.com/655503). */
+ margin-inline-end: 4px;
min-height: 40px;
+ padding-inline-start: 24px;
position: relative;
text-decoration: none;
}
@@ -56,7 +56,7 @@
}
.cr-icon {
- -webkit-margin-end: calc(
+ margin-inline-end: calc(
var(--cr-section-padding) - var(--cr-icon-ripple-padding));
}
</style>
diff --git a/chromium/chrome/browser/resources/md_extensions/toggle_row.html b/chromium/chrome/browser/resources/md_extensions/toggle_row.html
index b71803d44ca..c847dbfa88f 100644
--- a/chromium/chrome/browser/resources/md_extensions/toggle_row.html
+++ b/chromium/chrome/browser/resources/md_extensions/toggle_row.html
@@ -33,8 +33,8 @@
}
:host ::slotted(*) {
- -webkit-margin-end: 20px;
flex: 1;
+ margin-inline-end: 20px;
}
</style>
<label id="label">
diff --git a/chromium/chrome/browser/resources/md_extensions/toolbar.html b/chromium/chrome/browser/resources/md_extensions/toolbar.html
index b609815d867..e4e9ba43278 100644
--- a/chromium/chrome/browser/resources/md_extensions/toolbar.html
+++ b/chromium/chrome/browser/resources/md_extensions/toolbar.html
@@ -41,7 +41,7 @@
}
cr-tooltip-icon {
- -webkit-margin-end: 20px;
+ margin-inline-end: 20px;
}
#devDrawer[expanded] #buttonStrip {
@@ -63,8 +63,8 @@
}
#buttonStrip {
- -webkit-margin-end: auto;
- -webkit-margin-start: 24px;
+ margin-inline-end: auto;
+ margin-inline-start: 24px;
padding: var(--padding-top-bottom) 0;
position: absolute;
top: calc(var(--button-row-height) * -1);
@@ -75,7 +75,7 @@
}
#buttonStrip paper-button {
- -webkit-margin-end: 16px;
+ margin-inline-end: 16px;
}
.more-actions {
@@ -85,7 +85,7 @@
}
.more-actions span {
- -webkit-margin-end: 16px;
+ margin-inline-end: 16px;
}
cr-toast > div {
diff --git a/chromium/chrome/browser/resources/md_history/BUILD.gn b/chromium/chrome/browser/resources/md_history/BUILD.gn
index 7b647e03ee3..4523731ad49 100644
--- a/chromium/chrome/browser/resources/md_history/BUILD.gn
+++ b/chromium/chrome/browser/resources/md_history/BUILD.gn
@@ -15,6 +15,10 @@ optimize_webui("build") {
"app.vulcanized.html",
"lazy_load.vulcanized.html",
]
+ html_out_files_polymer2 = [
+ "app.vulcanized.p2.html",
+ "lazy_load.vulcanized.p2.html",
+ ]
input = rebase_path(".", root_build_dir)
js_out_files = [
diff --git a/chromium/chrome/browser/resources/md_history/history.html b/chromium/chrome/browser/resources/md_history/history.html
index 674255831e2..6ed853571a3 100644
--- a/chromium/chrome/browser/resources/md_history/history.html
+++ b/chromium/chrome/browser/resources/md_history/history.html
@@ -51,12 +51,12 @@
}
#loading-toolbar {
- -webkit-padding-start: 24px;
align-items: center;
background: var(--md-toolbar-color);
color: #fff;
height: 56px;
letter-spacing: .25px;
+ padding-inline-start: 24px;
}
#loading-message {
diff --git a/chromium/chrome/browser/resources/md_history/history_item.html b/chromium/chrome/browser/resources/md_history/history_item.html
index f80fda1b082..ba60c94e28a 100644
--- a/chromium/chrome/browser/resources/md_history/history_item.html
+++ b/chromium/chrome/browser/resources/md_history/history_item.html
@@ -49,10 +49,10 @@
}
#item-container {
- -webkit-padding-start: 10px;
align-items: center;
display: flex;
min-height: var(--item-height);
+ padding-inline-start: 10px;
pointer-events: auto;
}
@@ -88,24 +88,24 @@
}
#time-accessed {
- -webkit-margin-start: 6px;
color: var(--history-item-time-color);
+ margin-inline-start: 6px;
min-width: 96px;
}
#domain {
- -webkit-margin-start: 16px;
color: var(--cr-secondary-text-color);
flex-shrink: 0;
+ margin-inline-start: 16px;
}
#menu-button-container {
- -webkit-margin-end: 12px;
+ margin-inline-end: 12px;
}
#star-container {
- -webkit-margin-end: 4px;
- -webkit-margin-start: 12px;
+ margin-inline-end: 4px;
+ margin-inline-start: 12px;
width: 32px;
}
@@ -121,9 +121,9 @@
}
#time-gap-separator {
- -webkit-border-start: 1px solid #888;
- -webkit-margin-start: 77px;
+ border-inline-start: 1px solid #888;
height: 15px;
+ margin-inline-start: 77px;
}
#background-clip {
diff --git a/chromium/chrome/browser/resources/md_history/history_list.js b/chromium/chrome/browser/resources/md_history/history_list.js
index cfba7c3e491..8cfa93aaaf0 100644
--- a/chromium/chrome/browser/resources/md_history/history_list.js
+++ b/chromium/chrome/browser/resources/md_history/history_list.js
@@ -34,7 +34,10 @@ Polymer({
},
// An array of history entries in reverse chronological order.
- historyData_: Array,
+ historyData_: {
+ type: Array,
+ observer: 'onHistoryDataChanged_',
+ },
lastFocused_: Object,
@@ -521,4 +524,14 @@ Polymer({
}
}
},
+
+ /**
+ * Adding in order to address an issue with a flaky test. After the list is
+ * updated, the test would not see the updated elements when using Polymer 2.
+ * This has yet to be reproduced in manual testing.
+ * @private
+ */
+ onHistoryDataChanged_: function() {
+ this.$['infinite-list'].fire('iron-resize');
+ },
});
diff --git a/chromium/chrome/browser/resources/md_history/history_toolbar.html b/chromium/chrome/browser/resources/md_history/history_toolbar.html
index 05b0e167eb5..99706b56a6f 100644
--- a/chromium/chrome/browser/resources/md_history/history_toolbar.html
+++ b/chromium/chrome/browser/resources/md_history/history_toolbar.html
@@ -34,6 +34,10 @@
--selection-overlay-max-width: var(--card-max-width);
--cr-toolbar-field-margin: var(--side-bar-width);
}
+
+ cr-toolbar-selection-overlay[show] {
+ opacity: 1;
+ }
</style>
<cr-toolbar id="main-toolbar"
has-overlay$="[[itemsSelected_]]"
diff --git a/chromium/chrome/browser/resources/md_history/shared_style.html b/chromium/chrome/browser/resources/md_history/shared_style.html
index 6b30fd7697e..9fd5c3cbf72 100644
--- a/chromium/chrome/browser/resources/md_history/shared_style.html
+++ b/chromium/chrome/browser/resources/md_history/shared_style.html
@@ -43,8 +43,8 @@
}
.website-title {
- -webkit-margin-start: 16px;
color: var(--cr-primary-text-color);
+ margin-inline-start: 16px;
overflow: hidden;
text-decoration: none;
text-overflow: ellipsis;
diff --git a/chromium/chrome/browser/resources/md_history/side_bar.html b/chromium/chrome/browser/resources/md_history/side_bar.html
index e49ca4f078d..c2fbbb2c675 100644
--- a/chromium/chrome/browser/resources/md_history/side_bar.html
+++ b/chromium/chrome/browser/resources/md_history/side_bar.html
@@ -32,7 +32,7 @@
}
#clear-browsing-data .cr-icon {
- -webkit-margin-end: 20px;
+ margin-inline-end: 20px;
}
iron-selector {
@@ -47,15 +47,15 @@
iron-selector > a {
/* Ensure the focus outline appears correctly (crbug.com/655503). */
- -webkit-margin-end: 4px;
- -webkit-padding-start: 24px;
align-items: center;
box-sizing: border-box;
color: inherit;
cursor: pointer;
display: flex;
font-weight: 500;
+ margin-inline-end: 4px;
min-height: 40px;
+ padding-inline-start: 24px;
position: relative;
text-decoration: none;
}
@@ -79,9 +79,9 @@
}
#footer-text {
- -webkit-padding-end: 16px;
- -webkit-padding-start: 24px;
margin: 24px 0;
+ padding-inline-end: 16px;
+ padding-inline-start: 24px;
}
#footer a {
diff --git a/chromium/chrome/browser/resources/md_history/synced_device_card.html b/chromium/chrome/browser/resources/md_history/synced_device_card.html
index 9efd7ccb921..f9d48458ac3 100644
--- a/chromium/chrome/browser/resources/md_history/synced_device_card.html
+++ b/chromium/chrome/browser/resources/md_history/synced_device_card.html
@@ -23,9 +23,9 @@
}
#card-heading {
- -webkit-padding-end: 0;
cursor: pointer;
justify-content: space-between;
+ padding-inline-end: 0;
}
#tab-item-list {
@@ -48,8 +48,8 @@
}
#right-buttons {
- -webkit-margin-end: 12px;
color: var(--cr-secondary-text-color);
+ margin-inline-end: 12px;
}
#collapse {
diff --git a/chromium/chrome/browser/resources/md_user_manager/control_bar.html b/chromium/chrome/browser/resources/md_user_manager/control_bar.html
index 05133dec2a9..964e4614a48 100644
--- a/chromium/chrome/browser/resources/md_user_manager/control_bar.html
+++ b/chromium/chrome/browser/resources/md_user_manager/control_bar.html
@@ -11,20 +11,20 @@
<template>
<style include="shared-styles iron-flex iron-flex-alignment iron-positioning">
#container {
- -webkit-padding-end: 8px;
- -webkit-padding-start: 24px;
align-items: center;
min-height: 32px;
padding-bottom: 12px;
+ padding-inline-end: 8px;
+ padding-inline-start: 24px;
padding-top: 12px;
}
#logo {
- -webkit-margin-end: auto;
+ margin-inline-end: auto;
}
paper-button + paper-button {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
</style>
<div id="container" class="layout horizontal end-justified">
diff --git a/chromium/chrome/browser/resources/md_user_manager/create_profile.html b/chromium/chrome/browser/resources/md_user_manager/create_profile.html
index 3bda9942734..8e72249d398 100644
--- a/chromium/chrome/browser/resources/md_user_manager/create_profile.html
+++ b/chromium/chrome/browser/resources/md_user_manager/create_profile.html
@@ -61,7 +61,7 @@
}
#message-container #message {
- -webkit-margin-start: 16px;
+ margin-inline-start: 16px;
}
#message-container a {
@@ -100,9 +100,9 @@
}
#actions paper-spinner-lite {
- -webkit-margin-end: 8px;
align-self: center;
height: 20px;
+ margin-inline-end: 8px;
width: 20px;
}
</style>
diff --git a/chromium/chrome/browser/resources/md_user_manager/user_manager.html b/chromium/chrome/browser/resources/md_user_manager/user_manager.html
index f5bc375846f..6712b2e6a17 100644
--- a/chromium/chrome/browser/resources/md_user_manager/user_manager.html
+++ b/chromium/chrome/browser/resources/md_user_manager/user_manager.html
@@ -171,7 +171,7 @@
}
.pod.locked.child .locked-indicator {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
.pod.legacy-supervised .legacy-supervised-indicator {
diff --git a/chromium/chrome/browser/resources/md_user_manager/user_manager_tutorial.html b/chromium/chrome/browser/resources/md_user_manager/user_manager_tutorial.html
index c6b49136d6c..1a14dab370f 100644
--- a/chromium/chrome/browser/resources/md_user_manager/user_manager_tutorial.html
+++ b/chromium/chrome/browser/resources/md_user_manager/user_manager_tutorial.html
@@ -26,7 +26,7 @@
:host.single-pod #yourChrome,
:host.single-pod #complete {
- -webkit-margin-start: 30px;
+ margin-inline-start: 30px;
}
#guests {
diff --git a/chromium/chrome/browser/resources/media/media_engagement.html b/chromium/chrome/browser/resources/media/media_engagement.html
index af4c2d8e1e2..81708454a76 100644
--- a/chromium/chrome/browser/resources/media/media_engagement.html
+++ b/chromium/chrome/browser/resources/media/media_engagement.html
@@ -38,7 +38,7 @@
background: rgb(224, 236, 255);
cursor: pointer;
padding-bottom: 4px;
- padding-right: 16px;
+ padding-right: 4px;
padding-top: 4px;
white-space: nowrap;
}
@@ -87,6 +87,10 @@
background: rgb(255, 255, 187);
}
+ th.sort-column {
+ padding-right: 16px;
+ }
+
th.sort-column::after {
content: 'â–²';
position: absolute;
@@ -133,6 +137,12 @@
<th sort-key="mediaPlaybacks" sort-reverse>
Sessions with playback
</th>
+ <th sort-key="audioContextPlaybacks" sort-reverse>
+ Sessions with playback<br>(audio context only)
+ </th>
+ <th sort-key="mediaElementPlaybacks" sort-reverse>
+ Sessions with playback<br>(media element only)
+ </th>
<th sort-key="audiblePlaybacks" sort-reverse>
Audible Playbacks*
</th>
@@ -166,6 +176,8 @@
<td class="origin-cell"></td>
<td class="visits-count-cell"></td>
<td class="media-playbacks-count-cell"></td>
+ <td class="audio-context-playbacks-count-cell"></td>
+ <td class="media-element-playbacks-count-cell"></td>
<td class="audible-playbacks-count-cell"></td>
<td class="significant-playbacks-count-cell"></td>
<td class="last-playback-time-cell"></td>
diff --git a/chromium/chrome/browser/resources/media/media_engagement.js b/chromium/chrome/browser/resources/media/media_engagement.js
index a1619c26b6a..0852ee3dace 100644
--- a/chromium/chrome/browser/resources/media/media_engagement.js
+++ b/chromium/chrome/browser/resources/media/media_engagement.js
@@ -32,15 +32,17 @@ function createRow(rowInfo) {
td[0].textContent = rowInfo.origin.url;
td[1].textContent = rowInfo.visits;
td[2].textContent = rowInfo.mediaPlaybacks;
- td[3].textContent = rowInfo.audiblePlaybacks;
- td[4].textContent = rowInfo.significantPlaybacks;
- td[5].textContent = rowInfo.lastMediaPlaybackTime ?
+ td[3].textContent = rowInfo.audioContextPlaybacks;
+ td[4].textContent = rowInfo.mediaElementPlaybacks;
+ td[5].textContent = rowInfo.audiblePlaybacks;
+ td[6].textContent = rowInfo.significantPlaybacks;
+ td[7].textContent = rowInfo.lastMediaPlaybackTime ?
new Date(rowInfo.lastMediaPlaybackTime).toISOString() :
'';
- td[6].textContent = rowInfo.isHigh ? 'Yes' : 'No';
- td[7].textContent = rowInfo.highScoreChanges;
- td[8].textContent = rowInfo.totalScore ? rowInfo.totalScore.toFixed(2) : '0';
- td[9].getElementsByClassName('engagement-bar')[0].style.width =
+ td[8].textContent = rowInfo.isHigh ? 'Yes' : 'No';
+ td[9].textContent = rowInfo.highScoreChanges;
+ td[10].textContent = rowInfo.totalScore ? rowInfo.totalScore.toFixed(2) : '0';
+ td[11].getElementsByClassName('engagement-bar')[0].style.width =
(rowInfo.totalScore * 50) + 'px';
return document.importNode(template.content, true);
}
@@ -80,7 +82,8 @@ function compareTableItem(sortKey, a, b) {
if (sortKey == 'visits' || sortKey == 'mediaPlaybacks' ||
sortKey == 'lastMediaPlaybackTime' || sortKey == 'totalScore' ||
sortKey == 'audiblePlaybacks' || sortKey == 'significantPlaybacks' ||
- sortKey == 'highScoreChanges' || sortKey == 'isHigh') {
+ sortKey == 'highScoreChanges' || sortKey == 'mediaElementPlaybacks' ||
+ sortKey == 'audioContextPlaybacks' || sortKey == 'isHigh') {
return val1 - val2;
}
@@ -124,6 +127,15 @@ function renderConfigTable(config) {
formatFeatureFlag(config.featureBypassAutoplay)));
configTableBody.appendChild(createConfigRow(
'Preload MEI data', formatFeatureFlag(config.featurePreloadData)));
+ configTableBody.appendChild(createConfigRow(
+ 'Autoplay sound settings',
+ formatFeatureFlag(config.featureAutoplaySoundSettings)));
+ configTableBody.appendChild(createConfigRow(
+ 'Unified autoplay (preference)',
+ formatFeatureFlag(config.prefUnifiedAutoplay)));
+ configTableBody.appendChild(createConfigRow(
+ 'Custom autoplay policy',
+ formatFeatureFlag(config.hasCustomAutoplayPolicy)));
configTableBody.appendChild(
createConfigRow('Autoplay Policy', config.autoplayPolicy));
configTableBody.appendChild(createConfigRow(
diff --git a/chromium/chrome/browser/resources/media/webrtc_logs.css b/chromium/chrome/browser/resources/media/webrtc_logs.css
index a2dd3e4ac13..20eb184cf4d 100644
--- a/chromium/chrome/browser/resources/media/webrtc_logs.css
+++ b/chromium/chrome/browser/resources/media/webrtc_logs.css
@@ -18,7 +18,7 @@ html[dir=rtl] h1 {
background-position: right;
}
-#log-banner {
+.log-banner {
background-color: rgb(235, 239, 250);
border: 1px solid #bbb;
border-radius: 2px;
@@ -26,18 +26,18 @@ html[dir=rtl] h1 {
padding: 4px;
}
-#log-list h3 {
+.log-list h3 {
font-size: 100%;
}
-#log-list > div > * {
+.log-list > div > * {
margin: 0.75em 0;
}
-#log-list a:visited {
+.log-list a:visited {
color: #666;
}
-#log-list > div:not(:last-child) {
+.log-list > div:not(:last-child) {
border-bottom: 1px solid #bbb;
}
diff --git a/chromium/chrome/browser/resources/media/webrtc_logs.html b/chromium/chrome/browser/resources/media/webrtc_logs.html
index 7e3178b89b2..fe4191e1419 100644
--- a/chromium/chrome/browser/resources/media/webrtc_logs.html
+++ b/chromium/chrome/browser/resources/media/webrtc_logs.html
@@ -12,9 +12,15 @@
</head>
<body>
<header><h1>$i18n{webrtcLogsTitle}</h1></header>
- <h2 id="log-banner"></h2>
- <div id="log-list"></div>
- <p id="no-logs" hidden>$i18n{noLogsMessage}</p>
+
+ <h2 id="text-log-banner" class="log-banner"></h2>
+ <div id="text-log-list" class="log-list"></div>
+ <p id="text-no-logs" hidden>$i18n{noTextLogsMessage}</p>
+
+ <h2 id="event-log-banner" class="log-banner"></h2>
+ <div id="event-log-list" class="log-list"></div>
+ <p id="event-no-logs" hidden>$i18n{noEventLogsMessage}</p>
+
<script src="chrome://resources/js/i18n_template.js"></script>
</body>
</html>
diff --git a/chromium/chrome/browser/resources/media/webrtc_logs.js b/chromium/chrome/browser/resources/media/webrtc_logs.js
index e665ab67b85..0104cd8a129 100644
--- a/chromium/chrome/browser/resources/media/webrtc_logs.js
+++ b/chromium/chrome/browser/resources/media/webrtc_logs.js
@@ -3,60 +3,66 @@
// found in the LICENSE file.
/**
- * Requests the list of uploads from the backend.
+ * Requests the list of WebRTC logs from the backend.
*/
-function requestUploads() {
+function requestWebRtcLogsList() {
chrome.send('requestWebRtcLogsList');
}
/**
- * Callback from backend with the list of uploads. Builds the UI.
- * @param {array} uploads The list of uploads.
+ * Callback from backend with the list of WebRTC logs. Builds the UI.
+ * @param {array} textLogsList The list of WebRTC text logs.
+ * @param {array} eventLogsList The list of WebRTC event logs.
* @param {string} version The browser version.
*/
-function updateWebRtcLogsList(uploads, version) {
- $('log-banner').textContent =
- loadTimeData.getStringF('webrtcLogCountFormat', uploads.length);
+function updateWebRtcLogsList(textLogsList, eventLogsList, version) {
+ updateWebRtcTextLogsList(textLogsList, version);
+ updateWebRtcEventLogsList(eventLogsList);
+}
+
+function updateWebRtcTextLogsList(textLogsList, version) {
+ $('text-log-banner').textContent =
+ loadTimeData.getStringF('webrtcTextLogCountFormat', textLogsList.length);
- var logSection = $('log-list');
+ var textLogSection = $('text-log-list');
// Clear any previous list.
- logSection.textContent = '';
+ textLogSection.textContent = '';
- for (var i = 0; i < uploads.length; i++) {
- var upload = uploads[i];
+ for (var i = 0; i < textLogsList.length; i++) {
+ var textLog = textLogsList[i];
var logBlock = document.createElement('div');
var title = document.createElement('h3');
title.textContent = loadTimeData.getStringF(
- 'webrtcLogHeaderFormat', upload['capture_time']);
+ 'webrtcLogHeaderFormat', textLog['capture_time']);
logBlock.appendChild(title);
var localFileLine = document.createElement('p');
- if (upload['local_file'].length == 0) {
+ if (textLog['local_file'].length == 0) {
localFileLine.textContent =
loadTimeData.getString('noLocalLogFileMessage');
} else {
localFileLine.textContent =
loadTimeData.getString('webrtcLogLocalFileLabelFormat') + ' ';
var localFileLink = document.createElement('a');
- localFileLink.href = 'file://' + upload['local_file'];
- localFileLink.textContent = upload['local_file'];
+ localFileLink.href = 'file://' + textLog['local_file'];
+ localFileLink.textContent = textLog['local_file'];
localFileLine.appendChild(localFileLink);
}
logBlock.appendChild(localFileLine);
var uploadLine = document.createElement('p');
- if (upload['id'].length == 0) {
+ if (textLog['id'].length == 0) {
uploadLine.textContent =
loadTimeData.getString('webrtcLogNotUploadedMessage');
} else {
uploadLine.textContent =
loadTimeData.getStringF(
- 'webrtcLogUploadTimeFormat', upload['upload_time']) +
+ 'webrtcLogUploadTimeFormat', textLog['upload_time']) +
'. ' +
- loadTimeData.getStringF('webrtcLogReportIdFormat', upload['id']) +
+ loadTimeData.getStringF('webrtcLogReportIdFormat', textLog['id']) +
'. ';
var link = document.createElement('a');
var commentLines = [
@@ -70,7 +76,7 @@ function updateWebRtcLogsList(uploads, version) {
'', '1.', '2.', '3.', '',
'*Please note that issues filed with no information filled in ' +
'above will be marked as WontFix*',
- '', '****DO NOT CHANGE BELOW THIS LINE****', 'report_id:' + upload.id
+ '', '****DO NOT CHANGE BELOW THIS LINE****', 'report_id:' + textLog.id
];
var params = {
template: 'Defect report from user',
@@ -87,10 +93,175 @@ function updateWebRtcLogsList(uploads, version) {
}
logBlock.appendChild(uploadLine);
- logSection.appendChild(logBlock);
+ textLogSection.appendChild(logBlock);
+ }
+
+ $('text-no-logs').hidden = (textLogsList.length != 0);
+}
+
+function updateWebRtcEventLogsList(eventLogsList) {
+ var eventLogSection = $('event-log-list');
+
+ eventLogSection.textContent = ''; // Clear any previous list.
+
+ var entries = 0;
+
+ for (var i = 0; i < eventLogsList.length; i++) {
+ let entry = createEventLogEntryElement(eventLogsList[i]);
+ if (entry) {
+ eventLogSection.appendChild(entry);
+ entries += 1;
+ }
}
- $('no-logs').hidden = uploads.length != 0;
+ $('event-log-banner').textContent =
+ loadTimeData.getStringF('webrtcEventLogCountFormat', entries);
+
+ $('event-no-logs').hidden = (entries != 0);
+}
+
+function createEventLogEntryElement(eventLogEntry) {
+ // See LogHistory in webrtc_event_log_manager_remote.cc for an explanation
+ // of the various states.
+ var state = eventLogEntry['state'];
+ if (!state) {
+ console.error('Unknown state.');
+ return;
+ } else if (state == 'pending' || state == 'actively_uploaded') {
+ return createPendingOrActivelyUploadedEventLogEntryElement(eventLogEntry);
+ } else if (state == 'not_uploaded') {
+ return createNotUploadedEventLogEntryElement(eventLogEntry);
+ } else if (state == 'upload_unsuccessful') {
+ return createUploadUnsuccessfulEventLogEntryElement(eventLogEntry);
+ } else if (state == 'upload_successful') {
+ return createUploadSuccessfulEventLogEntryElement(eventLogEntry);
+ } else {
+ console.error('Unrecognized state.');
+ }
+}
+
+function createPendingOrActivelyUploadedEventLogEntryElement(eventLogEntry) {
+ var expectedFields = ['capture_time', 'local_file'];
+ if (!verifyExpectedFields(eventLogEntry, expectedFields)) {
+ return;
+ }
+
+ var logBlock = document.createElement('div');
+
+ appendCaptureTime(logBlock, eventLogEntry);
+ appendLocalFile(logBlock, eventLogEntry);
+
+ var uploadLine = document.createElement('p');
+ if (eventLogEntry['state'] == 'pending') {
+ uploadLine.textContent = loadTimeData.getString('webrtcLogPendingMessage');
+ } else {
+ uploadLine.textContent =
+ loadTimeData.getString('webrtcLogActivelyUploadedMessage');
+ }
+ logBlock.appendChild(uploadLine);
+
+ return logBlock;
+}
+
+function createNotUploadedEventLogEntryElement(eventLogEntry) {
+ var expectedFields = ['capture_time', 'local_id'];
+ if (!verifyExpectedFields(eventLogEntry, expectedFields)) {
+ return;
+ }
+
+ var logBlock = document.createElement('div');
+
+ appendCaptureTime(logBlock, eventLogEntry);
+ appendLocalLogId(logBlock, eventLogEntry);
+
+ var uploadLine = document.createElement('p');
+ uploadLine.textContent =
+ loadTimeData.getString('webrtcLogNotUploadedMessage');
+ logBlock.appendChild(uploadLine);
+
+ return logBlock;
+}
+
+function createUploadUnsuccessfulEventLogEntryElement(eventLogEntry) {
+ var expectedFields = ['capture_time', 'local_id', 'upload_time'];
+ if (!verifyExpectedFields(eventLogEntry, expectedFields)) {
+ return;
+ }
+
+ var logBlock = document.createElement('div');
+
+ appendCaptureTime(logBlock, eventLogEntry);
+ appendLocalLogId(logBlock, eventLogEntry);
+
+ var uploadLine = document.createElement('p');
+ uploadLine.textContent = loadTimeData.getStringF(
+ 'webrtcLogFailedUploadTimeFormat', eventLogEntry['upload_time']);
+ logBlock.appendChild(uploadLine);
+
+ return logBlock;
+}
+
+function createUploadSuccessfulEventLogEntryElement(eventLogEntry) {
+ var expectedFields = ['capture_time', 'local_id', 'upload_id', 'upload_time'];
+ if (!verifyExpectedFields(eventLogEntry, expectedFields)) {
+ return;
+ }
+
+ var logBlock = document.createElement('div');
+
+ appendCaptureTime(logBlock, eventLogEntry);
+ appendLocalLogId(logBlock, eventLogEntry);
+
+ var uploadLine = document.createElement('p');
+ uploadLine.textContent =
+ loadTimeData.getStringF(
+ 'webrtcLogUploadTimeFormat', eventLogEntry['upload_time']) +
+ '. ' +
+ loadTimeData.getStringF(
+ 'webrtcLogReportIdFormat', eventLogEntry['upload_id']) +
+ '. ';
+ logBlock.appendChild(uploadLine);
+
+ return logBlock;
+}
+
+function verifyExpectedFields(entry, expectedFields) {
+ for (var fieldIdx in expectedFields) {
+ let field = expectedFields[fieldIdx];
+ if (!entry[field]) {
+ console.error('|' + field + '| expected.');
+ return false;
+ }
+ }
+ return true;
+}
+
+function appendCaptureTime(logBlock, eventLogEntry) {
+ var title = document.createElement('h3');
+ title.textContent = loadTimeData.getStringF(
+ 'webrtcLogHeaderFormat', eventLogEntry['capture_time']);
+ logBlock.appendChild(title);
+}
+
+function appendLocalFile(logBlock, eventLogEntry) {
+ // Local file on disk, if still on disk.
+ var localFileLine = document.createElement('p');
+ localFileLine.textContent =
+ loadTimeData.getString('webrtcLogLocalFileLabelFormat') + ' ';
+ var localFileLink = document.createElement('a');
+ localFileLink.href = 'file://' + eventLogEntry['local_file'];
+ localFileLink.textContent = eventLogEntry['local_file'];
+ localFileLine.appendChild(localFileLink);
+ logBlock.appendChild(localFileLine);
+}
+
+function appendLocalLogId(logBlock, eventLogEntry) {
+ var localIdLine = document.createElement('p');
+ localIdLine.textContent =
+ loadTimeData.getStringF(
+ 'webrtcEventLogLocalLogIdFormat', eventLogEntry['local_id']) +
+ '';
+ logBlock.appendChild(localIdLine);
}
-document.addEventListener('DOMContentLoaded', requestUploads);
+document.addEventListener('DOMContentLoaded', requestWebRtcLogsList);
diff --git a/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.css b/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.css
index 4215fece3b6..42347f5fbc5 100644
--- a/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.css
+++ b/chromium/chrome/browser/resources/media_router/elements/issue_banner/issue_banner.css
@@ -46,16 +46,16 @@
}
.non-blocking > #buttons > #default-button {
- -webkit-margin-end: 24px;
+ margin-inline-end: 24px;
}
.non-blocking > div > #title {
- -webkit-margin-end: 12px;
- -webkit-padding-end: 12px;
color: rgba(255, 255, 255, 0.87);
+ margin-inline-end: 12px;
overflow: hidden;
+ padding-inline-end: 12px;
}
paper-button {
margin: 0;
-} \ No newline at end of file
+}
diff --git a/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css b/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css
index 22fcd22b519..cb45f58f6d1 100644
--- a/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css
+++ b/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.css
@@ -8,17 +8,12 @@
.cast-mode-icon,
.sink-icon {
- -webkit-padding-end: 12px;
- -webkit-padding-start: var(--dialog-padding-start);
height: var(--non-navigation-icon-size);
+ padding-inline-end: 12px;
+ padding-inline-start: var(--dialog-padding-start);
width: var(--non-navigation-icon-size);
}
-#cast-mode-list {
- padding-bottom: 12px;
- padding-top: 4px;
-}
-
#container-header {
position: fixed;
width: 100%;
@@ -68,7 +63,7 @@
}
#first-run-cloud-checkbox::shadow #checkboxLabel {
- -webkit-padding-start: var(-dialog-padding-start);
+ padding-inline-start: var(-dialog-padding-start);
}
#first-run-flow {
@@ -127,21 +122,36 @@ cr-checkbox {
--cr-checkbox-ripple-opacity: 0.25;
}
-paper-item {
+.selectable-item {
+ -webkit-appearance: none;
+ align-items: center;
+ background: none;
+ border: none;
cursor: pointer;
+ display: flex;
+ font-family: inherit;
font-size: 1.0em;
line-height: 0;
min-height: 0;
+ outline: 0;
padding: 12px 0;
+ text-align: initial;
+ width: 100%;
}
-paper-item:hover {
+.selectable-item:hover,
+.selectable-item:focus {
background-color: rgb(238, 238, 238);
border: 0;
}
-paper-listbox {
+.selectable-item.iron-selected {
+ font-weight: bold;
+}
+
+iron-selector {
color: rgba(0, 0, 0, 0.87);
+ display: block;
overflow-x: hidden;
overflow-y: auto;
padding-bottom: 0;
@@ -149,6 +159,11 @@ paper-listbox {
user-select: none;
}
+iron-selector#cast-mode-list {
+ padding-bottom: 12px;
+ padding-top: 4px;
+}
+
#search-input-container {
flex-grow: 1;
}
@@ -174,11 +189,11 @@ paper-listbox {
}
.subheading-text {
- -webkit-padding-start: var(--dialog-padding-start);
color: var(--paper-grey-600);
cursor: default;
font-weight: normal;
padding-bottom: 4px;
+ padding-inline-start: var(--dialog-padding-start);
padding-top: 12px;
}
@@ -194,8 +209,8 @@ paper-listbox {
}
.sink-domain {
- -webkit-padding-start: 6px;
color: var(--paper-grey-600);
+ padding-inline-start: 6px;
/* TODO(crbug/589697): Handle overflow of very long domain names. */
}
@@ -229,9 +244,9 @@ paper-listbox {
/* Separate icon class is a consequence of box-sizing: border-box set by
* paper-icon-button. This should achieve the same dimensions as .sink-icon. */
#sink-search-icon {
- -webkit-margin-start: 4px;
- -webkit-padding-end: 12px;
- -webkit-padding-start: 12px;
+ margin-inline-start: 4px;
+ padding-inline-end: 12px;
+ padding-inline-start: 12px;
}
#sink-search-input {
@@ -240,16 +255,17 @@ paper-listbox {
}
--cr-input-error-display: none;
--cr-input-input: {
- -webkit-padding-start: 0;
background-color: white;
border-bottom: 1px solid var(--paper-grey-800);
- padding-bottom: 2px;
- padding-top: 2px;
}
- -webkit-margin-end: 31px;
+ --cr-input-padding-end: 0;
+ --cr-input-padding-start: 0;
+ --cr-input-padding-bottom: 2px;
+ --cr-input-padding-top: 2px;
align-self: center;
flex-grow: 1;
font-size: 12px;
+ margin-inline-end: 31px;
}
.sink-subtext {
diff --git a/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html b/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html
index 3be58dc3490..50075c18bae 100644
--- a/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html
+++ b/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.html
@@ -3,8 +3,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-listbox/paper-listbox.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-selector/iron-selector.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="../media_router_header/media_router_header.html">
<link rel="import" href="../route_details/route_details.html">
@@ -52,16 +51,17 @@
</media-router-header>
<div id="content">
<template is="dom-if" if="[[!computeCastModeListHidden_(currentView_)]]">
- <paper-listbox id="cast-mode-list" role="presentation"
- selectable="paper-item" selected="{{selectedCastModeMenuItem_}}">
+ <iron-selector id="cast-mode-list" role="presentation"
+ selectable=".selectable-item"
+ selected="{{selectedCastModeMenuItem_}}">
<template is="dom-repeat" id="presentationCastModeList"
items="[[computePresentationCastModeList_(castModeList)]]">
- <paper-item on-tap="onCastModeClick_">
+ <button class="selectable-item" on-click="onCastModeClick_">
<iron-icon class="cast-mode-icon"
icon="[[computeCastModeIcon_(item)]]">
</iron-icon>
<div><span>[[item.host]]</span></div>
- </paper-item>
+ </button>
</template>
<div id="share-screen-text" class="subheading-text"
hidden$="[[computeShareScreenSubheadingHidden_(castModeList)]]">
@@ -69,12 +69,12 @@
</div>
<template is="dom-repeat" id="shareScreenCastModeList"
items="[[computeShareScreenCastModeList_(castModeList)]]">
- <paper-item on-tap="onCastModeClick_">
+ <button class="selectable-item" on-click="onCastModeClick_">
<iron-icon class="cast-mode-icon"
icon="[[computeCastModeIcon_(item)]]">
</iron-icon>
<div><span>[[item.description]]</span></div>
- </paper-item>
+ </button>
</template>
<div id="cast-local-media-text" class="subheading-text"
hidden$="[[computeLocalMediaSubheadingHidden_(castModeList)]]">
@@ -82,14 +82,14 @@
</div>
<template is="dom-repeat" id="localMediaCastModeList"
items="[[computeLocalMediaCastModeList_(castModeList)]]">
- <paper-item on-tap="onCastModeClick_">
+ <button class="selectable-item" on-click="onCastModeClick_">
<iron-icon class="cast-mode-icon"
icon="[[computeCastModeIcon_(item)]]">
</iron-icon>
<div><span>[[item.description]]</span></div>
- </paper-item>
+ </button>
</template>
- </paper-listbox>
+ </iron-selector>
</template>
<template is="dom-if"
if="[[!computeRouteDetailsHidden_(currentView_, issue)]]">
@@ -116,9 +116,10 @@
</div>
<template is="dom-if" if="[[!computeSinkListHidden_(sinksToShow_)]]">
<div id="sink-list" hidden$="[[hideSinkListForAnimation_]]">
- <paper-listbox id="sink-list-paper-menu" role="presentation">
+ <iron-selector id="sink-list-paper-menu" role="presentation"
+ selectable=".selectable-item">
<template is="dom-repeat" id="sinkList" items="[[sinksToShow_]]">
- <paper-item on-tap="onSinkClick_">
+ <button class="selectable-item" on-click="onSinkClick_">
<div class="sink-content">
<div>
<iron-icon icon="[[computeSinkIcon_(item)]]"
@@ -151,9 +152,9 @@
</template>
</div>
</div>
- </paper-item>
+ </button>
</template>
- </paper-listbox>
+ </iron-selector>
</div>
</template>
<template is="dom-if" if="[[searchEnabled_]]">
@@ -177,11 +178,12 @@
</div>
<div id="search-results"
hidden$="[[computeSearchResultsHidden_(searchResultsToShow_, isSearchListHidden_)]]">
- <paper-listbox id="search-results-paper-menu" selected="0"
- role="presentation">
+ <iron-selector id="search-results-paper-menu" selected="0"
+ role="presentation" selectable=".selectable-item">
<template is="dom-repeat" id="searchResults"
items="[[searchResultsToShow_]]">
- <paper-item class="search-item" on-tap="onSinkClick_">
+ <button class="search-item selectable-item"
+ on-click="onSinkClick_">
<div class="sink-content">
<div>
<iron-icon icon="[[computeSinkIcon_(item.sinkItem)]]"
@@ -217,9 +219,9 @@
</template>
</div>
</div>
- </paper-item>
+ </button>
</template>
- </paper-listbox>
+ </iron-selector>
</div>
</div>
</template>
diff --git a/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
index c35f233b84f..5068766c9d0 100644
--- a/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
+++ b/chromium/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -465,8 +465,13 @@ Polymer({
// sinks.
this.async(function() {
this.justOpened_ = false;
+ // |pseudoSinks_| does not contain pseudo sinks without a domain, so it
+ // cannot be used for calculating the number of real sinks.
+ var realSinks = this.allSinks.filter(function(sink) {
+ return !sink.isPseudoSink;
+ });
this.fire('report-sink-count', {
- sinkCount: this.allSinks.length - this.pseudoSinks_.length,
+ sinkCount: realSinks.length,
});
}, 3000 /* 3 seconds */);
@@ -1390,9 +1395,10 @@ Polymer({
* @private
*/
maybeUpdateFocusOnFilterViewExit_: function() {
- var searchSinks = this.$$('#search-results').querySelectorAll('paper-item');
+ var searchSinks =
+ this.$$('#search-results').querySelectorAll('.selectable-item');
var focusedElem = Array.prototype.find.call(searchSinks, function(sink) {
- return sink.focused;
+ return sink.matches(':focus');
});
if (!focusedElem) {
return;
diff --git a/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css b/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css
index 54d34e8a273..695e07f249c 100644
--- a/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css
+++ b/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.css
@@ -17,25 +17,25 @@
}
#back-button-container {
- -webkit-padding-end: 4px;
+ padding-inline-end: 4px;
}
#close-button {
- -webkit-margin-start: auto;
height: 31px;
+ margin-inline-start: auto;
width: 31px;
}
#close-button-container {
- -webkit-margin-start: auto;
- -webkit-padding-end: 16px;
- -webkit-padding-start: 24px;
+ margin-inline-start: auto;
+ padding-inline-end: 16px;
+ padding-inline-start: 24px;
}
#header {
- -webkit-padding-start: 8px;
align-items: center;
color: white;
+ padding-inline-start: 8px;
}
#header-and-arrow-container {
@@ -45,11 +45,11 @@
}
#header-text {
- -webkit-padding-end: 4px;
font-size: 1.175em;
line-height: 36px;
margin: 0 8px;
overflow: hidden;
+ padding-inline-end: 4px;
text-overflow: ellipsis;
}
@@ -74,10 +74,10 @@ paper-icon-button {
}
#user-email-container {
- -webkit-padding-start: 8px;
bottom: 0;
font-size: 0.917em;
left: auto;
padding-bottom: 12px;
+ padding-inline-start: 8px;
position: absolute;
}
diff --git a/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.html b/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.html
index 7a0603a8eef..3a58bc24608 100644
--- a/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.html
+++ b/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.html
@@ -1,4 +1,6 @@
<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../../icons/media_router_icons.html">
@@ -27,7 +29,7 @@
</div>
</div>
<div id="close-button-container">
- <paper-icon-button icon="media-router:close" id="close-button"
+ <paper-icon-button icon="cr:close" id="close-button"
on-tap="onCloseButtonClick_" title="[[i18n('closeButtonTitle')]]">
</paper-icon-button>
</div>
diff --git a/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js b/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
index 1c375cbb03a..50ba1501eb6 100644
--- a/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
+++ b/chromium/chrome/browser/resources/media_router/elements/media_router_header/media_router_header.js
@@ -99,8 +99,7 @@ Polymer({
attached: function() {
// isRTL() only works after i18n_template.js runs to set <html dir>.
// Set the back button icon based on text direction.
- this.arrowDropIcon_ =
- isRTL() ? 'media-router:arrow-forward' : 'media-router:arrow-back';
+ this.arrowDropIcon_ = isRTL() ? 'cr:arrow-forward' : 'cr:arrow-back';
},
/**
@@ -110,8 +109,8 @@ Polymer({
*/
computeArrowDropIcon_: function(view) {
return view == media_router.MediaRouterView.CAST_MODE_LIST ?
- 'media-router:arrow-drop-up' :
- 'media-router:arrow-drop-down';
+ 'cr:arrow-drop-up' :
+ 'cr:arrow-drop-down';
},
/**
diff --git a/chromium/chrome/browser/resources/media_router/elements/route_controls/route_controls.css b/chromium/chrome/browser/resources/media_router/elements/route_controls/route_controls.css
index a57d0dba893..6c7d65cbe4c 100644
--- a/chromium/chrome/browser/resources/media_router/elements/route_controls/route_controls.css
+++ b/chromium/chrome/browser/resources/media_router/elements/route_controls/route_controls.css
@@ -89,7 +89,7 @@
#hangouts-local-present-checkbox {
--cr-checkbox-label-container: {
- -webkit-padding-start: 14px;
+ padding-inline-start: 14px;
}
align-items: start;
}
@@ -109,6 +109,6 @@
}
#mirroring-fullscreen-video-dropdown {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
width: auto;
}
diff --git a/chromium/chrome/browser/resources/media_router/elements/route_details/route_details.css b/chromium/chrome/browser/resources/media_router/elements/route_details/route_details.css
index e5b7f3e72da..e48b7c24ad9 100644
--- a/chromium/chrome/browser/resources/media_router/elements/route_details/route_details.css
+++ b/chromium/chrome/browser/resources/media_router/elements/route_details/route_details.css
@@ -18,9 +18,9 @@
}
#route-description {
- -webkit-padding-end: var(--dialog-padding-end);
- -webkit-padding-start: 44px;
font-size: 1.2em;
line-height: 1.5em;
margin-top: 16px;
+ padding-inline-end: var(--dialog-padding-end);
+ padding-inline-start: 44px;
}
diff --git a/chromium/chrome/browser/resources/media_router/extension/src/init.js b/chromium/chrome/browser/resources/media_router/extension/src/init.js
index 6e6140e6c94..1e511bc8297 100644
--- a/chromium/chrome/browser/resources/media_router/extension/src/init.js
+++ b/chromium/chrome/browser/resources/media_router/extension/src/init.js
@@ -66,6 +66,7 @@ mr.Init.initProviderManager_ = function() {
throw Error('Failed to get MR instance ID.');
}
mr.Init.logger_.info('MR instance ID: ' + mrInstanceId);
+ mr.Init.logDialogType_(result['mrConfig'].use_views_dialog);
const mediaRouterService =
/** @type {!mr.MediaRouterService} */ (result['mrService']);
if (!mr.Init.providerManager_) {
@@ -142,6 +143,17 @@ mr.Init.addEventListeners_ = function() {
/**
+ * @param {boolean|undefined} useViewsDialog
+ * @private
+ */
+mr.Init.logDialogType_ = function(useViewsDialog) {
+ if (useViewsDialog === undefined) return;
+ const dialogType = useViewsDialog ? 'Views (Harmony)' : 'WebUI';
+ mr.Init.logger_.info(`Using the ${dialogType} dialog.`);
+};
+
+
+/**
* @return {!Promise}
*/
mr.Init.init = function() {
diff --git a/chromium/chrome/browser/resources/media_router/extension/src/init_test.js b/chromium/chrome/browser/resources/media_router/extension/src/init_test.js
index 25ba7d36419..bf60f2fa6c8 100644
--- a/chromium/chrome/browser/resources/media_router/extension/src/init_test.js
+++ b/chromium/chrome/browser/resources/media_router/extension/src/init_test.js
@@ -29,7 +29,14 @@ describe('Tests init', function() {
spyOn(mr.MediaRouterService, 'getInstance').and.returnValue({
'mrService': jasmine.createSpyObj(
'mrService', ['setHandlers', 'onRouteMessagesReceived']),
- 'mrInstanceId': 'mrInstanceId'
+ 'mrInstanceId': 'mrInstanceId',
+ 'mrConfig': {
+ 'enable_dial_discovery': true,
+ 'enable_dial_sink_query': true,
+ 'enable_cast_discovery': true,
+ 'enable_cast_sink_query': true,
+ 'use_views_dialog': true
+ }
});
spyOn(mr.PersistentDataManager, 'initialize');
diff --git a/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager.js b/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager.js
index a3883620ce1..34505a4a677 100644
--- a/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager.js
+++ b/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager.js
@@ -135,20 +135,6 @@ mr.ProviderManager = class extends mr.Module {
this.sinkAvailabilityMap_ = new Map();
/**
- * Whether mDNS is currently enabled.
- * @private {boolean}
- */
- this.mdnsEnabled_ = window.navigator.userAgent.indexOf('Windows') == -1;
-
- /**
- * Functions that should be executed when |mdnsEnabled_| goes from |false|
- * to
- * |true|.
- * @private {!Array<function()>}
- */
- this.mdnsEnabledCallbacks_ = [];
-
- /**
* Names of components that have requested to keep the extension alive.
* @private {!Array<string>}
*/
@@ -168,6 +154,13 @@ mr.ProviderManager = class extends mr.Module {
this.externalMessageHandler_ =
mr.InitHelper.getExternalMessageHandler(this);
+ /**
+ * The type of the Cast dialog used (WebUI or Views). This value is
+ * submitted with feedback reports.
+ * @type {string}
+ */
+ this.dialogType = '';
+
mr.ProviderManager.exportProperties_(this);
}
@@ -236,6 +229,9 @@ mr.ProviderManager = class extends mr.Module {
this.mediaRouterService_.onRouteMessagesReceived.bind(
this.mediaRouterService_));
this.registerAllProviders(providers, config);
+ if (config && config.use_views_dialog !== undefined) {
+ this.dialogType = config.use_views_dialog ? 'Views' : 'WebUI';
+ }
mr.PersistentDataManager.register(this);
mr.Module.onModuleLoaded(mr.ModuleId.PROVIDER_MANAGER, this);
@@ -608,11 +604,7 @@ mr.ProviderManager = class extends mr.Module {
* @override
*/
enableMdnsDiscovery() {
- this.mdnsEnabled_ = true;
- this.mdnsEnabledCallbacks_.forEach(callback => {
- callback();
- });
- this.mdnsEnabledCallbacks_.length = 0;
+
}
/**
@@ -728,8 +720,7 @@ mr.ProviderManager = class extends mr.Module {
Array.from(
this.routeIdToProvider_,
([routeId, provider]) => [routeId, provider.getName()]),
- Array.from(this.sinkAvailabilityMap_), this.mdnsEnabled_,
- this.lastUsedMirrorService_)];
+ Array.from(this.sinkAvailabilityMap_), this.lastUsedMirrorService_)];
}
/**
@@ -749,9 +740,6 @@ mr.ProviderManager = class extends mr.Module {
}
this.sinkAvailabilityMap_ = new Map(savedData.sinkAvailabilityMap);
this.lastUsedMirrorService_ = savedData.lastUsedMirrorService || null;
- if (savedData.mdnsEnabled) {
- this.enableMdnsDiscovery();
- }
}
}
@@ -1007,27 +995,6 @@ mr.ProviderManager = class extends mr.Module {
/**
* @override
*/
- registerMdnsDiscoveryEnabledCallback(callback) {
- if (this.mdnsEnabled_) {
- callback();
- return;
- }
- if (this.mdnsEnabledCallbacks_.indexOf(callback) != -1) {
- return;
- }
- this.mdnsEnabledCallbacks_.push(callback);
- }
-
- /**
- * @override
- */
- isMdnsDiscoveryEnabled() {
- return this.mdnsEnabled_;
- }
-
- /**
- * @override
- */
requestKeepAlive(componentId, keepAlive) {
const index = this.keepAliveComponents_.indexOf(componentId);
const componentKeepAlive = (index >= 0);
@@ -1201,7 +1168,6 @@ mr.ProviderManager = class extends mr.Module {
providerManager.startObservingMediaRoutes;
obj['stopObservingMediaRoutes'] = providerManager.stopObservingMediaRoutes;
obj['detachRoute'] = providerManager.detachRoute;
- obj['enableMdnsDiscovery'] = providerManager.enableMdnsDiscovery;
obj['searchSinks'] = providerManager.searchSinks;
obj['provideSinks'] = providerManager.provideSinks;
obj['updateMediaSinks'] = providerManager.updateMediaSinks;
@@ -1246,12 +1212,11 @@ mr.ProviderManager.PersistentData_ = class {
* @param {!Array<string>} routeQueries
* @param {!Array<!Array>} routeIdToProviderName
* @param {!Array<!Array>} sinkAvailabilityMap
- * @param {boolean} mdnsEnabled
* @param {?mr.mirror.ServiceName} lastUsedMirrorService
*/
constructor(
providerNames, sinkQueries, routeQueries, routeIdToProviderName,
- sinkAvailabilityMap, mdnsEnabled, lastUsedMirrorService) {
+ sinkAvailabilityMap, lastUsedMirrorService) {
/**
* @type {!Array<string>}
*/
@@ -1280,11 +1245,6 @@ mr.ProviderManager.PersistentData_ = class {
this.sinkAvailabilityMap = sinkAvailabilityMap;
/**
- * @type {boolean}
- */
- this.mdnsEnabled = mdnsEnabled;
-
- /**
* @type {?mr.mirror.ServiceName}
*/
this.lastUsedMirrorService = lastUsedMirrorService;
diff --git a/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_callbacks.js b/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_callbacks.js
index 01ff1f5d3fa..e99b33dcd1a 100644
--- a/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_callbacks.js
+++ b/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_callbacks.js
@@ -194,16 +194,6 @@ mr.ProviderManagerCallbacks = class {
opt_streamStartedCallback) {}
/**
- * Register a callback with the provider manager that will either be executed
- * immediately if mDNS discovery is currently enabled or saved to be executed
- * when mDNS discovery becomes enabled. This should allow duplicate calls to
- * be
- * made with the same function address but only call the function once.
- * @param {function()} callback Callback that depends on mDNS discovery.
- */
- registerMdnsDiscoveryEnabledCallback(callback) {}
-
- /**
* Called by a component with |keepAlive| set to true when it requires the
* extension to be kept alive. When a component no longer requires the
* extension
@@ -215,9 +205,4 @@ mr.ProviderManagerCallbacks = class {
* @param {boolean} keepAlive
*/
requestKeepAlive(componentId, keepAlive) {}
-
- /**
- * @return {boolean} Whether mDNS discovery is currently enabled.
- */
- isMdnsDiscoveryEnabled() {}
};
diff --git a/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_test.js b/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_test.js
index 9453ed678b2..01fc7581191 100644
--- a/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_test.js
+++ b/chromium/chrome/browser/resources/media_router/extension/src/manager/provider_manager_test.js
@@ -706,31 +706,6 @@ describe('Tests ProviderManager', function() {
expect(providerManager.sinkAvailabilityMap_.get(mockProvider1Name))
.toEqual(mr.SinkAvailability.AVAILABLE);
});
-
- it('ProviderManager calls mDNS callbacks if mDNS enabled', function() {
- let callbackRuns = 0;
- const callback = function() {
- ++callbackRuns;
- };
- providerManager.mdnsEnabled_ = true;
-
- // Data is saved to localStorage.
- mr.PersistentDataManager.onSuspend_();
-
- // Prevent immediate callback so we are sure it runs in loadSavedData
- providerManager.mdnsEnabled_ = false;
- providerManager.registerMdnsDiscoveryEnabledCallback(callback);
- expect(callbackRuns).toBe(0);
-
- // Make PersistentDataManager forget providerManager, so it can be
- // registered again.
- mr.PersistentDataManager.dataInstances_.clear();
-
- // Load data back to providerManager.
- mockProvider1.getAvailableSinks.and.returnValue(mr.SinkList.EMPTY);
- mr.PersistentDataManager.register(providerManager);
- expect(callbackRuns).toBe(1);
- });
});
describe('Test onRouteRemoved', function() {
@@ -868,42 +843,6 @@ describe('Tests ProviderManager', function() {
.toHaveBeenCalledWith(mr.SinkAvailability.UNAVAILABLE);
});
- it('Test mDNS callbacks wait until mDNS is enabled', function() {
- providerManager.mdnsEnabled_ = true;
- let callbackRuns = 0;
- const callback = function() {
- ++callbackRuns;
- };
- providerManager.registerMdnsDiscoveryEnabledCallback(callback);
- // Execute immediately when mDNS discovery is enabled.
- expect(callbackRuns).toBe(1);
-
- callbackRuns = 0;
- providerManager.mdnsEnabled_ = false;
- providerManager.registerMdnsDiscoveryEnabledCallback(callback);
- // Defer execution until mDNS discovery is enabled.
- expect(callbackRuns).toBe(0);
- providerManager.enableMdnsDiscovery();
- expect(callbackRuns).toBe(1);
- });
-
- it('Test mDNS callback registration disallows duplicates', function() {
- providerManager.mdnsEnabled_ = true;
- let callbackRuns = 0;
- const callback = function() {
- ++callbackRuns;
- };
-
- providerManager.mdnsEnabled_ = false;
- providerManager.registerMdnsDiscoveryEnabledCallback(callback);
- providerManager.registerMdnsDiscoveryEnabledCallback(callback);
- // Defer execution until mDNS discovery is enabled and ensure only called
- // once.
- expect(callbackRuns).toBe(0);
- providerManager.enableMdnsDiscovery();
- expect(callbackRuns).toBe(1);
- });
-
describe('searchSinks', function() {
const getSearchCriteria = function(input) {
return {'input': input, 'domain': 'google.com'};
diff --git a/chromium/chrome/browser/resources/media_router/extension/src/mojo_externs.js b/chromium/chrome/browser/resources/media_router/extension/src/mojo_externs.js
index f780f85645b..7b04af89aa0 100644
--- a/chromium/chrome/browser/resources/media_router/extension/src/mojo_externs.js
+++ b/chromium/chrome/browser/resources/media_router/extension/src/mojo_externs.js
@@ -416,6 +416,10 @@ mojo.MediaRouteProviderConfig.prototype.enable_cast_discovery;
mojo.MediaRouteProviderConfig.prototype.enable_cast_sink_query;
+/** @type {boolean} */
+mojo.MediaRouteProviderConfig.prototype.use_views_dialog;
+
+
/** @constructor */
mojo.RemotingStopReason = function() {};
diff --git a/chromium/chrome/browser/resources/media_router/icons/media_router_icons.html b/chromium/chrome/browser/resources/media_router/icons/media_router_icons.html
index 758151b69db..7d98ad6d2fa 100644
--- a/chromium/chrome/browser/resources/media_router/icons/media_router_icons.html
+++ b/chromium/chrome/browser/resources/media_router/icons/media_router_icons.html
@@ -5,11 +5,6 @@
<iron-iconset-svg name="media-router" size="24">
<svg><defs>
<!-- third_party/polymer/v1_0/components-chromium/iron-icons/iron-icons.html -->
- <g id="arrow-back"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"></path></g>
- <g id="arrow-drop-down"><path d="M7 10l5 5 5-5z"></path></g>
- <g id="arrow-drop-up"><path d="M7 14l5-5 5 5z"></path></g>
- <g id="arrow-forward"><path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"></path></g>
- <g id="close"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></g>
<g id="folder"><path d="M0 0h24v24H0z" fill="none"></path><path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"></path></g>
<g id="search"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path></g>
<g id="tab"><path d="M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z"></path></g>
diff --git a/chromium/chrome/browser/resources/media_router/media_router.css b/chromium/chrome/browser/resources/media_router/media_router.css
index 4b3904a5add..6b6092e2769 100644
--- a/chromium/chrome/browser/resources/media_router/media_router.css
+++ b/chromium/chrome/browser/resources/media_router/media_router.css
@@ -2,6 +2,11 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
+html {
+ /* Remove 300ms delay for 'click' event, when using touch interface. */
+ touch-action: manipulation;
+}
+
body {
font-size: 0.75em;
margin: 0;
diff --git a/chromium/chrome/browser/resources/ntp4/apps_page.js b/chromium/chrome/browser/resources/ntp4/apps_page.js
index 0cfe93869b9..2ebb92025db 100644
--- a/chromium/chrome/browser/resources/ntp4/apps_page.js
+++ b/chromium/chrome/browser/resources/ntp4/apps_page.js
@@ -80,13 +80,11 @@ cr.define('ntp', function() {
this.uninstall_.addEventListener(
'activate', this.onUninstall_.bind(this));
- if (!cr.isChromeOS) {
- this.createShortcutSeparator_ =
- menu.appendChild(cr.ui.MenuItem.createSeparator());
- this.createShortcut_ = this.appendMenuItem_('appcreateshortcut');
- this.createShortcut_.addEventListener(
- 'activate', this.onCreateShortcut_.bind(this));
- }
+ this.createShortcutSeparator_ =
+ menu.appendChild(cr.ui.MenuItem.createSeparator());
+ this.createShortcut_ = this.appendMenuItem_('appcreateshortcut');
+ this.createShortcut_.addEventListener(
+ 'activate', this.onCreateShortcut_.bind(this));
document.body.appendChild(menu);
},
@@ -143,11 +141,11 @@ cr.define('ntp', function() {
launchTypeButton.disabled = false;
launchTypeButton.checked = app.appData.launch_type == id;
// There are three cases when a launch type is hidden:
- // 1. packaged apps hide all launch types
+ // 1. if the launch type can't be changed.
// 2. canHostedAppsOpenInWindows is false and type is launchTypeWindow
// 3. enableNewBookmarkApps is true and type is anything except
// launchTypeWindow
- launchTypeButton.hidden = app.appData.packagedApp ||
+ launchTypeButton.hidden = !app.appData.mayChangeLaunchType ||
(!loadTimeData.getBoolean('canHostedAppsOpenInWindows') &&
launchTypeButton == launchTypeWindow) ||
(loadTimeData.getBoolean('enableNewBookmarkApps') &&
@@ -157,20 +155,17 @@ cr.define('ntp', function() {
});
this.launchTypeMenuSeparator_.hidden =
- app.appData.packagedApp || !hasLaunchType;
+ !app.appData.mayChangeLaunchType || !hasLaunchType;
this.options_.disabled = !app.appData.optionsUrl || !app.appData.enabled;
if (this.details_)
this.details_.disabled = !app.appData.detailsUrl;
this.uninstall_.disabled = !app.appData.mayDisable;
+ if (this.appinfo_)
+ this.appinfo_.hidden = !app.appData.isLocallyInstalled;
- if (cr.isMac) {
- // On Windows and Linux, these should always be visible. On ChromeOS,
- // they are never created. On Mac, shortcuts can only be created for
- // new-style packaged apps, so hide the menu item.
- this.createShortcutSeparator_.hidden = this.createShortcut_.hidden =
- !app.appData.packagedApp;
- }
+ this.createShortcutSeparator_.hidden = this.createShortcut_.hidden =
+ !app.appData.mayCreateShortcuts;
},
/** @private */
@@ -345,7 +340,7 @@ cr.define('ntp', function() {
setIcon: function() {
var src = this.useSmallIcon_ ? this.appData_.icon_small :
this.appData_.icon_big;
- if (!this.appData_.enabled ||
+ if (!this.appData_.enabled || !this.appData_.isLocallyInstalled ||
(!this.appData_.offlineEnabled && !navigator.onLine)) {
src += '?grayscale=true';
}
diff --git a/chromium/chrome/browser/resources/ntp4/incognito_tab.css b/chromium/chrome/browser/resources/ntp4/incognito_tab.css
index d0ae5fb0c1d..5a06e024eea 100644
--- a/chromium/chrome/browser/resources/ntp4/incognito_tab.css
+++ b/chromium/chrome/browser/resources/ntp4/incognito_tab.css
@@ -145,7 +145,7 @@ html[dir=rtl] .bulletpoints + .bulletpoints {
}
.icon {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
}
h1 {
@@ -161,8 +161,8 @@ html[dir=rtl] .bulletpoints + .bulletpoints {
/** Paddings and margins ---------------------------------------------------- */
.bulletpoints ul {
- -webkit-padding-start: 16px;
margin: 4px 0 0;
+ padding-inline-start: 16px;
}
/* Margins of floating elements don't collapse. The margin for bulletpoints
@@ -172,11 +172,11 @@ html[dir=rtl] .bulletpoints + .bulletpoints {
}
.bulletpoints + .bulletpoints {
- -webkit-margin-start: 40px;
+ margin-inline-start: 40px;
}
.bulletpoints + .bulletpoints.too-wide {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
margin-top: 1.5rem;
}
@@ -250,7 +250,7 @@ html[dir=rtl] .bulletpoints + .bulletpoints {
/* The two columns of bulletpoints are moved under each other. */
.bulletpoints + .bulletpoints {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
margin-top: 1.5rem;
}
diff --git a/chromium/chrome/browser/resources/ntp4/nav_dot.css b/chromium/chrome/browser/resources/ntp4/nav_dot.css
index 691217c943b..cca4b54fc2b 100644
--- a/chromium/chrome/browser/resources/ntp4/nav_dot.css
+++ b/chromium/chrome/browser/resources/ntp4/nav_dot.css
@@ -22,18 +22,18 @@ html.starting-up #dot-list {
}
.dot {
- -webkit-margin-end: 10px;
- -webkit-padding-start: 2px;
box-sizing: border-box;
cursor: pointer;
/* max-width: Set in new_tab.js. See measureNavDots() */
+ margin-inline-end: 10px;
outline: none;
+ padding-inline-start: 2px;
text-align: left;
- transition: -webkit-margin-end 250ms, max-width 250ms, opacity 250ms;
+ transition: margin-inline-end 250ms, max-width 250ms, opacity 250ms;
}
.dot:last-child {
- -webkit-margin-end: 0;
+ margin-inline-end: 0;
}
.dot:only-of-type {
@@ -43,7 +43,7 @@ html.starting-up #dot-list {
}
.dot.small {
- -webkit-margin-end: 0;
+ margin-inline-end: 0;
max-width: 0;
}
@@ -56,11 +56,11 @@ html.starting-up #dot-list {
.dot input {
-webkit-appearance: caret;
- -webkit-margin-start: 2px;
background-color: transparent;
cursor: inherit;
font: inherit;
height: auto;
+ margin-inline-start: 2px;
margin-top: 2px;
padding: 1px 0;
transition: color 200ms;
diff --git a/chromium/chrome/browser/resources/ntp4/new_tab.css b/chromium/chrome/browser/resources/ntp4/new_tab.css
index 4aa0a18dbe7..e9827c3faf7 100644
--- a/chromium/chrome/browser/resources/ntp4/new_tab.css
+++ b/chromium/chrome/browser/resources/ntp4/new_tab.css
@@ -55,7 +55,7 @@ body {
}
[is='action-link'] {
- -webkit-margin-start: 0.5em;
+ margin-inline-start: 0.5em;
}
#card-slider-frame {
@@ -166,14 +166,14 @@ html[dir='rtl'] #login-container {
}
#login-container [is='action-link'] {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
}
.login-status-icon {
- -webkit-padding-end: 37px;
background-position: right center;
background-repeat: no-repeat;
min-height: 27px;
+ padding-inline-end: 37px;
}
html[dir='rtl'] .login-status-icon {
@@ -210,10 +210,10 @@ html[dir='rtl'] .login-status-icon {
/* Trash. *********************************************************************/
#trash {
- -webkit-padding-start: 10px;
color: #222;
height: 100%;
opacity: 0;
+ padding-inline-start: 10px;
position: absolute;
right: 0;
top: 50px;
@@ -239,12 +239,12 @@ html[dir='rtl'] #trash {
}
#trash > .trash-text {
- -webkit-padding-end: 7px;
- -webkit-padding-start: 30px;
border: 1px dashed #7f7f7f;
border-radius: 4px;
display: inline-block;
padding-bottom: 9px;
+ padding-inline-end: 7px;
+ padding-inline-start: 30px;
padding-top: 10px;
position: relative;
top: 7px;
@@ -300,22 +300,22 @@ html[dir='rtl'] #footer.showing-trash-mode #trash.drag-target .lid {
#chrome-web-store-link {
-webkit-order: 3;
- -webkit-padding-end: 12px;
color: inherit;
cursor: pointer;
display: inline-block;
margin: 0;
+ padding-inline-end: 12px;
text-decoration: none;
transition-delay: 100ms;
white-space: nowrap;
}
#chrome-web-store-title {
- -webkit-padding-end: 36px;
- -webkit-padding-start: 15px;
background: url(chrome://theme/IDR_WEBSTORE_ICON_24) right 50% no-repeat;
display: inline-block;
line-height: 49px;
+ padding-inline-end: 36px;
+ padding-inline-start: 15px;
}
#chrome-web-store-link:hover {
diff --git a/chromium/chrome/browser/resources/ntp4/page_list_view.js b/chromium/chrome/browser/resources/ntp4/page_list_view.js
index cf3278cff87..2cc47f1836f 100644
--- a/chromium/chrome/browser/resources/ntp4/page_list_view.js
+++ b/chromium/chrome/browser/resources/ntp4/page_list_view.js
@@ -26,11 +26,14 @@
* id: string,
* is_component: boolean,
* is_webstore: boolean,
+ * isLocallyInstalled: boolean,
* kioskEnabled: boolean,
* kioskMode: boolean,
* kioskOnly: boolean,
* launch_container: number,
* launch_type: number,
+ * mayChangeLaunchType: boolean,
+ * mayCreateShortcuts: boolean,
* mayDisable: boolean,
* name: string,
* offlineEnabled: boolean,
diff --git a/chromium/chrome/browser/resources/optimize_webui.gni b/chromium/chrome/browser/resources/optimize_webui.gni
index 70dabca1012..2db654b4e36 100644
--- a/chromium/chrome/browser/resources/optimize_webui.gni
+++ b/chromium/chrome/browser/resources/optimize_webui.gni
@@ -40,6 +40,11 @@ template("optimize_webui") {
foreach(_out, invoker.html_out_files) {
outputs += [ "$target_gen_dir/$_out" ]
}
+ if (defined(invoker.html_out_files_polymer2)) {
+ foreach(_out, invoker.html_out_files_polymer2) {
+ outputs += [ "$target_gen_dir/$_out" ]
+ }
+ }
foreach(_out, invoker.js_out_files) {
outputs += [ "$target_gen_dir/$_out" ]
}
@@ -61,6 +66,10 @@ template("optimize_webui") {
args += [ "--html_in_files" ] + invoker.html_in_files
args += [ "--html_out_files" ] + invoker.html_out_files
+
+ if (defined(invoker.html_out_files_polymer2)) {
+ args += [ "--html_out_files_polymer2" ] + invoker.html_out_files_polymer2
+ }
args += [ "--js_out_files" ] + invoker.js_out_files
if (defined(invoker.excludes)) {
diff --git a/chromium/chrome/browser/resources/optimize_webui.py b/chromium/chrome/browser/resources/optimize_webui.py
index 6a8ddb4ad8f..124f748150d 100755
--- a/chromium/chrome/browser/resources/optimize_webui.py
+++ b/chromium/chrome/browser/resources/optimize_webui.py
@@ -202,16 +202,29 @@ def _optimize(in_folder, args):
# Run polymer-css-build and write the output HTML files to their final
# destination.
- pcb_html_out_paths = [
- os.path.join(out_path, f) for f in args.html_out_files]
- node.RunNode([node_modules.PathToPolymerCssBuild()] +
- ['--no-inline-includes', '-f'] +
- crisper_html_out_paths + ['-o'] + pcb_html_out_paths)
+ # TODO(dpapad): Remove this when Polymer 2 migration has completed.
+ _polymer_css_build(out_path, crisper_html_out_paths, args.html_out_files, 1)
+
+ if args.html_out_files_polymer2:
+ # Run polymer-css-build again with --polymer-version=2. This is
+ # necessary so that the runtime --enable-features=WebUIPolymer2 works
+ # with optimized builds.
+ _polymer_css_build(out_path, crisper_html_out_paths,
+ args.html_out_files_polymer2, 2)
finally:
shutil.rmtree(tmp_out_dir)
return manifest_out_path
+def _polymer_css_build(out_path, html_in_paths, html_out_files, version):
+ html_out_paths = [
+ os.path.join(out_path, f) for f in html_out_files]
+ node.RunNode([node_modules.PathToPolymerCssBuild()] +
+ ['--polymer-version', str(version)] +
+ ['--no-inline-includes', '-f'] +
+ html_in_paths + ['-o'] + html_out_paths)
+
+
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('--depfile', required=True)
@@ -219,6 +232,7 @@ def main(argv):
parser.add_argument('--host', required=True)
parser.add_argument('--html_in_files', nargs='*', required=True)
parser.add_argument('--html_out_files', nargs='*', required=True)
+ parser.add_argument('--html_out_files_polymer2', nargs='*')
parser.add_argument('--input', required=True)
parser.add_argument('--insert_in_head')
parser.add_argument('--js_out_files', nargs='*', required=True)
diff --git a/chromium/chrome/browser/resources/optimize_webui_test.py b/chromium/chrome/browser/resources/optimize_webui_test.py
index 5a9c2717ef9..6ce29d34690 100755
--- a/chromium/chrome/browser/resources/optimize_webui_test.py
+++ b/chromium/chrome/browser/resources/optimize_webui_test.py
@@ -44,17 +44,19 @@ class OptimizeWebUiTest(unittest.TestCase):
assert self._out_folder
return open(os.path.join(self._out_folder, file_name), 'r').read()
- def _run_optimize(self, depfile, html_in_file, html_out_file, js_out_file):
+ def _run_optimize(self, depfile, html_in_file, html_out_file,
+ html_out_file_polymer2, js_out_file):
# TODO(dbeam): make it possible to _run_optimize twice? Is that useful?
assert not self._out_folder
self._out_folder = self._create_tmp_dir()
optimize_webui.main([
'--depfile', os.path.join(self._out_folder,'depfile.d'),
- '--html_in_file', html_in_file,
- '--html_out_file', html_out_file,
+ '--html_in_files', html_in_file,
+ '--html_out_files', html_out_file,
+ '--html_out_files_polymer2', html_out_file_polymer2,
'--host', 'fake-host',
'--input', self._tmp_src_dir,
- '--js_out_file', js_out_file,
+ '--js_out_files', js_out_file,
'--out_folder', self._out_folder,
])
@@ -75,6 +77,7 @@ class OptimizeWebUiTest(unittest.TestCase):
self._run_optimize(depfile='depfile.d',
html_in_file='ui.html',
html_out_file='fast.html',
+ html_out_file_polymer2='fast.p2.html',
js_out_file='fast.js')
fast_html = self._read_out_file('fast.html')
diff --git a/chromium/chrome/browser/resources/pdf/elements/viewer-bookmark/viewer-bookmark.js b/chromium/chrome/browser/resources/pdf/elements/viewer-bookmark/viewer-bookmark.js
index 7a58c192af5..b05ae400a39 100644
--- a/chromium/chrome/browser/resources/pdf/elements/viewer-bookmark/viewer-bookmark.js
+++ b/chromium/chrome/browser/resources/pdf/elements/viewer-bookmark/viewer-bookmark.js
@@ -60,7 +60,7 @@ Polymer({
depthChanged: function() {
this.childDepth = this.depth + 1;
- this.$.item.style.webkitPaddingStart =
+ this.$.item.style.paddingInlineStart =
(this.depth * BOOKMARK_INDENT) + 'px';
},
diff --git a/chromium/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.html b/chromium/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.html
index 632001dd749..2f11b9dbb81 100644
--- a/chromium/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.html
+++ b/chromium/chrome/browser/resources/pdf/elements/viewer-page-selector/viewer-page-selector.html
@@ -23,18 +23,18 @@
--cr-input-background-color: transparent;
--cr-input-color: white;
--cr-input-input: {
- -webkit-margin-start: -3px;
- -webkit-padding-end: 3px;
- -webkit-padding-start: 3px;
- padding-bottom: 0;
- padding-top: 0;
text-align: end;
caret-color: #fff;
border-radius: 2px;
box-sizing: content-box;
+ margin-inline-start: -3px;
}
- -webkit-margin-start: -3px;
+ --cr-input-padding-end: 3px;
+ --cr-input-padding-start: 3px;
+ --cr-input-padding-bottom: 0;
+ --cr-input-padding-top: 0;
height: 100%;
+ margin-inline-start: -3px;
width: 1ch;
}
@@ -48,7 +48,7 @@
}
#pagelength-spacer {
- -webkit-margin-start: -2px;
+ margin-inline-start: -2px;
text-align: start;
}
diff --git a/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.html b/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.html
index 00b23ce44cb..8b218a7bdc6 100644
--- a/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.html
+++ b/chromium/chrome/browser/resources/pdf/elements/viewer-pdf-toolbar/viewer-pdf-toolbar.html
@@ -51,11 +51,11 @@
}
paper-icon-button {
- -webkit-margin-end: 12px;
+ margin-inline-end: 12px;
}
viewer-toolbar-dropdown {
- -webkit-margin-end: 4px;
+ margin-inline-end: 4px;
}
paper-progress {
diff --git a/chromium/chrome/browser/resources/pdf/elements/viewer-toolbar-dropdown/viewer-toolbar-dropdown.html b/chromium/chrome/browser/resources/pdf/elements/viewer-toolbar-dropdown/viewer-toolbar-dropdown.html
index c0424470e25..334ed97bcdb 100644
--- a/chromium/chrome/browser/resources/pdf/elements/viewer-toolbar-dropdown/viewer-toolbar-dropdown.html
+++ b/chromium/chrome/browser/resources/pdf/elements/viewer-toolbar-dropdown/viewer-toolbar-dropdown.html
@@ -54,8 +54,8 @@
}
#arrow {
- -webkit-margin-start: -12px;
- -webkit-padding-end: 4px;
+ margin-inline-start: -12px;
+ padding-inline-end: 4px;
}
h1 {
diff --git a/chromium/chrome/browser/resources/pdf/index.html b/chromium/chrome/browser/resources/pdf/index.html
index dcec3cc7343..f509a2d62e0 100644
--- a/chromium/chrome/browser/resources/pdf/index.html
+++ b/chromium/chrome/browser/resources/pdf/index.html
@@ -40,6 +40,6 @@
<script src="browser_api.js"></script>
<script src="coords_transformer.js"></script>
<script src="metrics.js"></script>
-<script src="pdf.js"></script>
+<script src="pdf_viewer.js"></script>
<script src="main.js"></script>
</html>
diff --git a/chromium/chrome/browser/resources/pdf/pdf_scripting_api.js b/chromium/chrome/browser/resources/pdf/pdf_scripting_api.js
index 6ade6be31d0..dac347df1d6 100644
--- a/chromium/chrome/browser/resources/pdf/pdf_scripting_api.js
+++ b/chromium/chrome/browser/resources/pdf/pdf_scripting_api.js
@@ -12,6 +12,7 @@ function DeserializeKeyEvent(dict) {
var e = document.createEvent('Event');
e.initEvent('keydown', true, true);
e.keyCode = dict.keyCode;
+ e.code = dict.code;
e.shiftKey = dict.shiftKey;
e.ctrlKey = dict.ctrlKey;
e.altKey = dict.altKey;
@@ -29,6 +30,7 @@ function DeserializeKeyEvent(dict) {
function SerializeKeyEvent(event) {
return {
keyCode: event.keyCode,
+ code: event.code,
shiftKey: event.shiftKey,
ctrlKey: event.ctrlKey,
altKey: event.altKey,
diff --git a/chromium/chrome/browser/resources/pdf/pdf.js b/chromium/chrome/browser/resources/pdf/pdf_viewer.js
index 6de1c5cc3c5..84ac5072c2d 100644
--- a/chromium/chrome/browser/resources/pdf/pdf.js
+++ b/chromium/chrome/browser/resources/pdf/pdf_viewer.js
@@ -106,7 +106,7 @@ function PDFViewer(browserApi) {
this.delayedScriptingMessages_ = [];
this.isPrintPreview_ = location.origin === 'chrome://print';
- this.isPrintPreviewLoaded_ = false;
+ this.isPrintPreviewLoadingFinished_ = false;
this.isUserInitiatedEvent_ = true;
/**
@@ -521,7 +521,7 @@ PDFViewer.prototype = {
sendDocumentLoadedMessage_: function() {
if (this.loadState_ == LoadState.LOADING)
return;
- if (this.isPrintPreview_ && !this.isPrintPreviewLoaded_)
+ if (this.isPrintPreview_ && !this.isPrintPreviewLoadingFinished_)
return;
this.sendScriptingMessage_(
{type: 'documentLoaded', load_state: this.loadState_});
@@ -598,6 +598,7 @@ PDFViewer.prototype = {
this.passwordScreen_.close();
}
this.loadState_ = LoadState.FAILED;
+ this.isPrintPreviewLoadingFinished_ = true;
this.sendDocumentLoadedMessage_();
} else if (progress == 100) {
// Document load complete.
@@ -718,7 +719,7 @@ PDFViewer.prototype = {
}
break;
case 'printPreviewLoaded':
- this.isPrintPreviewLoaded_ = true;
+ this.isPrintPreviewLoadingFinished_ = true;
this.sendDocumentLoadedMessage_();
break;
case 'setScrollPosition':
diff --git a/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json b/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json
index fb9de8bc475..69905af9962 100644
--- a/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json
+++ b/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json
@@ -1,5 +1,5 @@
{
- "x-version": 32,
+ "x-version": 33,
"google-talk": {
"mime_types": [
],
@@ -80,9 +80,9 @@
],
"versions": [
{
- "version": "30.0.0.154",
+ "version": "31.0.0.122",
"status": "up_to_date",
- "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-25.html"
+ "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-35.html"
}
],
"lang": "en-US",
diff --git a/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json b/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json
index 860323a4358..4309441fc30 100644
--- a/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json
+++ b/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json
@@ -1,5 +1,5 @@
{
- "x-version": 38,
+ "x-version": 39,
"google-talk": {
"mime_types": [
],
@@ -115,9 +115,9 @@
],
"versions": [
{
- "version": "30.0.0.154",
+ "version": "31.0.0.122",
"status": "requires_authorization",
- "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-25.html"
+ "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-35.html"
}
],
"lang": "en-US",
diff --git a/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json b/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json
index e88888859b0..c4efc6c5203 100644
--- a/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json
+++ b/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json
@@ -1,5 +1,5 @@
{
- "x-version": 47,
+ "x-version": 48,
"google-talk": {
"mime_types": [
],
@@ -137,9 +137,9 @@
],
"versions": [
{
- "version": "30.0.0.154",
+ "version": "31.0.0.122",
"status": "requires_authorization",
- "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-25.html"
+ "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-35.html"
}
],
"lang": "en-US",
diff --git a/chromium/chrome/browser/resources/policy.css b/chromium/chrome/browser/resources/policy.css
index 45df8882782..0744dea68e2 100644
--- a/chromium/chrome/browser/resources/policy.css
+++ b/chromium/chrome/browser/resources/policy.css
@@ -16,7 +16,7 @@ fieldset {
}
fieldset + fieldset {
- -webkit-margin-start: 20px;
+ margin-inline-start: 20px;
}
div.status-entry {
@@ -38,4 +38,8 @@ html[dir='rtl'] div.left-aligned-button {
section.status-box-section {
clear: both;
-} \ No newline at end of file
+}
+
+div.preformatted {
+ white-space: pre;
+}
diff --git a/chromium/chrome/browser/resources/policy.html b/chromium/chrome/browser/resources/policy.html
index b4dd54ccd4f..b142a6abc7b 100644
--- a/chromium/chrome/browser/resources/policy.html
+++ b/chromium/chrome/browser/resources/policy.html
@@ -123,7 +123,7 @@
</div>
</td>
<td class="status-column">
- <div class="status elide"></div>
+ <div class="status elide preformatted"></div>
</td>
</tr>
<tr class="expanded-value-container">
diff --git a/chromium/chrome/browser/resources/policy_android.css b/chromium/chrome/browser/resources/policy_android.css
index 999e02323da..5e06ea8b4e7 100644
--- a/chromium/chrome/browser/resources/policy_android.css
+++ b/chromium/chrome/browser/resources/policy_android.css
@@ -3,14 +3,14 @@
* found in the LICENSE file. */
body {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
}
body > .page {
- -webkit-margin-end: 0;
- -webkit-padding-end: 10px;
- -webkit-padding-start: 10px;
+ margin-inline-end: 0;
min-width: 0;
+ padding-inline-end: 10px;
+ padding-inline-start: 10px;
}
#filter-overlay {
@@ -30,12 +30,12 @@ body header > h1 {
}
body section {
- -webkit-padding-start: 0;
max-width: none;
+ padding-inline-start: 0;
}
body section > h3 {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
}
#status-box-container {
@@ -50,7 +50,7 @@ fieldset {
}
fieldset + fieldset {
- -webkit-margin-start: 20px;
+ margin-inline-start: 20px;
}
div.status-entry {
@@ -63,7 +63,7 @@ div.status-entry:last-child {
}
div.label {
- -webkit-margin-end: 1em;
+ margin-inline-end: 1em;
white-space: nowrap;
}
diff --git a/chromium/chrome/browser/resources/policy_common.css b/chromium/chrome/browser/resources/policy_common.css
index 937c38ea798..c894fd95718 100644
--- a/chromium/chrome/browser/resources/policy_common.css
+++ b/chromium/chrome/browser/resources/policy_common.css
@@ -3,12 +3,12 @@
* found in the LICENSE file. */
body {
- -webkit-margin-start: 23px;
+ margin-inline-start: 23px;
}
body > .page {
- -webkit-margin-end: 0;
- -webkit-padding-end: 24px;
+ margin-inline-end: 0;
+ padding-inline-end: 24px;
}
#filter-overlay {
@@ -31,7 +31,7 @@ body section {
}
div.label {
- -webkit-margin-end: 1em;
+ margin-inline-end: 1em;
white-space: nowrap;
}
@@ -87,7 +87,7 @@ section:not(.empty) > div.no-policies-set {
}
#main-section {
- -webkit-padding-start: 0;
+ padding-inline-start: 0;
}
section.policy-table-section {
diff --git a/chromium/chrome/browser/resources/print_preview/BUILD.gn b/chromium/chrome/browser/resources/print_preview/BUILD.gn
index e36e45667c0..e5536706faa 100644
--- a/chromium/chrome/browser/resources/print_preview/BUILD.gn
+++ b/chromium/chrome/browser/resources/print_preview/BUILD.gn
@@ -15,6 +15,7 @@ if (optimize_webui) {
host = "print"
html_in_files = [ "print_preview_new.html" ]
html_out_files = [ "vulcanized.html" ]
+ html_out_files_polymer2 = [ "vulcanized.p2.html" ]
insert_in_head = "<base href=\"chrome://print\">"
input = rebase_path("$target_gen_dir/$unpak_folder", root_build_dir)
js_out_files = [ "crisper.js" ]
diff --git a/chromium/chrome/browser/resources/print_preview/common/search_box.html b/chromium/chrome/browser/resources/print_preview/common/search_box.html
index 8c84964b6a8..eba42bb00f7 100644
--- a/chromium/chrome/browser/resources/print_preview/common/search_box.html
+++ b/chromium/chrome/browser/resources/print_preview/common/search_box.html
@@ -1,4 +1,4 @@
<div id="search-box-template" class="search-box" hidden>
<img src="../images/search.png" class="search-box-icon" alt="">
- <input type="text" class="search-box-input">
+ <input type="text" class="search-box-input" spellcheck="false">
</div>
diff --git a/chromium/chrome/browser/resources/print_preview/data/destination.js b/chromium/chrome/browser/resources/print_preview/data/destination.js
index a51790037dc..10ad760e483 100644
--- a/chromium/chrome/browser/resources/print_preview/data/destination.js
+++ b/chromium/chrome/browser/resources/print_preview/data/destination.js
@@ -163,6 +163,14 @@ print_preview.ColorMode = {
};
/**
+ * Policies affecting a destination.
+ * @typedef {{
+ * allowedColorModes: ?number,
+ * }}
+ */
+print_preview.Policies;
+
+/**
* @typedef {{id: string,
* origin: print_preview.DestinationOrigin,
* account: string,
@@ -218,7 +226,8 @@ cr.define('print_preview', function() {
* extensionName: (string|undefined),
* description: (string|undefined),
* certificateStatus:
- * (print_preview.DestinationCertificateStatus|undefined)
+ * (print_preview.DestinationCertificateStatus|undefined),
+ * policies: (print_preview.Policies|undefined),
* }=} opt_params Optional
* parameters for the destination.
*/
@@ -267,6 +276,12 @@ cr.define('print_preview', function() {
this.capabilities_ = null;
/**
+ * Policies affecting the destination.
+ * @private {?print_preview.Policies}
+ */
+ this.policies_ = (opt_params && opt_params.policies) || null;
+
+ /**
* Whether the destination is owned by the user.
* @private {boolean}
*/
@@ -521,6 +536,22 @@ cr.define('print_preview', function() {
}
/**
+ * @return {?print_preview.Policies} Print policies affecting the
+ * destination.
+ */
+ get policies() {
+ return this.policies_;
+ }
+
+ /**
+ * @param {?print_preview.Policies} policies Print policies affecting the
+ * destination.
+ */
+ set policies(policies) {
+ this.policies_ = policies;
+ }
+
+ /**
* @return {!print_preview.DestinationConnectionStatus} Connection status
* of the print destination.
*/
@@ -723,6 +754,17 @@ cr.define('print_preview', function() {
}
/**
+ * @return {?number} Color mode set by policy. Valid values are |null|,
+ |print_preview.ColorMode.COLOR| and |print_preview.ColorMode.GRAY|.
+ * @private
+ */
+ colorPolicy_() {
+ return this.policies && this.policies.allowedColorModes ?
+ this.policies.allowedColorModes :
+ null;
+ }
+
+ /**
* @return {boolean} Whether the printer supports both black and white and
* color printing.
*/
@@ -742,6 +784,22 @@ cr.define('print_preview', function() {
}
/**
+ * @return {boolean} Whether the printer color mode is set by policy.
+ */
+ get isColorManaged() {
+ return !!this.colorPolicy_();
+ }
+
+ /**
+ * @return {?boolean} Value for color setting set by policy.
+ */
+ get colorPolicyValue() {
+ return this.colorPolicy_() ?
+ this.colorPolicy_() == print_preview.ColorMode.COLOR :
+ null;
+ }
+
+ /**
* @param {boolean} isColor Whether to use a color printing mode.
* @return {Object} Selected color option.
*/
diff --git a/chromium/chrome/browser/resources/print_preview/data/local_parsers.js b/chromium/chrome/browser/resources/print_preview/data/local_parsers.js
index e2f1597c963..cfc2b693c16 100644
--- a/chromium/chrome/browser/resources/print_preview/data/local_parsers.js
+++ b/chromium/chrome/browser/resources/print_preview/data/local_parsers.js
@@ -42,7 +42,8 @@ cr.define('print_preview', function() {
function parseLocalDestination(destinationInfo) {
const options = {
description: destinationInfo.printerDescription,
- isEnterprisePrinter: destinationInfo.cupsEnterprisePrinter
+ isEnterprisePrinter: destinationInfo.cupsEnterprisePrinter,
+ policies: destinationInfo.policies
};
if (destinationInfo.printerOptions) {
// Convert options into cloud print tags format.
diff --git a/chromium/chrome/browser/resources/print_preview/native_layer.js b/chromium/chrome/browser/resources/print_preview/native_layer.js
index 021f981954f..9b2eef4e35f 100644
--- a/chromium/chrome/browser/resources/print_preview/native_layer.js
+++ b/chromium/chrome/browser/resources/print_preview/native_layer.js
@@ -22,6 +22,7 @@ print_preview.PreviewSettings;
* printerDescription: (string | undefined),
* cupsEnterprisePrinter: (boolean | undefined),
* printerOptions: (Object | undefined),
+ * policies: (print_preview.Policies | undefined),
* }}
*/
print_preview.LocalDestinationInfo;
@@ -38,6 +39,8 @@ print_preview.LocalDestinationInfo;
* documentHasSelection: boolean,
* shouldPrintSelectionOnly: boolean,
* printerName: string,
+ * headerFooter: ?boolean,
+ * isHeaderFooterManaged: boolean,
* serializedAppStateStr: ?string,
* serializedDefaultDestinationSelectionRulesStr: ?string,
* }}
@@ -72,6 +75,7 @@ print_preview.CapabilitiesResponse;
* printerId: string,
* success: boolean,
* capabilities: !print_preview.Cdd,
+ * policies: (print_preview.Policies | undefined),
* }}
*/
print_preview.PrinterSetupResponse;
diff --git a/chromium/chrome/browser/resources/print_preview/new/BUILD.gn b/chromium/chrome/browser/resources/print_preview/new/BUILD.gn
index e73f1358c4f..0c59dccef5a 100644
--- a/chromium/chrome/browser/resources/print_preview/new/BUILD.gn
+++ b/chromium/chrome/browser/resources/print_preview/new/BUILD.gn
@@ -75,6 +75,7 @@ js_library("app") {
"//ui/webui/resources/js:event_tracker",
"//ui/webui/resources/js:util",
"//ui/webui/resources/js:webui_listener_tracker",
+ "//ui/webui/resources/js/cr/ui:focus_outline_manager",
]
}
@@ -258,6 +259,7 @@ js_library("margin_control_container") {
deps = [
":margin_control",
":settings_behavior",
+ ":state",
"../data:coordinate2d",
"../data:margins",
"../data:measurement_system",
@@ -306,6 +308,7 @@ js_library("destination_list") {
"..:native_layer",
"../data:destination",
"//ui/webui/resources/js:i18n_behavior",
+ "//ui/webui/resources/js:list_property_update_behavior",
]
}
diff --git a/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.html b/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.html
index e77cd826cbe..7efa9f59f42 100644
--- a/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.html
+++ b/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.html
@@ -20,7 +20,7 @@
<div slot="title">
<div>[[i18n('advancedSettingsDialogTitle', destination.displayName)]]
</div>
- <print-preview-search-box id="searchBox" on-keydown="onKeydown_"
+ <print-preview-search-box id="searchBox"
hidden$="[[!hasMultipleItems_(
destination.capabilities.printer.vendor_capability)]]"
label="$i18n{advancedSettingsSearchBoxPlaceholder}"
diff --git a/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.js b/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.js
index 6b029738b8a..cfd36e3aea4 100644
--- a/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.js
+++ b/chromium/chrome/browser/resources/print_preview/new/advanced_settings_dialog.js
@@ -25,6 +25,10 @@ Polymer({
},
},
+ listeners: {
+ 'keydown': 'onKeydown_',
+ },
+
/** @private {!Array<Node>} */
highlights_: [],
@@ -52,7 +56,9 @@ Polymer({
*/
onKeydown_: function(e) {
e.stopPropagation();
- if (e.key == 'Escape' && !this.$.searchBox.getSearchInput().value.trim()) {
+ const searchInput = this.$.searchBox.getSearchInput();
+ if (e.key == 'Escape' &&
+ (e.composedPath()[0] !== searchInput || !searchInput.value.trim())) {
this.$.dialog.cancel();
e.preventDefault();
}
diff --git a/chromium/chrome/browser/resources/print_preview/new/advanced_settings_item.html b/chromium/chrome/browser/resources/print_preview/new/advanced_settings_item.html
index 7b1e87f70d7..9861226fef9 100644
--- a/chromium/chrome/browser/resources/print_preview/new/advanced_settings_item.html
+++ b/chromium/chrome/browser/resources/print_preview/new/advanced_settings_item.html
@@ -26,10 +26,10 @@
}
:host .label {
- -webkit-padding-end: 20px;
display: flex;
flex-direction: column;
justify-content: center;
+ padding-inline-end: 20px;
width: 250px;
}
@@ -59,7 +59,7 @@
</div>
</template>
<span hidden$="[[isCapabilityTypeSelect_(capability)]]">
- <input type="text" on-input="onUserInput_"
+ <input type="text" on-input="onUserInput_" spellcheck="false"
placeholder="[[getCapabilityPlaceholder_(capability)]]">
</span>
</div>
diff --git a/chromium/chrome/browser/resources/print_preview/new/app.html b/chromium/chrome/browser/resources/print_preview/new/app.html
index a0411c5cf03..9f21c03f37a 100644
--- a/chromium/chrome/browser/resources/print_preview/new/app.html
+++ b/chromium/chrome/browser/resources/print_preview/new/app.html
@@ -1,5 +1,7 @@
<link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/html/cr.html">
+<link rel="import" href="chrome://resources/html/cr/ui/focus_outline_manager.html">
<link rel="import" href="chrome://resources/html/event_tracker.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/html/webui_listener_tracker.html">
@@ -44,8 +46,8 @@
}
#sidebar {
- -webkit-border-end: 1px solid #c8c8c8;
background-color: white;
+ border-inline-end: 1px solid #c8c8c8;
display: flex;
flex-direction: column;
max-width: 310px;
@@ -60,9 +62,9 @@
}
#preview-area-container {
- -webkit-border-start: 1px solid #dcdcdc;
align-items: center;
background-color: #e6e6e6;
+ border-inline-start: 1px solid #dcdcdc;
flex: 1;
}
</style>
diff --git a/chromium/chrome/browser/resources/print_preview/new/app.js b/chromium/chrome/browser/resources/print_preview/new/app.js
index 49797f39cac..5dd5417b89b 100644
--- a/chromium/chrome/browser/resources/print_preview/new/app.js
+++ b/chromium/chrome/browser/resources/print_preview/new/app.js
@@ -170,6 +170,11 @@ Polymer({
openDialogs_: [],
/** @override */
+ ready: function() {
+ cr.ui.FocusOutlineManager.forDocument(document);
+ },
+
+ /** @override */
attached: function() {
this.nativeLayer_ = print_preview.NativeLayer.getInstance();
this.documentInfo_ = new print_preview.DocumentInfo();
@@ -320,6 +325,8 @@ Polymer({
this.notifyPath('documentInfo_.title');
this.notifyPath('documentInfo_.pageCount');
this.$.model.setStickySettings(settings.serializedAppStateStr);
+ this.$.model.setPolicySettings(
+ settings.headerFooter, settings.isHeaderFooterManaged);
this.measurementSystem_ = new print_preview.MeasurementSystem(
settings.thousandsDelimeter, settings.decimalDelimeter,
settings.unitType);
diff --git a/chromium/chrome/browser/resources/print_preview/new/button_css.html b/chromium/chrome/browser/resources/print_preview/new/button_css.html
index e4f5914b9e2..d62598549fa 100644
--- a/chromium/chrome/browser/resources/print_preview/new/button_css.html
+++ b/chromium/chrome/browser/resources/print_preview/new/button_css.html
@@ -6,8 +6,8 @@
<template>
<style include="print-preview-shared">
button {
- -webkit-padding-end: 10px;
- -webkit-padding-start: 10px;
+ padding-inline-end: 10px;
+ padding-inline-start: 10px;
}
button:enabled:hover {
diff --git a/chromium/chrome/browser/resources/print_preview/new/checkbox_radio_css.html b/chromium/chrome/browser/resources/print_preview/new/checkbox_radio_css.html
index 4ab95716591..95d59536758 100644
--- a/chromium/chrome/browser/resources/print_preview/new/checkbox_radio_css.html
+++ b/chromium/chrome/browser/resources/print_preview/new/checkbox_radio_css.html
@@ -96,11 +96,11 @@
}
:-webkit-any(.checkbox, .radio) label input ~ span {
- -webkit-margin-start: 0.6em;
/* Make sure long spans wrap at the same horizontal position they
* start.
*/
display: block;
+ margin-inline-start: 0.6em;
}
:-webkit-any(.checkbox, .radio) label:hover {
diff --git a/chromium/chrome/browser/resources/print_preview/new/color_settings.html b/chromium/chrome/browser/resources/print_preview/new/color_settings.html
index 242cf8789c8..76823ecd318 100644
--- a/chromium/chrome/browser/resources/print_preview/new/color_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/color_settings.html
@@ -9,10 +9,13 @@
<template>
<style include="print-preview-shared select">
</style>
- <print-preview-settings-section>
+ <print-preview-settings-section class$="[[sectionClass_]]"
+ managed="[[settings.color.setByPolicy]]">
<span id="color-label" slot="title">$i18n{optionColor}</span>
<div slot="controls">
- <select aria-labelledby="color-label" disabled$="[[disabled]]">
+ <select aria-labelledby="color-label"
+ disabled$="[[disabled_]]"
+ value="{{selectedValue::change}}">
<option value="bw" selected>$i18n{optionBw}</option>
<option value="color">$i18n{optionColor}</option>
</select>
diff --git a/chromium/chrome/browser/resources/print_preview/new/color_settings.js b/chromium/chrome/browser/resources/print_preview/new/color_settings.js
index 40e2e6b547e..d364c430e17 100644
--- a/chromium/chrome/browser/resources/print_preview/new/color_settings.js
+++ b/chromium/chrome/browser/resources/print_preview/new/color_settings.js
@@ -9,16 +9,32 @@ Polymer({
properties: {
disabled: Boolean,
+
+ /** @private {boolean} */
+ disabled_: {
+ type: Boolean,
+ computed: 'computeDisabled_(disabled, settings.color.setByPolicy)',
+ },
},
observers: ['onColorSettingChange_(settings.color.value)'],
/**
- * @param {*} value The new value of the color setting.
+ * @param {*} newValue The new value of the color setting.
+ * @private
+ */
+ onColorSettingChange_: function(newValue) {
+ this.selectedValue = /** @type {boolean} */ (newValue) ? 'color' : 'bw';
+ },
+
+ /**
+ * @param {boolean} disabled Whether color selection is disabled.
+ * @param {boolean} managed Whether color selection is managed.
+ * @return {boolean} Whether drop-down should be disabled.
* @private
*/
- onColorSettingChange_: function(value) {
- this.$$('select').value = /** @type {boolean} */ (value) ? 'color' : 'bw';
+ computeDisabled_: function(disabled, managed) {
+ return !!(disabled || managed);
},
/** @param {string} value The new select value. */
diff --git a/chromium/chrome/browser/resources/print_preview/new/destination_dialog.html b/chromium/chrome/browser/resources/print_preview/new/destination_dialog.html
index 02ea28f750b..ba2df4ae30e 100644
--- a/chromium/chrome/browser/resources/print_preview/new/destination_dialog.html
+++ b/chromium/chrome/browser/resources/print_preview/new/destination_dialog.html
@@ -37,8 +37,8 @@
height: 100%;
};
--cr-dialog-body: {
- -webkit-padding-end: 16px;
- -webkit-padding-start: 16px;
+ padding-inline-end: 16px;
+ padding-inline-start: 16px;
padding-bottom: 0;
padding-top: 0;
};
@@ -47,25 +47,25 @@
};
}
- :host .user-info {
+ .user-info {
font-size: calc(13/15 * 1em);
line-height: normal;
margin-top: 14px;
}
- :host .user-info .account-select-label {
- -webkit-padding-end: 18px;
+ .user-info .account-select-label {
+ padding-inline-end: 18px;
}
- :host .user-info .account-select {
+ .user-info .account-select {
width: auto
}
- :host #dialog #promos {
+ #dialog #promos {
padding: 0;
}
- :host #dialog .promo {
+ #dialog .promo {
align-items: center;
background-color: #f5f5f5;
border-top: 1px solid #e7e7e7;
@@ -74,48 +74,66 @@
padding: 14px 17px;
}
- :host #cloudprintPromo .promo-text {
+ #cloudprintPromo .promo-text {
flex: 1;
}
- :host #cloudprintPromo .icon {
- -webkit-margin-end: 12px;
+ #cloudprintPromo .icon {
display: block;
height: 24px;
+ margin-inline-end: 12px;
width: 24px;
}
- :host #cloudprintPromo .close-button {
- -webkit-margin-start: 12px;
+ #cloudprintPromo button {
+ background-color: #f5f5f5;
background-image: -webkit-image-set(
url(chrome://theme/IDR_CLOSE_DIALOG) 1x,
url(chrome://theme/IDR_CLOSE_DIALOG@2x) 2x);
background-repeat: no-repeat;
background-size: 14px;
- height: 14px;
- width: 14px;
+ border: none;
+ box-shadow: none;
+ margin-inline-start: 12px;
+ min-height: 14px;
+ min-width: 14px;
+ outline: none;
+ padding: 0;
}
- :host #cloudprintPromo .close-button:hover {
+ #cloudprintPromo button:active {
background-image: -webkit-image-set(
- url(chrome://theme/IDR_CLOSE_DIALOG_H) 1x,
- url(chrome://theme/IDR_CLOSE_DIALOG_H@2x) 2x);
+ url(chrome://theme/IDR_CLOSE_DIALOG_P) 1x,
+ url(chrome://theme/IDR_CLOSE_DIALOG_P@2x) 2x);
}
- :host #cloudprintPromo .close-button:active {
+ #cloudprintPromo button:focus,
+ #cloudprintPromo button:hover {
background-image: -webkit-image-set(
- url(chrome://theme/IDR_CLOSE_DIALOG_P) 1x,
- url(chrome://theme/IDR_CLOSE_DIALOG_P@2x) 2x);
+ url(chrome://theme/IDR_CLOSE_DIALOG_H) 1x,
+ url(chrome://theme/IDR_CLOSE_DIALOG_H@2x) 2x);
}
- :host #invitationPromo {
+ #invitationPromo {
flex-direction: column;
}
- :host #invitationPromo .invitation-buttons {
+ #invitationPromo .invitation-buttons {
padding: 12px 0;
}
+ /* Height = 3 * destination item (30px) + 9px padding + 1 line text */
+ #recentList {
+ height: calc(99px + 1rem);
+ }
+
+ /* Height = 100vh - recent (99px + 1 line) - padding (40px) - */
+ /* header (55px + 2 lines) - button (32px + 2 lines) */
+ #printList {
+ height: calc(100vh - 266px - 5rem);
+ min-height: calc(99px + 1rem);
+ }
+
print-preview-destination-list {
padding-bottom: 18px;
}
@@ -142,23 +160,24 @@
<option value="">$i18n{addAccountTitle}</option>
</select>
</div>
- <print-preview-search-box id="searchBox" on-keydown="onKeydown_"
+ <print-preview-search-box id="searchBox"
label="$i18n{searchBoxPlaceholder}" search-query="{{searchQuery_}}"
autofocus>
</print-preview-search-box>
</div>
<div slot="body" scrollable>
<div>
- <print-preview-destination-list
+ <print-preview-destination-list id="recentList"
destinations="[[recentDestinationList_]]"
search-query="[[searchQuery_]]"
- title="$i18n{recentDestinationsTitle}"
+ list-name="$i18n{recentDestinationsTitle}"
on-destination-selected="onDestinationSelected_">
</print-preview-destination-list>
- <print-preview-destination-list destinations="[[destinations_]]"
+ <print-preview-destination-list id="printList"
+ destinations="[[destinations_]]"
has-action-link loading-destinations="[[loadingDestinations_]]"
search-query="[[searchQuery_]]"
- title="$i18n{printDestinationsTitle}"
+ list-name="$i18n{printDestinationsTitle}"
on-destination-selected="onDestinationSelected_">
</print-preview-destination-list>
</div>
@@ -176,7 +195,7 @@
hidden$="[[!showCloudPrintPromo]]">
<img src="../images/cloud.png" class="icon" alt="">
<div class="promo-text"></div>
- <div class="close-button"></div>
+ <button on-click="onCloudPrintPromoDismissed_"></button>
</div>
<div class="promo" id="invitationPromo" hidden="[[!invitation_]]">
<div inner-h-t-m-l="[[getInvitationText_(invitation_)]]"></div>
diff --git a/chromium/chrome/browser/resources/print_preview/new/destination_dialog.js b/chromium/chrome/browser/resources/print_preview/new/destination_dialog.js
index 3a526c5a542..42204c442e1 100644
--- a/chromium/chrome/browser/resources/print_preview/new/destination_dialog.js
+++ b/chromium/chrome/browser/resources/print_preview/new/destination_dialog.js
@@ -71,6 +71,14 @@ Polymer({
},
},
+ observers: [
+ 'adjustHeight_(invitation_, showCloudPrintPromo)',
+ ],
+
+ listeners: {
+ 'keydown': 'onKeydown_',
+ },
+
/** @private {!EventTracker} */
tracker_: new EventTracker(),
@@ -100,9 +108,6 @@ Polymer({
attached: function() {
this.tracker_.add(
assert(this.$$('.sign-in')), 'click', this.onSignInClick_.bind(this));
- this.tracker_.add(
- assert(this.$$('#cloudprintPromo > .close-button')), 'click',
- this.onCloudPrintPromoDismissed_.bind(this));
},
/**
@@ -111,13 +116,40 @@ Polymer({
*/
onKeydown_: function(e) {
e.stopPropagation();
- if (e.key == 'Escape' && !this.$.searchBox.getSearchInput().value.trim()) {
+ const searchInput = this.$.searchBox.getSearchInput();
+ if (e.key == 'Escape' &&
+ (e.composedPath()[0] !== searchInput || !searchInput.value.trim())) {
this.$.dialog.cancel();
e.preventDefault();
}
},
/** @private */
+ adjustHeight_: function() {
+ // Baseline size of recent list + buttons + title + search box
+ let px = 266;
+ let lines = 5;
+ if (this.invitation_) {
+ // Invitation promo size
+ px += 57;
+ lines += 4;
+ }
+ if (this.showCloudPrintPromo) {
+ // Cloud print promo size
+ px += 28;
+ lines += 2;
+ }
+ if (this.userInfo && this.userInfo.loggedIn) {
+ // User accounts select size
+ px += 14;
+ lines += 2;
+ }
+
+ // Compute sizing
+ this.$.printList.style.height = `calc(100vh - ${px}px - ${lines}rem)`;
+ },
+
+ /** @private */
onDestinationStoreSet_: function() {
assert(this.destinations_.length == 0);
const destinationStore = assert(this.destinationStore);
@@ -264,6 +296,8 @@ Polymer({
listItem.onConfigureComplete(response.success);
if (response.success) {
destination.capabilities = response.capabilities;
+ if (response.policies)
+ destination.policies = response.policies;
this.selectDestination_(destination);
}
},
@@ -289,6 +323,8 @@ Polymer({
this.destinationStore.isPrintDestinationSearchInProgress;
this.metrics_.record(
print_preview.Metrics.DestinationSearchBucket.DESTINATION_SHOWN);
+ this.$.recentList.forceIronResize();
+ this.$.printList.forceIronResize();
},
/** @return {boolean} Whether the dialog is open. */
diff --git a/chromium/chrome/browser/resources/print_preview/new/destination_list.html b/chromium/chrome/browser/resources/print_preview/new/destination_list.html
index 6161329ab54..74b40b79d52 100644
--- a/chromium/chrome/browser/resources/print_preview/new/destination_list.html
+++ b/chromium/chrome/browser/resources/print_preview/new/destination_list.html
@@ -3,6 +3,8 @@
<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="chrome://resources/html/list_property_update_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
<link rel="import" href="../native_layer.html">
<link rel="import" href="../data/destination.html">
<link rel="import" href="destination_list_item.html">
@@ -19,24 +21,24 @@
}
:host > header {
- -webkit-padding-end: 19px;
- -webkit-padding-start: 0;
background-color: transparent;
border-bottom: 1px solid #d2d2d2;
padding-bottom: 8px;
+ padding-inline-end: 19px;
+ padding-inline-start: 0;
}
:host :-webkit-any(.title, .action-link, .total) {
- -webkit-padding-end: 8px;
- -webkit-padding-start: 4px;
display: inline;
+ padding-inline-end: 8px;
+ padding-inline-start: 4px;
vertical-align: middle;
}
:host .throbber-container {
- -webkit-padding-end: 16px;
- -webkit-padding-start: 8px;
display: inline-block;
+ padding-inline-end: 16px;
+ padding-inline-start: 8px;
position: relative;
vertical-align: middle;
}
@@ -46,18 +48,18 @@
}
:host .no-destinations-message {
- -webkit-padding-start: 18px;
color: #999;
padding-bottom: 8px;
+ padding-inline-start: 18px;
padding-top: 8px;
}
:host .list-item {
- -webkit-padding-end: 2px;
- -webkit-padding-start: 18px;
cursor: default;
display: flex;
padding-bottom: 3px;
+ padding-inline-end: 2px;
+ padding-inline-start: 18px;
padding-top: 3px;
}
@@ -75,9 +77,9 @@
}
</style>
<header>
- <h4 class="title">[[title]]</h4>
+ <h4 class="title">[[listName]]</h4>
<span class="total" hidden$="[[!showDestinationsTotal_]]">
- [[i18n('destinationCount', matchingDestinationsCount_)]]
+ [[i18n('destinationCount', matchingDestinations_.length)]]
</span>
<a is="action-link" class="action-link" hidden$="[[!hasActionLink]]"
on-click="onActionLinkClick_">
@@ -87,16 +89,18 @@
<div class="throbber"></div>
</div>
</header>
- <template is="dom-repeat" items="[[destinations]]" notify-dom-change
- on-dom-change="updateIfNeeded_">
- <print-preview-destination-list-item class="list-item"
- search-query="[[searchQuery]]" destination="[[item]]"
- on-click="onDestinationSelected_" on-keydown="onKeydown_">
- </print-preview-destination-list-item>
- </template>
<div class="no-destinations-message" hidden$="[[hasDestinations_]]">
$i18n{noDestinationsMessage}
</div>
+ <iron-list id="list" items="[[matchingDestinations_]]">
+ <template>
+ <print-preview-destination-list-item class="list-item"
+ search-query="[[searchQuery]]" destination="[[item]]"
+ on-click="onDestinationSelected_" on-keydown="onKeydown_"
+ tabindex$="[[tabIndex]]">
+ </print-preview-destination-list-item>
+ </template>
+ </iron-list>
</template>
<script src="destination_list.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/print_preview/new/destination_list.js b/chromium/chrome/browser/resources/print_preview/new/destination_list.js
index 446e54e913a..ab1ea38275e 100644
--- a/chromium/chrome/browser/resources/print_preview/new/destination_list.js
+++ b/chromium/chrome/browser/resources/print_preview/new/destination_list.js
@@ -8,12 +8,15 @@
Polymer({
is: 'print-preview-destination-list',
- behaviors: [I18nBehavior],
+ behaviors: [I18nBehavior, ListPropertyUpdateBehavior],
properties: {
/** @type {Array<!print_preview.Destination>} */
destinations: Array,
+ /** @type {?RegExp} */
+ searchQuery: Object,
+
/** @type {boolean} */
hasActionLink: {
type: Boolean,
@@ -26,108 +29,63 @@ Polymer({
value: false,
},
- /** @type {?RegExp} */
- searchQuery: {
- type: Object,
- observer: 'update_',
- },
+ listName: String,
- /** @type {boolean} */
- title: String,
-
- /** @private {number} */
- matchingDestinationsCount_: {
- type: Number,
- value: 0,
+ /** @private {!Array<!print_preview.Destination>} */
+ matchingDestinations_: {
+ type: Array,
+ value: () => [],
},
/** @private {boolean} */
hasDestinations_: {
type: Boolean,
- computed: 'computeHasDestinations_(matchingDestinationsCount_)',
+ value: true,
+ observer: 'hasDestinationsChanged_',
},
/** @private {boolean} */
showDestinationsTotal_: {
type: Boolean,
- computed: 'computeShowDestinationsTotal_(matchingDestinationsCount_)',
+ value: false,
},
},
observers: [
- 'destinationsChanged_(destinations.*)',
+ 'updateMatchingDestinations_(destinations.*, searchQuery)',
+ 'matchingDestinationsChanged_(matchingDestinations_.*)',
],
- /** @private {boolean} */
- newDestinations_: false,
-
- /** @private {boolean} */
- initializedDestinations_: false,
-
- /** @private {!Array<!Node>} */
- highlights_: [],
-
- /**
- * @param {!Array<!print_preview.Destination>} current
- * @param {?Array<!print_preview.Destination>} previous
- * @private
- */
- destinationsChanged_: function() {
- if (!this.initializedDestinations_) {
- this.matchingDestinationsCount_ = this.destinations.length;
- this.initializedDestinations_ = true;
- } else {
- this.newDestinations_ = true;
- }
+ // This is a workaround to ensure that the iron-list correctly updates the
+ // displayed destination information when the elements in the
+ // |matchingDestinations_| array change, instead of using stale information
+ // (a known iron-list issue). The event needs to be fired while the list is
+ // visible, so firing it immediately when the change occurs does not always
+ // work.
+ forceIronResize: function() {
+ this.$.list.fire('iron-resize');
},
/** @private */
- updateIfNeeded_: function() {
- if (!this.newDestinations_)
+ updateMatchingDestinations_: function() {
+ if (this.destinations === undefined)
return;
- this.newDestinations_ = false;
- this.update_();
- },
- /** @private */
- update_: function() {
- if (!this.destinations)
- return;
-
- cr.search_highlight_utils.removeHighlights(this.highlights_);
- this.highlights_ = [];
-
- const listItems =
- this.shadowRoot.querySelectorAll('print-preview-destination-list-item');
-
- let matchCount = 0;
- listItems.forEach(item => {
- item.hidden =
- !!this.searchQuery && !item.destination.matches(this.searchQuery);
- if (!item.hidden) {
- matchCount++;
- this.highlights_.push.apply(this.highlights_, item.update().highlights);
- }
- });
-
- this.matchingDestinationsCount_ =
- !this.searchQuery ? listItems.length : matchCount;
- },
-
- /**
- * @return {boolean}
- * @private
- */
- computeHasDestinations_: function() {
- return !this.destinations || this.matchingDestinationsCount_ > 0;
+ this.updateList(
+ 'matchingDestinations_',
+ destination => destination.origin + '/' + destination.id + '/' +
+ destination.connectionStatusText,
+ this.searchQuery ?
+ this.destinations.filter(
+ d => d.matches(/** @type {!RegExp} */ (this.searchQuery))) :
+ this.destinations.slice());
},
- /**
- * @return {boolean}
- * @private
- */
- computeShowDestinationsTotal_: function() {
- return this.matchingDestinationsCount_ > 4;
+ /** @private */
+ matchingDestinationsChanged_: function() {
+ const count = this.matchingDestinations_.length;
+ this.hasDestinations_ = count > 0;
+ this.showDestinationsTotal_ = count > 4;
},
/** @private */
@@ -153,5 +111,12 @@ Polymer({
onDestinationSelected_: function(e) {
this.fire('destination-selected', e.target);
},
+
+ /** @private */
+ hasDestinationsChanged_: function() {
+ // If there are no destinations, leave space for "no destinations" message.
+ this.$.list.style.height = this.hasDestinations_ ?
+ 'calc(100% - 1rem - 9px)' : 'calc(100% - 2rem - 9px)';
+ },
});
})();
diff --git a/chromium/chrome/browser/resources/print_preview/new/destination_list_item.html b/chromium/chrome/browser/resources/print_preview/new/destination_list_item.html
index 702662e9541..3cf746cd5aa 100644
--- a/chromium/chrome/browser/resources/print_preview/new/destination_list_item.html
+++ b/chromium/chrome/browser/resources/print_preview/new/destination_list_item.html
@@ -13,10 +13,10 @@
<template>
<style include="print-preview-shared action-link cr-hidden-style">
:host .icon {
- -webkit-margin-end: 8px;
display: inline-block;
flex: 0 0 auto;
height: 24px;
+ margin-inline-end: 8px;
transition: opacity 150ms;
vertical-align: middle;
width: 24px;
@@ -33,17 +33,17 @@
}
:host .search-hint {
- -webkit-margin-start: 1em;
color: #999;
font-size: 75%;
+ margin-inline-start: 1em;
}
:host .connection-status,
:host .learn-more-link {
- -webkit-margin-start: 1em;
flex: 0 0 auto;
font-size: 75%;
line-height: 24px;
+ margin-inline-start: 1em;
vertical-align: middle;
}
@@ -59,9 +59,9 @@
}
:host .extension-name {
- -webkit-margin-start: 1em;
color: #777;
line-height: 24px;
+ margin-inline-start: 1em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -79,9 +79,9 @@
:host .configuring-in-progress-text,
:host .configuring-failed-text {
- -webkit-margin-start: 1em;
flex: 0 1 auto;
line-height: 24px;
+ margin-inline-start: 1em;
vertical-align: middle;
}
diff --git a/chromium/chrome/browser/resources/print_preview/new/destination_list_item.js b/chromium/chrome/browser/resources/print_preview/new/destination_list_item.js
index a118f06f34d..a57a81323ce 100644
--- a/chromium/chrome/browser/resources/print_preview/new/destination_list_item.js
+++ b/chromium/chrome/browser/resources/print_preview/new/destination_list_item.js
@@ -50,16 +50,16 @@ Polymer({
// </if>
},
- hostAttributes: {
- tabindex: 0,
- },
-
observers: [
'onDestinationPropertiesChange_(' +
'destination.displayName, destination.isOfflineOrInvalid, ' +
'destination.isExtension)',
+ 'updateHighlightsAndHint_(destination, searchQuery)',
],
+ /** @private {!Array<!Node>} */
+ highlights_: [],
+
/** @private */
onDestinationPropertiesChange_: function() {
this.title = this.destination.displayName;
@@ -114,13 +114,11 @@ Polymer({
},
// </if>
- /**
- * @return {!print_preview.HighlightResults} The highlight wrappers and
- * search bubbles that were created.
- */
- update: function() {
+ /** @private */
+ updateHighlightsAndHint_: function() {
this.updateSearchHint_();
- return this.updateHighlighting_();
+ cr.search_highlight_utils.removeHighlights(this.highlights_);
+ this.highlights_ = this.updateHighlighting_().highlights;
},
/** @private */
diff --git a/chromium/chrome/browser/resources/print_preview/new/destination_settings.html b/chromium/chrome/browser/resources/print_preview/new/destination_settings.html
index 1fb778b1728..6b4307aed20 100644
--- a/chromium/chrome/browser/resources/print_preview/new/destination_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/destination_settings.html
@@ -35,8 +35,8 @@
}
.destination-icon {
- -webkit-margin-end: 8px;
height: 24px;
+ margin-inline-end: 8px;
vertical-align: middle;
width: 24px;
}
diff --git a/chromium/chrome/browser/resources/print_preview/new/header.html b/chromium/chrome/browser/resources/print_preview/new/header.html
index c5aa607bd79..e5c1de8a624 100644
--- a/chromium/chrome/browser/resources/print_preview/new/header.html
+++ b/chromium/chrome/browser/resources/print_preview/new/header.html
@@ -13,12 +13,12 @@
<template>
<style include="print-preview-shared button">
:host {
- -webkit-padding-end: 19px;
- -webkit-padding-start: 20px;
background-color: #f6f6f6;
border-bottom: 1px solid #d2d2d2;
display: block;
padding-bottom: 20px;
+ padding-inline-end: 19px;
+ padding-inline-start: 20px;
padding-top: 6px;
}
@@ -43,8 +43,8 @@
}
#button-strip button {
- -webkit-margin-start: 9px;
display: block;
+ margin-inline-start: 9px;
}
#button-strip button.loading {
diff --git a/chromium/chrome/browser/resources/print_preview/new/header.js b/chromium/chrome/browser/resources/print_preview/new/header.js
index 7156fb98e7b..c021c013975 100644
--- a/chromium/chrome/browser/resources/print_preview/new/header.js
+++ b/chromium/chrome/browser/resources/print_preview/new/header.js
@@ -49,8 +49,7 @@ Polymer({
observers:
['update_(settings.copies.value, settings.duplex.value, ' +
- 'settings.pages.value, settings.pagesPerSheet.value, state, ' +
- 'destination.id)'],
+ 'settings.pages.value, state, destination.id)'],
/** @private {!print_preview_new.State} */
lastState_: print_preview_new.State.NOT_READY,
@@ -98,14 +97,6 @@ Polymer({
numSheets = Math.ceil(numPages / 2);
}
- const pagesPerSheet = parseInt(this.getSettingValue('pagesPerSheet'), 10);
-
- if (!Number.isNaN(pagesPerSheet)) {
- assert(pagesPerSheet > 0);
- numSheets = Math.ceil(numSheets / pagesPerSheet);
- numPages = Math.ceil(numPages / pagesPerSheet);
- }
-
const copies = parseInt(this.getSettingValue('copies'), 10);
numSheets *= copies;
numPages *= copies;
diff --git a/chromium/chrome/browser/resources/print_preview/new/layout_settings.html b/chromium/chrome/browser/resources/print_preview/new/layout_settings.html
index dc7b9710046..0c43014717f 100644
--- a/chromium/chrome/browser/resources/print_preview/new/layout_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/layout_settings.html
@@ -12,7 +12,8 @@
<print-preview-settings-section>
<span id="layout-label" slot="title">$i18n{layoutLabel}</span>
<div slot="controls">
- <select aria-labelledby="layout-label" disabled$="[[disabled]]">
+ <select aria-labelledby="layout-label" disabled$="[[disabled]]"
+ value="{{selectedValue::change}}">
<option value="portrait" selected>$i18n{optionPortrait}</option>
<option value="landscape">$i18n{optionLandscape}</option>
</select>
diff --git a/chromium/chrome/browser/resources/print_preview/new/layout_settings.js b/chromium/chrome/browser/resources/print_preview/new/layout_settings.js
index c5cb3e5fc10..7569400a26a 100644
--- a/chromium/chrome/browser/resources/print_preview/new/layout_settings.js
+++ b/chromium/chrome/browser/resources/print_preview/new/layout_settings.js
@@ -14,12 +14,12 @@ Polymer({
observers: ['onLayoutSettingChange_(settings.layout.value)'],
/**
- * @param {*} value The new value of the layout setting.
+ * @param {*} newValue The new value of the layout setting.
* @private
*/
- onLayoutSettingChange_: function(value) {
- this.$$('select').value =
- /** @type {boolean} */ (value) ? 'landscape' : 'portrait';
+ onLayoutSettingChange_: function(newValue) {
+ this.selectedValue =
+ /** @type {boolean} */ (newValue) ? 'landscape' : 'portrait';
},
/** @param {string} value The new select value. */
diff --git a/chromium/chrome/browser/resources/print_preview/new/margin_control_container.html b/chromium/chrome/browser/resources/print_preview/new/margin_control_container.html
index 7b13229ee42..fefafefe9e0 100644
--- a/chromium/chrome/browser/resources/print_preview/new/margin_control_container.html
+++ b/chromium/chrome/browser/resources/print_preview/new/margin_control_container.html
@@ -3,6 +3,7 @@
<link rel="import" href="chrome://resources/html/event_tracker.html">
<link rel="import" href="margin_control.html">
<link rel="import" href="settings_behavior.html">
+<link rel="import" href="state.html">
<link rel="import" href="../data/coordinate2d.html">
<link rel="import" href="../data/margins.html">
<link rel="import" href="../data/measurement_system.html">
diff --git a/chromium/chrome/browser/resources/print_preview/new/margin_control_container.js b/chromium/chrome/browser/resources/print_preview/new/margin_control_container.js
index 25e8554b369..2adec20f6a1 100644
--- a/chromium/chrome/browser/resources/print_preview/new/margin_control_container.js
+++ b/chromium/chrome/browser/resources/print_preview/new/margin_control_container.js
@@ -2,22 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-(function() {
-'use strict';
-
-/** @const {number} */
-const MINIMUM_DISTANCE = 72; // 1 inch
+cr.exportPath('print_preview_new');
/**
* @const {!Map<!print_preview.ticket_items.CustomMarginsOrientation, string>}
*/
-const MARGIN_KEY_MAP = new Map([
+print_preview_new.MARGIN_KEY_MAP = new Map([
[print_preview.ticket_items.CustomMarginsOrientation.TOP, 'marginTop'],
[print_preview.ticket_items.CustomMarginsOrientation.RIGHT, 'marginRight'],
[print_preview.ticket_items.CustomMarginsOrientation.BOTTOM, 'marginBottom'],
[print_preview.ticket_items.CustomMarginsOrientation.LEFT, 'marginLeft']
]);
+(function() {
+'use strict';
+
+/** @const {number} */
+const MINIMUM_DISTANCE = 72; // 1 inch
+
Polymer({
is: 'print-preview-margin-control-container',
@@ -41,6 +43,12 @@ Polymer({
/** @type {?print_preview.MeasurementSystem} */
measurementSystem: Object,
+ /** @type {!print_preview_new.State} */
+ state: {
+ type: Number,
+ observer: 'onStateChanged_',
+ },
+
/** @private {number} */
scaleTransform_: {
type: Number,
@@ -107,6 +115,8 @@ Polymer({
observers: [
'onMarginSettingsChange_(settings.customMargins.value)',
+ 'onMediaSizeOrLayoutChange_(' +
+ 'settings.mediaSize.value, settings.layout.value)',
],
/** @private {!print_preview.Coordinate2d} */
@@ -115,6 +125,9 @@ Polymer({
/** @private {?print_preview.Coordinate2d} */
marginStartPositionInPixels_: null,
+ /** @private {?boolean} */
+ resetMargins_: null,
+
/**
* @return {boolean}
* @private
@@ -128,20 +141,17 @@ Polymer({
/** @private */
onAvailableChange_: function() {
- if (this.available_ && !!this.documentMargins) {
+ if (this.available_ && this.resetMargins_) {
+ // Set the custom margins values to the current document margins if the
+ // custom margins were reset.
const newMargins = {};
- // Track whether the margins have actually changed to avoid triggering the
- // setting change if they are the same.
- const oldMargins = this.getSettingValue('customMargins');
- let change = false;
for (let side of Object.values(
print_preview.ticket_items.CustomMarginsOrientation)) {
- const key = MARGIN_KEY_MAP.get(side);
+ const key = print_preview_new.MARGIN_KEY_MAP.get(side);
newMargins[key] = this.documentMargins.get(side);
- change = change || (newMargins[key] != oldMargins[key]);
}
- if (change)
- this.setSetting('customMargins', newMargins);
+ this.setSetting('customMargins', newMargins);
+ this.resetMargins_ = false;
}
this.invisible_ = !this.available_;
},
@@ -151,13 +161,44 @@ Polymer({
const margins = this.getSettingValue('customMargins');
this.shadowRoot.querySelectorAll('print-preview-margin-control')
.forEach(control => {
- const key = MARGIN_KEY_MAP.get(control.side);
+ const key = print_preview_new.MARGIN_KEY_MAP.get(control.side);
const newValue = margins[key] || 0;
control.setPositionInPts(newValue);
control.setTextboxValue(this.serializeValueFromPts_(newValue));
});
},
+ /** @private */
+ onMediaSizeOrLayoutChange_: function() {
+ // Reset the custom margins when the paper size changes. Don't do this if it
+ // is the first preview.
+ if (this.resetMargins_ === null)
+ return;
+
+ this.resetMargins_ = true;
+ const marginsSetting = this.getSetting('margins');
+ if (marginsSetting.value ==
+ print_preview.ticket_items.MarginsTypeValue.CUSTOM) {
+ // Set the margins value to default first.
+ this.setSetting(
+ 'margins', print_preview.ticket_items.MarginsTypeValue.DEFAULT);
+ }
+ // Reset custom margins so that the sticky value is not restored for the new
+ // paper size.
+ this.setSetting('customMargins', {});
+ },
+
+ /** @private */
+ onStateChanged_: function() {
+ if (this.state == print_preview_new.State.READY &&
+ this.resetMargins_ === null) {
+ // Don't reset margins if there are sticky values. Otherwise, set them to
+ // the document margins when the user selects custom margins.
+ this.resetMargins_ =
+ this.getSettingValue('customMargins').marginTop === undefined;
+ }
+ },
+
/**
* @param {!print_preview.ticket_items.CustomMarginsOrientation} orientation
* Orientation value to test.
@@ -298,7 +339,7 @@ Polymer({
side);
const oldMargins = /** @type {print_preview.MarginsSetting} */ (
this.getSettingValue('customMargins'));
- const key = MARGIN_KEY_MAP.get(marginSide);
+ const key = print_preview_new.MARGIN_KEY_MAP.get(marginSide);
if (oldMargins[key] == marginValue)
return;
const newMargins = Object.assign({}, oldMargins);
diff --git a/chromium/chrome/browser/resources/print_preview/new/margins_settings.html b/chromium/chrome/browser/resources/print_preview/new/margins_settings.html
index 87121b453d7..8c2ebcd9e4d 100644
--- a/chromium/chrome/browser/resources/print_preview/new/margins_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/margins_settings.html
@@ -13,7 +13,8 @@
<print-preview-settings-section>
<span id="margins-label" slot="title">$i18n{marginsLabel}</span>
<div slot="controls">
- <select aria-labelledby="margins-label" disabled$="[[disabled]]">
+ <select aria-labelledby="margins-label" disabled$="[[disabled]]"
+ value="{{selectedValue::change}}">
<!-- The order of these options must match the natural order of their
values, which come from
print_preview.ticket_items.MarginsTypeValue. -->
diff --git a/chromium/chrome/browser/resources/print_preview/new/margins_settings.js b/chromium/chrome/browser/resources/print_preview/new/margins_settings.js
index 9145663aab0..6873f6283a0 100644
--- a/chromium/chrome/browser/resources/print_preview/new/margins_settings.js
+++ b/chromium/chrome/browser/resources/print_preview/new/margins_settings.js
@@ -14,11 +14,13 @@ Polymer({
observers: ['onMarginsSettingChange_(settings.margins.value)'],
/**
- * @param {*} value The new value of the margins setting.
+ * @param {*} newValue The new value of the margins setting.
* @private
*/
- onMarginsSettingChange_: function(value) {
- this.$$('select').value = /** @type {string} */ (value).toString();
+ onMarginsSettingChange_: function(newValue) {
+ this.selectedValue =
+ /** @type {!print_preview.ticket_items.MarginsTypeValue} */ (newValue)
+ .toString();
},
/** @param {string} value The new select value. */
diff --git a/chromium/chrome/browser/resources/print_preview/new/model.js b/chromium/chrome/browser/resources/print_preview/new/model.js
index 4e734351097..f1d4b05af96 100644
--- a/chromium/chrome/browser/resources/print_preview/new/model.js
+++ b/chromium/chrome/browser/resources/print_preview/new/model.js
@@ -31,6 +31,21 @@ cr.exportPath('print_preview_new');
print_preview_new.SerializedSettings;
/**
+ * @typedef {{
+ * value: *,
+ * managed: boolean
+ * }}
+ */
+print_preview_new.PolicyEntry;
+
+/**
+ * @typedef {{
+ * headerFooter: print_preview_new.PolicyEntry
+ * }}
+ */
+print_preview_new.PolicySettings;
+
+/**
* Constant values matching printing::DuplexMode enum.
* @enum {number}
*/
@@ -96,6 +111,7 @@ Polymer({
unavailableValue: [],
valid: true,
available: true,
+ setByPolicy: false,
key: '',
},
copies: {
@@ -103,6 +119,7 @@ Polymer({
unavailableValue: '1',
valid: true,
available: true,
+ setByPolicy: false,
key: '',
},
collate: {
@@ -110,6 +127,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: 'isCollateEnabled',
},
layout: {
@@ -117,6 +135,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: 'isLandscapeEnabled',
},
color: {
@@ -124,6 +143,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: 'isColorEnabled',
},
mediaSize: {
@@ -134,6 +154,7 @@ Polymer({
unavailableValue: {},
valid: true,
available: true,
+ setByPolicy: false,
key: 'mediaSize',
},
margins: {
@@ -142,18 +163,15 @@ Polymer({
print_preview.ticket_items.MarginsTypeValue.DEFAULT,
valid: true,
available: true,
+ setByPolicy: false,
key: 'marginsType',
},
customMargins: {
- value: {
- marginTop: 0,
- marginRight: 0,
- marginBottom: 0,
- marginLeft: 0,
- },
+ value: {},
unavailableValue: {},
valid: true,
available: true,
+ setByPolicy: false,
key: 'customMargins',
},
dpi: {
@@ -161,6 +179,7 @@ Polymer({
unavailableValue: {},
valid: true,
available: true,
+ setByPolicy: false,
key: 'dpi',
},
fitToPage: {
@@ -168,6 +187,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: 'isFitToPageEnabled',
},
scaling: {
@@ -175,6 +195,7 @@ Polymer({
unavailableValue: '100',
valid: true,
available: true,
+ setByPolicy: false,
key: 'scaling',
},
duplex: {
@@ -182,6 +203,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: 'isDuplexEnabled',
},
cssBackground: {
@@ -189,6 +211,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: 'isCssBackgroundEnabled',
},
selectionOnly: {
@@ -196,6 +219,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: '',
},
headerFooter: {
@@ -203,6 +227,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: 'isHeaderFooterEnabled',
},
rasterize: {
@@ -210,6 +235,7 @@ Polymer({
unavailableValue: false,
valid: true,
available: true,
+ setByPolicy: false,
key: '',
},
vendorItems: {
@@ -217,6 +243,7 @@ Polymer({
unavailableValue: {},
valid: true,
available: true,
+ setByPolicy: false,
key: 'vendorOptions',
},
pagesPerSheet: {
@@ -224,6 +251,7 @@ Polymer({
unavailableValue: 1,
valid: true,
available: true,
+ setByPolicy: false,
key: '',
},
// This does not represent a real setting value, and is used only to
@@ -233,6 +261,7 @@ Polymer({
unavailableValue: null,
valid: true,
available: true,
+ setByPolicy: false,
key: '',
},
// This does not represent a real settings value, but is used to
@@ -242,6 +271,7 @@ Polymer({
unavailableValue: [],
valid: true,
available: true,
+ setByPolicy: false,
key: '',
},
};
@@ -294,6 +324,9 @@ Polymer({
/** @private {?print_preview_new.SerializedSettings} */
stickySettings_: null,
+ /** @private {?print_preview_new.PolicySettings} */
+ policySettings_: null,
+
/** @private {?print_preview.Cdd} */
lastDestinationCapabilities_: null,
@@ -331,6 +364,14 @@ Polymer({
this.set('settings.collate.available', !!caps && !!(caps.collate));
this.set('settings.layout.available', this.isLayoutAvailable_(caps));
this.set('settings.color.available', this.destination.hasColorCapability);
+ if (this.destination.isColorManaged) {
+ // |this.setSetting| does nothing if policy is present.
+ // We want to set the value nevertheless so we call |this.set| directly.
+ this.set('settings.color.value', this.destination.colorPolicyValue);
+ }
+
+ this.set('settings.color.setByPolicy', this.destination.isColorManaged);
+
this.set(
'settings.dpi.available',
!!caps && !!caps.dpi && !!caps.dpi.option &&
@@ -345,10 +386,12 @@ Polymer({
/** @private */
updateSettingsAvailabilityFromDestinationAndDocumentInfo_: function() {
- const knownSizeToSaveAsPdf = this.destination.id ==
- print_preview.Destination.GooglePromotedId.SAVE_AS_PDF &&
+ const isSaveAsPDF = this.destination.id ==
+ print_preview.Destination.GooglePromotedId.SAVE_AS_PDF;
+ const knownSizeToSaveAsPdf = isSaveAsPDF &&
(!this.documentInfo.isModifiable ||
this.documentInfo.hasCssMediaStyles);
+ this.set('settings.fitToPage.unavailableValue', !isSaveAsPDF);
this.set(
'settings.fitToPage.available',
!knownSizeToSaveAsPdf && !this.documentInfo.isModifiable);
@@ -469,12 +512,12 @@ Polymer({
updateSettingsValues_: function(caps) {
if (this.settings.mediaSize.available) {
const defaultOption = caps.media_size.option.find(o => !!o.is_default);
- this.set('settings.mediaSize.value', defaultOption);
+ this.setSetting('mediaSize', defaultOption);
}
if (this.settings.dpi.available) {
const defaultOption = caps.dpi.option.find(o => !!o.is_default);
- this.set('settings.dpi.value', defaultOption);
+ this.setSetting('dpi', defaultOption);
} else if (
caps && caps.dpi && caps.dpi.option && caps.dpi.option.length > 0) {
this.set('settings.dpi.unavailableValue', caps.dpi.option[0]);
@@ -483,8 +526,8 @@ Polymer({
if (this.settings.color.available) {
const defaultOption = this.destination.defaultColorOption;
if (defaultOption) {
- this.set(
- 'settings.color.value',
+ this.setSetting(
+ 'color',
!['STANDARD_MONOCHROME', 'CUSTOM_MONOCHROME'].includes(
defaultOption.type));
}
@@ -518,7 +561,7 @@ Polymer({
if (defaultValue != null)
vendorSettings[item.id] = defaultValue;
}
- this.set('settings.vendorItems.value', vendorSettings);
+ this.setSetting('vendorItems', vendorSettings);
}
},
@@ -591,15 +634,41 @@ Polymer({
this.stickySettings_ = savedSettings;
},
+ /**
+ * Sets settings in accordance to policies from native code, and prevents
+ * those settings from being changed via other means.
+ * @param {boolean|undefined} headerFooter Value of
+ * printing.print_header_footer, if set in prefs (or undefined, if not).
+ * @param {boolean} isHeaderFooterManaged true if the header/footer UI state
+ * is managed by a policy.
+ */
+ setPolicySettings: function(headerFooter, isHeaderFooterManaged) {
+ this.policySettings_ = {
+ headerFooter: {
+ value: headerFooter,
+ managed: isHeaderFooterManaged,
+ },
+ };
+ },
+
applyStickySettings: function() {
if (this.stickySettings_) {
STICKY_SETTING_NAMES.forEach(settingName => {
const setting = this.get(settingName, this.settings);
const value = this.stickySettings_[setting.key];
if (value != undefined)
- this.set(`settings.${settingName}.value`, value);
+ this.setSetting(settingName, value);
});
}
+ if (this.policySettings_) {
+ for (const [settingName, policy] of Object.entries(
+ this.policySettings_)) {
+ if (policy.value !== undefined)
+ this.setSetting(settingName, policy.value);
+ if (policy.managed)
+ this.set(`settings.${settingName}.setByPolicy`, true);
+ }
+ }
this.initialized_ = true;
this.stickySettings_ = null;
this.stickySettingsChanged_();
@@ -668,6 +737,7 @@ Polymer({
pagesPerSheet: this.getSettingValue('pagesPerSheet'),
dpiHorizontal: (dpi && 'horizontal_dpi' in dpi) ? dpi.horizontal_dpi : 0,
dpiVertical: (dpi && 'vertical_dpi' in dpi) ? dpi.vertical_dpi : 0,
+ dpiDefault: (dpi && 'is_default' in dpi) ? dpi.is_default : false,
deviceName: destination.id,
fitToPageEnabled: this.getSettingValue('fitToPage'),
pageWidth: this.documentInfo.pageSize.width,
diff --git a/chromium/chrome/browser/resources/print_preview/new/more_settings.html b/chromium/chrome/browser/resources/print_preview/new/more_settings.html
index 527973849f0..d41ba3c1fdc 100644
--- a/chromium/chrome/browser/resources/print_preview/new/more_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/more_settings.html
@@ -1,26 +1,44 @@
<link rel="import" href="chrome://resources/html/polymer.html">
-
<link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
-<link rel="import" href="chrome://resources/html/action_link.html">
-<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="../metrics.html">
<link rel="import" href="strings.html">
<dom-module id="print-preview-more-settings">
<template>
- <style include="action-link cr-hidden-style">
+ <style include="cr-hidden-style">
:host {
+ display: block;
+ margin: 10px auto 0;
+ }
+
+ :host([disabled]) {
+ pointer-events: none;
+ }
+
+ :host button {
align-items: center;
background-color: #f6f6f6;
+ background-image: none;
--border: 1px solid #e1e1e1;
border-bottom: var(--border);
+ border-left: none;
+ border-right: none;
border-top: var(--border);
+ box-shadow: none;
cursor: pointer;
display: flex;
- margin-top: 4px;
- min-height: 38px;
+ font: inherit;
+ margin: auto;
+ min-height: 51px;
+ outline: none;
padding: 5px 20px;
+ /* sidebar width - 2px */
+ width: 308px;
+ }
+
+ :host-context(.focus-outline-visible) button:focus {
+ outline: -webkit-focus-ring-color auto 5px;
}
:host([hidden]) {
@@ -28,7 +46,23 @@
}
:host #label {
+ color: var(--google-blue-700);
flex: 1;
+ text-align: left;
+ }
+
+ :host-context([dir=rtl]) #label {
+ text-align: right;
+ }
+
+ :host([disabled]) #label {
+ color: var(--paper-grey-600);
+ opacity: .65;
+ }
+
+ :host #label:hover,
+ :host #label:active {
+ text-decoration: underline;
}
:host #icon {
@@ -44,10 +78,12 @@
background-image: url(chrome://resources/images/icon_expand_more.svg);
}
</style>
- <a id="label" is="action-link" disabled="[[disabled]]">
- [[getLabelText_(settingsExpandedByUser)]]
- </a>
- <div id="icon" class$="[[getIconClass_(settingsExpandedByUser)]]"></div>
+ <button disabled="[[disabled]]" on-click="onMoreSettingsClick_"
+ aria-expanded$="[[getAriaExpanded_(settingsExpandedByUser)]]"
+ aria-label$="[[i18n('moreOptionsLabel')]]">
+ <span id="label">[[getLabelText_(settingsExpandedByUser)]]</span>
+ <div id="icon" class$="[[getIconClass_(settingsExpandedByUser)]]"></div>
+ </button>
</template>
<script src="more_settings.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/print_preview/new/more_settings.js b/chromium/chrome/browser/resources/print_preview/new/more_settings.js
index 431625fbea2..5a31e23494e 100644
--- a/chromium/chrome/browser/resources/print_preview/new/more_settings.js
+++ b/chromium/chrome/browser/resources/print_preview/new/more_settings.js
@@ -13,11 +13,10 @@ Polymer({
notify: true,
},
- disabled: Boolean,
- },
-
- listeners: {
- 'click': 'onMoreSettingsClick_',
+ disabled: {
+ type: Boolean,
+ reflectToAttribute: true,
+ },
},
/** @private {!print_preview.PrintSettingsUiMetricsContext} */
@@ -41,6 +40,14 @@ Polymer({
this.settingsExpandedByUser ? 'lessOptionsLabel' : 'moreOptionsLabel');
},
+ /**
+ * @return {string} 'true' if the settings are expanded, 'false' otherwise
+ * @private
+ */
+ getAriaExpanded_: function() {
+ return this.settingsExpandedByUser ? 'true' : 'false';
+ },
+
/** @private */
onMoreSettingsClick_: function() {
this.settingsExpandedByUser = !this.settingsExpandedByUser;
diff --git a/chromium/chrome/browser/resources/print_preview/new/number_settings_section.html b/chromium/chrome/browser/resources/print_preview/new/number_settings_section.html
index 59c1e3df744..d535e2904e8 100644
--- a/chromium/chrome/browser/resources/print_preview/new/number_settings_section.html
+++ b/chromium/chrome/browser/resources/print_preview/new/number_settings_section.html
@@ -9,8 +9,8 @@
<template>
<style include="print-preview-shared input">
input[type='number'] {
- -webkit-margin-end: 16px;
margin-bottom: 2.5px;
+ margin-inline-end: 16px;
margin-top: 2.5px;
}
@@ -35,7 +35,7 @@
<span class="input-wrapper">
<input id="userValue" class="user-value" type="number"
max="[[maxValue]]" min="[[minValue]]" data-timeout-delay="250"
- disabled$="[[getDisabled_(disabled)]]"
+ disabled$="[[getDisabled_(disabled)]]" on-keydown="onKeydown_"
on-blur="onBlur_" aria-labelled-by="section-title">
<slot name="opt-inside-content"></slot>
</span>
diff --git a/chromium/chrome/browser/resources/print_preview/new/other_options_settings.html b/chromium/chrome/browser/resources/print_preview/new/other_options_settings.html
index d5ee2d569ef..e164225cfa5 100644
--- a/chromium/chrome/browser/resources/print_preview/new/other_options_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/other_options_settings.html
@@ -19,7 +19,7 @@
<label hidden$="[[!settings.headerFooter.available]]"
aria-live="polite">
<input type="checkbox" id="headerFooter"
- disabled$="[[disabled]]"
+ disabled$="[[headerFooterCheckboxDisabled_]]"
on-change="onHeaderFooterChange_"
checked$="[[settings.headerFooter.value]]">
<span>$i18n{optionHeaderFooter}</span>
diff --git a/chromium/chrome/browser/resources/print_preview/new/other_options_settings.js b/chromium/chrome/browser/resources/print_preview/new/other_options_settings.js
index 783dde11e6f..afe7b431e5a 100644
--- a/chromium/chrome/browser/resources/print_preview/new/other_options_settings.js
+++ b/chromium/chrome/browser/resources/print_preview/new/other_options_settings.js
@@ -9,6 +9,13 @@ Polymer({
properties: {
disabled: Boolean,
+
+ /** @private */
+ headerFooterCheckboxDisabled_: {
+ type: Boolean,
+ computed: 'computeHeaderFooterCheckboxDisabled_(disabled, ' +
+ 'settings.headerFooter.setByPolicy)'
+ },
},
observers: [
@@ -47,6 +54,16 @@ Polymer({
},
/**
+ * @param {boolean} globallyDisabled Value of the |disabled| property.
+ * @param {boolean} setByPolicy Value of |settings.headerFooter.setByPolicy|.
+ * @return {boolean} New value for |headerFooterCheckboxDisabled_|.
+ * @private
+ */
+ computeHeaderFooterCheckboxDisabled_(globallyDisabled, setByPolicy) {
+ return globallyDisabled || setByPolicy;
+ },
+
+ /**
* @param {boolean} value The new value of the header footer setting.
* @private
*/
diff --git a/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.html b/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.html
index 09a4a68b846..526a2d11d7d 100644
--- a/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.html
@@ -15,7 +15,7 @@
</span>
<div slot="controls">
<select aria-labelledby="pages-per-sheet-label"
- disabled$="[[disabled]]">
+ value="{{selectedValue::change}}" disabled$="[[disabled]]">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="4">4</option>
diff --git a/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.js b/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.js
index 0b23bbcda2f..0e9701e8c99 100644
--- a/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.js
+++ b/chromium/chrome/browser/resources/print_preview/new/pages_per_sheet_settings.js
@@ -14,11 +14,11 @@ Polymer({
observers: ['onPagesPerSheetSettingChange_(settings.pagesPerSheet.value)'],
/**
- * @param {*} value The new value of the pages per sheet setting.
+ * @param {*} newValue The new value of the pages per sheet setting.
* @private
*/
- onPagesPerSheetSettingChange_: function(value) {
- this.$$('select').value = /** @type {number} */ (value).toString();
+ onPagesPerSheetSettingChange_: function(newValue) {
+ this.selectedValue = /** @type {number} */ (newValue).toString();
},
/** @param {string} value The new select value. */
diff --git a/chromium/chrome/browser/resources/print_preview/new/pages_settings.html b/chromium/chrome/browser/resources/print_preview/new/pages_settings.html
index f8ab58423a2..f1fb5114ca0 100644
--- a/chromium/chrome/browser/resources/print_preview/new/pages_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/new/pages_settings.html
@@ -2,6 +2,7 @@
<link rel="import" href="checkbox_radio_css.html">
<link rel="import" href="../data/document_info.html">
+<link rel="import" href="../print_preview_utils.html">
<link rel="import" href="input_behavior.html">
<link rel="import" href="input_css.html">
<link rel="import" href="print_preview_shared_css.html">
@@ -13,8 +14,8 @@
<template>
<style include="print-preview-shared checkbox-radio input">
:host .radio .user-value {
- -webkit-margin-start: 0.6em;
flex: 1;
+ margin-inline-start: 0.6em;
width: 100%;
}
@@ -46,7 +47,7 @@
on-click="onCustomRadioClick_">
<input id="pageSettingsCustomInput" class="user-value" type="text"
checked="{{customSelected_::change}}" data-timeout-delay="500"
- disabled$="[[getDisabled_(disabled)]]"
+ disabled$="[[getDisabled_(disabled)]]" spellcheck="false"
pattern="[[inputPattern_]]"
on-focus="onCustomInputFocus_" on-blur="onCustomInputBlur_"
placeholder="$i18n{examplePageRangeText}"
diff --git a/chromium/chrome/browser/resources/print_preview/new/pages_settings.js b/chromium/chrome/browser/resources/print_preview/new/pages_settings.js
index 96cc7c4425d..1bd94ebacea 100644
--- a/chromium/chrome/browser/resources/print_preview/new/pages_settings.js
+++ b/chromium/chrome/browser/resources/print_preview/new/pages_settings.js
@@ -76,7 +76,8 @@ Polymer({
},
observers: [
- 'onRangeChange_(errorState_, rangesToPrint_, settings.pages)',
+ 'onRangeChange_(errorState_, rangesToPrint_, settings.pages, ' +
+ 'settings.pagesPerSheet.value)',
'onRadioChange_(allSelected_, customSelected_)'
],
@@ -114,6 +115,15 @@ Polymer({
* @private
*/
computeAllPagesArray_: function() {
+ // This computed function will unnecessarily get triggered if
+ // this.documentInfo is set to a new object, which happens whenever the
+ // preview refreshes, but the page count is the same as before. We do not
+ // want to trigger all observers unnecessarily.
+ if (!!this.allPagesArray_ &&
+ this.allPagesArray_.length == this.documentInfo.pageCount) {
+ return this.allPagesArray_;
+ }
+
const array = new Array(this.documentInfo.pageCount);
for (let i = 0; i < array.length; i++)
array[i] = i + 1;
@@ -216,17 +226,22 @@ Polymer({
},
/**
- * @return {boolean} Whether pages setting and pagesToPrint_ match.
+ * @return {!Array<number>} The final page numbers, reflecting N-up setting.
+ * Page numbers are 1 indexed, since these numbers are displayed to the
+ * user.
+ * @private
*/
- settingMatches_: function() {
- const setting = this.getSetting('pages').value;
- if (setting.length != this.pagesToPrint_.length)
- return false;
- for (let index = 0; index < this.pagesToPrint_.length; index++) {
- if (this.pagesToPrint_[index] != setting[index])
- return false;
- }
- return true;
+ getNupPages_: function() {
+ const pagesPerSheet =
+ /** @type {number} */ (this.getSettingValue('pagesPerSheet'));
+ if (pagesPerSheet <= 1 || this.pagesToPrint_.length == 0)
+ return this.pagesToPrint_;
+
+ const numPages = Math.ceil(this.pagesToPrint_.length / pagesPerSheet);
+ const nupPages = new Array(numPages);
+ for (let i = 0; i < nupPages.length; i++)
+ nupPages[i] = i + 1;
+ return nupPages;
},
/**
@@ -245,10 +260,16 @@ Polymer({
}
this.$.pageSettingsCustomInput.classList.remove('invalid');
this.setSettingValid('pages', true);
- if (!this.settingMatches_()) {
- this.setSetting('pages', this.pagesToPrint_);
- this.setSetting('ranges', this.rangesToPrint_);
+ const nupPages = this.getNupPages_();
+ const rangesChanged = !areRangesEqual(
+ this.rangesToPrint_,
+ /** @type {!Array} */ (this.getSettingValue('ranges')));
+ if (rangesChanged ||
+ nupPages.length != this.getSettingValue('pages').length) {
+ this.setSetting('pages', nupPages);
}
+ if (rangesChanged)
+ this.setSetting('ranges', this.rangesToPrint_);
},
/** @private */
diff --git a/chromium/chrome/browser/resources/print_preview/new/preview_area.html b/chromium/chrome/browser/resources/print_preview/new/preview_area.html
index 744bc3fcb0f..56267d10ddc 100644
--- a/chromium/chrome/browser/resources/print_preview/new/preview_area.html
+++ b/chromium/chrome/browser/resources/print_preview/new/preview_area.html
@@ -154,7 +154,7 @@
<print-preview-margin-control-container id="marginControlContainer"
page-size="[[documentInfo.pageSize]]" settings="{{settings}}"
document-margins="[[documentInfo.margins]]"
- measurement-system="[[measurementSystem]]"
+ measurement-system="[[measurementSystem]]" state="[[state]]"
preview-loaded="[[previewLoaded_]]"
on-margin-drag-changed="onMarginDragChanged_">
</print-preview-margin-control-container>
diff --git a/chromium/chrome/browser/resources/print_preview/new/preview_area.js b/chromium/chrome/browser/resources/print_preview/new/preview_area.js
index 665c3fb8186..43622f414a1 100644
--- a/chromium/chrome/browser/resources/print_preview/new/preview_area.js
+++ b/chromium/chrome/browser/resources/print_preview/new/preview_area.js
@@ -350,10 +350,11 @@ Polymer({
plugin.setViewportChangedCallback(
this.onPreviewVisualStateChange_.bind(this));
}
+
this.pluginLoaded_ = false;
this.pluginProxy_.resetPrintPreviewMode(
previewUid, index, !this.getSettingValue('color'),
- /** @type {!Array<number>} */ (this.getSetting('pages').value),
+ /** @type {!Array<number>} */ (this.getSettingValue('pages')),
this.documentInfo.isModifiable);
},
@@ -421,10 +422,15 @@ Polymer({
* Called when the plugin loads. This is a consequence of calling
* plugin.reload(). Certain plugin state can only be set after the plugin
* has loaded.
+ * @param {boolean} success Whether the plugin load succeeded or not.
* @private
*/
- onPluginLoad_: function() {
- this.pluginLoaded_ = true;
+ onPluginLoad_: function(success) {
+ if (success) {
+ this.pluginLoaded_ = true;
+ } else {
+ this.previewState = print_preview_new.PreviewAreaState.PREVIEW_FAILED;
+ }
},
/**
@@ -460,7 +466,13 @@ Polymer({
if (this.inFlightRequestId_ != previewResponseId)
return;
const pageNumber = pageIndex + 1;
- const index = this.getSettingValue('pages').indexOf(pageNumber);
+ let index = this.getSettingValue('pages').indexOf(pageNumber);
+ // When pagesPerSheet > 1, the backend will always return page indices 0 to
+ // N-1, where N is the total page count of the N-upped document.
+ const pagesPerSheet =
+ /** @type {number} */ (this.getSettingValue('pagesPerSheet'));
+ if (pagesPerSheet > 1)
+ index = pageIndex;
if (index == 0)
this.onPreviewStart_(previewUid, pageIndex);
if (index != -1)
@@ -477,18 +489,15 @@ Polymer({
// We only care about: PageUp, PageDown, Left, Up, Right, Down.
// If the user is holding a modifier key, ignore.
if (!this.pluginProxy_.pluginReady() ||
- !arrayContains(
- [
- 'PageUp', 'PageDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp',
- 'ArrowDown'
- ],
- e.code) ||
+ !['PageUp', 'PageDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp',
+ 'ArrowDown']
+ .includes(e.code) ||
hasKeyModifiers(e)) {
return;
}
// Don't handle the key event for these elements.
- const tagName = e.path[0].tagName;
+ const tagName = e.composedPath()[0].tagName;
if (['INPUT', 'SELECT', 'EMBED'].includes(tagName))
return;
@@ -497,13 +506,13 @@ Polymer({
// element, and work up the DOM tree to see if any element has a
// scrollbar. If there exists a scrollbar, do not handle the key event
// here.
- let element = e.target;
- while (element) {
- if (element.scrollHeight > element.clientHeight ||
- element.scrollWidth > element.clientWidth) {
+ const isEventHorizontal = ['ArrowLeft', 'ArrowRight'].includes(e.code);
+ for (let i = 0; i < e.composedPath().length; i++) {
+ const element = e.composedPath()[i];
+ if (element.scrollHeight > element.clientHeight && !isEventHorizontal ||
+ element.scrollWidth > element.clientWidth && isEventHorizontal) {
return;
}
- element = element.parentElement;
}
// No scroll bar anywhere, or the active element is something else, like a
@@ -551,12 +560,28 @@ Polymer({
onMarginsChanged_: function() {
if (this.getSettingValue('margins') !=
print_preview.ticket_items.MarginsTypeValue.CUSTOM) {
- this.lastCustomMargins_ = null;
this.onSettingsChanged_();
} else {
- this.lastCustomMargins_ =
+ const customMargins =
/** @type {!print_preview.MarginsSetting} */ (
this.getSettingValue('customMargins'));
+
+ for (let side of Object.values(
+ print_preview.ticket_items.CustomMarginsOrientation)) {
+ const key = print_preview_new.MARGIN_KEY_MAP.get(side);
+ // If custom margins are undefined, return and wait for them to be set.
+ if (customMargins[key] === undefined || !this.documentInfo ||
+ !this.documentInfo.margins) {
+ return;
+ }
+
+ // Start a preview request if the margins actually changed.
+ if (this.documentInfo.margins.get(side) != customMargins[key]) {
+ this.onSettingsChanged_();
+ break;
+ }
+ }
+ this.lastCustomMargins_ = customMargins;
}
},
@@ -566,6 +591,7 @@ Polymer({
/** @type {!print_preview.MarginsSetting} */ (
this.getSettingValue('customMargins'));
if (!!this.lastCustomMargins_ &&
+ this.lastCustomMargins_.marginTop !== undefined &&
this.getSettingValue('margins') ==
print_preview.ticket_items.MarginsTypeValue.CUSTOM &&
(this.lastCustomMargins_.marginTop != newValue.marginTop ||
diff --git a/chromium/chrome/browser/resources/print_preview/new/print_preview_search_box.html b/chromium/chrome/browser/resources/print_preview/new/print_preview_search_box.html
index 5cd9d62beb4..418c9ce5bb2 100644
--- a/chromium/chrome/browser/resources/print_preview/new/print_preview_search_box.html
+++ b/chromium/chrome/browser/resources/print_preview/new/print_preview_search_box.html
@@ -36,7 +36,7 @@
<input type="search" id="searchInput" class="search-box-input"
on-search="onSearchTermSearch" on-input="onSearchTermInput"
incremental aria-label$="[[label]]" placeholder="[[label]]"
- autofocus="[[autofocus]]">
+ autofocus="[[autofocus]]" spellcheck="false">
</template>
<script src="print_preview_search_box.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/print_preview/new/print_preview_shared_css.html b/chromium/chrome/browser/resources/print_preview/new/print_preview_shared_css.html
index 23fe6a190a0..a9d42eed099 100644
--- a/chromium/chrome/browser/resources/print_preview/new/print_preview_shared_css.html
+++ b/chromium/chrome/browser/resources/print_preview/new/print_preview_shared_css.html
@@ -16,8 +16,6 @@
input[type='checkbox'],
input[type='radio'] {
-webkit-appearance: none;
- -webkit-margin-end: 1px;
- -webkit-margin-start: 0;
border: 1px solid rgba(0, 0, 0, 0.25);
border-radius: 2px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),
@@ -25,6 +23,8 @@
color: #444;
font: inherit;
margin-bottom: 0;
+ margin-inline-end: 1px;
+ margin-inline-start: 0;
margin-top: 0;
outline: none;
text-shadow: 0 1px 0 rgb(240, 240, 240);
@@ -108,31 +108,33 @@
}
/* Focus ****************************************************************/
+ :host {
+ --print-preview-focus-border: {
+ /* We use border color because it follows the border radius (unlike
+ * outline). This is particularly noticeable on mac. */
+ border-color: rgb(77, 144, 254);
+ outline: none;
+ /* OVERRIDE */
+ transition: border-color 200ms;
+ };
+ }
:enabled:focus:-webkit-any(
select,
- input[type='checkbox'],
input[type='number'],
- input[type='radio'],
input[type='search'],
input[type='text'],
- input:not([type]),
- button) {
- /* We use border color because it follows the border radius (unlike
- * outline). This is particularly noticeable on mac. */
- border-color: rgb(77, 144, 254);
- outline: none;
- /* OVERRIDE */
- transition: border-color 200ms;
+ input:not([type])) {
+ @apply --print-preview-focus-border;
}
- html:not(.focus-outline-visible)
- :enabled:focus:-webkit-any(input[type='checkbox'],
- input[type='radio'],
- button) {
- border-color: rgba(0,0,0,0.25);
+ :host-context(.focus-outline-visible)
+ :enabled:focus:-webkit-any(
+ input[type='checkbox'],
+ input[type='radio'],
+ button) {
+ @apply --print-preview-focus-border;
}
-
</style>
</template>
</dom-module>
diff --git a/chromium/chrome/browser/resources/print_preview/new/search_dialog_css.html b/chromium/chrome/browser/resources/print_preview/new/search_dialog_css.html
index 759365c1c9e..2f53bfdec05 100644
--- a/chromium/chrome/browser/resources/print_preview/new/search_dialog_css.html
+++ b/chromium/chrome/browser/resources/print_preview/new/search_dialog_css.html
@@ -13,7 +13,7 @@
background-color: rgba(255, 255, 255, 0.75) for the inner dialog's
backdrop. See context at crbug.com/827397 */
--cr-dialog-close-image: {
- -webkit-margin-end: 7px;
+ margin-inline-end: 7px;
background-image: url(chrome://theme/IDR_CLOSE_DIALOG);
margin-top: 10px;
};
@@ -34,14 +34,14 @@
--cr-icon-ripple-size: 14px;
--cr-icon-size: 14px;
--cr-dialog-title: {
- -webkit-padding-end: 16px;
- -webkit-padding-start: 16px;
+ padding-inline-end: 16px;
+ padding-inline-start: 16px;
padding-bottom: 16px;
padding-top: 16px;
};
--cr-dialog-body: {
- -webkit-padding-end: 16px;
- -webkit-padding-start: 16px;
+ padding-inline-end: 16px;
+ padding-inline-start: 16px;
box-sizing: border-box;
padding-bottom: 12px;
padding-top: 0;
@@ -69,7 +69,7 @@
}
#dialog button {
- -webkit-margin-start: 10px;
+ margin-inline-start: 10px;
}
</style>
</template>
diff --git a/chromium/chrome/browser/resources/print_preview/new/select_behavior.js b/chromium/chrome/browser/resources/print_preview/new/select_behavior.js
index a248f6c958a..e76f128b76a 100644
--- a/chromium/chrome/browser/resources/print_preview/new/select_behavior.js
+++ b/chromium/chrome/browser/resources/print_preview/new/select_behavior.js
@@ -12,24 +12,29 @@ cr.define('print_preview_new', function() {
* @polymerBehavior
*/
const SelectBehavior = {
- /** @private {string} */
- lastValue_: '',
+ properties: {
+ selectedValue: {
+ type: String,
+ observer: 'onSelectedValueChange_',
+ },
+ },
/**
- * Timeout used to delay processing of the selection.
- * @private {?number}
+ * @param {string} current
+ * @param {?string} previous
+ * @private
*/
- timeout_: null,
+ onSelectedValueChange_: function(current, previous) {
+ // Don't trigger an extra preview request at startup.
+ if (previous === undefined)
+ return;
- /** @override */
- ready: function() {
- assert(this.shadowRoot.querySelectorAll('select').length == 1);
- this.$$('select').addEventListener('change', () => {
- if (this.timeout_) {
- clearTimeout(this.timeout_);
- }
- this.timeout_ = setTimeout(this.onTimeout_.bind(this), 100);
- });
+ this.debounce('select-change', () => {
+ this.onProcessSelectChange(this.selectedValue);
+
+ // For testing only
+ this.fire('process-select-change');
+ }, 100);
},
/**
@@ -38,22 +43,6 @@ cr.define('print_preview_new', function() {
* @param {string} value The new select value to process.
*/
onProcessSelectChange: function(value) {},
-
- /**
- * Called after a timeout after user selects a new option.
- * @private
- */
- onTimeout_: function() {
- this.timeout_ = null;
- const value = /** @type {!HTMLSelectElement} */ (this.$$('select')).value;
- if (this.lastValue_ != value) {
- this.lastValue_ = value;
- this.onProcessSelectChange(value);
-
- // For testing only
- this.fire('process-select-change');
- }
- },
};
return {SelectBehavior: SelectBehavior};
diff --git a/chromium/chrome/browser/resources/print_preview/new/select_css.html b/chromium/chrome/browser/resources/print_preview/new/select_css.html
index b89394f92a0..63963e5fcb1 100644
--- a/chromium/chrome/browser/resources/print_preview/new/select_css.html
+++ b/chromium/chrome/browser/resources/print_preview/new/select_css.html
@@ -6,14 +6,14 @@
<style include="print-preview-shared">
select {
-webkit-appearance: none;
- -webkit-padding-end: 24px;
- -webkit-padding-start: 10px;
/* OVERRIDE */
background-image: url(chrome://resources/images/select.png),
linear-gradient(#ededed, #ededed 38%, #dedede);
background-position: right center;
background-repeat: no-repeat;
height: 28px;
+ padding-inline-end: 24px;
+ padding-inline-start: 10px;
width: 100%;
}
diff --git a/chromium/chrome/browser/resources/print_preview/new/settings_behavior.js b/chromium/chrome/browser/resources/print_preview/new/settings_behavior.js
index d5976f1b498..71ee009e2ae 100644
--- a/chromium/chrome/browser/resources/print_preview/new/settings_behavior.js
+++ b/chromium/chrome/browser/resources/print_preview/new/settings_behavior.js
@@ -12,6 +12,7 @@ cr.exportPath('print_preview_new');
* unavailableValue: *,
* valid: boolean,
* available: boolean,
+ * setByPolicy: boolean,
* key: string,
* }}
*/
@@ -74,11 +75,12 @@ const SettingsBehavior = {
/**
* @param {string} settingName Name of the setting to set
- * @param {boolean | string | number | Array | Object} value The value to set
- * the setting to.
+ * @param {*} value The value to set the setting to.
*/
setSetting: function(settingName, value) {
const setting = this.getSetting(settingName);
+ if (setting.setByPolicy)
+ return;
this.set(`settings.${settingName}.value`, value);
},
diff --git a/chromium/chrome/browser/resources/print_preview/new/settings_section.html b/chromium/chrome/browser/resources/print_preview/new/settings_section.html
index 83083c4d4ef..2a85bb190af 100644
--- a/chromium/chrome/browser/resources/print_preview/new/settings_section.html
+++ b/chromium/chrome/browser/resources/print_preview/new/settings_section.html
@@ -16,11 +16,11 @@
}
::slotted([slot=title]) {
- -webkit-padding-end: 20px;
color: #646464;
font-size: 1em;
max-width: 70px;
min-width: 70px;
+ padding-inline-end: 20px;
word-break: break-word;
}
@@ -28,8 +28,21 @@
align-self: flex-start;
padding-top: 7px;
}
+
+ :host([managed]) ::slotted([slot=title]) {
+ max-width: 60px;
+ min-width: 60px;
+ padding-inline-end: 5px;
+ }
+
+ .policy-icon {
+ padding-inline-end: 5px;
+ width: 20px;
+ }
</style>
<slot name="title"></slot>
+ <img src="../../../../../ui/webui/resources/images/business.svg"
+ hidden$="[[!managed]]" class="policy-icon">
<slot name="controls"></slot>
</template>
<script src="settings_section.js"></script>
diff --git a/chromium/chrome/browser/resources/print_preview/new/settings_section.js b/chromium/chrome/browser/resources/print_preview/new/settings_section.js
index a28a5054954..95833f38624 100644
--- a/chromium/chrome/browser/resources/print_preview/new/settings_section.js
+++ b/chromium/chrome/browser/resources/print_preview/new/settings_section.js
@@ -4,4 +4,13 @@
Polymer({
is: 'print-preview-settings-section',
+
+ properties: {
+ /** @type {boolean} */
+ managed: {
+ type: Boolean,
+ value: false,
+ reflectToAttribute: true,
+ },
+ },
});
diff --git a/chromium/chrome/browser/resources/print_preview/new/settings_select.html b/chromium/chrome/browser/resources/print_preview/new/settings_select.html
index 45eb62fb630..e2b7ea98187 100644
--- a/chromium/chrome/browser/resources/print_preview/new/settings_select.html
+++ b/chromium/chrome/browser/resources/print_preview/new/settings_select.html
@@ -10,9 +10,9 @@
<template>
<style include="print-preview-shared select">
</style>
- <select disabled$="[[disabled]]">
+ <select disabled$="[[disabled]]" value="{{selectedValue::change}}">
<template is="dom-repeat" items="[[capability.option]]">
- <option selected="[[isSelected_(item, selectedValue_)]]"
+ <option selected="[[isSelected_(item, selectedValue)]]"
value="[[getValue_(item)]]">
[[getDisplayName_(item)]]
</option>
diff --git a/chromium/chrome/browser/resources/print_preview/new/settings_select.js b/chromium/chrome/browser/resources/print_preview/new/settings_select.js
index c855e071752..d4bb36c1455 100644
--- a/chromium/chrome/browser/resources/print_preview/new/settings_select.js
+++ b/chromium/chrome/browser/resources/print_preview/new/settings_select.js
@@ -26,13 +26,6 @@ Polymer({
settingName: String,
disabled: Boolean,
-
- /** @private {string} */
- selectedValue_: {
- type: String,
- notify: true,
- value: '',
- },
},
/**
@@ -41,13 +34,13 @@ Polymer({
* @private
*/
isSelected_: function(option) {
- return this.getValue_(option) == this.selectedValue_ ||
- (!!option.is_default && this.selectedValue_ == '');
+ return this.getValue_(option) == this.selectedValue ||
+ (!!option.is_default && this.selectedValue == '');
},
/** @param {string} value The value to select. */
selectValue: function(value) {
- this.selectedValue_ = value;
+ this.selectedValue = value;
},
/**
@@ -84,6 +77,7 @@ Polymer({
assertNotReached();
return;
}
- this.setSetting(this.settingName, /** @type {Object} */ (newValue));
+ if (value !== JSON.stringify(this.getSettingValue(this.settingName)))
+ this.setSetting(this.settingName, /** @type {Object} */ (newValue));
},
});
diff --git a/chromium/chrome/browser/resources/print_preview/print_preview.css b/chromium/chrome/browser/resources/print_preview/print_preview.css
index d9b3f8f2bdd..53a352be0fe 100644
--- a/chromium/chrome/browser/resources/print_preview/print_preview.css
+++ b/chromium/chrome/browser/resources/print_preview/print_preview.css
@@ -16,16 +16,16 @@ body {
/* Header */
header {
- -webkit-padding-end: 19px;
- -webkit-padding-start: 20px;
background-color: #F6F6F6;
border-bottom: 1px solid #d2d2d2;
+ padding-inline-end: 19px;
+ padding-inline-start: 20px;
}
#print-preview #navbar-container {
- -webkit-border-end: 1px solid #c8c8c8;
-webkit-box-orient: vertical;
background-color: white;
+ border-inline-end: 1px solid #c8c8c8;
display: -webkit-box;
position: relative;
user-select: none;
@@ -57,8 +57,8 @@ header {
}
.right-column {
- -webkit-padding-end: 20px;
display: table-cell;
+ padding-inline-end: 20px;
width: 99%;
}
@@ -73,10 +73,10 @@ header {
}
.left-column {
- -webkit-padding-end: 20px;
- -webkit-padding-start: 20px;
display: table-cell;
min-width: 70px;
+ padding-inline-end: 20px;
+ padding-inline-start: 20px;
vertical-align: middle;
}
@@ -273,8 +273,8 @@ span.jumping-dots > span:nth-child(3) {
}
#print-header .button-strip button {
- -webkit-margin-start: 9px;
display: block;
+ margin-inline-start: 9px;
}
#link-container {
@@ -294,9 +294,9 @@ span.jumping-dots > span:nth-child(3) {
}
#main-container {
- -webkit-border-start: 1px solid #dcdcdc;
-webkit-box-flex: 1;
-webkit-box-orient: vertical;
+ border-inline-start: 1px solid #dcdcdc;
display: -webkit-box;
height: 100%;
position: relative;
diff --git a/chromium/chrome/browser/resources/print_preview/print_preview.js b/chromium/chrome/browser/resources/print_preview/print_preview.js
index 3702bf1cc83..74dc6c0f658 100644
--- a/chromium/chrome/browser/resources/print_preview/print_preview.js
+++ b/chromium/chrome/browser/resources/print_preview/print_preview.js
@@ -634,6 +634,9 @@ cr.define('print_preview', function() {
dpiVertical: 'vertical_dpi' in printTicketStore.dpi.getValue() ?
printTicketStore.dpi.getValue().vertical_dpi :
0,
+ dpiDefault: 'is_default' in printTicketStore.dpi.getValue() ?
+ printTicketStore.dpi.getValue().is_default :
+ false,
deviceName: destination.id,
fitToPageEnabled: printTicketStore.fitToPage.getValue(),
pageWidth: documentInfo.pageSize.width,
diff --git a/chromium/chrome/browser/resources/print_preview/print_preview_resources.grd b/chromium/chrome/browser/resources/print_preview/print_preview_resources.grd
index 83555c52b75..d23b52d26df 100644
--- a/chromium/chrome/browser/resources/print_preview/print_preview_resources.grd
+++ b/chromium/chrome/browser/resources/print_preview/print_preview_resources.grd
@@ -196,7 +196,9 @@
type="chrome_html" />
<structure name="IDR_PRINT_PREVIEW_NEW_SETTINGS_SECTION_HTML"
file="new/settings_section.html"
- type="chrome_html" />
+ type="chrome_html"
+ flattenhtml="true"
+ allowexternalscript="true" />
<structure name="IDR_PRINT_PREVIEW_NEW_SETTINGS_SECTION_JS"
file="new/settings_section.js"
type="chrome_html" />
diff --git a/chromium/chrome/browser/resources/print_preview/print_preview_resources_vulcanized.grd b/chromium/chrome/browser/resources/print_preview/print_preview_resources_vulcanized.grd
index 3acbd3087c4..4d17378b936 100644
--- a/chromium/chrome/browser/resources/print_preview/print_preview_resources_vulcanized.grd
+++ b/chromium/chrome/browser/resources/print_preview/print_preview_resources_vulcanized.grd
@@ -13,6 +13,7 @@
<release seq="1">
<includes>
<include name="IDR_PRINT_PREVIEW_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\print_preview\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
+ <include name="IDR_PRINT_PREVIEW_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\print_preview\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PRINT_PREVIEW_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\print_preview\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" />
</includes>
</release>
diff --git a/chromium/chrome/browser/resources/print_preview/search/destination_list.css b/chromium/chrome/browser/resources/print_preview/search/destination_list.css
index c20cfed6c83..d56dcdc75ff 100644
--- a/chromium/chrome/browser/resources/print_preview/search/destination_list.css
+++ b/chromium/chrome/browser/resources/print_preview/search/destination_list.css
@@ -3,15 +3,15 @@
* found in the LICENSE file. */
.destination-list > header {
- -webkit-padding-start: 0;
background-color: transparent;
padding-bottom: 8px;
+ padding-inline-start: 0;
}
.destination-list .title {
- -webkit-padding-end: 8px;
- -webkit-padding-start: 4px;
display: inline;
+ padding-inline-end: 8px;
+ padding-inline-start: 4px;
vertical-align: middle;
}
@@ -26,9 +26,9 @@
}
.destination-list .throbber-container {
- -webkit-padding-end: 16px;
- -webkit-padding-start: 8px;
display: inline-block;
+ padding-inline-end: 16px;
+ padding-inline-start: 8px;
position: relative;
vertical-align: middle;
}
@@ -38,14 +38,14 @@
}
.destination-list .no-destinations-message {
- -webkit-padding-start: 18px;
color: #999;
padding-bottom: 8px;
+ padding-inline-start: 18px;
padding-top: 8px;
}
.destination-list > footer {
- -webkit-padding-start: 18px;
+ padding-inline-start: 18px;
padding-top: 6px;
}
diff --git a/chromium/chrome/browser/resources/print_preview/search/destination_list_item.css b/chromium/chrome/browser/resources/print_preview/search/destination_list_item.css
index 3f07a54c76a..ba652e0892c 100644
--- a/chromium/chrome/browser/resources/print_preview/search/destination_list_item.css
+++ b/chromium/chrome/browser/resources/print_preview/search/destination_list_item.css
@@ -3,10 +3,10 @@
* found in the LICENSE file. */
.destination-list-item {
- -webkit-padding-end: 2px;
- -webkit-padding-start: 18px;
cursor: default;
padding-bottom: 3px;
+ padding-inline-end: 2px;
+ padding-inline-start: 18px;
padding-top: 3px;
}
@@ -32,10 +32,10 @@
}
.destination-list-item-icon {
- -webkit-margin-end: 8px;
display: inline-block;
flex: 0 0 auto;
height: 24px;
+ margin-inline-end: 8px;
transition: opacity 150ms;
vertical-align: middle;
width: 24px;
@@ -51,17 +51,17 @@
}
.destination-list-item-name .search-hint {
- -webkit-margin-start: 1em;
color: #999;
font-size: 75%;
+ margin-inline-start: 1em;
}
.destination-list-item .connection-status,
.destination-list-item .learn-more-link {
- -webkit-margin-start: 1em;
flex: 0 0 auto;
font-size: 75%;
line-height: 24px;
+ margin-inline-start: 1em;
vertical-align: middle;
}
@@ -70,8 +70,8 @@
}
.register-promo {
- -webkit-margin-start: 1em;
flex: 0 0 auto;
+ margin-inline-start: 1em;
}
.destination-list-item-query-highlight {
@@ -86,9 +86,9 @@
}
.extension-name {
- -webkit-margin-start: 1em;
color: #777;
line-height: 24px;
+ margin-inline-start: 1em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -106,9 +106,9 @@
.configuring-in-progress-text,
.configuring-failed-text {
- -webkit-margin-start: 1em;
flex: 0 1 auto;
line-height: 24px;
+ margin-inline-start: 1em;
vertical-align: middle;
}
diff --git a/chromium/chrome/browser/resources/print_preview/search/destination_search.css b/chromium/chrome/browser/resources/print_preview/search/destination_search.css
index 8eddc19d078..aa4b3bbb20e 100644
--- a/chromium/chrome/browser/resources/print_preview/search/destination_search.css
+++ b/chromium/chrome/browser/resources/print_preview/search/destination_search.css
@@ -17,10 +17,10 @@
}
#destination-search .user-info {
- -webkit-padding-end: 18px;
- -webkit-padding-start: 18px;
display: flex;
padding-bottom: 14px;
+ padding-inline-end: 18px;
+ padding-inline-start: 18px;
}
#destination-search .account-select-label {
@@ -33,7 +33,7 @@
}
#destination-search .account-select {
- -webkit-margin-start: 18px;
+ margin-inline-start: 18px;
width: auto;
}
@@ -86,7 +86,7 @@
}
#destination-search .invitation-buttons > *:not(:first-child) {
- -webkit-margin-start: 10px;
+ margin-inline-start: 10px;
}
#destination-search .invitation-cloud-print-information {
@@ -107,9 +107,9 @@
}
#destination-search .cloudprint-promo .icon {
- -webkit-margin-end: 12px;
display: block;
height: 24px;
+ margin-inline-end: 12px;
width: 24px;
}
@@ -118,13 +118,13 @@
}
#destination-search .cloudprint-promo .close-button {
- -webkit-margin-start: 12px;
background-image: -webkit-image-set(
url(chrome://theme/IDR_CLOSE_DIALOG) 1x,
url(chrome://theme/IDR_CLOSE_DIALOG@2x) 2x);
background-repeat: no-repeat;
background-size: 14px;
height: 14px;
+ margin-inline-start: 12px;
width: 14px;
}
diff --git a/chromium/chrome/browser/resources/print_preview/search/destination_search.js b/chromium/chrome/browser/resources/print_preview/search/destination_search.js
index 6235d6f3c12..bdb9b5433d5 100644
--- a/chromium/chrome/browser/resources/print_preview/search/destination_search.js
+++ b/chromium/chrome/browser/resources/print_preview/search/destination_search.js
@@ -660,7 +660,8 @@ cr.define('print_preview', function() {
// Restore focus to the previosly focused element if it's
// still shown in the search.
if (lastFocusedElement && this.getIsVisible() &&
- getIsVisible(lastFocusedElement) &&
+ getIsVisible(
+ /** @type {!HTMLElement} */ (lastFocusedElement)) &&
this.getElement().contains(lastFocusedElement)) {
lastFocusedElement.focus();
}
diff --git a/chromium/chrome/browser/resources/print_preview/search/provisional_destination_resolver.js b/chromium/chrome/browser/resources/print_preview/search/provisional_destination_resolver.js
index e60eecccf15..d9dcc121fbc 100644
--- a/chromium/chrome/browser/resources/print_preview/search/provisional_destination_resolver.js
+++ b/chromium/chrome/browser/resources/print_preview/search/provisional_destination_resolver.js
@@ -56,7 +56,7 @@ cr.define('print_preview', function() {
/**
* @param {!print_preview.DestinationStore} store
* @param {!print_preview.Destination} destination
- * @return {?ProvisionalDestinationResolver}
+ * @return {?print_preview.ProvisionalDestinationResolver}
*/
ProvisionalDestinationResolver.create = function(store, destination) {
if (destination.provisionalType !=
diff --git a/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.css b/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.css
index 2db6286bb2c..7bd8d275f20 100644
--- a/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.css
+++ b/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.css
@@ -29,9 +29,9 @@
}
#advanced-settings .no-settings-match-hint {
- -webkit-padding-start: 17px;
color: #999;
padding-bottom: 8px;
+ padding-inline-start: 17px;
padding-top: 8px;
}
diff --git a/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.css b/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.css
index dec2f08e65d..027780619f3 100644
--- a/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.css
+++ b/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.css
@@ -13,9 +13,9 @@
}
.advanced-settings-item-label {
- -webkit-padding-end: 20px;
display: table-cell;
overflow: hidden;
+ padding-inline-end: 20px;
text-overflow: ellipsis;
vertical-align: middle;
white-space: nowrap;
@@ -23,9 +23,9 @@
}
.advanced-settings-item-name .search-hint {
- -webkit-margin-start: 1em;
color: #999;
font-size: 75%;
+ margin-inline-start: 1em;
}
.advanced-settings-item-query-highlight {
diff --git a/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.html b/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.html
index da8415d43ad..ad6b550a082 100644
--- a/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.html
+++ b/chromium/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings_item.html
@@ -6,7 +6,8 @@
</select>
</span>
<span class="advanced-settings-item-value-text" hidden>
- <input type="text" class="advanced-settings-item-value-text-control">
+ <input type="text" class="advanced-settings-item-value-text-control"
+ spellcheck="false">
</span>
</span>
</div>
diff --git a/chromium/chrome/browser/resources/print_preview/settings/destination_settings.css b/chromium/chrome/browser/resources/print_preview/settings/destination_settings.css
index 1962f1d7b79..2351a2fe055 100644
--- a/chromium/chrome/browser/resources/print_preview/settings/destination_settings.css
+++ b/chromium/chrome/browser/resources/print_preview/settings/destination_settings.css
@@ -26,8 +26,8 @@
}
.destination-settings-icon {
- -webkit-margin-end: 8px;
height: 24px;
+ margin-inline-end: 8px;
vertical-align: middle;
width: 24px;
}
@@ -48,7 +48,7 @@
}
.throbber-container .throbber {
- -webkit-margin-end: 8px;
+ margin-inline-end: 8px;
}
.destination-throbber-name-container {
diff --git a/chromium/chrome/browser/resources/print_preview/settings/page_settings.css b/chromium/chrome/browser/resources/print_preview/settings/page_settings.css
index 2e3b0a541d5..820cd7110b6 100644
--- a/chromium/chrome/browser/resources/print_preview/settings/page_settings.css
+++ b/chromium/chrome/browser/resources/print_preview/settings/page_settings.css
@@ -10,7 +10,7 @@
#page-settings .page-settings-custom-input-wrapper {
-webkit-box-flex: 1;
- -webkit-margin-start: 0.6em;
+ margin-inline-start: 0.6em;
min-height: 2em;
position: relative;
}
diff --git a/chromium/chrome/browser/resources/print_preview/settings/page_settings.html b/chromium/chrome/browser/resources/print_preview/settings/page_settings.html
index cad226ede8d..60789951a45 100644
--- a/chromium/chrome/browser/resources/print_preview/settings/page_settings.html
+++ b/chromium/chrome/browser/resources/print_preview/settings/page_settings.html
@@ -14,7 +14,7 @@
i18n-values="aria-label:printPagesLabel;">
<div class="page-settings-custom-input-wrapper">
<input class="page-settings-custom-input" type="text"
- id="page-settings-custom-input"
+ id="page-settings-custom-input" spellcheck="false"
i18n-values="placeholder:examplePageRangeText;
aria-label:examplePageRangeText">
</div>
diff --git a/chromium/chrome/browser/resources/print_preview/settings/settings_box.css b/chromium/chrome/browser/resources/print_preview/settings/settings_box.css
index b95a669f277..35d9b7aea63 100644
--- a/chromium/chrome/browser/resources/print_preview/settings/settings_box.css
+++ b/chromium/chrome/browser/resources/print_preview/settings/settings_box.css
@@ -8,8 +8,8 @@
}
.settings-box input[type='number'] {
- -webkit-margin-end: 16px;
margin-bottom: 2.5px;
+ margin-inline-end: 16px;
margin-top: 2.5px;
}
diff --git a/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.html b/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.html
index 308e08c75d7..0531ce6ba56 100644
--- a/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.html
+++ b/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.html
@@ -22,6 +22,9 @@
.bad {
background-color: rgb(249, 156, 149);
}
+ .medium {
+ background-color: rgb(255, 255, 90);
+ }
.info {
background-color: rgb(169, 217, 239);
}
diff --git a/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.js b/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.js
index 81c4ad5cf7c..f691b62a922 100644
--- a/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.js
+++ b/chromium/chrome/browser/resources/sandbox_internals/sandbox_internals.js
@@ -3,9 +3,16 @@
// found in the LICENSE file.
(function() {
-let GOOD = 'good';
-let BAD = 'bad';
-let INFO = 'info';
+/**
+ * CSS classes for different statuses.
+ * @enum {string}
+ */
+const StatusClass = {
+ GOOD: 'good',
+ BAD: 'bad',
+ MEDIUM: 'medium',
+ INFO: 'info'
+};
/**
* Adds a row to the sandbox status table.
@@ -39,7 +46,8 @@ function addStatusRow(name, value, cssClass) {
* @return {Element} The newly added TR.
*/
function addGoodBadRow(name, result) {
- return addStatusRow(name, result ? 'Yes' : 'No', result ? GOOD : BAD);
+ return addStatusRow(
+ name, result ? 'Yes' : 'No', result ? StatusClass.GOOD : StatusClass.BAD);
}
/**
@@ -61,19 +69,21 @@ function androidHandler() {
var isTsync = false;
var isChromeSeccomp = false;
- addStatusRow('PID', status.pid, INFO);
- addStatusRow('UID', status.uid, INFO);
+ addStatusRow('PID', status.pid, StatusClass.INFO);
+ addStatusRow('UID', status.uid, StatusClass.INFO);
isIsolated = status.secontext.indexOf(':isolated_app:') != -1;
- addStatusRow('SELinux Context', status.secontext, isIsolated ? GOOD : BAD);
+ addStatusRow(
+ 'SELinux Context', status.secontext,
+ isIsolated ? StatusClass.GOOD : StatusClass.BAD);
let procStatus = status.procStatus.split('\n');
for (let line of procStatus) {
if (line.startsWith('Seccomp')) {
var value = line.split(':')[1].trim();
- var cssClass = BAD;
+ var cssClass = StatusClass.BAD;
if (value == '2') {
value = 'Yes - TSYNC (' + line + ')';
- cssClass = GOOD;
+ cssClass = StatusClass.GOOD;
isTsync = true;
} else if (value == '1') {
value = 'Yes (' + line + ')';
@@ -106,9 +116,9 @@ function androidHandler() {
}
addStatusRow(
'Seccomp-BPF Enabled (Chrome)', seccompStatus,
- status.seccompStatus == 4 ? GOOD : BAD);
+ status.seccompStatus == 4 ? StatusClass.GOOD : StatusClass.BAD);
- addStatusRow('Android Build ID', status.androidBuildId, INFO);
+ addStatusRow('Android Build ID', status.androidBuildId, StatusClass.INFO);
setEvaluation(isIsolated && isTsync && isChromeSeccomp);
});
@@ -118,15 +128,42 @@ function androidHandler() {
* Main page handler for desktop Linux.
*/
function linuxHandler() {
- addGoodBadRow('SUID Sandbox', loadTimeData.getBoolean('suid'));
- addGoodBadRow('Namespace Sandbox', loadTimeData.getBoolean('userNs'));
+ let suidSandbox = loadTimeData.getBoolean('suid');
+ let nsSandbox = loadTimeData.getBoolean('userNs');
+
+ let layer1SandboxType = 'None';
+ let layer1SandboxCssClass = StatusClass.BAD;
+ if (suidSandbox) {
+ layer1SandboxType = 'SUID';
+ layer1SandboxCssClass = StatusClass.MEDIUM;
+ } else if (nsSandbox) {
+ layer1SandboxType = 'Namespace';
+ layer1SandboxCssClass = StatusClass.GOOD;
+ }
+
+ addStatusRow('Layer 1 Sandbox', layer1SandboxType, layer1SandboxCssClass);
addGoodBadRow('PID namespaces', loadTimeData.getBoolean('pidNs'));
addGoodBadRow('Network namespaces', loadTimeData.getBoolean('netNs'));
addGoodBadRow('Seccomp-BPF sandbox', loadTimeData.getBoolean('seccompBpf'));
addGoodBadRow(
'Seccomp-BPF sandbox supports TSYNC',
loadTimeData.getBoolean('seccompTsync'));
- addGoodBadRow('Yama LSM Enforcing', loadTimeData.getBoolean('yama'));
+
+ let enforcingYamaBroker = loadTimeData.getBoolean('yamaBroker');
+ addGoodBadRow(
+ 'Ptrace Protection with Yama LSM (Broker)', enforcingYamaBroker);
+
+ let enforcingYamaNonbroker = loadTimeData.getBoolean('yamaNonbroker');
+ // If there is no ptrace protection anywhere, that is bad.
+ // If there is no ptrace protection for nonbroker processes because of the
+ // user namespace sandbox, that is fine and we display as medium.
+ let yamaNonbrokerCssClass = enforcingYamaBroker ?
+ (enforcingYamaNonbroker ? StatusClass.GOOD : StatusClass.MEDIUM) :
+ StatusClass.BAD;
+ addStatusRow(
+ 'Ptrace Protection with Yama LSM (Non-broker)',
+ enforcingYamaNonbroker ? 'Yes' : 'No', yamaNonbrokerCssClass);
+
setEvaluation(loadTimeData.getBoolean('sandboxGood'));
}
diff --git a/chromium/chrome/browser/resources/set_as_default_browser.css b/chromium/chrome/browser/resources/set_as_default_browser.css
index 1d492637e45..9fb82d5c72a 100644
--- a/chromium/chrome/browser/resources/set_as_default_browser.css
+++ b/chromium/chrome/browser/resources/set_as_default_browser.css
@@ -81,13 +81,13 @@
/* Action buttons. */
#metro-action-box button {
- -webkit-margin-end: 0.4em;
- -webkit-margin-start: 0;
border-radius: 2px;
display: inline-block;
font-size: 13px;
height: 32px;
line-height: 27px;
+ margin-inline-end: 0.4em;
+ margin-inline-start: 0;
margin-top: 0;
min-width: 80px;
transition: all 218ms;
diff --git a/chromium/chrome/browser/resources/settings/BUILD.gn b/chromium/chrome/browser/resources/settings/BUILD.gn
index a21d2781afe..94da713a1ce 100644
--- a/chromium/chrome/browser/resources/settings/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/BUILD.gn
@@ -22,6 +22,10 @@ if (optimize_webui) {
"vulcanized.html",
"lazy_load.vulcanized.html",
]
+ html_out_files_polymer2 = [
+ "vulcanized.p2.html",
+ "lazy_load.vulcanized.p2.html",
+ ]
insert_in_head = "<base href=\"chrome://settings\">"
input = rebase_path("$target_gen_dir/$unpak_folder", root_build_dir)
js_out_files = [
@@ -124,9 +128,9 @@ js_library("extension_control_browser_proxy") {
js_library("find_shortcut_behavior") {
deps = [
- "//third_party/polymer/v1_0/components-chromium/iron-a11y-keys-behavior:iron-a11y-keys-behavior-extracted",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
+ "//ui/webui/resources/js/cr/ui:command",
]
}
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html
index 0d071105c46..e9e35f21160 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html
+++ b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.html
@@ -15,21 +15,21 @@
<template>
<style include="settings-shared">
h2 {
- -webkit-padding-start: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-padding);
}
.sub-item {
- -webkit-margin-start: var(--settings-indent-width);
+ margin-inline-start: var(--settings-indent-width);
}
h2 ~ .settings-box,
h2 ~ settings-toggle-button,
iron-collapse .settings-box,
iron-collapse settings-toggle-button {
- -webkit-margin-end: var(--settings-box-row-padding);
- -webkit-margin-start: var(--settings-box-row-indent);
- -webkit-padding-end: 0;
- -webkit-padding-start: 0;
+ margin-inline-end: var(--settings-box-row-padding);
+ margin-inline-start: var(--settings-box-row-indent);
+ padding-inline-end: 0;
+ padding-inline-start: 0;
}
</style>
<div class="settings-box row first">
@@ -244,6 +244,11 @@
pref="{{prefs.settings.a11y.mono_audio}}"
label="$i18n{monoAudioLabel}">
</settings-toggle-button>
+ <settings-toggle-button id="startupSoundEnabled" class="first"
+ pref=" "
+ on-change="toggleStartupSoundEnabled_"
+ label="$i18n{startupSoundLabel}">
+ </settings-toggle-button>
<template is="dom-if" if="[[!isGuest_]]">
<a class="settings-box two-line inherit-color no-outline" tabindex="-1"
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js
index 2466b990bbe..d8acc989fc0 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js
+++ b/chromium/chrome/browser/resources/settings/a11y_page/manage_a11y_page.js
@@ -114,6 +114,14 @@ Polymer({
chrome.send('initializeKeyboardWatcher');
},
+ /** @override */
+ ready: function() {
+ this.addWebUIListener(
+ 'startup-sound-enabled-updated',
+ this.updateStartupSoundEnabled_.bind(this));
+ chrome.send('getStartupSoundEnabled');
+ },
+
/**
* Updates the Select-to-Speak description text based on:
* 1. Whether Select-to-Speak is enabled.
@@ -133,6 +141,23 @@ Polymer({
hasKeyboard ? keyboardString : noKeyboardString;
},
+ /**
+ * @param {!CustomEvent} e
+ * @private
+ */
+ toggleStartupSoundEnabled_: function(e) {
+ let checked = /** @type {boolean} */ (e.detail);
+ chrome.send('setStartupSoundEnabled', [checked]);
+ },
+
+ /**
+ * @param {boolean} enabled
+ * @private
+ */
+ updateStartupSoundEnabled_: function(enabled) {
+ this.$.startupSoundEnabled.checked = enabled;
+ },
+
/** @private */
onManageTtsSettingsTap_: function() {
settings.navigateTo(settings.routes.MANAGE_TTS_SETTINGS);
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.html b/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.html
index 565e2243c62..47e2e5abf5b 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.html
+++ b/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.html
@@ -16,14 +16,14 @@
<template>
<style include="settings-shared md-select">
h2 {
- -webkit-padding-start: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-padding);
}
.settings-box {
- -webkit-margin-end: var(--settings-box-row-padding);
- -webkit-margin-start: var(--settings-box-row-indent);
- -webkit-padding-end: 0;
- -webkit-padding-start: 0;
+ margin-inline-end: var(--settings-box-row-padding);
+ margin-inline-start: var(--settings-box-row-indent);
+ padding-inline-end: 0;
+ padding-inline-start: 0;
}
#previewInput {
@@ -32,7 +32,7 @@
}
#previewInput paper-button {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
</style>
@@ -147,15 +147,11 @@
<div id="extension_name_[[index]]" class="start">
[[extension.name]]
</div>
- <a href="[[extension.optionsPage]]"
- tabindex=-1
- target="_blank"
+ <paper-button on-click="onEngineSettingsTap_"
aria-describedby$="extension_name_[[index]]"
hidden$="[[!extension.optionsPage]]">
- <paper-button>
- $i18n{settings}
- </paper-button>
- </a>
+ $i18n{settings}
+ </paper-button>
</div>
</template>
</template>
diff --git a/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.js b/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.js
index f6e16daae7f..0e27875f62b 100644
--- a/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.js
+++ b/chromium/chrome/browser/resources/settings/a11y_page/tts_subpage.js
@@ -360,4 +360,13 @@ Polymer({
chrome.metricsPrivate.recordSparseHashable(
'TextToSpeech.Settings.DefaultVoicePicked', newDefault);
},
+
+ /**
+ * @param {{model:Object}} event
+ * @private
+ */
+ onEngineSettingsTap_: function(event) {
+ chrome.send('wakeTtsEngine');
+ window.open(event.model.extension.optionsPage);
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page.html b/chromium/chrome/browser/resources/settings/about_page/about_page.html
index 720a636c74c..4bc8e37370d 100644
--- a/chromium/chrome/browser/resources/settings/about_page/about_page.html
+++ b/chromium/chrome/browser/resources/settings/about_page/about_page.html
@@ -53,11 +53,11 @@
}
img {
- -webkit-margin-end: var(--about-page-image-space);
+ margin-inline-end: var(--about-page-image-space);
}
iron-icon {
- -webkit-margin-end: var(--about-page-image-space);
+ margin-inline-end: var(--about-page-image-space);
min-width: 32px; /* The width of the product-logo img. */
}
diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page.js b/chromium/chrome/browser/resources/settings/about_page/about_page.js
index 0274720ac5a..e03fda011c3 100644
--- a/chromium/chrome/browser/resources/settings/about_page/about_page.js
+++ b/chromium/chrome/browser/resources/settings/about_page/about_page.js
@@ -41,7 +41,10 @@ Polymer({
regulatoryInfo_: Object,
/** @private */
- hasEndOfLife_: Boolean,
+ hasEndOfLife_: {
+ type: Boolean,
+ value: false,
+ },
/** @private */
showCrostini: Boolean,
@@ -72,18 +75,25 @@ Polymer({
// </if>
/** @private */
- showUpdateStatus_: Boolean,
+ showUpdateStatus_: {
+ type: Boolean,
+ value: false,
+ },
/** @private */
showButtonContainer_: Boolean,
/** @private */
- showRelaunch_: Boolean,
+ showRelaunch_: {
+ type: Boolean,
+ value: false,
+ },
// <if expr="chromeos">
/** @private */
showRelaunchAndPowerwash_: {
type: Boolean,
+ value: false,
computed: 'computeShowRelaunchAndPowerwash_(' +
'currentUpdateStatusEvent_, targetChannel_, currentChannel_)',
},
diff --git a/chromium/chrome/browser/resources/settings/about_page/detailed_build_info.html b/chromium/chrome/browser/resources/settings/about_page/detailed_build_info.html
index e0c6761e7be..c604d6dd566 100644
--- a/chromium/chrome/browser/resources/settings/about_page/detailed_build_info.html
+++ b/chromium/chrome/browser/resources/settings/about_page/detailed_build_info.html
@@ -14,7 +14,7 @@
<template>
<style include="settings-shared">
cr-policy-indicator {
- -webkit-margin-start: var(--cr-controlled-by-spacing);
+ margin-inline-start: var(--cr-controlled-by-spacing);
}
/* The command line string can contain very long substrings that
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html b/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html
index e3e305c9e18..720d25d126a 100644
--- a/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html
+++ b/chromium/chrome/browser/resources/settings/appearance_page/appearance_page.html
@@ -23,7 +23,7 @@
<template>
<style include="settings-shared md-select iron-flex">
.secondary-button ~ .secondary-button {
- -webkit-margin-start: 12px;
+ margin-inline-start: 12px;
}
/* Lines up with cr-input. */
@@ -40,11 +40,11 @@
* grit expressions and dom-if templates. That leads to a tricky thing
* to style correctly, these are a workaround. */
#themeRow paper-button {
- -webkit-margin-end: 20px;
+ margin-inline-end: 20px;
}
#themeRow .separator {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
}
</style>
<settings-animated-pages id="pages" section="appearance"
diff --git a/chromium/chrome/browser/resources/settings/appearance_page/home_url_input.js b/chromium/chrome/browser/resources/settings/appearance_page/home_url_input.js
index a9939ce9517..870e6c10fa7 100644
--- a/chromium/chrome/browser/resources/settings/appearance_page/home_url_input.js
+++ b/chromium/chrome/browser/resources/settings/appearance_page/home_url_input.js
@@ -123,7 +123,7 @@ Polymer({
/**
* This function prevents unwanted change of selection of the containing
* paper-radio-group, when the user traverses the input with arrow keys.
- * @param {!Event} event
+ * @param {!Event} e
* @private
*/
stopKeyEventPropagation_: function(e) {
diff --git a/chromium/chrome/browser/resources/settings/basic_page/basic_page.html b/chromium/chrome/browser/resources/settings/basic_page/basic_page.html
index e3369e5ef3b..ec867412506 100644
--- a/chromium/chrome/browser/resources/settings/basic_page/basic_page.html
+++ b/chromium/chrome/browser/resources/settings/basic_page/basic_page.html
@@ -85,7 +85,7 @@
}
iron-icon {
- -webkit-margin-start: 16px;
+ margin-inline-start: 16px;
}
</style>
<template is="dom-if" if="[[showBasicPage_(
@@ -110,18 +110,6 @@
</settings-internet-page>
</settings-section>
</template>
- <template is="dom-if"
- if="[[canShowMultideviceSection_(showMultidevice, pageVisibility)]]"
- restamp>
- <settings-section page-title="$i18n{multidevicePageTitle}"
- section="multidevice"
- hidden$="[[!doesAccountSupportMultiDeviceSection_]]">
- <settings-multidevice-page-container prefs="{{prefs}}"
- does-potential-connected-phone-exist=
- "{{doesAccountSupportMultiDeviceSection_}}">
- </settings-multidevice-page-container>
- </settings-section>
- </template>
<template is="dom-if" if="[[showPage_(pageVisibility.bluetooth)]]"
restamp>
<settings-section page-title="$i18n{bluetoothPageTitle}"
@@ -130,6 +118,18 @@
</settings-bluetooth-page>
</settings-section>
</template>
+ <template is="dom-if"
+ if="[[canShowMultideviceSection_(showMultidevice, pageVisibility)]]"
+ restamp>
+ <settings-section page-title="$i18n{multidevicePageTitle}"
+ section="multidevice"
+ hidden$="[[!doesChromebookSupportMultiDeviceSection_]]">
+ <settings-multidevice-page-container
+ does-chromebook-support-multi-device-features=
+ "{{doesChromebookSupportMultiDeviceSection_}}">
+ </settings-multidevice-page-container>
+ </settings-section>
+ </template>
</if>
<template is="dom-if" if="[[showChangePassword]]" restamp>
<settings-section section="changePassword">
diff --git a/chromium/chrome/browser/resources/settings/basic_page/basic_page.js b/chromium/chrome/browser/resources/settings/basic_page/basic_page.js
index b0e03709417..0a99b639d16 100644
--- a/chromium/chrome/browser/resources/settings/basic_page/basic_page.js
+++ b/chromium/chrome/browser/resources/settings/basic_page/basic_page.js
@@ -95,7 +95,7 @@ Polymer({
* section.
* @private {boolean}
*/
- doesAccountSupportMultiDeviceSection_: {
+ doesChromebookSupportMultiDeviceSection_: {
type: Boolean,
value: false,
},
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
index 36872d0208c..cb249bebe13 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
@@ -3,6 +3,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
+<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="../i18n_setup.html">
@@ -21,36 +22,47 @@
<settings-animated-pages id="pages" section="bluetooth"
focus-config="[[focusConfig_]]">
<neon-animatable route-path="default">
- <div id="bluetoothDevices"
- class="settings-box two-line" actionable on-click="onTap_">
- <iron-icon icon="[[getIcon_(bluetoothToggleState_)]]"></iron-icon>
- <div class="middle">
- $i18n{bluetoothPageTitle}
- <div class="secondary" id="bluetoothSecondary">
- [[getOnOffString_(bluetoothToggleState_,
- '$i18nPolymer{deviceOn}', '$i18nPolymer{deviceOff}')]]
+ <template is="dom-if" if="[[!isSecondaryUser_]]">
+ <div id="bluetoothDevices"
+ class="settings-box two-line" actionable on-click="onTap_">
+ <iron-icon icon="[[getIcon_(bluetoothToggleState_)]]"></iron-icon>
+ <div class="middle">
+ $i18n{bluetoothPageTitle}
+ <div class="secondary" id="bluetoothSecondary">
+ [[getOnOffString_(bluetoothToggleState_,
+ '$i18nPolymer{deviceOn}', '$i18nPolymer{deviceOff}')]]
+ </div>
</div>
+ <cr-policy-pref-indicator
+ icon-aria-label="$i18n{bluetoothPageTitle}"
+ pref="[[prefs.cros.device.allow_bluetooth]]"
+ hidden="[[prefs.cros.device.allow_bluetooth.value]]">
+ </cr-policy-pref-indicator>
+ <template is="dom-if" if="[[bluetoothToggleState_]]">
+ <paper-icon-button-light class="subpage-arrow">
+ <button on-click="onSubpageArrowTap_"
+ aria-label="$i18n{bluetoothPageTitle}"
+ aria-describedby="bluetoothSecondary">
+ </button>
+ </paper-icon-button-light>
+ </template>
+ <div class="separator"></div>
+ <cr-toggle id="enableBluetooth"
+ checked="{{bluetoothToggleState_}}"
+ disabled$="[[!isToggleEnabled_(
+ adapterState_, stateChangeInProgress_)]]"
+ aria-label="$i18n{bluetoothToggleA11yLabel}">
+ </cr-toggle>
</div>
- <cr-policy-pref-indicator icon-aria-label="$i18n{bluetoothPageTitle}"
- pref="[[prefs.cros.device.allow_bluetooth]]"
- hidden="[[prefs.cros.device.allow_bluetooth.value]]">
- </cr-policy-pref-indicator>
- <template is="dom-if" if="[[bluetoothToggleState_]]">
- <paper-icon-button-light class="subpage-arrow">
- <button on-click="onSubpageArrowTap_"
- aria-label="$i18n{bluetoothPageTitle}"
- aria-describedby="bluetoothSecondary">
- </button>
- </paper-icon-button-light>
- </template>
- <div class="separator"></div>
- <cr-toggle id="enableBluetooth"
- checked="{{bluetoothToggleState_}}"
- disabled$=
- "[[!isToggleEnabled_(adapterState_, stateChangeInProgress_)]]"
- aria-label="$i18n{bluetoothToggleA11yLabel}">
- </cr-toggle>
- </div>
+ </template>
+ <template is="dom-if" if="[[isSecondaryUser_]]">
+ <div id="bluetoothDevices" class="settings-box two-line">
+ <iron-icon class="policy" icon="cr:group"></iron-icon>
+ <div class="middle">
+ [[i18n('bluetoothPrimaryUserControlled', primaryUserEmail_)]]
+ </div>
+ </div>
+ </template>
</neon-animatable>
<template is="dom-if" route-path="/bluetoothDevices">
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
index ec86e09ad87..f532340394a 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
@@ -25,7 +25,7 @@ const bluetoothApis = window['bluetoothApis'] || {
Polymer({
is: 'settings-bluetooth-page',
- behaviors: [PrefsBehavior],
+ behaviors: [I18nBehavior, PrefsBehavior],
properties: {
/** Preferences state. */
@@ -99,6 +99,30 @@ Polymer({
type: Object,
value: chrome.bluetoothPrivate,
},
+
+ /**
+ * Whether the user is a secondary user.
+ * @private
+ */
+ isSecondaryUser_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('isSecondaryUser');
+ },
+ readOnly: true,
+ },
+
+ /**
+ * Email address for the primary user.
+ * @private
+ */
+ primaryUserEmail_: {
+ type: String,
+ value: function() {
+ return loadTimeData.getString('primaryUserEmail');
+ },
+ readOnly: true,
+ },
},
observers: ['deviceListChanged_(deviceList_.*)'],
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js
index 476a45012b2..a29bb4d3afa 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js
@@ -271,7 +271,7 @@ Polymer({
* @private
*/
updateDeviceList_: function() {
- if (!this.bluetoothToggleState) {
+ if (!this.adapterState || !this.adapterState.powered) {
this.deviceList_ = [];
return;
}
diff --git a/chromium/chrome/browser/resources/settings/change_password_page/change_password_page.html b/chromium/chrome/browser/resources/settings/change_password_page/change_password_page.html
index dc7ebec5125..8bb78adddca 100644
--- a/chromium/chrome/browser/resources/settings/change_password_page/change_password_page.html
+++ b/chromium/chrome/browser/resources/settings/change_password_page/change_password_page.html
@@ -11,7 +11,7 @@
<template>
<style include="settings-shared">
.icon-container {
- -webkit-padding-end: var(--settings-box-row-padding);
+ padding-inline-end: var(--settings-box-row-padding);
}
.change-password-icon {
diff --git a/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html b/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html
index 2a309a7a43d..dbab0d8557f 100644
--- a/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html
+++ b/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.html
@@ -1,11 +1,9 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
-<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
@@ -13,7 +11,6 @@
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="../controls/controlled_button.html">
<link rel="import" href="../controls/settings_toggle_button.html">
-<link rel="import" href="../icons.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="chrome_cleanup_proxy.html">
<link rel="import" href="items_to_remove_list.html">
@@ -22,6 +19,7 @@
<template>
<style include="settings-shared">
#waiting-spinner {
+ flex-shrink: 0;
height: 20px;
width: 20px;
}
@@ -43,28 +41,6 @@
height: 22px;
}
- #status-icon {
- height: 20px;
- vertical-align: top;
- width: 20px;
- }
-
- .status-icon-container {
- -webkit-padding-end: var(--settings-box-row-padding);
- }
-
- .status-icon-remove {
- --iron-icon-fill-color: var(--google-grey-refresh-700);
- }
-
- .status-icon-done {
- --iron-icon-fill-color: var(--google-blue-500);
- }
-
- .status-icon-warning {
- --iron-icon-fill-color: var(--google-red-700);
- }
-
.top-aligned-settings-box {
align-items: center;
/* override settings-box min-height since we use vertical padding */
@@ -74,14 +50,6 @@
</style>
<div class$="settings-box first
[[getTopSettingsBoxClass_(showExplanation_)]]">
- <div class="status-icon-container">
- <paper-spinner-lite id="waiting-spinner"
- hidden="[[!isWaitingForResult_]]" active="[[isWaitingForResult_]]">
- </paper-spinner-lite>
- <iron-icon id="status-icon" hidden="[[isWaitingForResult_]]"
- icon="[[statusIcon_]]" class$="[[statusIconClassName_]]">
- </iron-icon>
- </div>
<div class="start">
<div id="status-title" role="status" inner-h-t-m-l="[[title_]]"></div>
<div hidden="[[!showExplanation_]]">
@@ -91,6 +59,9 @@
<cr-policy-pref-indicator
pref="[[prefs.software_reporter.enabled]]">
</cr-policy-pref-indicator>
+ <paper-spinner-lite id="waiting-spinner"
+ hidden="[[!isWaitingForResult_]]" active="[[isWaitingForResult_]]">
+ </paper-spinner-lite>
<template is="dom-if" if="[[showActionButton_]]">
<div class="separator"></div>
<paper-button id="action-button" class="action-button"
diff --git a/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js b/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js
index 8c6329255bf..e61a4d7aa0a 100644
--- a/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js
+++ b/chromium/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js
@@ -60,14 +60,6 @@ settings.ChromeCleanupOngoingAction = {
/**
* @typedef {{
- * statusIcon: string,
- * statusIconClassName: string,
- * }}
- */
-settings.ChromeCleanupCardIcon;
-
-/**
- * @typedef {{
* label: string,
* doAction: !function(),
* }}
@@ -78,7 +70,6 @@ settings.ChromeCleanupCardActionButton;
* @typedef {{
* title: ?string,
* explanation: ?string,
- * icon: ?settings.ChromeCleanupCardIcon,
* actionButton: ?settings.ChromeCleanupCardActionButton,
* flags: number,
* }}
@@ -214,18 +205,6 @@ Polymer({
computed: 'computeHasExtensionsToShow_(scannerResults_)',
},
- /** @private */
- statusIcon_: {
- type: String,
- value: '',
- },
-
- /** @private */
- statusIconClassName_: {
- type: String,
- value: '',
- },
-
/** @private {chrome.settingsPrivate.PrefObject} */
logsUploadPref_: {
type: Object,
@@ -521,28 +500,11 @@ Polymer({
this.title_ = components.title || '';
this.explanation_ = components.explanation || '';
- this.updateIcon_(components.icon);
this.updateActionButton_(components.actionButton);
this.updateCardFlags_(components.flags);
},
/**
- * Updates the icon on the cleanup card to show the current state.
- * @param {?settings.ChromeCleanupCardIcon} icon The icon to
- * render, or null if no icon should be shown.
- * @private
- */
- updateIcon_: function(icon) {
- if (!icon) {
- this.statusIcon_ = '';
- this.statusIconClassName_ = '';
- } else {
- this.statusIcon_ = icon.statusIcon;
- this.statusIconClassName_ = icon.statusIconClassName;
- }
- },
-
- /**
* Updates the action button on the cleanup card as the action expected for
* the current state.
* @param {?settings.ChromeCleanupCardActionButton} actionButton
@@ -663,30 +625,6 @@ Polymer({
*/
buildCardStateToComponentsMap_: function() {
/**
- * The icons to show on the card.
- * @enum {settings.ChromeCleanupCardIcon}
- */
- const icons = {
- // Card's icon indicates a cleanup offer.
- SYSTEM: {
- statusIcon: 'cr:security',
- statusIconClassName: 'status-icon-remove',
- },
-
- // Card's icon indicates a warning (in case of failure).
- WARNING: {
- statusIcon: 'cr:error',
- statusIconClassName: 'status-icon-warning',
- },
-
- // Card's icon indicates completion or reboot required.
- DONE: {
- statusIcon: 'settings:check-circle',
- statusIconClassName: 'status-icon-done',
- },
- };
-
- /**
* The action buttons to show on the card.
* @enum {settings.ChromeCleanupCardActionButton}
*/
@@ -719,7 +657,6 @@ Polymer({
settings.ChromeCleanerCardState.CLEANUP_OFFERED, {
title: this.i18n('chromeCleanupTitleRemove'),
explanation: this.i18n('chromeCleanupExplanationRemove'),
- icon: icons.SYSTEM,
actionButton: actionButtons.REMOVE,
flags: settings.ChromeCleanupCardFlags.SHOW_LOGS_PERMISSIONS |
settings.ChromeCleanupCardFlags.SHOW_ITEMS_TO_REMOVE,
@@ -729,7 +666,6 @@ Polymer({
settings.ChromeCleanerCardState.CLEANING, {
title: this.i18n('chromeCleanupTitleRemoving'),
explanation: this.i18n('chromeCleanupExplanationRemoving'),
- icon: null,
actionButton: null,
flags: settings.ChromeCleanupCardFlags.WAITING_FOR_RESULT |
settings.ChromeCleanupCardFlags.SHOW_ITEMS_TO_REMOVE,
@@ -739,7 +675,6 @@ Polymer({
settings.ChromeCleanerCardState.REBOOT_REQUIRED, {
title: this.i18n('chromeCleanupTitleRestart'),
explanation: null,
- icon: icons.DONE,
actionButton: actionButtons.RESTART_COMPUTER,
flags: settings.ChromeCleanupCardFlags.NONE,
}
@@ -748,7 +683,6 @@ Polymer({
settings.ChromeCleanerCardState.CLEANUP_SUCCEEDED, {
title: this.i18nAdvanced('chromeCleanupTitleRemoved', {tags: ['a']}),
explanation: null,
- icon: icons.DONE,
actionButton: null,
flags: settings.ChromeCleanupCardFlags.NONE,
}
@@ -757,7 +691,6 @@ Polymer({
settings.ChromeCleanerCardState.CLEANING_FAILED, {
title: this.i18n('chromeCleanupTitleErrorCantRemove'),
explanation: this.i18n('chromeCleanupExplanationCleanupError'),
- icon: icons.WARNING,
actionButton: null,
flags: settings.ChromeCleanupCardFlags.NONE,
}
@@ -766,7 +699,6 @@ Polymer({
settings.ChromeCleanerCardState.SCANNING_OFFERED, {
title: this.i18n('chromeCleanupTitleFindAndRemove'),
explanation: this.i18n('chromeCleanupExplanationFindAndRemove'),
- icon: icons.SYSTEM,
actionButton: actionButtons.FIND,
flags: settings.ChromeCleanupCardFlags.SHOW_LOGS_PERMISSIONS,
}
@@ -775,7 +707,6 @@ Polymer({
settings.ChromeCleanerCardState.SCANNING, {
title: this.i18n('chromeCleanupTitleScanning'),
explanation: null,
- icon: null,
actionButton: null,
flags: settings.ChromeCleanupCardFlags.WAITING_FOR_RESULT,
}
@@ -785,7 +716,6 @@ Polymer({
settings.ChromeCleanerCardState.SCANNING_FOUND_NOTHING, {
title: this.i18n('chromeCleanupTitleNothingFound'),
explanation: null,
- icon: icons.DONE,
actionButton: null,
flags: settings.ChromeCleanupCardFlags.NONE,
}
@@ -794,7 +724,6 @@ Polymer({
settings.ChromeCleanerCardState.SCANNING_FAILED, {
title: this.i18n('chromeCleanupTitleScanningFailed'),
explanation: this.i18n('chromeCleanupExplanationScanError'),
- icon: icons.WARNING,
actionButton: null,
flags: settings.ChromeCleanupCardFlags.NONE,
}
@@ -806,7 +735,6 @@ Polymer({
// connectivity and cleanups being disabled by the server.
title: this.i18n('chromeCleanupTitleCleanupUnavailable'),
explanation: this.i18n('chromeCleanupExplanationCleanupUnavailable'),
- icon: icons.WARNING,
actionButton: actionButtons.TRY_SCAN_AGAIN,
flags: settings.ChromeCleanupCardFlags.NONE,
},
diff --git a/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/BUILD.gn b/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/BUILD.gn
index cf04a888e8d..272d36e080d 100644
--- a/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/BUILD.gn
@@ -22,6 +22,7 @@ js_library("clear_browsing_data_dialog") {
deps = [
":clear_browsing_data_browser_proxy",
"../device_page:keyboard",
+ "../people_page:sync_browser_proxy",
"//third_party/polymer/v1_0/components-chromium/iron-pages:iron-pages-extracted",
"//third_party/polymer/v1_0/components-chromium/iron-resizable-behavior:iron-resizable-behavior-extracted",
"//ui/webui/resources/js:cr",
diff --git a/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html b/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html
index 48df5d399b4..ba93834005d 100644
--- a/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html
+++ b/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.html
@@ -2,6 +2,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/paper_tabs_style_css.html">
+<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
@@ -46,6 +47,12 @@
padding-top: 8px;
}
+ #clearBrowsingDataDialog [slot=footer] {
+ background: var(--paper-grey-50);
+ border-top: none;
+ padding: 0;
+ }
+
.row {
align-items: center;
display: flex;
@@ -53,8 +60,8 @@
}
paper-spinner-lite {
- -webkit-margin-end: 16px;
margin-bottom: auto;
+ margin-inline-end: 16px;
margin-top: auto;
}
@@ -81,13 +88,23 @@
}
.time-range-select {
- -webkit-margin-start: 12px;
+ margin-inline-start: 12px;
}
[slot=title] .secondary {
font-size: calc(13 / 15 * 100%);
padding-top: 8px;
}
+
+ .divider {
+ border-top: var(--settings-separator-line);
+ margin: 0 16px;
+ }
+
+ #footer-description {
+ color: var(--cr-secondary-text-color);
+ padding: 16px;
+ }
</style>
<cr-dialog id="clearBrowsingDataDialog"
@@ -127,7 +144,7 @@
pref="{{prefs.browser.clear_data.browsing_history_basic}}"
label="$i18n{clearBrowsingHistory}"
sub-label-html="[[browsingCheckboxLabel_(
- isSignedIn_, isSyncingHistory_,
+ isSignedIn_, isSyncingHistory_, syncStatus.hasError,
'$i18nPolymer{clearBrowsingHistorySummary}',
'$i18nPolymer{clearBrowsingHistorySummarySignedIn}',
'$i18nPolymer{clearBrowsingHistorySummarySynced}')]]"
@@ -239,6 +256,37 @@
$i18n{clearData}
</paper-button>
</div>
+ <div slot="footer"
+ hidden="[[!shouldShowFooter_(syncStatus.signedIn, diceEnabled_)]]">
+ <settings-sync-account-control sync-status="[[syncStatus]]"
+ hide-buttons>
+ </settings-sync-account-control>
+ <div class="divider"></div>
+ <div id="footer-description" on-tap="onSyncDescriptionLinkClicked_">
+ <template is="dom-if" if="[[!syncStatus.hasError]]">
+ <span id="sync-info">
+ $i18nRaw{clearBrowsingDataWithSync}
+ </span>
+ </template>
+ <template is="dom-if" if="[[syncStatus.hasError]]">
+ <template is="dom-if" if="[[isSyncPaused_]]">
+ <span id="sync-paused-info">
+ $i18nRaw{clearBrowsingDataWithSyncPaused}
+ </span>
+ </template>
+ <template is="dom-if" if="[[hasPassphraseError_]]">
+ <span id="sync-passphrase-error-info">
+ $i18nRaw{clearBrowsingDataWithSyncPassphraseError}
+ </span>
+ </template>
+ <template is="dom-if" if="[[hasOtherSyncError_]]">
+ <span id="sync-other-error-info">
+ $i18nRaw{clearBrowsingDataWithSyncError}
+ </span>
+ </template>
+ </template>
+ </div>
+ </div>
</cr-dialog>
<template is="dom-if" if="[[showHistoryDeletionDialog_]]" restamp>
diff --git a/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js b/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js
index fd323fc5f5a..a3e35cf4a9e 100644
--- a/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js
+++ b/chromium/chrome/browser/resources/settings/clear_browsing_data_dialog/clear_browsing_data_dialog.js
@@ -21,6 +21,12 @@ Polymer({
},
/**
+ * The current sync status, supplied by SyncBrowserProxy.
+ * @type {?settings.SyncStatus}
+ */
+ syncStatus: Object,
+
+ /**
* Results of browsing data counters, keyed by the suffix of
* the corresponding data type deletion preference, as reported
* by the C++ side.
@@ -94,6 +100,43 @@ Polymer({
value: false,
},
+ /** @private */
+ isSyncPaused_: {
+ type: Boolean,
+ value: false,
+ computed: 'computeIsSyncPaused_(syncStatus)',
+ },
+
+ /** @private */
+ hasPassphraseError_: {
+ type: Boolean,
+ value: false,
+ computed: 'computeHasPassphraseError_(syncStatus)',
+ },
+
+ /** @private */
+ hasOtherSyncError_: {
+ type: Boolean,
+ value: false,
+ computed:
+ 'computeHasOtherError_(syncStatus, isSyncPaused_, hasPassphraseError_)',
+ },
+
+ /**
+ * This flag is used to conditionally show the footer for the dialog.
+ * @private
+ */
+ diceEnabled_: {
+ type: Boolean,
+ value: function() {
+ let diceEnabled = false;
+ // <if expr="not chromeos">
+ diceEnabled = loadTimeData.getBoolean('diceEnabled');
+ // </if>
+ return diceEnabled;
+ },
+ },
+
/**
* Time in ms, when the dialog was opened.
* @private
@@ -109,8 +152,17 @@ Polymer({
/** @private {settings.ClearBrowsingDataBrowserProxy} */
browserProxy_: null,
+ /** @private {?settings.SyncBrowserProxy} */
+ syncBrowserProxy_: null,
+
/** @override */
ready: function() {
+ this.syncBrowserProxy_ = settings.SyncBrowserProxyImpl.getInstance();
+ this.syncBrowserProxy_.getSyncStatus().then(
+ this.handleSyncStatus_.bind(this));
+ this.addWebUIListener(
+ 'sync-status-changed', this.handleSyncStatus_.bind(this));
+
this.addWebUIListener(
'update-sync-state', this.updateSyncState_.bind(this));
this.addWebUIListener(
@@ -128,6 +180,15 @@ Polymer({
},
/**
+ * Handler for when the sync state is pushed from the browser.
+ * @param {?settings.SyncStatus} syncStatus
+ * @private
+ */
+ handleSyncStatus_: function(syncStatus) {
+ this.syncStatus = syncStatus;
+ },
+
+ /**
* Returns true if either clearing is in progress or no data type is selected.
* @param {boolean} clearingInProgress
* @param {boolean} clearButtonDisabled
@@ -193,9 +254,9 @@ Polymer({
* @private
*/
browsingCheckboxLabel_: function(
- isSignedIn, isSyncingHistory, historySummary, historySummarySignedIn,
- historySummarySynced) {
- if (isSyncingHistory) {
+ isSignedIn, isSyncingHistory, hasSyncError, historySummary,
+ historySummarySignedIn, historySummarySynced) {
+ if (isSyncingHistory && !hasSyncError) {
return historySummarySynced;
} else if (isSignedIn) {
return historySummarySignedIn;
@@ -318,4 +379,61 @@ Polymer({
'ClearBrowsingData_SwitchTo_AdvancedTab');
}
},
+
+ /**
+ * Called when the user clicks the link in the footer.
+ * @param {!Event} e
+ * @private
+ */
+ onSyncDescriptionLinkClicked_: function(e) {
+ if (e.target.tagName === 'A') {
+ e.preventDefault();
+ if (!this.syncStatus.hasError) {
+ this.syncBrowserProxy_.pauseSync();
+ return;
+ }
+
+ if (this.isSyncPaused_) {
+ this.syncBrowserProxy_.startSignIn();
+ } else {
+ // In any other error case, navigate to the sync page.
+ settings.navigateTo(settings.routes.SYNC);
+ }
+ }
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ computeIsSyncPaused_: function() {
+ return !!this.syncStatus.hasError &&
+ this.syncStatus.statusAction === settings.StatusAction.REAUTHENTICATE;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ computeHasPassphraseError_: function() {
+ return !!this.syncStatus.hasError &&
+ this.syncStatus.statusAction === settings.StatusAction.ENTER_PASSPHRASE;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ computeHasOtherError_: function() {
+ return !!this.syncStatus.hasError && !this.isSyncPaused_ &&
+ !this.hasPassphraseError_;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ shouldShowFooter_: function() {
+ return this.diceEnabled_ && !!this.syncStatus.signedIn;
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/controls/BUILD.gn b/chromium/chrome/browser/resources/settings/controls/BUILD.gn
index 8e938f25335..7baf0b551a4 100644
--- a/chromium/chrome/browser/resources/settings/controls/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/controls/BUILD.gn
@@ -9,6 +9,7 @@ js_type_check("closure_compile") {
":controlled_button",
":controlled_radio_button",
":extension_controlled_indicator",
+ ":password_prompt_dialog",
":pref_control_behavior",
":settings_boolean_control_behavior",
":settings_checkbox",
@@ -47,6 +48,16 @@ js_library("extension_controlled_indicator") {
]
}
+js_library("password_prompt_dialog") {
+ deps = [
+ "..:route",
+ "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog",
+ "//ui/webui/resources/cr_elements/cr_input:cr_input",
+ ]
+ externs_list = [ "$externs_path/quick_unlock_private.js" ]
+ extra_sources = [ "$interfaces_path/quick_unlock_private_interface.js" ]
+}
+
js_library("pref_control_behavior") {
deps = [
"../prefs:prefs_types",
diff --git a/chromium/chrome/browser/resources/settings/controls/controlled_button.html b/chromium/chrome/browser/resources/settings/controls/controlled_button.html
index f1d81142250..e76e3584ea7 100644
--- a/chromium/chrome/browser/resources/settings/controls/controlled_button.html
+++ b/chromium/chrome/browser/resources/settings/controls/controlled_button.html
@@ -31,14 +31,14 @@
}
:host(:not([end-justified])) cr-policy-pref-indicator {
- -webkit-margin-end: calc(
+ margin-inline-end: calc(
var(--cr-controlled-by-spacing) - var(--justify-margin));
- -webkit-margin-start: var(--cr-controlled-by-spacing);
+ margin-inline-start: var(--cr-controlled-by-spacing);
}
:host([end-justified]) cr-policy-pref-indicator {
- -webkit-margin-end: var(--cr-controlled-by-spacing);
- -webkit-margin-start: calc(
+ margin-inline-end: var(--cr-controlled-by-spacing);
+ margin-inline-start: calc(
var(--cr-controlled-by-spacing) - var(--justify-margin));
order: -1;
}
diff --git a/chromium/chrome/browser/resources/settings/controls/controlled_radio_button.html b/chromium/chrome/browser/resources/settings/controls/controlled_radio_button.html
index a8260c24312..e3b26b4205b 100644
--- a/chromium/chrome/browser/resources/settings/controls/controlled_radio_button.html
+++ b/chromium/chrome/browser/resources/settings/controls/controlled_radio_button.html
@@ -22,7 +22,7 @@
}
cr-policy-pref-indicator {
- -webkit-margin-start: var(--settings-controlled-by-spacing);
+ margin-inline-start: var(--settings-controlled-by-spacing);
/* Enable pointer events for the indicator so :hover works. Disable
* clicks/taps via onIndicatorTap_ so outer on-tap doesn't trigger. */
pointer-events: all;
diff --git a/chromium/chrome/browser/resources/settings/controls/extension_controlled_indicator.html b/chromium/chrome/browser/resources/settings/controls/extension_controlled_indicator.html
index 50e3313c33c..15be87a78f0 100644
--- a/chromium/chrome/browser/resources/settings/controls/extension_controlled_indicator.html
+++ b/chromium/chrome/browser/resources/settings/controls/extension_controlled_indicator.html
@@ -10,23 +10,23 @@
<template>
<style include="settings-shared">
:host {
- -webkit-margin-start: 36px;
align-items: center;
display: flex;
+ margin-inline-start: 36px;
min-height: var(--settings-row-min-height);
}
img {
@apply --cr-icon-height-width;
- -webkit-margin-end: 16px;
+ margin-inline-end: 16px;
}
/* Using ">" operator to ensure that this CSS rule will not accidentally
* be applied to a search highlight span (which is inserted dynamically if
* when search "hit" occurs within this element. */
:host > span {
- -webkit-margin-end: 8px;
flex: 1;
+ margin-inline-end: 8px;
}
</style>
<img role="presentation" src="chrome://extension-icon/[[extensionId]]/40/1">
diff --git a/chromium/chrome/browser/resources/settings/people_page/password_prompt_dialog.html b/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html
index 3425c33c812..b8afbd0e4a8 100644
--- a/chromium/chrome/browser/resources/settings/people_page/password_prompt_dialog.html
+++ b/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.html
@@ -3,8 +3,6 @@
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
-<link rel="import" href="lock_screen_constants.html">
-<link rel="import" href="lock_state_behavior.html">
<link rel="import" href="../settings_shared_css.html">
<dom-module id="settings-password-prompt-dialog">
@@ -23,7 +21,7 @@
<div slot="title">$i18n{passwordPromptTitle}</div>
<div slot="body">
<div class="settings-box first">
- [[selectPasswordPromptEnterPasswordString(hasPinLogin)]]
+ [[passwordPromptText]]
</div>
<cr-input id="passwordInput" type="password"
placeholder="$i18n{passwordPromptPasswordLabel}"
diff --git a/chromium/chrome/browser/resources/settings/people_page/password_prompt_dialog.js b/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.js
index a633c83a40b..2ed8e8b55dd 100644
--- a/chromium/chrome/browser/resources/settings/people_page/password_prompt_dialog.js
+++ b/chromium/chrome/browser/resources/settings/controls/password_prompt_dialog.js
@@ -8,20 +8,15 @@
* 'settings-password-prompt-dialog' shows a dialog which asks for the user to
* enter their password. It validates the password is correct. Once the user has
* entered their account password, the page fires an 'authenticated' event and
- * updates the setModes binding.
- *
- * The setModes binding is a wrapper around chrome.quickUnlockPrivate.setModes
- * which has a prebound account password. The account password by itself is not
- * available for other elements to access.
+ * updates the authToken binding.
*
* Example:
*
* <settings-password-prompt-dialog
* id="passwordPrompt"
- * set-modes="[[setModes]]">
+ * password-prompt-text="{{passwordPromptText}}"
+ * auth-token="{{authToken}}">
* </settings-password-prompt-dialog>
- *
- * this.$.passwordPrompt.open()
*/
(function() {
@@ -30,27 +25,21 @@
Polymer({
is: 'settings-password-prompt-dialog',
- behaviors: [
- LockStateBehavior,
- ],
-
properties: {
/**
- * A wrapper around chrome.quickUnlockPrivate.setModes with the account
- * password already supplied. If this is null, the authentication screen
- * needs to be redisplayed. This property will be cleared after the timeout
- * returned by quickUnlockPrivate.getAuthToken.
- * @type {?Object}
+ * The subtext to be displayed above the password input field. Embedders
+ * may choose to change this value for their specific use case.
+ * @type {string}
*/
- setModes: {
- type: Object,
+ passwordPromptText: {
+ type: String,
notify: true,
},
/**
- * Authentication token used when calling setModes, returned by
- * quickUnlockPrivate.getAuthToken. Reflected to lock-screen.
- * @private
+ * Authentication token returned by quickUnlockPrivate.getAuthToken().
+ * Should be passed to API calls which require authentication.
+ * @type {string}
*/
authToken: {
type: String,
@@ -58,17 +47,17 @@ Polymer({
},
/**
- * @private
+ * @private {string}
*/
inputValue_: {
- type: Boolean,
+ type: String,
value: '',
observer: 'onInputValueChange_',
},
/**
* Helper property which marks password as valid/invalid.
- * @private
+ * @private {boolean}
*/
passwordInvalid_: {
type: Boolean,
@@ -76,18 +65,11 @@ Polymer({
},
/**
- * writeUma_ is a function that handles writing uma stats. It may be
- * overridden for tests.
- *
- * @type {Function}
- * @private
+ * Interface for chrome.quickUnlockPrivate calls. May be overridden by
+ * tests.
+ * @type {QuickUnlockPrivate}
*/
- writeUma_: {
- type: Object,
- value: function() {
- return settings.recordLockScreenProgress;
- }
- },
+ quickUnlockPrivate: {type: Object, value: chrome.quickUnlockPrivate},
},
/** @return {!CrInputElement} */
@@ -97,13 +79,14 @@ Polymer({
/** @override */
attached: function() {
- this.writeUma_(LockScreenProgress.START_SCREEN_LOCK);
this.$.dialog.showModal();
// This needs to occur at the next paint otherwise the password input will
// not receive focus.
this.async(() => {
+ // TODO(crbug.com/876377): This is unusual; the 'autofocus' attribute on
+ // the cr-input element should work. Investigate.
this.passwordInput.focus();
- }, 1);
+ }, 1 /* waitTime */);
},
/** @private */
@@ -113,11 +96,18 @@ Polymer({
},
/**
+ * The timeout ID to pass to clearTimeout() to cancel auth token
+ * invalidation.
+ * @private {number|undefined}
+ */
+ clearAccountPasswordTimeoutId_: undefined,
+
+ /**
* Run the account password check.
* @private
*/
submitPassword_: function() {
- clearTimeout(this.clearAccountPasswordTimeout_);
+ clearTimeout(this.clearAccountPasswordTimeoutId_);
const password = this.passwordInput.value;
// The user might have started entering a password and then deleted it all.
@@ -138,35 +128,19 @@ Polymer({
this.authToken = tokenInfo.token;
this.passwordInvalid_ = false;
- // Create the |this.setModes| closure and automatically clear it after
- // tokenInfo.lifetimeSeconds.
- this.setModes = (modes, credentials, onComplete) => {
- this.quickUnlockPrivate.setModes(
- tokenInfo.token, modes, credentials, () => {
- let result = true;
- if (chrome.runtime.lastError) {
- console.error(
- 'setModes failed: ' + chrome.runtime.lastError.message);
- result = false;
- }
- onComplete(result);
- });
- };
-
- // Subtract time from the exiration time to account for IPC delays.
+ // Clear |this.authToken| after tokenInfo.lifetimeSeconds.
+ // Subtract time from the expiration time to account for IPC delays.
// Treat values less than the minimum as 0 for testing.
const IPC_SECONDS = 2;
const lifetimeMs = tokenInfo.lifetimeSeconds > IPC_SECONDS ?
(tokenInfo.lifetimeSeconds - IPC_SECONDS) * 1000 :
0;
- this.clearAccountPasswordTimeout_ = setTimeout(() => {
- this.setModes = null;
+ this.clearAccountPasswordTimeoutId_ = setTimeout(() => {
+ this.authToken = '';
}, lifetimeMs);
if (this.$.dialog.open)
this.$.dialog.close();
-
- this.writeUma_(LockScreenProgress.ENTER_PASSWORD_CORRECTLY);
});
},
@@ -179,16 +153,5 @@ Polymer({
isConfirmEnabled_: function() {
return !this.passwordInvalid_ && this.inputValue_;
},
-
- /**
- * Looks up the translation id, which depends on PIN login support.
- * @param {boolean} hasPinLogin
- * @private
- */
- selectPasswordPromptEnterPasswordString(hasPinLogin) {
- if (hasPinLogin)
- return this.i18n('passwordPromptEnterPasswordLoginLock');
- return this.i18n('passwordPromptEnterPasswordLock');
- },
});
})();
diff --git a/chromium/chrome/browser/resources/settings/controls/settings_checkbox.html b/chromium/chrome/browser/resources/settings/controls/settings_checkbox.html
index ec8f7cfed6e..d8856d5402e 100644
--- a/chromium/chrome/browser/resources/settings/controls/settings_checkbox.html
+++ b/chromium/chrome/browser/resources/settings/controls/settings_checkbox.html
@@ -27,7 +27,7 @@
}
cr-policy-pref-indicator {
- -webkit-margin-start: var(--settings-controlled-by-spacing);
+ margin-inline-start: var(--settings-controlled-by-spacing);
}
</style>
<div id="outerRow" noSubLabel$="[[!hasSubLabel_(subLabel, subLabelHtml)]]">
diff --git a/chromium/chrome/browser/resources/settings/controls/settings_slider.html b/chromium/chrome/browser/resources/settings/controls/settings_slider.html
index c1015b40593..f58423c9724 100644
--- a/chromium/chrome/browser/resources/settings/controls/settings_slider.html
+++ b/chromium/chrome/browser/resources/settings/controls/settings_slider.html
@@ -9,15 +9,15 @@
<style>
:host {
--calculated-paper-slider-height: var(--paper-slider-height, 2px);
+ display: inline-flex;
/* Counteract the margin on #sliderContainer in paper-slider.html. */
- -webkit-margin-end:
+ margin-inline-end:
calc(-15px - var(--calculated-paper-slider-height) / 2);
- display: inline-flex;
}
cr-policy-pref-indicator {
- -webkit-margin-start: var(--settings-controlled-by-spacing);
align-self: center;
+ margin-inline-start: var(--settings-controlled-by-spacing);
}
#labels[disabled] {
@@ -44,7 +44,7 @@
}
#label-begin {
- -webkit-margin-end: 4px;
+ margin-inline-end: 4px;
}
#label-end {
diff --git a/chromium/chrome/browser/resources/settings/controls/settings_toggle_button.html b/chromium/chrome/browser/resources/settings/controls/settings_toggle_button.html
index 0965fc374fa..dcf511439de 100644
--- a/chromium/chrome/browser/resources/settings/controls/settings_toggle_button.html
+++ b/chromium/chrome/browser/resources/settings/controls/settings_toggle_button.html
@@ -46,11 +46,11 @@
#labelWrapper,
::slotted([slot='more-actions']) {
- -webkit-margin-end: var(--settings-control-label-spacing);
+ margin-inline-end: var(--settings-control-label-spacing);
}
cr-policy-pref-indicator {
- -webkit-margin-end: var(--settings-controlled-by-spacing);
+ margin-inline-end: var(--settings-controlled-by-spacing);
}
</style>
<div id="outerRow" noSubLabel$="[[!subLabel]]">
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
index e2953defea0..2ae2ba3226e 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
+++ b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
@@ -20,7 +20,7 @@
}
#timeZoneResolveMethodDropdown,
#timezoneSelector {
- -webkit-padding-start: 28px;
+ padding-inline-start: 28px;
}
</style>
<div class="settings-box block first">
diff --git a/chromium/chrome/browser/resources/settings/device_page/device_page.html b/chromium/chrome/browser/resources/settings/device_page/device_page.html
index 7d8d94f311d..d9a55adb6d6 100644
--- a/chromium/chrome/browser/resources/settings/device_page/device_page.html
+++ b/chromium/chrome/browser/resources/settings/device_page/device_page.html
@@ -57,8 +57,8 @@
<button aria-label="$i18n{displayTitle}"></button>
</paper-icon-button-light>
</div>
- <div id="storageRow" class="settings-box" on-click="onStorageTap_"
- actionable>
+ <div id="storageRow" hidden="[[hideStorageInfo_]]" class="settings-box"
+ on-click="onStorageTap_" actionable>
<div class="start">$i18n{storageTitle}</div>
<paper-icon-button-light class="subpage-arrow">
<button aria-label="$i18n{storageTitle}"></button>
diff --git a/chromium/chrome/browser/resources/settings/device_page/device_page.js b/chromium/chrome/browser/resources/settings/device_page/device_page.js
index 2dac5e6137f..46c32cde32e 100644
--- a/chromium/chrome/browser/resources/settings/device_page/device_page.js
+++ b/chromium/chrome/browser/resources/settings/device_page/device_page.js
@@ -54,6 +54,19 @@ Polymer({
readOnly: true,
},
+ /**
+ * Whether storage management info should be hidden.
+ * @private
+ */
+ hideStorageInfo_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.valueExists('hideStorageInfo') &&
+ loadTimeData.getBoolean('hideStorageInfo');
+ },
+ readOnly: true,
+ },
+
/** @private {!Map<string, string>} */
focusConfig_: {
type: Object,
diff --git a/chromium/chrome/browser/resources/settings/device_page/display.html b/chromium/chrome/browser/resources/settings/device_page/display.html
index 577ec094628..f271dcdc49b 100644
--- a/chromium/chrome/browser/resources/settings/device_page/display.html
+++ b/chromium/chrome/browser/resources/settings/device_page/display.html
@@ -26,8 +26,8 @@
<template>
<style include="settings-shared md-select iron-flex iron-flex-alignment paper-tabs-style">
.indented {
- -webkit-margin-start: var(--cr-section-indent-padding);
align-self: stretch;
+ margin-inline-start: var(--cr-section-indent-padding);
padding: 0;
}
@@ -52,7 +52,7 @@
}
.settings-box > paper-button:first-child {
- -webkit-padding-start: 0
+ padding-inline-start: 0
}
#controlsDiv > .settings-box:first-of-type {
@@ -137,57 +137,39 @@
</div>
</template>
- <!-- Slider for selecting resolution when display zoom is disabled -->
- <template is="dom-if" if="[[!showDisplayZoomSetting_]]">
- <div class="settings-box indented two-line">
- <div class="start text-area layout vertical">
- <div>$i18n{displayResolutionTitle}</div>
- <div class="secondary self-start">
- [[getResolutionText_(selectedDisplay, selectedModePref_.value)]]
- </div>
- </div>
- <settings-slider disabled="[[!enableSetResolution_(selectedDisplay)]]"
- tick-values="[[modeValues_]]" pref="{{selectedModePref_}}"
- on-change="onSelectedModeSliderChange_">
- </settings-slider>
- </div>
- </template>
-
<!-- Display zoom selection slider -->
- <template is="dom-if" if="[[showDisplayZoomSetting_]]">
- <div class="settings-box indented two-line">
- <div class="start text-area layout vertical">
- <div>$i18n{displayZoomTitle}</div>
- <div class="secondary self-start">$i18n{displayZoomSublabel}</div>
- <div class="secondary self-start"
- hidden$="[[!logicalResolutionText_]]">
- [[logicalResolutionText_]]
- </div>
+ <div class="settings-box indented two-line">
+ <div class="start text-area layout vertical">
+ <div>$i18n{displayZoomTitle}</div>
+ <div class="secondary self-start">$i18n{displayZoomSublabel}</div>
+ <div class="secondary self-start"
+ hidden$="[[!logicalResolutionText_]]">
+ [[logicalResolutionText_]]
</div>
- <display-size-slider id="displaySizeSlider"
- ticks="[[zoomValues_]]" pref="{{selectedZoomPref_}}"
- min-label="$i18n{displaySizeSliderMinLabel}"
- max-label="$i18n{displaySizeSliderMaxLabel}"
- on-immediate-value-changed="onDisplaySizeSliderDrag_">
- </display-size-slider>
</div>
+ <display-size-slider id="displaySizeSlider"
+ ticks="[[zoomValues_]]" pref="{{selectedZoomPref_}}"
+ min-label="$i18n{displaySizeSliderMinLabel}"
+ max-label="$i18n{displaySizeSliderMaxLabel}"
+ on-immediate-value-changed="onDisplaySizeSliderDrag_">
+ </display-size-slider>
+ </div>
- <!-- Drop down select menu for resolution -->
- <div class="settings-box indented two-line"
- hidden$="[[!showDropDownResolutionSetting_(selectedDisplay)]]">
- <div class="start text-area layout vertical">
- <div>$i18n{displayResolutionTitle}</div>
- <div class="secondary self-start">
- $i18n{displayResolutionSublabel}
- </div>
+ <!-- Drop down select menu for resolution -->
+ <div class="settings-box indented two-line"
+ hidden$="[[!showDropDownResolutionSetting_(selectedDisplay)]]">
+ <div class="start text-area layout vertical">
+ <div>$i18n{displayResolutionTitle}</div>
+ <div class="secondary self-start">
+ $i18n{displayResolutionSublabel}
</div>
- <settings-dropdown-menu id="displayModeSelector"
- pref="{{selectedModePref_}}"
- label="Display Mode Menu"
- menu-options="[[displayModeList_]]">
- </settings-dropdown-menu>
</div>
- </template>
+ <settings-dropdown-menu id="displayModeSelector"
+ pref="{{selectedModePref_}}"
+ label="Display Mode Menu"
+ menu-options="[[displayModeList_]]">
+ </settings-dropdown-menu>
+ </div>
<template is="dom-if" if="[[!unifiedDesktopMode_]]" restamp>
<div class="settings-box indented">
<div id="displayOrientation" class="start text-area">
diff --git a/chromium/chrome/browser/resources/settings/device_page/display.js b/chromium/chrome/browser/resources/settings/device_page/display.js
index 3443c71cd57..cde11aeae41 100644
--- a/chromium/chrome/browser/resources/settings/device_page/display.js
+++ b/chromium/chrome/browser/resources/settings/device_page/display.js
@@ -170,12 +170,6 @@ Polymer({
},
/** @private */
- showDisplayZoomSetting_: {
- type: Boolean,
- value: loadTimeData.getBoolean('enableDisplayZoomSetting'),
- },
-
- /** @private */
nightLightScheduleSubLabel_: String,
/** @private */
@@ -370,14 +364,12 @@ Polymer({
const numModes = selectedDisplay.modes.length;
this.modeValues_ = numModes == 0 ? [] : Array.from(Array(numModes).keys());
- if (this.showDisplayZoomSetting_) {
- // Note that the display zoom values has the same number of ticks for all
- // displays, so the above problem doesn't apply here.
- this.zoomValues_ = this.getZoomValues_(selectedDisplay);
- this.set(
- 'selectedZoomPref_.value',
- this.getSelectedDisplayZoom_(selectedDisplay));
- }
+ // Note that the display zoom values has the same number of ticks for all
+ // displays, so the above problem doesn't apply here.
+ this.zoomValues_ = this.getZoomValues_(selectedDisplay);
+ this.set(
+ 'selectedZoomPref_.value',
+ this.getSelectedDisplayZoom_(selectedDisplay));
this.displayModeList_ = this.getDisplayModeOptionList_(selectedDisplay);
// Set |selectedDisplay| first since only the resolution slider depends
@@ -401,8 +393,7 @@ Polymer({
* @private
*/
showDropDownResolutionSetting_: function(display) {
- return !display.isInternal &&
- loadTimeData.getBoolean('enableDisplayZoomSetting');
+ return !display.isInternal;
},
/**
@@ -600,7 +591,7 @@ Polymer({
* @private
*/
updateLogicalResolutionText_: function(zoomFactor) {
- if (!this.showDisplayZoomSetting_ || !this.selectedDisplay.isInternal) {
+ if (!this.selectedDisplay.isInternal) {
this.logicalResolutionText_ = '';
return;
}
@@ -718,11 +709,7 @@ Polymer({
*/
onSelectedModeChange_: function(newModeIndex) {
// We want to ignore all value changes to the pref due to the slider being
- // dragged. Since this can only happen when the slider is present which is
- // when display zoom is disabled, we can use this check.
- // See http://crbug/845712 for more info.
- if (!this.showDisplayZoomSetting_)
- return;
+ // dragged. See http://crbug/845712 for more info.
if (this.currentSelectedModeIndex_ == newModeIndex)
return;
this.onSelectedModeSliderChange_();
diff --git a/chromium/chrome/browser/resources/settings/device_page/display_size_slider.html b/chromium/chrome/browser/resources/settings/device_page/display_size_slider.html
index 631200d711c..93757c4ef6f 100644
--- a/chromium/chrome/browser/resources/settings/device_page/display_size_slider.html
+++ b/chromium/chrome/browser/resources/settings/device_page/display_size_slider.html
@@ -14,13 +14,14 @@
<template>
<style>
:host {
- /* Counteract the margin on #sliderContainer and match the margin from
- settings-slider.html */
- -webkit-margin-end: -16px;
-
cursor: default;
display: inline-flex;
font-weight: 500;
+
+ /* Counteract the margin on #sliderContainer and match the margin from
+ settings-slider.html */
+ margin-inline-end: -16px;
+
min-width: 200px;
text-align: center;
user-select: none;
@@ -142,14 +143,12 @@
.slider-knob-inner {
background-color: var(--google-blue-600);
- border: 2px solid var(--google-blue-600);
+ border: 0;
border-radius: 50%;
- box-sizing: border-box;
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
+ box-sizing: content-box;
height: 10px;
margin: 11px;
- transition-duration: 180ms;
- transition-property: transform, background-color, border;
- transition-timing-function: ease;
width: 10px;
}
@@ -192,6 +191,8 @@
.slider-knob-inner[disabled] {
background-color: var(--google-grey-600);
border: 2px solid white;
+ box-shadow: unset;
+ margin: 9px;
}
</style>
<div id="sliderContainer" class$="[[getClassNames_(disabled, dragging)]]">
diff --git a/chromium/chrome/browser/resources/settings/device_page/display_size_slider.js b/chromium/chrome/browser/resources/settings/device_page/display_size_slider.js
index 924c9bfd5ff..7dd8f904aaa 100644
--- a/chromium/chrome/browser/resources/settings/device_page/display_size_slider.js
+++ b/chromium/chrome/browser/resources/settings/device_page/display_size_slider.js
@@ -128,6 +128,16 @@ Polymer({
'pageup end': 'resetToMaxIndex_',
},
+ /** @override */
+ ready: function() {
+ chrome.settingsPrivate.onPrefsChanged.addListener((prefs) => {
+ prefs.forEach((pref) => {
+ if (pref.key == this.pref.key && this.pref.value != pref.value)
+ this.pref.value = pref.value;
+ });
+ });
+ },
+
/** @private {boolean} */
usedMouse_: false,
@@ -469,18 +479,20 @@ Polymer({
updateIndex_: function() {
if (!this.ticks || this.ticks.length == 0)
return;
- if (!this.pref)
+ if (!this.pref || typeof(this.pref.value) != 'number')
return;
+ let resolvedTick = this.ticks.length - 1;
for (let i = 0; i < this.ticks.length; i++) {
- if (this.ticks[i].value == this.pref.value) {
- this._setIndex(i);
- this.setAttribute(
- 'aria-valuenow',
- this.getAriaValueForIndex_(this.ticks, this.index));
- this.setAttribute(
- 'aria-valuetext', this.getLabelForIndex_(this.ticks, this.index));
+ if (this.ticks[i].value >= this.pref.value) {
+ resolvedTick = i;
+ break;
}
}
+ this._setIndex(resolvedTick);
+ this.setAttribute(
+ 'aria-valuenow', this.getAriaValueForIndex_(this.ticks, this.index));
+ this.setAttribute(
+ 'aria-valuetext', this.getLabelForIndex_(this.ticks, this.index));
},
/**
diff --git a/chromium/chrome/browser/resources/settings/device_page/keyboard.html b/chromium/chrome/browser/resources/settings/device_page/keyboard.html
index 6f88254da9c..415d4d62a62 100644
--- a/chromium/chrome/browser/resources/settings/device_page/keyboard.html
+++ b/chromium/chrome/browser/resources/settings/device_page/keyboard.html
@@ -34,15 +34,6 @@
menu-options="[[keyMapTargets_]]">
</settings-dropdown-menu>
</div>
- <template is="dom-if" if="[[showCapsLock_]]">
- <div class="settings-box" id="capsLockKey">
- <div class="start">$i18n{keyboardKeyCapsLock}</div>
- <settings-dropdown-menu label="$i18n{keyboardKeyCapsLock}"
- pref="{{prefs.settings.language.remap_caps_lock_key_to}}"
- menu-options="[[keyMapTargets_]]">
- </settings-dropdown-menu>
- </div>
- </template>
<template is="dom-if" if="[[showDiamondKey_]]">
<div class="settings-box" id="diamondKey">
<div class="start">$i18n{keyboardKeyDiamond}</div>
@@ -66,6 +57,34 @@
menu-options="[[keyMapTargets_]]">
</settings-dropdown-menu>
</div>
+ <template is="dom-if" if="[[showCapsLock_]]">
+ <div class="settings-box" id="capsLockKey">
+ <div class="start">$i18n{keyboardKeyCapsLock}</div>
+ <settings-dropdown-menu label="$i18n{keyboardKeyCapsLock}"
+ pref="{{prefs.settings.language.remap_caps_lock_key_to}}"
+ menu-options="[[keyMapTargets_]]">
+ </settings-dropdown-menu>
+ </div>
+ </template>
+ <template is="dom-if" if="[[showExternalMetaKey_]]">
+ <div class="settings-box" id="externalMetaKey">
+ <div class="start">$i18n{keyboardKeyExternalMeta}</div>
+ <settings-dropdown-menu label="$i18n{keyboardKeyExternalMeta}"
+ pref="{{prefs.settings.language.remap_external_meta_key_to}}"
+ menu-options="[[keyMapTargets_]]">
+ </settings-dropdown-menu>
+ </div>
+ </template>
+ <template is="dom-if" if="[[showAppleCommandKey_]]">
+ <div class="settings-box" id="externalCommandKey">
+ <div class="start">$i18n{keyboardKeyExternalCommand}</div>
+ <settings-dropdown-menu
+ label="$i18n{keyboardKeyExternalCommand}"
+ pref="{{prefs.settings.language.remap_external_command_key_to}}"
+ menu-options="[[keyMapTargets_]]">
+ </settings-dropdown-menu>
+ </div>
+ </template>
<settings-toggle-button
pref="{{prefs.settings.language.send_function_keys}}"
label="$i18n{keyboardSendFunctionKeys}"
diff --git a/chromium/chrome/browser/resources/settings/device_page/keyboard.js b/chromium/chrome/browser/resources/settings/device_page/keyboard.js
index e10766d145b..204013c2fd2 100644
--- a/chromium/chrome/browser/resources/settings/device_page/keyboard.js
+++ b/chromium/chrome/browser/resources/settings/device_page/keyboard.js
@@ -39,6 +39,21 @@ Polymer({
/** @private Whether to show diamond key options. */
showDiamondKey_: Boolean,
+ /**
+ * Whether to show a remapping option for external keyboard's Meta key
+ * (Search/Windows keys). This is true only when there's an external
+ * keyboard connected that is a non-Apple keyboard.
+ * @private
+ */
+ showExternalMetaKey_: Boolean,
+
+ /**
+ * Whether to show a remapping option for the Command key. This is true when
+ * one of the connected keyboards is an Apple keyboard.
+ * @private
+ */
+ showAppleCommandKey_: Boolean,
+
/** @private {!DropdownMenuOptionList} Menu items for key mapping. */
keyMapTargets_: Object,
@@ -114,13 +129,14 @@ Polymer({
/**
* Handler for updating which keys to show.
- * @param {boolean} showCapsLock
- * @param {boolean} showDiamondKey
+ * @param {Object} keyboardParams
* @private
*/
- onShowKeysChange_: function(showCapsLock, showDiamondKey) {
- this.showCapsLock_ = showCapsLock;
- this.showDiamondKey_ = showDiamondKey;
+ onShowKeysChange_: function(keyboardParams) {
+ this.showCapsLock_ = keyboardParams['showCapsLock'];
+ this.showDiamondKey_ = keyboardParams['showDiamondKey'];
+ this.showExternalMetaKey_ = keyboardParams['showExternalMetaKey'];
+ this.showAppleCommandKey_ = keyboardParams['showAppleCommandKey'];
},
onShowKeyboardShortcutsOverlayTap_: function() {
diff --git a/chromium/chrome/browser/resources/settings/device_page/pointers.html b/chromium/chrome/browser/resources/settings/device_page/pointers.html
index 0595aa2bf6e..0ae8891c9cc 100644
--- a/chromium/chrome/browser/resources/settings/device_page/pointers.html
+++ b/chromium/chrome/browser/resources/settings/device_page/pointers.html
@@ -11,12 +11,12 @@
<template>
<style include="settings-shared">
h2 {
- -webkit-padding-start: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-padding);
}
.subsection {
- -webkit-padding-end: var(--settings-box-row-padding);
- -webkit-padding-start: var(--settings-box-row-indent);
+ padding-inline-end: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-indent);
}
.subsection > settings-toggle-button,
diff --git a/chromium/chrome/browser/resources/settings/device_page/storage.html b/chromium/chrome/browser/resources/settings/device_page/storage.html
index 27bef12bff6..7b7c8d91bc8 100644
--- a/chromium/chrome/browser/resources/settings/device_page/storage.html
+++ b/chromium/chrome/browser/resources/settings/device_page/storage.html
@@ -55,20 +55,20 @@
}
.message-area {
- -webkit-padding-end: 48px;
- -webkit-padding-start: 16px;
background-color: var(--google-grey-100);
border-radius: 2px;
display: flex;
margin: 14px 0 16px;
padding-bottom: 12px;
+ padding-inline-end: 48px;
+ padding-inline-start: 16px;
padding-top: 16px;
width: 100%;
}
.message-area > iron-icon {
- -webkit-padding-end: 16px;
flex: none;
+ padding-inline-end: 16px;
}
.message-title {
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/BUILD.gn b/chromium/chrome/browser/resources/settings/downloads_page/BUILD.gn
index 77ad172d70c..a4c1ddd2ed5 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/downloads_page/BUILD.gn
@@ -24,6 +24,7 @@ js_library("downloads_browser_proxy") {
js_library("smb_shares_page") {
deps = [
":add_smb_share_dialog",
+ "..:route",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
}
@@ -32,6 +33,7 @@ js_library("add_smb_share_dialog") {
deps = [
":smb_browser_proxy",
"//ui/webui/resources/js:i18n_behavior",
+ "//ui/webui/resources/js:web_ui_listener_behavior",
]
}
@@ -47,6 +49,7 @@ js_library("downloads_page") {
":smb_browser_proxy",
"..:page_visibility",
"..:route",
+ "../prefs:prefs_behavior",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util",
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.html b/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.html
index 155c13f9f75..5dab706aaa2 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.html
+++ b/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.html
@@ -2,7 +2,9 @@
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
+<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
@@ -11,12 +13,21 @@
<dom-module id="settings-add-smb-share-dialog">
<template>
<style include="settings-shared">
+ #dialog [slot=body] {
+ height: 350px;
+ }
+
cr-input {
--cr-input-error-display: none;
- width: var(--settings-input-max-width);
}
- cr-input:not(:last-child) {
+ cr-searchable-drop-down {
+ display: block;
+ --cr-searchable-drop-down-width: 472px;
+ }
+
+ cr-input:not(:last-child),
+ cr-searchable-drop-down {
margin-bottom: var(--cr-form-field-bottom-spacing);
}
</style>
@@ -24,9 +35,10 @@
<cr-dialog id="dialog">
<div slot="title">$i18n{addSmbShare}</div>
<div slot="body" spellcheck="false">
- <cr-input id="address" label="$i18n{smbShareUrl}" value="{{mountUrl_}}"
- autofocus>
- </cr-input>
+ <cr-searchable-drop-down id="address" label="$i18n{smbShareUrl}"
+ value="{{mountUrl_}}" items="[[discoveredShares_]]"
+ update-value-on-input autofocus>
+ </cr-searchable-drop-down>
<cr-input id="name" label="$i18n{smbShareName}" value="{{mountName_}}"
maxlength="64">
</cr-input>
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.js b/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.js
index 0156d6df0fc..67273f283d3 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.js
+++ b/chromium/chrome/browser/resources/settings/downloads_page/add_smb_share_dialog.js
@@ -9,18 +9,39 @@
Polymer({
is: 'settings-add-smb-share-dialog',
+ behaviors: [WebUIListenerBehavior],
+
properties: {
/** @private {string} */
- mountUrl_: String,
+ mountUrl_: {
+ type: String,
+ value: '',
+ },
/** @private {string} */
- mountName_: String,
+ mountName_: {
+ type: String,
+ value: '',
+ },
/** @private {string} */
- username_: String,
+ username_: {
+ type: String,
+ value: '',
+ },
/** @private {string} */
- password_: String,
+ password_: {
+ type: String,
+ value: '',
+ },
+ /** @private {!Array<string>}*/
+ discoveredShares_: {
+ type: Array,
+ value: function() {
+ return [];
+ },
+ },
},
/** @private {?settings.SmbBrowserProxy} */
@@ -35,6 +56,8 @@ Polymer({
attached: function() {
this.browserProxy_.startDiscovery();
this.$.dialog.showModal();
+
+ this.addWebUIListener('on-shares-found', this.onSharesFound_.bind(this));
},
/** @private */
@@ -56,4 +79,13 @@ Polymer({
canAddShare_: function() {
return !!this.mountUrl_;
},
+
+ /**
+ * @param {!Array<string>} shares
+ * @private
+ */
+ onSharesFound_: function(shares) {
+ this.discoveredShares_ = this.discoveredShares_.concat(shares);
+ },
+
});
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/downloads_browser_proxy.js b/chromium/chrome/browser/resources/settings/downloads_page/downloads_browser_proxy.js
index 88c41dbafbc..0ce7ea25259 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/downloads_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/downloads_page/downloads_browser_proxy.js
@@ -8,6 +8,13 @@ cr.define('settings', function() {
initializeDownloads() {}
selectDownloadLocation() {}
resetAutoOpenFileTypes() {}
+ // <if expr="chromeos">
+ /**
+ * @param {string} path path to sanitze.
+ * @return {!Promise<string>} string to display in UI.
+ */
+ getDownloadLocationText(path) {}
+ // </if>
}
/**
@@ -28,6 +35,13 @@ cr.define('settings', function() {
resetAutoOpenFileTypes() {
chrome.send('resetAutoOpenFileTypes');
}
+
+ // <if expr="chromeos">
+ /** @override */
+ getDownloadLocationText(path) {
+ return cr.sendWithPromise('getDownloadLocationText', path);
+ }
+ // </if>
}
cr.addSingletonGetter(DownloadsBrowserProxyImpl);
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.html b/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.html
index 90e4ca90487..69dbf529286 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.html
+++ b/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.html
@@ -4,6 +4,7 @@
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="../controls/controlled_button.html">
<link rel="import" href="../controls/settings_toggle_button.html">
+<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="downloads_browser_proxy.html">
@@ -24,12 +25,12 @@
<div class="settings-box first two-line">
<div class="start">
<div>$i18n{downloadLocation}</div>
- <div class="secondary">
+ <div class="secondary" id="defaultDownloadPath">
<if expr="not chromeos">
[[prefs.download.default_directory.value]]
</if>
<if expr="chromeos">
- [[getDownloadLocation_(prefs.download.default_directory.value)]]
+ [[downloadLocation_]]
</if>
</div>
</div>
@@ -80,7 +81,7 @@
<settings-subpage
associated-control="[[$$('#smbShares')]]"
page-title="$i18n{smbSharesTitle}">
- <settings-smb-shares-page>
+ <settings-smb-shares-page prefs="[[prefs]]">
</settings-smb-shares-page>
</settings-subpage>
</template>
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.js b/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.js
index 11a50db0904..11c89e7c8c4 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.js
+++ b/chromium/chrome/browser/resources/settings/downloads_page/downloads_page.js
@@ -18,7 +18,7 @@
Polymer({
is: 'settings-downloads-page',
- behaviors: [WebUIListenerBehavior],
+ behaviors: [WebUIListenerBehavior, PrefsBehavior],
properties: {
/**
@@ -53,6 +53,11 @@ Polymer({
},
readOnly: true,
},
+
+ /**
+ * The download location string that is suitable to display in the UI.
+ */
+ downloadLocation_: String,
// </if>
/** @private {!Map<string, string>} */
@@ -73,13 +78,22 @@ Polymer({
},
+ // <if expr="chromeos">
+ observers: [
+ 'handleDownloadLocationChanged_(prefs.download.default_directory.value)'
+ ],
+ // </if>
+
/** @private {?settings.DownloadsBrowserProxy} */
browserProxy_: null,
/** @override */
- attached: function() {
+ created: function() {
this.browserProxy_ = settings.DownloadsBrowserProxyImpl.getInstance();
+ },
+ /** @override */
+ ready: function() {
this.addWebUIListener('auto-open-downloads-changed', autoOpen => {
this.autoOpenDownloads_ = autoOpen;
});
@@ -99,25 +113,17 @@ Polymer({
onTapSmbShares_: function() {
settings.navigateTo(settings.routes.SMB_SHARES);
},
- // </if>
-
- // <if expr="chromeos">
/**
- * @param {string} path
- * @return {string} The download location string that is suitable to display
- * in the UI.
* @private
*/
- getDownloadLocation_: function(path) {
- // Replace /special/drive-<hash>/root with "Google Drive" for remote files,
- // /home/chronos/user/Downloads or /home/chronos/u-<hash>/Downloads with
- // "Downloads" for local paths, and '/' with ' \u203a ' (angled quote sign)
- // everywhere. It is used only for display purpose.
- path = path.replace(/^\/special\/drive[^\/]*\/root/, 'Google Drive');
- path = path.replace(/^\/home\/chronos\/(user|u-[^\/]*)\//, '');
- path = path.replace(/\//g, ' \u203a ');
- return path;
+ handleDownloadLocationChanged_: function() {
+ this.browserProxy_
+ .getDownloadLocationText(/** @type {string} */ (
+ this.getPref('download.default_directory').value))
+ .then(text => {
+ this.downloadLocation_ = text;
+ });
},
// </if>
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/smb_browser_proxy.js b/chromium/chrome/browser/resources/settings/downloads_page/smb_browser_proxy.js
index e32cc6e4a62..5085ce6b042 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/smb_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/downloads_page/smb_browser_proxy.js
@@ -19,6 +19,7 @@ const SmbMountResult = {
NOT_FOUND: 3,
UNSUPPORTED_DEVICE: 4,
MOUNT_EXISTS: 5,
+ INVALID_URL: 6,
};
cr.define('settings', function() {
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.html b/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.html
index 83406eaf117..584488ae30d 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.html
+++ b/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.html
@@ -7,6 +7,7 @@
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/html/md_select_css.html">
+<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
<link rel="import" href="add_smb_share_dialog.html">
@@ -17,15 +18,23 @@
<div class="settings-box first">
<div class="start">
<span>$i18n{smbSharesLearnMoreLabel}</span>
- <a href="http://support.google.com" target="_blank">
+ <a href="$i18n{smbSharesLearnMoreURL}" target="_blank">
$i18n{learnMore}
</a>
<div class="secondary" hidden="false">
$i18n{requireNetworkMessage}
</div>
</div>
+ <template is="dom-if" if="[[!prefs.network_file_shares.allowed.value]]"
+ restamp>
+ <cr-policy-pref-indicator
+ pref="[[prefs.network_file_shares.allowed]]"
+ icon-aria-label="$i18n{smbSharesTitle}">
+ </cr-policy-pref-indicator>
+ </template>
<paper-button class="action-button" id="addShare"
- on-click="onAddShareTap_">
+ on-click="onAddShareTap_"
+ disabled="[[!prefs.network_file_shares.allowed.value]]">
$i18n{addSmbShare}
</paper-button>
</div>
diff --git a/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.js b/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.js
index 04829640903..f9a8ecc35d1 100644
--- a/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.js
+++ b/chromium/chrome/browser/resources/settings/downloads_page/smb_shares_page.js
@@ -5,9 +5,20 @@
Polymer({
is: 'settings-smb-shares-page',
- behaviors: [WebUIListenerBehavior],
+ behaviors: [
+ WebUIListenerBehavior,
+ settings.RouteObserverBehavior,
+ ],
properties: {
+ /**
+ * Preferences state.
+ */
+ prefs: {
+ type: Object,
+ notify: true,
+ },
+
/** @private */
showAddSmbDialog_: Boolean,
@@ -15,6 +26,18 @@ Polymer({
addShareResultText_: String,
},
+ /**
+ * Overridden from settings.RouteObserverBehavior.
+ * @param {!settings.Route} route
+ * @protected
+ */
+ currentRouteChanged: function(route) {
+ if (route == settings.routes.SMB_SHARES) {
+ this.showAddSmbDialog_ =
+ settings.getQueryParameters().get('showAddShare') == 'true';
+ }
+ },
+
/** @override */
attached: function() {
this.addWebUIListener('on-add-smb-share', this.onAddShare_.bind(this));
@@ -56,6 +79,10 @@ Polymer({
this.addShareResultText_ =
loadTimeData.getString('smbShareAddedMountExistsMessage');
break;
+ case SmbMountResult.INVALID_URL:
+ this.addShareResultText_ =
+ loadTimeData.getString('smbShareAddedInvalidURLMessage');
+ break;
default:
this.addShareResultText_ =
loadTimeData.getString('smbShareAddedErrorMessage');
diff --git a/chromium/chrome/browser/resources/settings/find_shortcut_behavior.html b/chromium/chrome/browser/resources/settings/find_shortcut_behavior.html
index 4fedd0e11f1..50b4f350f43 100644
--- a/chromium/chrome/browser/resources/settings/find_shortcut_behavior.html
+++ b/chromium/chrome/browser/resources/settings/find_shortcut_behavior.html
@@ -1,4 +1,4 @@
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
+<link rel="import" href="chrome://resources/html/cr/ui/command.html">
<script src="find_shortcut_behavior.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/find_shortcut_behavior.js b/chromium/chrome/browser/resources/settings/find_shortcut_behavior.js
index 51103e5b683..0beae62528a 100644
--- a/chromium/chrome/browser/resources/settings/find_shortcut_behavior.js
+++ b/chromium/chrome/browser/resources/settings/find_shortcut_behavior.js
@@ -3,49 +3,80 @@
// found in the LICENSE file.
/**
- * @fileoverview Listens for a find keyboard shortcut (i.e. Ctrl/Cmd+f) wherever
- * this behavior is applied and invokes canHandleFindShortcut(). If
- * canHandleFindShortcut() returns true, handleFindShortcut() will be called.
- * Override these methods in your element in order to use this behavior.
+ * @fileoverview Listens for a find keyboard shortcut (i.e. Ctrl/Cmd+f)
+ * and keeps track of an stack of potential listeners. Only the listener at the
+ * top of the stack will be notified that a find shortcut has been invoked.
*/
-cr.exportPath('settings');
-
-/** @polymerBehavior */
-settings.FindShortcutBehaviorImpl = {
- keyBindings: {
- // <if expr="is_macosx">
- 'meta+f': 'onFindShortcut_',
- // </if>
- // <if expr="not is_macosx">
- 'ctrl+f': 'onFindShortcut_',
- // </if>
- },
-
- /** @private */
- onFindShortcut_: function(e) {
- if (!e.defaultPrevented && this.canHandleFindShortcut()) {
- this.handleFindShortcut();
- e.preventDefault();
+cr.define('settings', function() {
+ /**
+ * Stack of listeners. Only the top listener will handle the shortcut.
+ * @type {!Array<!HTMLElement>}
+ */
+ const listeners = [];
+
+ /**
+ * Tracks if any modal context is open in settings. This assumes only one
+ * modal can be open at a time. The modals that are being tracked include
+ * cr-dialog and cr-drawer.
+ * @type {boolean}
+ */
+ let modalContextOpen = false;
+
+ const shortcut =
+ new cr.ui.KeyboardShortcutList(cr.isMac ? 'meta|f' : 'ctrl|f');
+
+ window.addEventListener('keydown', e => {
+ if (e.defaultPrevented || listeners.length == 0)
+ return;
+
+ if (shortcut.matchesEvent(e)) {
+ const listener = /** @type {!{handleFindShortcut: function(boolean)}} */ (
+ listeners[listeners.length - 1]);
+ if (listener.handleFindShortcut(modalContextOpen))
+ e.preventDefault();
}
- },
+ });
+
+ window.addEventListener('cr-dialog-open', () => {
+ modalContextOpen = true;
+ });
+
+ window.addEventListener('cr-drawer-opened', () => {
+ modalContextOpen = true;
+ });
+
+ window.addEventListener('close', e => {
+ if (['CR-DIALOG', 'CR-DRAWER'].includes(e.composedPath()[0].nodeName))
+ modalContextOpen = false;
+ });
/**
- * @return {boolean}
- * @protected
+ * Used to determine how to handle find shortcut invocations.
+ * @polymerBehavior
*/
- canHandleFindShortcut: function() {
- assertNotReached();
- },
-
- /** @protected */
- handleFindShortcut: function() {
- assertNotReached();
- },
-};
-
-/** @polymerBehavior */
-settings.FindShortcutBehavior = [
- Polymer.IronA11yKeysBehavior,
- settings.FindShortcutBehaviorImpl,
-];
+ const FindShortcutBehavior = {
+ /**
+ * If handled, return true.
+ * @param {boolean} modalContextOpen
+ * @return {boolean}
+ * @protected
+ */
+ handleFindShortcut(modalContextOpen) {
+ assertNotReached();
+ },
+
+ becomeActiveFindShortcutListener() {
+ assert(listeners.length == 0 || listeners[listeners.length - 1] != this);
+ listeners.push(this);
+ },
+
+ removeSelfAsFindShortcutListener() {
+ assert(listeners.pop() == this);
+ },
+ };
+
+ return {
+ FindShortcutBehavior,
+ };
+});
diff --git a/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.html b/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.html
index fdfd106a425..e87f2d0f2f0 100644
--- a/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.html
+++ b/chromium/chrome/browser/resources/settings/google_assistant_page/google_assistant_page.html
@@ -37,6 +37,14 @@
sub-label="$i18n{googleAssistantEnableHotwordDescription}">
</settings-toggle-button>
</template>
+ <template is="dom-if" if="[[assistantFeatureEnabled_]]">
+ <settings-toggle-button id="googleAssistantNotificationEnable"
+ class="continuation indented"
+ pref="{{prefs.settings.voice_interaction.notification.enabled}}"
+ label="$i18n{googleAssistantEnableNotification}"
+ sub-label="$i18n{googleAssistantEnableNotificationDescription}">
+ </settings-toggle-button>
+ </template>
<div id="googleAssistantSettings" class="settings-box"
on-click="onGoogleAssistantSettingsTapped_" actionable>
<div class="start">
diff --git a/chromium/chrome/browser/resources/settings/icons.html b/chromium/chrome/browser/resources/settings/icons.html
index 0f361f4f1cc..ae8db8c7760 100644
--- a/chromium/chrome/browser/resources/settings/icons.html
+++ b/chromium/chrome/browser/resources/settings/icons.html
@@ -49,8 +49,9 @@ List icons here rather than importing large sets of (e.g. Polymer) icons.
</g>
<!-- Icons for MultiDevice Settings UI -->
- <g id="smart-lock" fill="#9AA0A6" fill-rule="nonzero"><path d="M18,9 L17,9 L17,7 C17,4.24 14.76,2 12,2 C9.24,2 7,4.24 7,7 L7,9 L6,9 C4.9,9 4,9.9 4,11 L4,21 C4,22.1 4.9,23 6,23 L18,23 C19.1,23 20,22.1 20,21 L20,11 C20,9.9 19.1,9 18,9 Z M9,7 C9,5.34 10.34,4 12,4 C13.66,4 15,5.34 15,7 L15,9 L9,9 L9,7 Z M18,21 L6,21 L6,11 L18,11 L18,21 Z M12,18 C13.1,18 14,17.1 14,16 C14,14.9 13.1,14 12,14 C10.9,14 10,14.9 10,16 C10,17.1 10.9,18 12,18 Z"></path></g>
-
+ <g id="multidevice-better-together-suite" fill="#9AA0A6" fill-rule="nonzero"><path d="M17,1.01 L7,1 C5.9,1 5,1.9 5,3 L5,21 C5,22.1 5.9,23 7,23 L17,23 C18.1,23 19,22.1 19,21 L19,3 C19,1.9 18.1,1.01 17,1.01 Z M17,21 L7,21 L7,20 L17,20 L17,21 Z M17,18 L7,18 L7,6 L17,6 L17,18 Z M7,4 L7,3 L17,3 L17,4 L7,4 Z"></path></g>
+ <g id="multidevice-smart-lock" fill="#9AA0A6" fill-rule="nonzero"><path d="M18,9 L17,9 L17,7 C17,4.24 14.76,2 12,2 C9.24,2 7,4.24 7,7 L7,9 L6,9 C4.9,9 4,9.9 4,11 L4,21 C4,22.1 4.9,23 6,23 L18,23 C19.1,23 20,22.1 20,21 L20,11 C20,9.9 19.1,9 18,9 Z M9,7 C9,5.34 10.34,4 12,4 C13.66,4 15,5.34 15,7 L15,9 L9,9 L9,7 Z M18,21 L6,21 L6,11 L18,11 L18,21 Z M12,18 C13.1,18 14,17.1 14,16 C14,14.9 13.1,14 12,14 C10.9,14 10,14.9 10,16 C10,17.1 10.9,18 12,18 Z"></path></g>
+ <g id="multidevice-messages" fill="#9AA0A6" fill-rule="nonzero"><path d="M19.9593506,2 C21.0593506,2 22,2.89658203 22,3.99658203 L22,16.0036621 C22,17.1036621 21.0593506,18.0036621 19.9593506,18.0036621 L6.00878906,18.0036621 L2.00878906,22.4 L2.01878906,3.99658203 C2.01878906,2.89658203 2.90878906,2 4.00878906,2 L19.9593506,2 Z M8,8.56896973 L4.5,12 L8,15.6103516 L8,13 L14,13 L14,11 L8,11 L8,8.56896973 Z M20.5688477,7 L17,3.57207031 L17,6 L11,6 L11,8 L17,8 L17,10.5720703 L20.5688477,7 Z"></path></g>
</if>
<!-- Protected Content SVG -->
diff --git a/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn b/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn
index 19d20ec040e..02cd35af1eb 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/internet_page/BUILD.gn
@@ -12,7 +12,6 @@ js_type_check("closure_compile") {
":internet_page",
":internet_page_browser_proxy",
":internet_subpage",
- ":network_listener_behavior",
":network_proxy_section",
":network_summary",
":network_summary_item",
@@ -24,9 +23,9 @@ js_library("internet_page") {
deps = [
":internet_config",
":internet_page_browser_proxy",
- ":network_listener_behavior",
"..:route",
"../settings_page:settings_animated_pages",
+ "//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
@@ -101,14 +100,6 @@ js_library("internet_subpage") {
extra_sources = [ "$interfaces_path/networking_private_interface.js" ]
}
-js_library("network_listener_behavior") {
- deps = [
- "//ui/webui/resources/js:assert",
- ]
- externs_list = [ "$externs_path/networking_private.js" ]
- extra_sources = [ "$interfaces_path/networking_private_interface.js" ]
-}
-
js_library("network_proxy_section") {
deps = [
"..:route",
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html
index a7c1e4f2f18..5eaadd83c65 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.html
@@ -38,16 +38,16 @@
}
iron-icon {
- -webkit-margin-end: 10px;
+ margin-inline-end: 10px;
}
cr-toggle {
- -webkit-margin-start: var(--settings-control-label-spacing);
+ margin-inline-start: var(--settings-control-label-spacing);
}
cr-policy-network-indicator,
cr-policy-indicator {
- -webkit-margin-start: var(--settings-controlled-by-spacing);
+ margin-inline-start: var(--settings-controlled-by-spacing);
}
.settings-box:first-of-type {
@@ -93,13 +93,16 @@
$i18n{networkButtonActivate}
</paper-button>
<paper-button on-click="onConfigureTap_"
- hidden$="[[!showConfigure_(networkProperties, globalPolicy)]]">
+ hidden$="[[!showConfigure_(networkProperties, globalPolicy,
+ managedNetworkAvailable)]]">
$i18n{networkButtonConfigure}
</paper-button>
<paper-button class="action-button" on-click="onConnectTap_"
- hidden$="[[!showConnect_(networkProperties, globalPolicy)]]"
+ hidden$="[[!showConnect_(networkProperties, globalPolicy,
+ managedNetworkAvailable)]]"
disabled="[[!enableConnect_(networkProperties, defaultNetwork,
- networkPropertiesReceived_, outOfRange_, globalPolicy)]]">
+ networkPropertiesReceived_, outOfRange_, globalPolicy,
+ managedNetworkAvailable)]]">
$i18n{networkButtonConnect}
</paper-button>
<paper-button class="action-button" on-click="onDisconnectTap_"
@@ -110,12 +113,14 @@
<!-- Disabled by policy / Shared messages. -->
<div class="settings-box continuation"
- hidden$="[[!isBlockedByPolicy_(networkProperties, globalPolicy)]]">
+ hidden$="[[!isBlockedByPolicy_(networkProperties, globalPolicy,
+ managedNetworkAvailable)]]">
<iron-icon class="policy" icon="cr20:domain"></iron-icon>
<div>$i18n{networkConnectNotAllowed}</div>
</div>
<div class="settings-box continuation"
- hidden$="[[!showShared_(networkProperties, globalPolicy)]]">
+ hidden$="[[!showShared_(networkProperties, globalPolicy,
+ managedNetworkAvailable)]]">
$i18n{networkShared}
</div>
@@ -132,7 +137,8 @@
<template is="dom-if" if="[[!isSecondaryUser_]]">
<!-- Prefer this network. -->
<template is="dom-if"
- if="[[showPreferNetwork_(networkProperties, globalPolicy)]]">
+ if="[[showPreferNetwork_(networkProperties, globalPolicy,
+ managedNetworkAvailable)]]">
<div class="settings-box">
<div id="preferNetworkToggleLabel"class="start">
$i18n{networkPrefer}
@@ -148,7 +154,8 @@
</template>
<!-- Autoconnect. -->
<template is="dom-if"
- if="[[showAutoConnect_(networkProperties, globalPolicy)]]">
+ if="[[showAutoConnect_(networkProperties, globalPolicy,
+ managedNetworkAvailable)]]">
<div class="settings-box">
<div id="autoConnectToggleLabel" class="start">
$i18n{networkAutoConnect}
@@ -227,8 +234,8 @@
</iron-collapse>
</template>
- <template is="dom-if"
- if="[[hasNetworkSection_(networkProperties, globalPolicy)]]">
+ <template is="dom-if" if="[[hasNetworkSection_(networkProperties,
+ globalPolicy, managedNetworkAvailable)]]">
<!-- Network toggle -->
<div class="settings-box" actionable on-click="toggleNetworkExpanded_">
<div class="start">$i18n{networkSectionNetwork}</div>
@@ -270,8 +277,8 @@
</iron-collapse>
</template>
- <template is="dom-if"
- if="[[hasProxySection_(networkProperties, globalPolicy)]]">
+ <template is="dom-if" if="[[hasProxySection_(networkProperties,
+ globalPolicy, managedNetworkAvailable)]]">
<!-- Proxy toggle -->
<div class="settings-box" actionable on-click="toggleProxyExpanded_">
<div class="start">$i18n{networkSectionProxy}</div>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js
index 0c6b717312d..399bbfd6179 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -90,6 +90,14 @@ Polymer({
value: null,
},
+ /** Whether a managed network is available in the visible network list.
+ * @private {boolean}
+ */
+ managedNetworkAvailable: {
+ type: Boolean,
+ value: false,
+ },
+
/**
* Interface for networkingPrivate calls, passed from internet_page.
* @type {NetworkingPrivate}
@@ -137,7 +145,7 @@ Polymer({
listeners: {
'network-list-changed': 'checkNetworkExists_',
- 'networks-changed': 'updateNetworkDetails_',
+ 'networks-changed': 'updateNetworkDetails_'
},
/** @private {boolean} */
@@ -468,30 +476,36 @@ Polymer({
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
- isBlockedByPolicy_: function(networkProperties, globalPolicy) {
+ isBlockedByPolicy_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
if (networkProperties.Type != CrOnc.Type.WI_FI ||
- this.isPolicySource(networkProperties.Source)) {
+ this.isPolicySource(networkProperties.Source) || !globalPolicy) {
return false;
}
- return !!globalPolicy &&
- (!!globalPolicy.AllowOnlyPolicyNetworksToConnect ||
- (!!networkProperties.WiFi && !!networkProperties.WiFi.HexSSID &&
- !!globalPolicy.BlacklistedHexSSIDs &&
- globalPolicy.BlacklistedHexSSIDs.includes(
- CrOnc.getStateOrActiveString(networkProperties.WiFi.HexSSID))));
+ return !!globalPolicy.AllowOnlyPolicyNetworksToConnect ||
+ (!!globalPolicy.AllowOnlyPolicyNetworksToConnectIfAvailable &&
+ !!managedNetworkAvailable) ||
+ (!!networkProperties.WiFi && !!networkProperties.WiFi.HexSSID &&
+ !!globalPolicy.BlacklistedHexSSIDs &&
+ globalPolicy.BlacklistedHexSSIDs.includes(
+ CrOnc.getStateOrActiveString(networkProperties.WiFi.HexSSID)));
},
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
- showConnect_: function(networkProperties, globalPolicy) {
- if (this.isBlockedByPolicy_(networkProperties, globalPolicy))
+ showConnect_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
+ if (this.isBlockedByPolicy_(
+ networkProperties, globalPolicy, managedNetworkAvailable))
return false;
// TODO(lgcheng@) support connect Arc VPN from UI once Android support API
// to initiate a VPN session.
@@ -549,13 +563,16 @@ Polymer({
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
- showConfigure_: function(networkProperties, globalPolicy) {
+ showConfigure_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
if (this.isSecondaryUser_)
return false;
- if (this.isBlockedByPolicy_(networkProperties, globalPolicy))
+ if (this.isBlockedByPolicy_(
+ networkProperties, globalPolicy, managedNetworkAvailable))
return false;
const type = networkProperties.Type;
if (type == CrOnc.Type.CELLULAR || type == CrOnc.Type.TETHER)
@@ -621,13 +638,15 @@ Polymer({
* @param {boolean} networkPropertiesReceived
* @param {boolean} outOfRange
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean} Whether or not to enable the network connect button.
* @private
*/
enableConnect_: function(
networkProperties, defaultNetwork, networkPropertiesReceived, outOfRange,
- globalPolicy) {
- if (!this.showConnect_(networkProperties, globalPolicy))
+ globalPolicy, managedNetworkAvailable) {
+ if (!this.showConnect_(
+ networkProperties, globalPolicy, managedNetworkAvailable))
return false;
if (!networkPropertiesReceived || outOfRange)
return false;
@@ -880,26 +899,32 @@ Polymer({
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean} True if the shared message should be shown.
* @private
*/
- showShared_: function(networkProperties, globalPolicy) {
+ showShared_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
return (networkProperties.Source == 'Device' ||
networkProperties.Source == 'DevicePolicy') &&
- !this.isBlockedByPolicy_(networkProperties, globalPolicy);
+ !this.isBlockedByPolicy_(
+ networkProperties, globalPolicy, managedNetworkAvailable);
},
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean} True if the AutoConnect checkbox should be shown.
* @private
*/
- showAutoConnect_: function(networkProperties, globalPolicy) {
+ showAutoConnect_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
return networkProperties.Type != CrOnc.Type.ETHERNET &&
this.isRemembered_(networkProperties) &&
!this.isArcVpn_(networkProperties) &&
- !this.isBlockedByPolicy_(networkProperties, globalPolicy);
+ !this.isBlockedByPolicy_(
+ networkProperties, globalPolicy, managedNetworkAvailable);
},
/**
@@ -930,15 +955,18 @@ Polymer({
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean} True if the prefer network checkbox should be shown.
* @private
*/
- showPreferNetwork_: function(networkProperties, globalPolicy) {
+ showPreferNetwork_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
// TODO(stevenjb): Resolve whether or not we want to allow "preferred" for
// networkProperties.Type == CrOnc.Type.ETHERNET.
return this.isRemembered_(networkProperties) &&
!this.isArcVpn_(networkProperties) &&
- !this.isBlockedByPolicy_(networkProperties, globalPolicy);
+ !this.isBlockedByPolicy_(
+ networkProperties, globalPolicy, managedNetworkAvailable);
},
/**
@@ -1109,16 +1137,19 @@ Polymer({
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
- hasNetworkSection_: function(networkProperties, globalPolicy) {
+ hasNetworkSection_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
if (networkProperties.Type == CrOnc.Type.TETHER) {
// These settings apply to the underlying WiFi network, not the Tether
// network.
return false;
}
- if (this.isBlockedByPolicy_(networkProperties, globalPolicy))
+ if (this.isBlockedByPolicy_(
+ networkProperties, globalPolicy, managedNetworkAvailable))
return false;
if (networkProperties.Type == CrOnc.Type.CELLULAR)
return true;
@@ -1128,16 +1159,19 @@ Polymer({
/**
* @param {!CrOnc.NetworkProperties} networkProperties
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean}
* @private
*/
- hasProxySection_: function(networkProperties, globalPolicy) {
+ hasProxySection_: function(
+ networkProperties, globalPolicy, managedNetworkAvailable) {
if (networkProperties.Type == CrOnc.Type.TETHER) {
// Proxy settings apply to the underlying WiFi network, not the Tether
// network.
return false;
}
- if (this.isBlockedByPolicy_(networkProperties, globalPolicy))
+ if (this.isBlockedByPolicy_(
+ networkProperties, globalPolicy, managedNetworkAvailable))
return false;
return this.isRememberedOrConnected_(networkProperties);
},
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html b/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
index 35babb87473..82af6eeacb9 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
@@ -10,7 +10,7 @@
<template>
<style include="internet-shared iron-flex">
cr-policy-indicator {
- -webkit-margin-start: var(--settings-controlled-by-spacing);
+ margin-inline-start: var(--settings-controlled-by-spacing);
}
</style>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_page.html b/chromium/chrome/browser/resources/settings/internet_page/internet_page.html
index 41701b4c97a..5544462d263 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_page.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_page.html
@@ -1,5 +1,6 @@
<link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_listener_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
@@ -17,16 +18,15 @@
<link rel="import" href="internet_detail_page.html">
<link rel="import" href="internet_known_networks_page.html">
<link rel="import" href="internet_subpage.html">
-<link rel="import" href="network_listener_behavior.html">
<link rel="import" href="network_summary.html">
<dom-module id="settings-internet-page">
<template>
<style include="settings-shared">
iron-icon.policy {
- -webkit-margin-end: 12px;
- -webkit-margin-start: 4px;
height: 24px;
+ margin-inline-end: 12px;
+ margin-inline-start: 4px;
width: 24px;
}
</style>
@@ -37,7 +37,8 @@
device-states="{{deviceStates}}"
networking-private="[[networkingPrivate]]">
</network-summary>
- <template is="dom-if" if="[[allowAddConnection_(globalPolicy_)]]">
+ <template is="dom-if" if="[[allowAddConnection_(globalPolicy_,
+ managedNetworkAvailable)]]">
<div actionable class="settings-box two-line"
on-click="onExpandAddConnectionsTap_">
<div class="start layout horizontal center">
@@ -88,7 +89,8 @@
</div>
</template>
</template>
- <template is="dom-if" if="[[!allowAddConnection_(globalPolicy_)]]">
+ <template is="dom-if" if="[[!allowAddConnection_(globalPolicy_,
+ managedNetworkAvailable)]]">
<div class="settings-box">
<iron-icon class="policy" icon="cr20:domain"></iron-icon>
<div>$i18n{internetAddConnectionNotAllowed}</div>
@@ -101,7 +103,8 @@
<settings-internet-detail-page prefs="{{prefs}}"
default-network="[[defaultNetwork]]"
global-policy="[[globalPolicy_]]"
- networking-private="[[networkingPrivate]]">
+ networking-private="[[networkingPrivate]]"
+ managed-network-available="[[managedNetworkAvailable]]">
</settings-internet-detail-page>
</settings-subpage>
</template>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_page.js b/chromium/chrome/browser/resources/settings/internet_page/internet_page.js
index 3f01b7f2ea7..103624689c5 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_page.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_page.js
@@ -12,7 +12,7 @@ Polymer({
behaviors: [
I18nBehavior, settings.RouteObserverBehavior, WebUIListenerBehavior,
- NetworkListenerBehavior
+ CrNetworkListenerBehavior
],
properties: {
@@ -39,6 +39,7 @@ Polymer({
deviceStates: {
type: Object,
notify: true,
+ observer: 'onDeviceStatesChanged_',
},
/**
@@ -78,7 +79,19 @@ Polymer({
},
/** @private {!chrome.networkingPrivate.GlobalPolicy|undefined} */
- globalPolicy_: Object,
+ globalPolicy_: {
+ type: Object,
+ value: null,
+ },
+
+ /**
+ * Whether a managed network is available in the visible network list.
+ * @private {boolean}
+ */
+ managedNetworkAvailable: {
+ type: Boolean,
+ value: false,
+ },
/** Overridden from NetworkListenerBehavior. */
networkListChangeSubscriberSelectors_: {
@@ -125,7 +138,7 @@ Polymer({
}
},
- /** @private {!Map<string, string>} */
+ /** @private {!Map<string, Element>} */
focusConfig_: {
type: Object,
value: function() {
@@ -239,18 +252,21 @@ Polymer({
return;
// Focus the subpage arrow where appropriate.
- let selector;
+ let element;
if (route == settings.routes.INTERNET_NETWORKS) {
// iron-list makes the correct timing to focus an item in the list
// very complicated, and the item may not exist, so just focus the
// entire list for now.
- selector = '* /deep/ #networkList';
+ let subPage = this.$$('settings-internet-subpage');
+ if (subPage)
+ element = subPage.$$('#networkList');
} else if (this.detailType_) {
- selector =
- '* /deep/ #' + this.detailType_ + ' /deep/ .subpage-arrow button';
+ element = this.$$('network-summary')
+ .$$(`#${this.detailType_}`)
+ .$$('.subpage-arrow button');
}
- if (selector && this.querySelector(selector))
- this.focusConfig_.set(oldRoute.path, selector);
+ if (element)
+ this.focusConfig_.set(oldRoute.path, element);
else
this.focusConfig_.delete(oldRoute.path);
},
@@ -274,10 +290,14 @@ Polymer({
*/
onShowConfig_: function(event) {
const properties = event.detail;
- let configAndConnect = !properties.GUID; // New configuration
- this.showConfig_(
- configAndConnect, properties.Type, properties.GUID,
- CrOnc.getNetworkName(properties));
+ if (!properties.GUID) {
+ // New configuration
+ this.showConfig_(true /* configAndConnect */, properties.Type);
+ } else {
+ this.showConfig_(
+ false /* configAndConnect */, properties.Type, properties.GUID,
+ CrOnc.getNetworkName(properties));
+ }
},
/**
@@ -354,6 +374,21 @@ Polymer({
},
/**
+ * @param {!CrOnc.DeviceStateProperties|undefined} newValue
+ * @param {!CrOnc.DeviceStateProperties|undefined} oldValue
+ * @private
+ */
+ onDeviceStatesChanged_: function(newValue, oldValue) {
+ let wifiDeviceState = this.getDeviceState_(CrOnc.Type.WI_FI, newValue);
+ let managedNetworkAvailable = false;
+ if (!!wifiDeviceState)
+ managedNetworkAvailable = !!wifiDeviceState.ManagedNetworkAvailable;
+
+ if (this.managedNetworkAvailable != managedNetworkAvailable)
+ this.managedNetworkAvailable = managedNetworkAvailable;
+ },
+
+ /**
* @param {!{detail: {type: string}}} event
* @private
*/
@@ -517,10 +552,16 @@ Polymer({
/**
* @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
+ * @param {boolean} managedNetworkAvailable
* @return {boolean}
*/
- allowAddConnection_: function(globalPolicy) {
- return !globalPolicy.AllowOnlyPolicyNetworksToConnect;
+ allowAddConnection_: function(globalPolicy, managedNetworkAvailable) {
+ if (!globalPolicy)
+ return true;
+
+ return !globalPolicy.AllowOnlyPolicyNetworksToConnect &&
+ (!globalPolicy.AllowOnlyPolicyNetworksToConnectIfAvailable ||
+ !managedNetworkAvailable);
},
/**
@@ -528,7 +569,8 @@ Polymer({
* @return {string}
*/
getAddThirdPartyVpnLabel_: function(provider) {
- return this.i18n('internetAddThirdPartyVPN', provider.ProviderName);
+ return this.i18n(
+ 'internetAddThirdPartyVPN', provider.ProviderName || '');
},
/**
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_shared_css.html b/chromium/chrome/browser/resources/settings/internet_page/internet_shared_css.html
index 39d86fdfa70..a3b39fb5c99 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_shared_css.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_shared_css.html
@@ -6,15 +6,15 @@
<template>
<style include="settings-shared">
cr-network-icon {
- -webkit-padding-end: var(--settings-box-row-padding);
+ padding-inline-end: var(--settings-box-row-padding);
}
iron-icon.policy {
- -webkit-margin-end: var(--cr-controlled-by-spacing);
+ margin-inline-end: var(--cr-controlled-by-spacing);
}
.indented {
- -webkit-margin-start: var(--settings-box-row-padding);
+ margin-inline-start: var(--settings-box-row-padding);
}
.stretch {
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html
index 2889a2e4f56..40ef55b8d7b 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.html
@@ -20,13 +20,13 @@
separator lines can fill the entire width of the page. */
#networkListDiv > * {
/* cr-network-list is padded to the right to allow space for a ripple */
- -webkit-padding-end: calc(var(--settings-box-row-padding) -
+ padding-inline-end: calc(var(--settings-box-row-padding) -
var(--cr-icon-ripple-padding));
- -webkit-padding-start: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-padding);
}
#addButton {
- -webkit-margin-end: var(--settings-control-label-spacing);
+ margin-inline-end: var(--settings-control-label-spacing);
}
#onOff {
@@ -38,9 +38,9 @@
}
.vpn-header {
- -webkit-margin-end: 12px;
- -webkit-margin-start: 4px;
margin-bottom: 8px;
+ margin-inline-end: 12px;
+ margin-inline-start: 4px;
margin-top: 8px;
}
@@ -71,8 +71,8 @@
#gmscore-notifications-instructions {
@apply --cr-secondary-text;
- -webkit-padding-start: 15px;
margin: 0;
+ padding-inline-start: 15px;
}
</style>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js
index 7f61083c696..003c91a13f6 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/internet_subpage.js
@@ -363,7 +363,8 @@ Polymer({
* @private
*/
getAddThirdPartyVpnA11yString_: function(vpnState) {
- return this.i18n('internetAddThirdPartyVPN', vpnState.ProviderName);
+ return this.i18n(
+ 'internetAddThirdPartyVPN', vpnState.ProviderName || '');
},
/**
@@ -509,7 +510,7 @@ Polymer({
assert(this.defaultNetwork !== undefined);
const state = e.detail;
e.target.blur();
- if (this.canConnect_(state, this.defaultNetwork, this.globalPolicy)) {
+ if (this.canConnect_(state)) {
this.fire('network-connect', {networkProperties: state});
return;
}
@@ -518,35 +519,35 @@ Polymer({
/**
* @param {!CrOnc.NetworkStateProperties} state The network state.
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
* @private
*/
- isBlockedByPolicy_: function(state, globalPolicy) {
- if (state.Type != CrOnc.Type.WI_FI || this.isPolicySource(state.Source)) {
+ isBlockedByPolicy_: function(state) {
+ if (state.Type != CrOnc.Type.WI_FI || this.isPolicySource(state.Source) ||
+ !this.globalPolicy) {
return false;
}
- return !!globalPolicy &&
- (!!globalPolicy.AllowOnlyPolicyNetworksToConnect ||
- (!!state.WiFi && !!state.WiFi.HexSSID &&
- !!globalPolicy.BlacklistedHexSSIDs &&
- globalPolicy.BlacklistedHexSSIDs.includes(state.WiFi.HexSSID)));
+ return !!this.globalPolicy.AllowOnlyPolicyNetworksToConnect ||
+ (!!this.globalPolicy.AllowOnlyPolicyNetworksToConnectIfAvailable &&
+ !!this.deviceState && !!this.deviceState.ManagedNetworkAvailable) ||
+ (!!state.WiFi && !!state.WiFi.HexSSID &&
+ !!this.globalPolicy.BlacklistedHexSSIDs &&
+ this.globalPolicy.BlacklistedHexSSIDs.includes(state.WiFi.HexSSID));
},
/**
* Determines whether or not a network state can be connected to.
* @param {!CrOnc.NetworkStateProperties} state The network state.
- * @param {?CrOnc.NetworkStateProperties} defaultNetwork
- * @param {!chrome.networkingPrivate.GlobalPolicy} globalPolicy
* @private
*/
- canConnect_: function(state, defaultNetwork, globalPolicy) {
+ canConnect_: function(state) {
if (state.ConnectionState != CrOnc.ConnectionState.NOT_CONNECTED)
return false;
- if (this.isBlockedByPolicy_(state, globalPolicy))
+ if (this.isBlockedByPolicy_(state))
return false;
if (state.Type == CrOnc.Type.VPN &&
- (!defaultNetwork ||
- defaultNetwork.ConnectionState != CrOnc.ConnectionState.CONNECTED)) {
+ (!this.defaultNetwork ||
+ this.defaultNetwork.ConnectionState !=
+ CrOnc.ConnectionState.CONNECTED)) {
return false;
}
return true;
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.html b/chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.html
deleted file mode 100644
index f564a7461d6..00000000000
--- a/chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.html
+++ /dev/null
@@ -1 +0,0 @@
-<script src="network_listener_behavior.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.js b/chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.js
deleted file mode 100644
index 665cc54069c..00000000000
--- a/chromium/chrome/browser/resources/settings/internet_page/network_listener_behavior.js
+++ /dev/null
@@ -1,94 +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.
-
-/**
- * @fileoverview Polymer behavior for alerting specified child elements of
- * changes to the devices network data.
- */
-
-/** @polymerBehavior */
-const NetworkListenerBehavior = {
- properties: {
- /**
- * Array of selectors specifying all children to alert of changes to the
- * network list.
- * @private {!Array<string>}
- */
- networkListChangeSubscriberSelectors_: Array,
-
- /**
- * Array of selectors specifying all children to alert of important changes
- * to the specific networks.
- * @private {!Array<string>}
- */
- networksChangeSubscriberSelectors_: Array,
-
- /** @type {!NetworkingPrivate} */
- networkingPrivate: Object,
- },
-
- /** @private {?function(!Array<string>)} */
- networkListChangedListener_: null,
-
- /** @private {?function(!Array<string>)} */
- networksChangedListener_: null,
-
- /** @override */
- attached: function() {
- this.networkListChangedListener_ = this.networkListChangedListener_ ||
- this.onNetworkListChanged_.bind(this);
- this.networkingPrivate.onNetworkListChanged.addListener(
- this.networkListChangedListener_);
-
- this.networksChangedListener_ =
- this.networksChangedListener_ || this.onNetworksChanged_.bind(this);
- this.networkingPrivate.onNetworksChanged.addListener(
- this.networksChangedListener_);
- },
-
- /** @override */
- detached: function() {
- this.networkingPrivate.onNetworkListChanged.removeListener(
- assert(this.networkListChangedListener_));
- this.networkingPrivate.onNetworksChanged.removeListener(
- assert(this.networksChangedListener_));
- },
-
- /**
- * This event is triggered when the list of networks changes.
- * |networkIds| contains the ids for all visible or configured networks.
- * networkingPrivate.onNetworkListChanged event callback.
- * @param {!Array<string>} networkIds
- * @private
- */
- onNetworkListChanged_: function(networkIds) {
- const event = new CustomEvent('network-list-changed', {detail: networkIds});
- this.networkListChangeSubscriberSelectors_.forEach(
- selector => this.maybeDispatchEvent_(selector, event));
- },
-
- /**
- * This event is triggered when interesting properties of a network change.
- * |networkIds| contains the ids for networks whose properties have changed.
- * networkingPrivate.onNetworksChanged event callback.
- * @param {!Array<string>} networkIds
- * @private
- */
- onNetworksChanged_: function(networkIds) {
- const event = new CustomEvent('networks-changed', {detail: networkIds});
- this.networksChangeSubscriberSelectors_.forEach(
- selector => this.maybeDispatchEvent_(selector, event));
- },
-
- /**
- * @param {!Event} event
- * @private
- */
- maybeDispatchEvent_: function(selectors, event) {
- const element = this.$$(selectors);
- if (!element)
- return;
- element.dispatchEvent(event);
- },
-};
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html
index 146da4c1ceb..9d718a9df80 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.html
@@ -22,11 +22,11 @@
<template>
<style include="internet-shared cr-hidden-style iron-flex iron-flex-alignment">
cr-policy-network-indicator {
- -webkit-margin-end: 10px;
+ margin-inline-end: 10px;
}
extension-controlled-indicator {
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
width: 100%;
}
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html
index 930197efe7d..7edbb1cd5f2 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.html
@@ -15,7 +15,12 @@
<template>
<style include="internet-shared iron-flex">
network-siminfo {
- -webkit-padding-start: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-padding);
+ }
+
+ #outerBox {
+ padding: 0 var(--settings-box-row-padding);
+ @apply(--network-summary-item-outer-box);
}
#details {
@@ -24,9 +29,10 @@
flex: auto;
}
- #networkName {
+ #networkTitleText {
color: #333;
font-weight: 500;
+ @apply(--network-summary-item-title);
}
#networkState {
@@ -35,7 +41,7 @@
font-weight: 400;
}
</style>
- <div class="settings-box two-line">
+ <div id="outerBox" class="settings-box two-line">
<div actionable class="flex layout horizontal center"
on-click="onShowDetailsTap_">
<div id="details" no-flex$="[[showSimInfo_(deviceState)]]">
@@ -43,7 +49,9 @@
device-state="[[deviceState]]">
</cr-network-icon>
<div class="flex">
- <div id="networkName">[[getNetworkName_(activeNetworkState)]]</div>
+ <div id="networkTitleText">
+ [[getTitleText_(activeNetworkState)]]
+ </div>
<div id="networkState">
[[getNetworkStateText_(activeNetworkState, deviceState)]]
</div>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js
index ab3be60ec47..b4a8f8892ea 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_summary_item.js
@@ -51,14 +51,14 @@ Polymer({
* @type {!NetworkingPrivate}
*/
networkingPrivate: Object,
- },
- /**
- * @return {string}
- * @private
- */
- getNetworkName_: function() {
- return CrOncStrings['OncType' + this.activeNetworkState.Type];
+ /**
+ * Title line describing the network type to appear in the row's top line.
+ * If it is undefined, the title text is a default from CrOncStrings (see
+ * this.getTitleText_() below).
+ * @type {string|undefined}
+ */
+ networkTitleText: String,
},
/**
@@ -335,6 +335,15 @@ Polymer({
},
/**
+ * @return {string}
+ * @private
+ */
+ getTitleText_: function() {
+ return this.networkTitleText ||
+ CrOncStrings['OncType' + this.activeNetworkState.Type];
+ },
+
+ /**
* Make sure events in embedded components do not propagate to onDetailsTap_.
* @param {!Event} event
* @private
diff --git a/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.html b/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.html
index 9c0daa34a25..62c848ce669 100644
--- a/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.html
+++ b/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.html
@@ -16,7 +16,7 @@
<style include="settings-shared">
cr-dialog {
--cr-dialog-body: {
- -webkit-padding-end: 0;
+ padding-inline-end: 0;
display: flex;
flex-direction: column;
height: 350px;
@@ -25,7 +25,7 @@
}
settings-subpage-search {
- -webkit-padding-end: 24px;
+ padding-inline-end: 24px;
}
iron-list {
@@ -34,7 +34,7 @@
.ripple-padding {
/* Create a little extra space for checkbox ink ripple to flow into. */
- -webkit-padding-start: 20px;
+ padding-inline-start: 20px;
}
cr-checkbox {
diff --git a/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.js b/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.js
index 4e38bc5f976..77c6b94a521 100644
--- a/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.js
+++ b/chromium/chrome/browser/resources/settings/languages_page/add_languages_dialog.js
@@ -48,16 +48,23 @@ Polymer({
/** @override */
attached: function() {
this.$.dialog.showModal();
+ this.becomeActiveFindShortcutListener();
},
- // Override settings.FindShortcutBehavior methods.
- canHandleFindShortcut: function() {
- return true;
+ /** @override */
+ detached: function() {
+ this.removeSelfAsFindShortcutListener();
},
- handleFindShortcut: function() {
- this.$.search.getSearchInput().scrollIntoViewIfNeeded();
- this.$.search.getSearchInput().focus();
+ // Override settings.FindShortcutBehavior methods.
+ handleFindShortcut: function(modalContextOpen) {
+ // Assumes this is the only open modal.
+ const searchInput = this.$.search.getSearchInput();
+ if (searchInput != this.$.search.shadowRoot.activeElement) {
+ searchInput.scrollIntoViewIfNeeded();
+ searchInput.focus();
+ }
+ return true;
},
/**
diff --git a/chromium/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html b/chromium/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html
index d8957326506..cef2743fea8 100644
--- a/chromium/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html
+++ b/chromium/chrome/browser/resources/settings/languages_page/edit_dictionary_page.html
@@ -37,7 +37,8 @@
invalid="[[isWordInvalid_(newWordValue_)]]"
error-message="[[isWordInvalid_(newWordValue_,
'$i18nPolymer{addDictionaryWordDuplicateError}',
- '$i18nPolymer{addDictionaryWordLengthError}')]]">
+ '$i18nPolymer{addDictionaryWordLengthError}')]]"
+ spellcheck="false">
<paper-button class="secondary-button" on-click="onAddWordTap_"
disabled="[[disableAddButton_(newWordValue_)]]" id="addWord"
slot="suffix">
diff --git a/chromium/chrome/browser/resources/settings/languages_page/languages.js b/chromium/chrome/browser/resources/settings/languages_page/languages.js
index 6acc1a9601f..6c81d0d59f5 100644
--- a/chromium/chrome/browser/resources/settings/languages_page/languages.js
+++ b/chromium/chrome/browser/resources/settings/languages_page/languages.js
@@ -174,6 +174,12 @@ Polymer({
// <if expr="chromeos">
/** @private {?InputMethodPrivate} */
inputMethodPrivate_: null,
+
+ /** @private {?Function} */
+ boundOnInputMethodAdded_: null,
+
+ /** @private {?Function} */
+ boundOnInputMethodRemoved_: null,
// </if>
/** @override */
@@ -251,6 +257,12 @@ Polymer({
this.boundOnInputMethodChanged_ = this.onInputMethodChanged_.bind(this);
this.inputMethodPrivate_.onChanged.addListener(
assert(this.boundOnInputMethodChanged_));
+ this.boundOnInputMethodAdded_ = this.onInputMethodAdded_.bind(this);
+ this.languageSettingsPrivate_.onInputMethodAdded.addListener(
+ this.boundOnInputMethodAdded_);
+ this.boundOnInputMethodRemoved_ = this.onInputMethodRemoved_.bind(this);
+ this.languageSettingsPrivate_.onInputMethodRemoved.addListener(
+ this.boundOnInputMethodRemoved_);
}
},
@@ -260,6 +272,12 @@ Polymer({
this.inputMethodPrivate_.onChanged.removeListener(
assert(this.boundOnInputMethodChanged_));
this.boundOnInputMethodChanged_ = null;
+ this.languageSettingsPrivate_.onInputMethodAdded.removeListener(
+ assert(this.boundOnInputMethodAdded_));
+ this.boundOnInputMethodAdded_ = null;
+ this.languageSettingsPrivate_.onInputMethodRemoved.removeListener(
+ assert(this.boundOnInputMethodRemoved_));
+ this.boundOnInputMethodRemoved_ = null;
}
// <if expr="not is_macosx">
@@ -414,25 +432,7 @@ Polymer({
}
if (supportedInputMethods) {
- // Populate the hash map of supported input methods.
- for (let j = 0; j < supportedInputMethods.length; j++) {
- const inputMethod = supportedInputMethods[j];
- inputMethod.enabled = !!inputMethod.enabled;
- inputMethod.isProhibitedByPolicy = !!inputMethod.isProhibitedByPolicy;
- // Add the input method to the map of IDs.
- this.supportedInputMethodMap_.set(inputMethod.id, inputMethod);
- // Add the input method to the list of input methods for each language
- // it supports.
- for (let k = 0; k < inputMethod.languageCodes.length; k++) {
- const languageCode = inputMethod.languageCodes[k];
- if (!this.supportedLanguageMap_.has(languageCode))
- continue;
- if (!this.languageInputMethods_.has(languageCode))
- this.languageInputMethods_.set(languageCode, [inputMethod]);
- else
- this.languageInputMethods_.get(languageCode).push(inputMethod);
- }
- }
+ this.createInputMethodModel_(supportedInputMethods);
}
let prospectiveUILanguage;
@@ -475,6 +475,37 @@ Polymer({
},
/**
+ * Constructs the input method part of the languages model.
+ * @param {!Array<!chrome.languageSettingsPrivate.InputMethod>}
+ * supportedInputMethods Input methods.
+ * @private
+ */
+ createInputMethodModel_: function(supportedInputMethods) {
+ assert(cr.isChromeOS);
+ // Populate the hash map of supported input methods.
+ this.supportedInputMethodMap_.clear();
+ this.languageInputMethods_.clear();
+ for (let j = 0; j < supportedInputMethods.length; j++) {
+ const inputMethod = supportedInputMethods[j];
+ inputMethod.enabled = !!inputMethod.enabled;
+ inputMethod.isProhibitedByPolicy = !!inputMethod.isProhibitedByPolicy;
+ // Add the input method to the map of IDs.
+ this.supportedInputMethodMap_.set(inputMethod.id, inputMethod);
+ // Add the input method to the list of input methods for each language
+ // it supports.
+ for (let k = 0; k < inputMethod.languageCodes.length; k++) {
+ const languageCode = inputMethod.languageCodes[k];
+ if (!this.supportedLanguageMap_.has(languageCode))
+ continue;
+ if (!this.languageInputMethods_.has(languageCode))
+ this.languageInputMethods_.set(languageCode, [inputMethod]);
+ else
+ this.languageInputMethods_.get(languageCode).push(inputMethod);
+ }
+ }
+ },
+
+ /**
* Returns a list of LanguageStates for each enabled language in the supported
* languages list.
* @param {string} translateTarget Language code of the default translate
@@ -589,6 +620,23 @@ Polymer({
},
/** @private */
+ updateSupportedInputMethods_: function() {
+ assert(cr.isChromeOS);
+ const promise = new Promise(resolve => {
+ this.languageSettingsPrivate_.getInputMethodLists(function(lists) {
+ resolve(
+ lists.componentExtensionImes.concat(lists.thirdPartyExtensionImes));
+ });
+ });
+ promise.then(result => {
+ const supportedInputMethods = result;
+ this.createInputMethodModel_(supportedInputMethods);
+ this.set('languages.inputMethods.supported', supportedInputMethods);
+ this.updateEnabledInputMethods_();
+ });
+ },
+
+ /** @private */
updateEnabledInputMethods_: function() {
assert(cr.isChromeOS);
const enabledInputMethods = this.getEnabledInputMethods_();
@@ -932,12 +980,12 @@ Polymer({
/** @param {string} id Added input method ID. */
onInputMethodAdded_: function(id) {
- this.updateEnabledInputMethods_();
+ this.updateSupportedInputMethods_();
},
/** @param {string} id Removed input method ID. */
onInputMethodRemoved_: function(id) {
- this.updateEnabledInputMethods_();
+ this.updateSupportedInputMethods_();
},
// </if>
});
diff --git a/chromium/chrome/browser/resources/settings/languages_page/languages_page.html b/chromium/chrome/browser/resources/settings/languages_page/languages_page.html
index 75a6eb93028..a979b391e55 100644
--- a/chromium/chrome/browser/resources/settings/languages_page/languages_page.html
+++ b/chromium/chrome/browser/resources/settings/languages_page/languages_page.html
@@ -67,13 +67,13 @@
cr-checkbox.dropdown-item {
--cr-action-menu-disabled-item-opacity: 0.38;
- -webkit-margin-start: 0;
+ margin-inline-start: 0;
}
.icon-external {
/* The negative margin messes up the outline border. These are in an
indented list so this looks fine until moved: crbug.com/708286. */
- -webkit-margin-end: 0;
+ margin-inline-end: 0;
}
#uiLanguageItem:focus,
@@ -102,7 +102,7 @@
iron-icon[icon='cr:error'] {
@apply --cr-icon-height-width;
--iron-icon-fill-color: var(--google-red-700);
- -webkit-margin-end: 8px;
+ margin-inline-end: 8px;
}
.name-with-error-list[disabled] {
@@ -110,7 +110,7 @@
}
iron-icon.policy {
- -webkit-margin-start: 10px;
+ margin-inline-start: 10px;
}
</style>
<settings-languages languages="{{languages}}" prefs="{{prefs}}"
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/BUILD.gn b/chromium/chrome/browser/resources/settings/multidevice_page/BUILD.gn
index ed7d9c960e0..46e84a108f6 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/BUILD.gn
@@ -8,15 +8,19 @@ js_type_check("closure_compile") {
deps = [
":multidevice_browser_proxy",
":multidevice_constants",
+ ":multidevice_feature_behavior",
":multidevice_feature_item",
+ ":multidevice_feature_toggle",
":multidevice_page",
":multidevice_page_container",
":multidevice_subpage",
+ ":multidevice_tether_item",
]
}
js_library("multidevice_browser_proxy") {
deps = [
+ ":multidevice_constants",
"//ui/webui/resources/js:cr",
]
}
@@ -27,26 +31,45 @@ js_library("multidevice_constants") {
]
}
+js_library("multidevice_feature_behavior") {
+ deps = [
+ ":multidevice_constants",
+ "//ui/webui/resources/js:cr",
+ "//ui/webui/resources/js:i18n_behavior",
+ ]
+}
+
js_library("multidevice_feature_item") {
deps = [
+ ":multidevice_constants",
+ ":multidevice_feature_behavior",
"..:route",
"//ui/webui/resources/js:cr",
]
}
+js_library("multidevice_feature_toggle") {
+ deps = [
+ ":multidevice_constants",
+ ":multidevice_feature_behavior",
+ ]
+}
+
js_library("multidevice_page") {
deps = [
":multidevice_browser_proxy",
":multidevice_constants",
+ ":multidevice_feature_behavior",
+ "../controls:password_prompt_dialog",
"//ui/webui/resources/js:cr",
- "//ui/webui/resources/js:i18n_behavior",
]
}
js_library("multidevice_page_container") {
deps = [
+ ":multidevice_browser_proxy",
":multidevice_constants",
- ":multidevice_page",
+ ":multidevice_feature_behavior",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
@@ -54,7 +77,19 @@ js_library("multidevice_page_container") {
js_library("multidevice_subpage") {
deps = [
+ ":multidevice_constants",
+ ":multidevice_feature_behavior",
"..:route",
- "//ui/webui/resources/js:i18n_behavior",
+ "//ui/webui/resources/cr_elements/chromeos/network:cr_network_listener_behavior",
+ ]
+ externs_list = [ "$externs_path/networking_private.js" ]
+ extra_sources = [ "$interfaces_path/networking_private_interface.js" ]
+}
+
+js_library("multidevice_tether_item") {
+ deps = [
+ "//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
]
+ externs_list = [ "$externs_path/networking_private.js" ]
+ extra_sources = [ "$interfaces_path/networking_private_interface.js" ]
}
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_browser_proxy.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_browser_proxy.js
index 594d6de3e80..bdc01201447 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_browser_proxy.js
@@ -7,8 +7,29 @@ cr.define('settings', function() {
class MultiDeviceBrowserProxy {
showMultiDeviceSetupDialog() {}
- /** @return Promise<!MultiDevicePageContentData> */
+ /** @return {!Promise<!MultiDevicePageContentData>} */
getPageContentData() {}
+
+ /**
+ * @param {!settings.MultiDeviceFeature} feature The feature whose state
+ * should be set.
+ * @param {boolean} enabled Whether the feature should be turned off or on.
+ * @param {string=} opt_authToken Proof that the user is authenticated.
+ * Needed to enable Smart Lock, and Better Together Suite if the Smart
+ * Lock user pref is enabled.
+ * @return {!Promise<boolean>} Whether the operation was successful.
+ */
+ setFeatureEnabledState(feature, enabled, opt_authToken) {}
+
+ removeHostDevice() {}
+
+ retryPendingHostSetup() {}
+
+ /**
+ * Called when the "Set Up" button is clicked to open the Android Messages
+ * PWA.
+ */
+ setUpAndroidSms() {}
}
/**
@@ -22,15 +43,28 @@ cr.define('settings', function() {
/** @override */
getPageContentData() {
- // TODO(jordynass): change method content to
- // return cr.sendWithPromise('getPageContentData');
- // once handler is built.
- return Promise.resolve({
- mode: settings.MultiDeviceSettingsMode.HOST_SET_VERIFIED,
- hostDevice: {
- name: 'Pixel XL',
- },
- });
+ return cr.sendWithPromise('getPageContentData');
+ }
+
+ /** @override */
+ setFeatureEnabledState(feature, enabled, opt_authToken) {
+ return cr.sendWithPromise(
+ 'setFeatureEnabledState', feature, enabled, opt_authToken);
+ }
+
+ /** @override */
+ removeHostDevice() {
+ chrome.send('removeHostDevice');
+ }
+
+ /** @override */
+ retryPendingHostSetup() {
+ chrome.send('retryPendingHostSetup');
+ }
+
+ /** @override */
+ setUpAndroidSms() {
+ chrome.send('setUpAndroidSms');
}
}
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_constants.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_constants.js
index 585611f3ab4..b254dd07c2f 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_constants.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_constants.js
@@ -19,70 +19,62 @@ cr.define('settings', function() {
};
/**
- * MultiDevice software features. Note that this is copied from (and must
- * include an analog of all values in) the enum of the same name in
- * //components/cryptauth/proto/cryptauth_api.proto.
+ * Enum of MultiDevice features. Note that this is copied from (and must
+ * include an analog of all values in) the Feature enum in
+ * //chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.
* @enum {number}
*/
- MultiDeviceSoftwareFeature = {
- UNKNOWN_FEATURE: 0,
- BETTER_TOGETHER_HOST: 1,
- BETTER_TOGETHER_CLIENT: 2,
- EASY_UNLOCK_HOST: 3,
- EASY_UNLOCK_CLIENT: 4,
- MAGIC_TETHER_HOST: 5,
- MAGIC_TETHER_CLIENT: 6,
- SMS_CONNECT_HOST: 7,
- SMS_CONNECT_CLIENT: 8,
+ MultiDeviceFeature = {
+ BETTER_TOGETHER_SUITE: 0,
+ INSTANT_TETHERING: 1,
+ MESSAGES: 2,
+ SMART_LOCK: 3,
};
/**
- * Possible states of MultiDevice software features. Note that this is based
- * on (and must include an analog of all values in) the enum of the same name
- * in //components/cryptauth/software_feature_state.h.
+ * Possible states of MultiDevice features. Note that this is copied from (and
+ * must include an analog of all values in) the FeatureState enum in
+ * //chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.
* @enum {number}
*/
- MultiDeviceSoftwareFeatureState = {
- NOT_SUPPORTED: 0,
- SUPPORTED: 1,
- ENABLED: 2,
+ MultiDeviceFeatureState = {
+ PROHIBITED_BY_POLICY: 0,
+ DISABLED_BY_USER: 1,
+ ENABLED_BY_USER: 2,
+ NOT_SUPPORTED_BY_CHROMEBOOK: 3,
+ NOT_SUPPORTED_BY_PHONE: 4,
+ UNAVAILABLE_NO_VERIFIED_HOST: 5,
+ UNAVAILABLE_INSUFFICIENT_SECURITY: 6,
+ UNAVAILABLE_SUITE_DISABLED: 7,
};
return {
MultiDeviceSettingsMode: MultiDeviceSettingsMode,
- MultiDeviceSoftwareFeature: MultiDeviceSoftwareFeature,
- MultiDeviceSoftwareFeatureState: MultiDeviceSoftwareFeatureState,
+ MultiDeviceFeature: MultiDeviceFeature,
+ MultiDeviceFeatureState: MultiDeviceFeatureState,
};
});
/**
- * Represents a multidevice host, i.e. a phone set by the user to connect to
- * their Chromebook(s). The type is a subset of the RemoteDevice structure
- * defined by CryptAuth (components/cryptauth/remote_device.h). It contains the
- * host device's name (e.g. Pixel, Nexus 5) and the map softwareFeatures
- * sending each MultiDevice feature to the host device's state with regards to
- * that feature.
- *
- * @typedef {{
- * name: string,
- * softwareFeatures:
- * !Object<settings.MultiDeviceSoftwareFeature,
- * settings.MultiDeviceSoftwareFeatureState>
- * }}
- */
-let RemoteDevice;
-
-/**
* Container for the initial data that the page requires in order to display
* the correct content. It is also used for receiving status updates during
- * use. Note that the host may be verified (enabled or disabled), awaiting
- * verification, or it may have failed setup because it was not able to connect
- * to the server. If the property is null or undefined, then no host has been
- * set up, although there may be potential hosts on the account.
+ * use. Note that the host device may be verified (enabled or disabled),
+ * awaiting verification, or it may have failed setup because it was not able
+ * to connect to the server.
+ *
+ * For each MultiDevice feature (including the "suite" feature, which acts as a
+ * gatekeeper for the others), the corresponding *State property is an enum
+ * containing the data necessary to display it. Note that hostDeviceName should
+ * be undefined if and only if no host has been set up, regardless of whether
+ * there are potential hosts on the account.
*
* @typedef {{
* mode: !settings.MultiDeviceSettingsMode,
- * hostDevice: (?RemoteDevice|undefined)
+ * hostDeviceName: (string|undefined),
+ * betterTogetherState: !settings.MultiDeviceFeatureState,
+ * instantTetheringState: !settings.MultiDeviceFeatureState,
+ * messagesState: !settings.MultiDeviceFeatureState,
+ * smartLockState: !settings.MultiDeviceFeatureState,
* }}
*/
let MultiDevicePageContentData;
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html
new file mode 100644
index 00000000000..709413725c9
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.html
@@ -0,0 +1,4 @@
+<link rel="import" href="chrome://resources/html/cr.html">
+<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="multidevice_constants.html">
+<script src="multidevice_feature_behavior.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js
new file mode 100644
index 00000000000..4179e9c94c7
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_behavior.js
@@ -0,0 +1,181 @@
+// 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.
+
+/**
+ * @fileoverview Polymer behavior for dealing with MultiDevice features. It is
+ * intended to facilitate passing data between elements in the MultiDevice page
+ * cleanly and concisely. It includes some constants and utility methods.
+ */
+cr.exportPath('settings');
+
+/** @polymerBehavior */
+const MultiDeviceFeatureBehaviorImpl = {
+ properties: {
+ /** @type {MultiDevicePageContentData} */
+ pageContentData: Object,
+
+ /**
+ * Enum defined in multidevice_constants.js.
+ * @type {Object<string, number>}
+ */
+ MultiDeviceFeature: {
+ type: Object,
+ value: settings.MultiDeviceFeature,
+ },
+ },
+
+ /**
+ * Whether the gatekeeper pref for the whole Better Together feature suite is
+ * on.
+ * @return {boolean}
+ */
+ isSuiteOn: function() {
+ return this.pageContentData.betterTogetherState ===
+ settings.MultiDeviceFeatureState.ENABLED_BY_USER;
+ },
+
+ /**
+ * Whether the gatekeeper pref for the whole Better Together feature suite is
+ * allowed by policy.
+ * @return {boolean}
+ */
+ isSuiteAllowedByPolicy: function() {
+ return this.pageContentData.betterTogetherState !==
+ settings.MultiDeviceFeatureState.PROHIBITED_BY_POLICY;
+ },
+
+ /**
+ * Whether an individual feature is allowed by policy.
+ * @param {!settings.MultiDeviceFeature} feature
+ * @return {boolean}
+ */
+ isFeatureAllowedByPolicy: function(feature) {
+ return this.getFeatureState(feature) !==
+ settings.MultiDeviceFeatureState.PROHIBITED_BY_POLICY;
+ },
+
+ /**
+ * @param {!settings.MultiDeviceFeature} feature
+ * @return {boolean}
+ */
+ isFeatureSupported: function(feature) {
+ return ![settings.MultiDeviceFeatureState.NOT_SUPPORTED_BY_CHROMEBOOK,
+ settings.MultiDeviceFeatureState.NOT_SUPPORTED_BY_PHONE,
+ ].includes(this.getFeatureState(feature));
+ },
+
+ /**
+ * Whether the user is prevented from attempted to change a given feature. In
+ * the UI this corresponds to a disabled toggle.
+ * @param {!settings.MultiDeviceFeature} feature
+ * @return {boolean}
+ */
+ isFeatureStateEditable: function(feature) {
+ // The suite is off and the toggle corresponds to an individual feature
+ // (as opposed to the full suite).
+ if (feature !== settings.MultiDeviceFeature.BETTER_TOGETHER_SUITE &&
+ !this.isSuiteOn()) {
+ return false;
+ }
+
+ return [
+ settings.MultiDeviceFeatureState.DISABLED_BY_USER,
+ settings.MultiDeviceFeatureState.ENABLED_BY_USER
+ ].includes(this.getFeatureState(feature));
+ },
+
+ /**
+ * The localized string representing the name of the feature.
+ * @param {!settings.MultiDeviceFeature} feature
+ * @return {string}
+ */
+ getFeatureName: function(feature) {
+ switch (feature) {
+ case settings.MultiDeviceFeature.INSTANT_TETHERING:
+ return this.i18n('multideviceInstantTetheringItemTitle');
+ case settings.MultiDeviceFeature.MESSAGES:
+ return this.i18n('multideviceAndroidMessagesItemTitle');
+ case settings.MultiDeviceFeature.SMART_LOCK:
+ return this.i18n('multideviceSmartLockItemTitle');
+ default:
+ return '';
+ }
+ },
+
+ /**
+ * The full icon name used provided by the containing iron-iconset-svg
+ * (i.e. [iron-iconset-svg name]:[SVG <g> tag id]) for a given feature.
+ * @param {!settings.MultiDeviceFeature} feature
+ * @return {string}
+ */
+ getIconName: function(feature) {
+ switch (feature) {
+ case settings.MultiDeviceFeature.BETTER_TOGETHER_SUITE:
+ return 'settings:multidevice-better-together-suite';
+ case settings.MultiDeviceFeature.MESSAGES:
+ return 'settings:multidevice-messages';
+ case settings.MultiDeviceFeature.SMART_LOCK:
+ return 'settings:multidevice-smart-lock';
+ default:
+ return '';
+ }
+ },
+
+ /**
+ * The localized string providing a description or useful status information
+ * concerning a given feature.
+ * @param {!settings.MultiDeviceFeature} feature
+ * @return {string}
+ */
+ getFeatureSummaryHtml: function(feature) {
+ switch (feature) {
+ case settings.MultiDeviceFeature.SMART_LOCK:
+ return this.i18nAdvanced('multideviceSmartLockItemSummary');
+ case settings.MultiDeviceFeature.MESSAGES:
+ return this.i18nAdvanced('multideviceAndroidMessagesItemSummary');
+ default:
+ return '';
+ }
+ },
+
+ /**
+ * Extracts the MultiDeviceFeatureState enum value describing the given
+ * feature from this.pageContentData. Returns null if the feature is not
+ * an accepted value (e.g. testing fake).
+ * @param {!settings.MultiDeviceFeature} feature
+ * @return {?settings.MultiDeviceFeatureState}
+ */
+ getFeatureState: function(feature) {
+ switch (feature) {
+ case settings.MultiDeviceFeature.BETTER_TOGETHER_SUITE:
+ return this.pageContentData.betterTogetherState;
+ case settings.MultiDeviceFeature.INSTANT_TETHERING:
+ return this.pageContentData.instantTetheringState;
+ case settings.MultiDeviceFeature.MESSAGES:
+ return this.pageContentData.messagesState;
+ case settings.MultiDeviceFeature.SMART_LOCK:
+ return this.pageContentData.smartLockState;
+ default:
+ return null;
+ }
+ },
+
+ /**
+ * Whether a host phone has been set by the user (not necessarily verified).
+ * @return {boolean}
+ */
+ isHostSet: function() {
+ return [
+ settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER,
+ settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION,
+ settings.MultiDeviceSettingsMode.HOST_SET_VERIFIED,
+ ].includes(this.pageContentData.mode);
+ },
+};
+
+/** @polymerBehavior */
+const MultiDeviceFeatureBehavior = [
+ I18nBehavior,
+ MultiDeviceFeatureBehaviorImpl,
+];
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.html
index e4a2b503647..2be742bad0e 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.html
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.html
@@ -7,37 +7,64 @@
<link rel="import" href="../icons.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
+<link rel="import" href="../settings_vars_css.html">
+<link rel="import" href="multidevice_constants.html">
+<link rel="import" href="multidevice_feature_behavior.html">
+<link rel="import" href="multidevice_feature_toggle.html">
<dom-module id="settings-multidevice-feature-item">
<template>
<style include="settings-shared">
+ #card {
+ border-top: var(--settings-separator-line);
+ border-top-style: var(--feature-item-border-top-style, solid);
+ padding: var(--feature-item-row-padding);
+ }
+
iron-icon {
padding: 2px;
}
- #item-text-container {
- -webkit-padding-start: 18px;
+ cr-policy-indicator {
+ padding: 0 var(--cr-controlled-by-spacing);
}
</style>
- <div class="settings-box two-line first"
+ <div id="card"
+ class="settings-box two-line"
on-click="handleItemClick_"
- actionable$="[[hasSubpageClickHandler_(subpageRoute)]]">
- <iron-icon icon="[[iconName]]"></iron-icon>
+ actionable$="[[hasSubpageClickHandler_(
+ subpageRoute, pageContentData, feature)]]">
+ <iron-icon icon="[[getIconName(feature)]]"></iron-icon>
<div id="item-text-container" class="middle">
- [[featureName]]
+ [[getFeatureName(feature)]]
<div class="secondary"
id="featureSecondary"
- inner-h-t-m-l="[[featureSummaryHtml]]">
+ inner-h-t-m-l="[[getFeatureSummaryHtml(feature)]]">
</div>
</div>
- <template is="dom-if" if="[[hasSubpageClickHandler_(subpageRoute)]]">
+ <template is="dom-if"
+ if="[[hasSubpageClickHandler_(
+ subpageRoute, pageContentData, feature)]]"
+ restamp>
<paper-icon-button-light class="subpage-arrow">
- <button aria-label="[[featureName]]"
- aria-describedby="featureSecondary"></button>
+ <button aria-label="[[getFeatureName(feature)]]"
+ aria-describedby="featureSecondary"></button>
</paper-icon-button-light>
<div class="separator"></div>
</template>
- <cr-toggle on-change="onChangeToggle_"></cr-toggle>
+ <template is="dom-if"
+ if="[[!isFeatureAllowedByPolicy(feature, pageContentData)]]"
+ restamp>
+ <cr-policy-indicator indicator-type="userPolicy"></cr-policy-indicator>
+ </template>
+ <slot name="feature-controller">
+ <!-- This settings-multidevice-feature-toggle is the default controller.
+ If an element with slot="feature-controller" is attached, it will
+ replace this one. -->
+ <settings-multidevice-feature-toggle feature="[[feature]]"
+ page-content-data="[[pageContentData]]">
+ </settings-multidevice-feature-toggle>
+ </slot>
</div>
</template>
<script src="multidevice_feature_item.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js
index 6b71b219733..55783509adb 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_item.js
@@ -15,30 +15,15 @@ cr.exportPath('settings');
Polymer({
is: 'settings-multidevice-feature-item',
- properties: {
- /**
- * The localized string representing the name of the feature.
- * @type {string}
- */
- featureName: String,
-
- /**
- * The localized string providing a description or useful status information
- * concertning the feature.
- * @type {string}
- */
- featureSummaryHtml: String,
+ behaviors: [MultiDeviceFeatureBehavior],
- /**
- * The full icon name used provided by the containing iron-iconset-svg
- * (i.e. [iron-iconset-svg name]:[SVG <g> tag id]
- * @type {string}
- */
- iconName: String,
+ properties: {
+ /** @type {!settings.MultiDeviceFeature} */
+ feature: Number,
/**
- * If it is non-null, the item should be actionable and clicking on it
- * should navigate there. If it is undefined, the item is simply not
+ * If it is truthy, the item should be actionable and clicking on it should
+ * navigate to the provided route. Otherwise, the item is simply not
* actionable.
* @type {settings.Route|undefined}
*/
@@ -50,18 +35,12 @@ Polymer({
* @private
*/
hasSubpageClickHandler_: function() {
- return !!this.subpageRoute;
- },
-
- /** @private */
- onChangeToggle_: function() {
- // TODO (jordynass): Trigger the correct workflow.
- console.log('Toggle changed');
+ return !!this.subpageRoute && this.isFeatureAllowedByPolicy(this.feature);
},
/** @private */
handleItemClick_: function(event) {
- if (!this.subpageRoute)
+ if (!this.hasSubpageClickHandler_())
return;
// We do not navigate away if the click was on a link.
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.html
new file mode 100644
index 00000000000..b52a7be4e64
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.html
@@ -0,0 +1,17 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
+<link rel="import" href="multidevice_browser_proxy.html">
+<link rel="import" href="multidevice_constants.html">
+<link rel="import" href="multidevice_feature_behavior.html">
+
+<dom-module id="settings-multidevice-feature-toggle">
+ <template>
+ <cr-toggle id="toggle"
+ checked="{{checked_}}"
+ disabled="[[!isFeatureStateEditable(feature, pageContentData)]]"
+ on-change="onChange_">
+ </cr-toggle>
+ </template>
+ <script src="multidevice_feature_toggle.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.js
new file mode 100644
index 00000000000..83350e86cb8
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_feature_toggle.js
@@ -0,0 +1,76 @@
+// 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.
+
+/**
+ * @fileoverview
+ * A toggle button specially suited for the MultiDevice Settings UI use-case.
+ * Instead of changing on clicks, it requests a pref change from the
+ * MultiDevice service and/or triggers a password check to grab an auth token
+ * for the user. It also receives real time updates on feature states and
+ * reflects them in the toggle status.
+ */
+Polymer({
+ is: 'settings-multidevice-feature-toggle',
+
+ behaviors: [MultiDeviceFeatureBehavior],
+
+ properties: {
+ /** @type {!settings.MultiDeviceFeature} */
+ feature: Number,
+
+ /** @private {boolean} */
+ checked_: Boolean,
+ },
+
+ listeners: {
+ 'click': 'onDisabledInnerToggleClick_',
+ },
+
+ // Note that, although this.feature does not change throughout the element's
+ // lifecycle, it must be listed as an observer dependency to ensure that
+ // this.feature is defined by the time of the observer's first call.
+ observers: ['resetChecked_(feature, pageContentData)'],
+
+ /**
+ * Because MultiDevice prefs are only meant to be controlled via the
+ * MultiDevice mojo service, we need the cr-toggle to appear not to change
+ * when pressed. This method resets it before a change is visible to the
+ * user.
+ * @private
+ */
+ resetChecked_: function() {
+ this.checked_ = this.getFeatureState(this.feature) ===
+ settings.MultiDeviceFeatureState.ENABLED_BY_USER;
+ },
+
+ /**
+ * This handles the edge case in which the inner toggle (i.e., the cr-toggle)
+ * is disabled. For context, the cr-toggle element naturally stops clicks
+ * from propagating as long as its disabled attribute is false. However, if
+ * the cr-toggle's disabled attribute is set to true, its pointer-event CSS
+ * property is set to 'none' automatically. Thus, if the cr-toggle is clicked
+ * while it is disabled, the click event targets the parent element directly
+ * instead of propagating through the cr-toggle. This handler prevents such a
+ * click from unintentionally bubbling up the tree.
+ * @private
+ */
+ onDisabledInnerToggleClick_: function(event) {
+ event.stopPropagation();
+ },
+
+ /**
+ * Callback for clicking on the toggle. It attempts to toggle the feature's
+ * status if the user is allowed.
+ * @private
+ */
+ onChange_: function() {
+ this.resetChecked_();
+
+ // Pass the negation of |this.checked_|: this indicates that if the toggle
+ // is checked, the intent is for it to be unchecked, and vice versa.
+ this.fire(
+ 'feature-toggle-clicked',
+ {feature: this.feature, enabled: !this.checked_});
+ },
+});
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.html
index 1708c06a264..c9c8c666188 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.html
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.html
@@ -1,66 +1,106 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="../icons.html">
<link rel="import" href="../route.html">
+<link rel="import" href="../controls/password_prompt_dialog.html">
<link rel="import" href="../settings_page/settings_animated_pages.html">
<link rel="import" href="../settings_page/settings_subpage.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="multidevice_browser_proxy.html">
<link rel="import" href="multidevice_constants.html">
+<link rel="import" href="multidevice_feature_behavior.html">
+<link rel="import" href="multidevice_feature_toggle.html">
<link rel="import" href="multidevice_subpage.html">
<dom-module id="settings-multidevice-page">
<template>
- <style include="settings-shared"></style>
+ <style include="settings-shared">
+ cr-policy-indicator {
+ padding: 0 var(--cr-controlled-by-spacing);
+ }
+ </style>
<settings-animated-pages id="pages" section="multidevice"
focus-config="[[focusConfig_]]">
<neon-animatable route-path="default">
<div id="multidevice-item"
- class="settings-box two-line first"
+ class="settings-box two-line"
on-click="handleItemClick_"
actionable$="[[doesClickOpenSubpage_(pageContentData)]]">
- <div class="start">
+ <template is="dom-if" if="[[isHostSet(pageContentData)]]" restamp>
+ <iron-icon icon=
+ "[[getIconName(MultiDeviceFeature.BETTER_TOGETHER_SUITE)]]">
+ </iron-icon>
+ </template>
+ <div class$=
+ "[[getMultiDeviceItemLabelBlockCssClass_(pageContentData)]]">
<div id="multidevice-label">[[getLabelText_(pageContentData)]]</div>
- <div class="secondary" id="mutltideviceSubLabel" inner-h-t-m-l=
- "[[getSubLabelInnerHtml_(pageContentData, hostEnabled_)]]">
+ <div id="mutltideviceSubLabel" class="secondary"
+ inner-h-t-m-l="[[getSubLabelInnerHtml_(pageContentData)]]">
</div>
</div>
<template is="dom-if"
- if="[[doesClickOpenSubpage_(pageContentData)]]">
- <paper-icon-button-light class="subpage-arrow">
- <button aria-label="[[getLabelText_(pageContentData)]]"
- aria-describedby="mutltideviceSubLabel"></button>
- </paper-icon-button-light>
+ if="[[!isSuiteAllowedByPolicy(pageContentData)]]"
+ restamp>
+ <cr-policy-indicator indicator-type="userPolicy">
+ </cr-policy-indicator>
+ <settings-multidevice-feature-toggle
+ feature="[[MultiDeviceFeature.BETTER_TOGETHER_SUITE]]"
+ page-content-data="[[pageContentData]]">
+ </settings-multidevice-feature-toggle>
+ </template>
+ <template is="dom-if"
+ if="[[shouldShowSeparatorAndSubpageArrow_(pageContentData)]]"
+ restamp>
+ <template is="dom-if"
+ if="[[doesClickOpenSubpage_(pageContentData)]]"
+ restamp>
+ <paper-icon-button-light class="subpage-arrow">
+ <button aria-label="[[getLabelText_(pageContentData)]]"
+ aria-describedby="mutltideviceSubLabel"></button>
+ </paper-icon-button-light>
+ </template>
+ <div class="separator"></div>
</template>
- <div class="separator"></div>
- <template is="dom-if" if="[[showButton_(pageContentData)]]" restamp>
+ <template is="dom-if"
+ if="[[shouldShowButton_(pageContentData)]]"
+ restamp>
<paper-button class="secondary-button"
+ disabled$="[[shouldDisableButton_(pageContentData)]]"
on-click="handleButtonClick_">
[[getButtonText_(pageContentData)]]
</paper-button>
</template>
- <template is="dom-if" if="[[showToggle_(pageContentData)]]" restamp>
- <cr-toggle checked="{{hostEnabled_}}"></cr-toggle>
+ <template is="dom-if"
+ if="[[shouldShowToggle_(pageContentData)]]"
+ restamp>
+ <settings-multidevice-feature-toggle
+ feature="[[MultiDeviceFeature.BETTER_TOGETHER_SUITE]]"
+ page-content-data="[[pageContentData]]">
+ </settings-multidevice-feature-toggle>
</template>
</div>
</neon-animatable>
- <template is="dom-if" route-path="/multidevice/features">
+ <template is="dom-if" route-path="/multidevice/features" restamp>
<settings-subpage associated-control="[[$$('#multidevice-item')]]"
- page-title="[[pageContentData.hostDevice.name]]">
- <settings-multidevice-subpage prefs="{{prefs}}"
- page-content-data="[[pageContentData]]"
- host-enabled="{{hostEnabled_}}">
+ page-title="[[pageContentData.hostDeviceName]]">
+ <settings-multidevice-subpage
+ page-content-data="[[pageContentData]]">
</settings-multidevice-subpage>
</settings-subpage>
</template>
</settings-animated-pages>
+ <template is="dom-if" if="[[showPasswordPromptDialog_]]" restamp>
+ <settings-password-prompt-dialog id="passwordPrompt">
+ </settings-password-prompt-dialog>
+ </template>
</template>
<script src="multidevice_page.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.js
index 9172aa548a2..f6dec83fc24 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page.js
@@ -11,30 +11,9 @@ cr.exportPath('settings');
Polymer({
is: 'settings-multidevice-page',
- behaviors: [I18nBehavior],
+ behaviors: [MultiDeviceFeatureBehavior],
properties: {
- /** SettingsPrefsElement 'prefs' Object reference. See prefs.js. */
- prefs: {
- type: Object,
- notify: true,
- },
-
- /** @type {MultiDevicePageContentData} */
- pageContentData: Object,
-
- // TODO(jordynass): Set this variable once the information is retrieved from
- // prefs.
- /**
- * True if the multidevice setup is complete and the paired phone has been
- * verified; otherwise, false.
- * @private {boolean}
- */
- hostEnabled_: {
- type: Boolean,
- value: true,
- },
-
/**
* A Map specifying which element should be focused when exiting a subpage.
* The key of the map holds a settings.Route path, and the value holds a
@@ -52,6 +31,42 @@ Polymer({
return map;
},
},
+
+ /**
+ * Authentication token provided by password-prompt-dialog.
+ * @private {string}
+ */
+ authToken_: {
+ type: String,
+ value: '',
+ observer: 'authTokenChanged_',
+ },
+
+ /**
+ * Feature which the user has requested to be enabled but could not be
+ * enabled immediately because authentication (i.e., entering a password) is
+ * required. This value is initialized to null, is set when the password
+ * dialog is opened, and is reset to null again once the password dialog is
+ * closed.
+ * @private {?settings.MultiDeviceFeature}
+ */
+ featureToBeEnabledOnceAuthenticated_: {
+ type: Number,
+ value: null,
+ },
+
+ /** @private {boolean} */
+ showPasswordPromptDialog_: {
+ type: Boolean,
+ value: false,
+ },
+ },
+
+ listeners: {
+ 'auth-token-changed': 'onAuthTokenChanged_',
+ 'close': 'onPasswordPromptDialogClose_',
+ 'feature-toggle-clicked': 'onFeatureToggleClicked_',
+ 'forget-device-requested': 'onForgetDeviceRequested_',
},
/** @private {?settings.MultiDeviceBrowserProxy} */
@@ -63,12 +78,22 @@ Polymer({
},
/**
+ * CSS class for the <div> containing all the text in the multidevice-item
+ * <div>, i.e. the label and sublabel. If the host is set, the Better Together
+ * icon appears so before the text (i.e. text div is 'middle' class).
+ * @return {string}
+ * @private
+ */
+ getMultiDeviceItemLabelBlockCssClass_: function() {
+ return this.isHostSet() ? 'middle' : 'start';
+ },
+
+ /**
* @return {string} Translated item label.
* @private
*/
getLabelText_: function() {
- return !!this.pageContentData.hostDevice ?
- this.pageContentData.hostDevice.name :
+ return this.pageContentData.hostDeviceName ||
this.i18n('multideviceSetupItemHeading');
},
@@ -77,7 +102,11 @@ Polymer({
* @private
*/
getSubLabelInnerHtml_: function() {
+ if (!this.isSuiteAllowedByPolicy())
+ return this.i18nAdvanced('multideviceSetupSummary');
switch (this.pageContentData.mode) {
+ case settings.MultiDeviceSettingsMode.NO_ELIGIBLE_HOSTS:
+ return this.i18nAdvanced('multideviceNoHostText');
case settings.MultiDeviceSettingsMode.NO_HOST_SET:
return this.i18nAdvanced('multideviceSetupSummary');
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER:
@@ -85,8 +114,8 @@ Polymer({
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION:
return this.i18nAdvanced('multideviceVerificationText');
default:
- return this.hostEnabled_ ? this.i18n('multideviceEnabled') :
- this.i18n('multideviceDisabled');
+ return this.isSuiteOn() ? this.i18n('multideviceEnabled') :
+ this.i18n('multideviceDisabled');
}
},
@@ -99,7 +128,7 @@ Polymer({
case settings.MultiDeviceSettingsMode.NO_HOST_SET:
return this.i18n('multideviceSetupButton');
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER:
- return this.i18n('retry');
+ return this.i18n('multideviceVerifyButton');
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION:
return this.i18n('multideviceVerifyButton');
default:
@@ -111,36 +140,56 @@ Polymer({
* @return {boolean}
* @private
*/
- showButton_: function() {
- return this.pageContentData.mode !=
- settings.MultiDeviceSettingsMode.HOST_SET_VERIFIED;
+ shouldShowButton_: function() {
+ return [
+ settings.MultiDeviceSettingsMode.NO_HOST_SET,
+ settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER,
+ settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION,
+ ].includes(this.pageContentData.mode);
},
/**
* @return {boolean}
* @private
*/
- showToggle_: function() {
- return this.pageContentData.mode ==
+ shouldDisableButton_: function() {
+ return this.pageContentData.mode ===
+ settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ shouldShowToggle_: function() {
+ return this.pageContentData.mode ===
settings.MultiDeviceSettingsMode.HOST_SET_VERIFIED;
},
/**
+ * Whether to show the separator bar and, if the state calls for a chevron
+ * (a.k.a. subpage arrow) routing to the subpage, the chevron.
+ * @return {boolean}
+ * @private
+ */
+ shouldShowSeparatorAndSubpageArrow_: function() {
+ return this.pageContentData.mode !==
+ settings.MultiDeviceSettingsMode.NO_ELIGIBLE_HOSTS;
+ },
+
+ /**
* @return {boolean}
* @private
*/
doesClickOpenSubpage_: function() {
- return [
- settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER,
- settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION,
- settings.MultiDeviceSettingsMode.HOST_SET_VERIFIED,
- ].includes(this.pageContentData.mode);
+ return this.isHostSet();
},
/** @private */
handleItemClick_: function() {
- if (!this.doesClickOpenSubpage_())
+ if (!this.isHostSet())
return;
+
settings.navigateTo(settings.routes.MULTIDEVICE_FEATURES);
},
@@ -152,13 +201,114 @@ Polymer({
this.browserProxy_.showMultiDeviceSetupDialog();
return;
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_SERVER:
- // TODO(jordynass): Implement this when API is ready.
- console.log('Trying to connect to server again.');
- return;
+ // Intentional fall-through.
case settings.MultiDeviceSettingsMode.HOST_SET_WAITING_FOR_VERIFICATION:
- // TODO(jordynass): Implement this when API is ready.
- console.log('Trying to verify multidevice connection.');
- return;
+ // If this device is waiting for action on the server or the host
+ // device, clicking the button should trigger this action.
+ this.browserProxy_.retryPendingHostSetup();
+ }
+ },
+
+ /** @private */
+ openPasswordPromptDialog_: function() {
+ this.showPasswordPromptDialog_ = true;
+ },
+
+ /** @private */
+ onPasswordPromptDialogClose_: function() {
+ // The password prompt should only be shown when there is a feature waiting
+ // to be enabled.
+ assert(this.featureToBeEnabledOnceAuthenticated_ !== null);
+
+ // If |this.authToken_| is set when the dialog has been closed, this means
+ // that the user entered the correct password into the dialog. Thus, send
+ // all pending features to be enabled.
+ if (this.authToken_) {
+ this.browserProxy_.setFeatureEnabledState(
+ this.featureToBeEnabledOnceAuthenticated_, true /* enabled */,
+ this.authToken_);
+
+ // Reset |this.authToken_| now that it has been used. This ensures that
+ // users cannot keep an old auth token and reuse it on an subsequent
+ // request.
+ this.authToken_ = '';
+ }
+
+ // Either the feature was enabled above or the user canceled the request by
+ // clicking "Cancel" on the password dialog. Thus, there is no longer a need
+ // to track any pending feature.
+ this.featureToBeEnabledOnceAuthenticated_ = null;
+
+ // Remove the password prompt dialog from the DOM.
+ this.showPasswordPromptDialog_ = false;
+ },
+
+ /**
+ * @param {!{detail: !Object}} event
+ * @private
+ */
+ onAuthTokenChanged_: function(event) {
+ this.authToken_ = event.detail.value;
+ },
+
+ /**
+ * Attempt to enable the provided feature. If not authenticated (i.e.,
+ * |authToken_| is invalid), display the password prompt to begin the
+ * authentication process.
+ *
+ * @param {!{detail: !Object}} event
+ * @private
+ */
+ onFeatureToggleClicked_: function(event) {
+ let feature = event.detail.feature;
+ let enabled = event.detail.enabled;
+
+ // Disabling any feature does not require authentication, and enable some
+ // features does not require authentication.
+ if (!enabled || !this.isAuthenticationRequiredToEnable_(feature)) {
+ this.browserProxy_.setFeatureEnabledState(feature, enabled);
+ return;
}
+
+ // If the feature required authentication to be enabled, open the password
+ // prompt dialog. This is required every time the user enables a security-
+ // sensitive feature (i.e., use of stale auth tokens is not acceptable).
+ this.featureToBeEnabledOnceAuthenticated_ = feature;
+ this.openPasswordPromptDialog_();
+ },
+
+ /**
+ * @param {!settings.MultiDeviceFeature} feature The feature to enable.
+ * @return {boolean} Whether authentication is required to enable the feature.
+ * @private
+ */
+ isAuthenticationRequiredToEnable_: function(feature) {
+ // Enabling SmartLock always requires authentication.
+ if (feature == settings.MultiDeviceFeature.SMART_LOCK)
+ return true;
+
+ // Enabling any feature besides SmartLock and the Better Together suite does
+ // not require authentication.
+ if (feature != settings.MultiDeviceFeature.BETTER_TOGETHER_SUITE)
+ return false;
+
+ const smartLockState =
+ this.getFeatureState(settings.MultiDeviceFeature.SMART_LOCK);
+
+ // If the user is enabling the Better Together suite and this change would
+ // result in SmartLock being implicitly enabled, authentication is required.
+ // SmartLock is implicitly enabled if it is only currently not enabled due
+ // to the suite being disabled or due to the SmartLock host device not
+ // having a lock screen set.
+ return smartLockState ==
+ settings.MultiDeviceFeatureState.UNAVAILABLE_SUITE_DISABLED ||
+ smartLockState ==
+ settings.MultiDeviceFeatureState.UNAVAILABLE_INSUFFICIENT_SECURITY;
+ },
+
+ /** @private */
+ onForgetDeviceRequested_: function() {
+ this.browserProxy_.removeHostDevice();
+ settings.navigateTo(settings.routes.MULTIDEVICE);
},
});
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.html
index 98b70696a94..c804083150d 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.html
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.html
@@ -2,15 +2,17 @@
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
-<link rel="import" href="multidevice_constants.html">
<link rel="import" href="multidevice_browser_proxy.html">
+<link rel="import" href="multidevice_constants.html">
+<link rel="import" href="multidevice_feature_behavior.html">
<link rel="import" href="multidevice_page.html">
<dom-module id="settings-multidevice-page-container">
<template>
- <template is="dom-if" if="[[doesPotentialConnectedPhoneExist]]" restamp>
- <settings-multidevice-page prefs="[[prefs]]"
- page-content-data="[[pageContentData_]]">
+ <template is="dom-if"
+ if="[[doesChromebookSupportMultiDeviceFeatures]]"
+ restamp>
+ <settings-multidevice-page page-content-data="[[pageContentData]]">
</settings-multidevice-page>
</template>
</template>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.js
index 87143142770..dd74a9271a4 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_page_container.js
@@ -18,28 +18,19 @@ cr.exportPath('settings');
Polymer({
is: 'settings-multidevice-page-container',
- behaviors: [WebUIListenerBehavior],
+ behaviors: [MultiDeviceFeatureBehavior, WebUIListenerBehavior],
properties: {
- /** SettingsPrefsElement 'prefs' Object reference. See prefs.js. */
- prefs: {
- type: Object,
- notify: true,
- },
-
/**
- * Whether a phone was found on the account that is either connected to the
- * Chromebook or has the potential to be.
+ * Whether the Chromebook is capable of enabling Better Together features.
* @type {boolean}
*/
- doesPotentialConnectedPhoneExist: {
+ doesChromebookSupportMultiDeviceFeatures: {
type: Boolean,
- computed: 'computeDoesPotentialConnectedPhoneExist(pageContentData_)',
+ computed:
+ 'computeDoesChromebookSupportMultiDeviceFeatures(pageContentData)',
notify: true,
},
-
- /** @private {MultiDevicePageContentData} */
- pageContentData_: Object,
},
/** @private {?settings.MultiDeviceBrowserProxy} */
@@ -66,13 +57,13 @@ Polymer({
console.error('Invalid status change');
return;
}
- this.pageContentData_ = newData;
+ this.pageContentData = newData;
},
/**
* If the new mode corresponds to no eligible host or unset potential hosts
- * (i.e. NO_ELIGIBLE_HOSTS or NO_HOST_SET), then newHostDevice should be null
- * or undefined. Otherwise it should be defined and non-null.
+ * (i.e. NO_ELIGIBLE_HOSTS or NO_HOST_SET), then newHostDeviceName should be
+ * falsy. Otherwise it should be truthy.
* @param {!MultiDevicePageContentData} newData
* @private
*/
@@ -81,16 +72,16 @@ Polymer({
settings.MultiDeviceSettingsMode.NO_ELIGIBLE_HOSTS,
settings.MultiDeviceSettingsMode.NO_HOST_SET,
];
- return !newData.hostDevice == noHostModes.includes(newData.mode);
+ return !newData.hostDeviceName === noHostModes.includes(newData.mode);
},
/**
* @return {boolean}
* @private
*/
- computeDoesPotentialConnectedPhoneExist: function() {
- return !!this.pageContentData_ &&
- this.pageContentData_.mode !=
- settings.MultiDeviceSettingsMode.NO_ELIGIBLE_HOSTS;
+ computeDoesChromebookSupportMultiDeviceFeatures: function() {
+ return !!this.pageContentData &&
+ this.isFeatureSupported(
+ settings.MultiDeviceFeature.BETTER_TOGETHER_SUITE);
},
});
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.html
index 3f78863025d..946ab4a626d 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.html
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.html
@@ -1,44 +1,136 @@
<link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_listener_behavior.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
+<link rel="import" href="multidevice_constants.html">
+<link rel="import" href="multidevice_feature_behavior.html">
<link rel="import" href="multidevice_feature_item.html">
+<link rel="import" href="multidevice_feature_toggle.html">
+<link rel="import" href="multidevice_tether_item.html">
<dom-module id="settings-multidevice-subpage">
<template>
<style include="settings-shared iron-flex">
+ settings-multidevice-feature-item,
+ settings-multidevice-tether-item {
+ --feature-item-row-padding: 0;
+ }
+
+ settings-multidevice-feature-item:first-of-type {
+ --feature-item-border-top-style: none;
+ }
+
#status-text-container[enabled] {
color: var(--google-green-500);
}
- .feature-item-container {
- -webkit-margin-end: var(--settings-box-row-padding);
- -webkit-margin-start: var(--settings-box-row-indent);
+ #feature-items-container,
+ #forget-device-container {
+ @apply(--settings-list-frame-padding);
+ }
+
+ #forget-device-container {
+ border-top: var(--settings-separator-line);
+ }
+
+ #forget-device {
+ padding: 0;
}
</style>
<div class="settings-box first">
- <div id="status-text-container" class="start" enabled$="[[hostEnabled]]">
- [[getStatusText_(hostEnabled)]]
+ <div id="status-text-container"
+ class="start"
+ enabled$="[[isSuiteOn(pageContentData)]]">
+ [[getStatusText_(pageContentData)]]
</div>
- <cr-toggle id="enable-multidevice" checked="{{hostEnabled}}">
- </cr-toggle>
+ <settings-multidevice-feature-toggle
+ feature="[[MultiDeviceFeature.BETTER_TOGETHER_SUITE]]"
+ page-content-data="[[pageContentData]]">
+ </settings-multidevice-feature-toggle>
</div>
<template is="dom-if"
if="[[shouldShowIndividualFeatures_(pageContentData)]]"
restamp>
- <div class="feature-item-container">
- <settings-multidevice-feature-item icon-name="settings:smart-lock"
- subpage-route="[[routes.LOCK_SCREEN]]"
- feature-name="$i18n{multideviceSmartLockItemTitle}"
- feature-summary-html="$i18n{multideviceSmartLockItemSummary}">
- </settings-multidevice-feature-item>
+ <div id="feature-items-container">
+ <template is="dom-if"
+ if="[[isFeatureSupported(
+ MultiDeviceFeature.SMART_LOCK, pageContentData)]]"
+ restamp>
+ <settings-multidevice-feature-item id="smartLockItem"
+ feature="[[MultiDeviceFeature.SMART_LOCK]]"
+ page-content-data="[[pageContentData]]"
+ subpage-route="[[routes.LOCK_SCREEN]]">
+ </settings-multidevice-feature-item>
+ </template>
+ <template is="dom-if"
+ if="[[isFeatureSupported(
+ MultiDeviceFeature.INSTANT_TETHERING, pageContentData)]]"
+ restamp>
+ <settings-multidevice-tether-item id="instantTetheringItem">
+ </settings-multidevice-tether-item>
+ </template>
+ <template is="dom-if"
+ if="[[isFeatureSupported(
+ MultiDeviceFeature.MESSAGES, pageContentData)]]"
+ restamp>
+ <settings-multidevice-feature-item id="messagesItem"
+ feature="[[MultiDeviceFeature.MESSAGES]]"
+ page-content-data="[[pageContentData]]">
+ <template is="dom-if" if="[[androidMessagesRequiresSetup_]]"
+ restamp>
+ <paper-button on-click="handleAndroidMessagesButtonClick_"
+ slot="feature-controller">
+ $i18n{multideviceSetupButton}
+ </paper-button>
+ </template>
+ </settings-multidevice-feature-item>
+ </template>
</div>
</template>
+ <div id="forget-device-container">
+ <div id="forget-device"
+ class="settings-box two-line first"
+ on-click="handleForgetDeviceClick_"
+ actionable>
+ <div class="start">
+ $i18n{multideviceForgetDevice}
+ <div class="secondary" id="multideviceForgetDeviceSummary">
+ $i18n{multideviceForgetDeviceSummary}
+ </div>
+ </div>
+ <paper-icon-button-light class="subpage-arrow">
+ <button aria-label="$i18n{multideviceForgetDevice}"
+ aria-describedby="multideviceForgetDeviceSummary"></button>
+ </paper-icon-button-light>
+ </div>
+ </div>
+ <cr-dialog id="forgetDeviceDialog" show-close-button="false">
+ <div slot="title">$i18n{multideviceForgetDeviceDialogHeading}</div>
+ <div slot="body">
+ <div class="settings-box first">
+ $i18n{multideviceForgetDeviceDialogMessage}
+ </div>
+ </div>
+ <div slot="button-container">
+ <paper-button class="cancel-button"
+ on-click="onForgetDeviceDialogCancelClick_">
+ $i18n{cancel}
+ </paper-button>
+
+ <paper-button id="confirmButton"
+ class="action-button"
+ on-click="onForgetDeviceDialogConfirmClick_">
+ $i18n{confirm}
+ </paper-button>
+ </div>
+ </cr-dialog>
</template>
<script src="multidevice_subpage.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.js
index 202a2b58d64..a8da00c237d 100644
--- a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.js
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_subpage.js
@@ -12,34 +12,71 @@ cr.exportPath('settings');
Polymer({
is: 'settings-multidevice-subpage',
- behaviors: [I18nBehavior],
+ behaviors: [
+ MultiDeviceFeatureBehavior,
+ CrNetworkListenerBehavior,
+ ],
properties: {
- /** SettingsPrefsElement 'prefs' Object reference. See prefs.js. */
- prefs: {
+ /** @type {?SettingsRoutes} */
+ routes: {
type: Object,
- notify: true,
+ value: settings.routes,
+ },
+
+ /** Overridden from NetworkListenerBehavior. */
+ networkingPrivate: {
+ type: Object,
+ value: chrome.networkingPrivate,
+ },
+
+ /** Overridden from NetworkListenerBehavior. */
+ networkListChangeSubscriberSelectors_: {
+ type: Array,
+ value: () => ['settings-multidevice-tether-item'],
+ },
+
+ /** Overridden from NetworkListenerBehavior. */
+ networksChangeSubscriberSelectors_: {
+ type: Array,
+ value: () => ['settings-multidevice-tether-item'],
},
- // TODO(jordynass): Set this based on data in this.prefs.
+ // TODO(jordynass): Once the service provides this data via pageContentData,
+ // replace this property with that path.
/**
- * If a host has been verified, this is true if that host is and enabled and
- * false if it is disabled. Otherwise it is undefined.
- * @type {boolean|undefined}
+ * If SMS Connect requires setup, it displays a paper button prompting the
+ * setup flow. If it is already set up, it displays a regular toggle for the
+ * feature.
+ * @private {boolean}
*/
- hostEnabled: {
+ androidMessagesRequiresSetup_: {
type: Boolean,
- notify: true,
+ value: true,
},
+ },
- /** @type {?SettingsRoutes} */
- routes: {
- type: Object,
- value: settings.routes,
- },
+ /** @private {?settings.MultiDeviceBrowserProxy} */
+ browserProxy_: null,
+
+ /** @override */
+ created: function() {
+ this.browserProxy_ = settings.MultiDeviceBrowserProxyImpl.getInstance();
+ },
+
+ /** @private */
+ handleAndroidMessagesButtonClick_: function() {
+ this.browserProxy_.setUpAndroidSms();
+ },
+
+ listeners: {
+ 'show-networks': 'onShowNetworks_',
+ },
- /** @type {MultiDevicePageContentData} */
- pageContentData: Object,
+ onShowNetworks_: function() {
+ settings.navigateTo(
+ settings.routes.INTERNET_NETWORKS,
+ new URLSearchParams('type=' + CrOnc.Type.TETHER));
},
/**
@@ -51,12 +88,28 @@ Polymer({
settings.MultiDeviceSettingsMode.HOST_SET_VERIFIED;
},
+ /** @private */
+ handleForgetDeviceClick_: function() {
+ this.$.forgetDeviceDialog.showModal();
+ },
+
+ /** @private */
+ onForgetDeviceDialogCancelClick_: function() {
+ this.$.forgetDeviceDialog.close();
+ },
+
+ /** @private */
+ onForgetDeviceDialogConfirmClick_: function() {
+ this.fire('forget-device-requested');
+ this.$.forgetDeviceDialog.close();
+ },
+
/**
* @return {string}
* @private
*/
getStatusText_: function() {
- return this.hostEnabled ? this.i18n('multideviceEnabled') :
+ return this.isSuiteOn() ? this.i18n('multideviceEnabled') :
this.i18n('multideviceDisabled');
},
});
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.html b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.html
new file mode 100644
index 00000000000..e831086d43e
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.html
@@ -0,0 +1,34 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
+<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="../internet_page/network_summary_item.html">
+<link rel="import" href="../settings_shared_css.html">
+<link rel="import" href="../settings_vars_css.html">
+
+<dom-module id="settings-multidevice-tether-item">
+ <style include="settings-shared">
+ network-summary-item {
+ --network-summary-item-outer-box: {
+ padding: var(--feature-item-row-padding);
+ };
+
+ --network-summary-item-title: {
+ color: var(--cr-primary-text-color);
+ font-weight: 400;
+ };
+ }
+ </style>
+ <template>
+ <network-summary-item id="networkSummaryItem"
+ active-network-state="[[activeNetworkState_]]"
+ device-state="[[deviceState_]]"
+ network-state-list="[[getNetworkStateList_(activeNetworkState_)]]"
+ networking-private="[[networkingPrivate]]"
+ tether-device-state="[[deviceState_]]"
+ network-title-text="$i18n{multideviceInstantTetheringItemTitle}">
+ </network-summary-item>
+ </template>
+ <script src="multidevice_tether_item.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js
new file mode 100644
index 00000000000..468d045f1b6
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/multidevice_page/multidevice_tether_item.js
@@ -0,0 +1,163 @@
+// 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.
+
+/**
+ * @fileoverview
+ * This element provides a layer between the settings-multidevice-subpage
+ * element and the internet_page folder's network-summary-item. It is
+ * responsible for loading initial tethering network data from the
+ * chrome.networkingPrivate API as well as updating the data in real time. It
+ * serves a role comparable to the internet_page's network-summary element.
+ */
+
+Polymer({
+ is: 'settings-multidevice-tether-item',
+
+ properties: {
+ /**
+ * Interface for networkingPrivate calls.
+ * @private {!NetworkingPrivate}
+ */
+ networkingPrivate_: {
+ type: Object,
+ value: chrome.networkingPrivate,
+ },
+
+ /**
+ * The device state for tethering.
+ * @private {?CrOnc.DeviceStateProperties|undefined}
+ */
+ deviceState_: Object,
+
+ /**
+ * The network state for a potential tethering host phone. Note that there
+ * is at most one because only one MultiDevice host phone is allowed on an
+ * account at a given time.
+ * @private {?CrOnc.NetworkStateProperties|undefined}
+ */
+ activeNetworkState_: Object,
+ },
+
+ listeners: {
+ 'device-enabled-toggled': 'onDeviceEnabledToggled_',
+ 'network-list-changed': 'updateTetherNetworkState_',
+ // network-changed is fired by the settings-multidevice-subpage element's
+ // CrNetworkListenerBehavior.
+ // TODO (jordynass): Refactor to allow this element to listen to network
+ // changes without requiring the settings-multidevice-subpage to communicate
+ // with the networkingPrivate API.
+ 'networks-changed': 'onNetworksChanged_',
+ },
+
+ /**
+ * Listener function for chrome.networkingPrivate.onDeviceStateListChanged
+ * event.
+ * @private {?function(!Array<string>)}
+ */
+ deviceStateListChangedListener_: null,
+
+ /** @override */
+ attached: function() {
+ this.updateTetherDeviceState_();
+ this.updateTetherNetworkState_();
+
+ this.deviceStateListChangedListener_ =
+ this.deviceStateListChangedListener_ ||
+ this.updateTetherDeviceState_.bind(this);
+ this.networkingPrivate_.onDeviceStateListChanged.addListener(
+ this.deviceStateListChangedListener_);
+ },
+
+ /** @override */
+ detached: function() {
+ this.networkingPrivate_.onDeviceStateListChanged.removeListener(
+ assert(this.deviceStateListChangedListener_));
+ },
+
+ /**
+ * Callback for the a network changing state. Note that any change to leading
+ * to a new active network would fire the 'network-list-changed' event,
+ * triggering updateTetherNetworkState_ and rendering this callback
+ * redundant. As a result, we return early if the active network is not
+ * changed.
+ * @param {{detail: Array<string>}} event stores an array of the GUIDs of all
+ * networks that changed in its detail property.
+ * @private
+ */
+ onNetworksChanged_: function(event) {
+ const id = this.activeNetworkState_.GUID;
+ if (!event.detail.includes(id))
+ return;
+ this.networkingPrivate_.getState(id, newNetworkState => {
+ if (chrome.runtime.lastError) {
+ const message = chrome.runtime.lastError.message;
+ if (message != 'Error.NetworkUnavailable' &&
+ message != 'Error.InvalidNetworkGuid') {
+ console.error(
+ 'Unexpected networkingPrivate.getState error: ' + message +
+ ' For: ' + id);
+ return;
+ }
+ }
+ this.activeNetworkState_ = newNetworkState;
+ });
+ },
+
+ /**
+ * Event triggered by a device state enabled toggle.
+ * @param {!{detail: {enabled: boolean, type: CrOnc.Type}}} event
+ * @private
+ */
+ onDeviceEnabledToggled_: function(event) {
+ if (event.detail.enabled)
+ this.networkingPrivate_.enableNetworkType(CrOnc.Type.TETHER);
+ else
+ this.networkingPrivate_.disableNetworkType(CrOnc.Type.TETHER);
+ },
+
+ /**
+ * Retrieves device states (CrOnc.DeviceStateProperties) and sets
+ * this.deviceState_ to the retrieved Instant Tethering state (or undefined if
+ * there is none) in its callback. Note that the function
+ * chrome.networkingPrivate.getDevicePolicy() retrieves at most one object per
+ * network type (CrOnc.Type) so, in particular there will be at most one state
+ * for Instant Tethering.
+ * @private
+ */
+ updateTetherDeviceState_: function() {
+ this.networkingPrivate_.getDeviceStates(deviceStates => {
+ this.deviceState_ =
+ deviceStates.find(
+ deviceState => deviceState.Type == CrOnc.Type.TETHER) ||
+ {Type: CrOnc.Type.TETHER, State: CrOnc.DeviceState.DISABLED};
+ });
+ },
+
+ /**
+ * Retrieves all Instant Tethering network states
+ * (CrOnc.NetworkStateProperties). Note that there is at most one because
+ * only one host is allowed on an account at a given time. Then it sets
+ * this.activeNetworkState_ to that network if there is one or a dummy object
+ * with an empty string for a GUID otherwise.
+ * @private
+ */
+ updateTetherNetworkState_: function() {
+ this.networkingPrivate_.getNetworks(
+ {networkType: CrOnc.Type.TETHER}, networkStates => {
+ this.activeNetworkState_ =
+ networkStates[0] || {GUID: '', Type: CrOnc.Type.TETHER};
+ });
+ },
+
+ /**
+ * Returns an array containing the active network state if there is one
+ * (note that if there is not GUID will be falsy). Returns an empty array
+ * otherwise.
+ * @return {!Array<CrOnc.NetworkStateProperties>}
+ * @private
+ */
+ getNetworkStateList_: function() {
+ return this.activeNetworkState_.GUID ? [this.activeNetworkState_] : [];
+ },
+});
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/BUILD.gn b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/BUILD.gn
index 4f4ba6a686b..a8f8b60e2b6 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/BUILD.gn
@@ -14,6 +14,7 @@ js_type_check("closure_compile") {
":password_manager_proxy",
":passwords_and_forms_page",
":passwords_section",
+ ":payments_section",
":show_password_behavior",
]
}
@@ -22,6 +23,7 @@ js_library("passwords_and_forms_page") {
deps = [
":autofill_section",
":passwords_section",
+ ":payments_section",
"..:route",
"../prefs:prefs_behavior",
"../settings_page:settings_animated_pages",
@@ -37,10 +39,22 @@ js_library("passwords_and_forms_page") {
js_library("autofill_section") {
deps = [
":address_edit_dialog",
+ "//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
+ "//ui/webui/resources/js:assert",
+ "//ui/webui/resources/js:load_time_data",
+ "//ui/webui/resources/js/cr/ui:focus_without_ink",
+ ]
+ externs_list = [ "$externs_path/autofill_private.js" ]
+}
+
+js_library("payments_section") {
+ deps = [
":credit_card_edit_dialog",
+ "../people_page:sync_browser_proxy",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
"//ui/webui/resources/js:assert",
- "//ui/webui/resources/js:i18n_behavior",
+ "//ui/webui/resources/js:load_time_data",
+ "//ui/webui/resources/js:web_ui_listener_behavior",
"//ui/webui/resources/js/cr/ui:focus_without_ink",
]
externs_list = [ "$externs_path/autofill_private.js" ]
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html
index 45beb855788..5ceba365497 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.html
@@ -18,7 +18,7 @@
}
.address-column {
- -webkit-margin-end: 16px;
+ margin-inline-end: 16px;
width: calc((var(--settings-input-max-width) - 16px) / 2);
}
@@ -77,12 +77,13 @@
<template is="dom-if" if="[[item.isTextArea]]">
<settings-textarea label="[[item.component.fieldName]]"
value="{{item.value}}" on-value-changed="updateCanSave_"
- class$="address-column [[long_(item)]]" autofocus>
+ class$="address-column [[long_(item)]]" autofocus
+ spellcheck="false">
</settings-textarea>
</template>
<template is="dom-if" if="[[!item.isTextArea]]">
<cr-input type="text" label="[[item.component.fieldName]]"
- autofocus value="{{item.value}}"
+ autofocus value="{{item.value}}" spellcheck="false"
on-value-changed="updateCanSave_"
class$="address-column [[long_(item)]]">
</cr-input>
@@ -106,11 +107,11 @@
<div class="address-row">
<cr-input id="phoneInput" type="text" label="$i18n{addressPhone}"
class="address-column last-row" on-value-changed="updateCanSave_"
- value="{{phoneNumber_}}">
+ value="{{phoneNumber_}}" spellcheck="false">
</cr-input>
<cr-input id="emailInput" type="text" label="$i18n{addressEmail}"
on-value-changed="updateCanSave_" value="{{email_}}"
- class="address-column long last-row">
+ class="address-column long last-row" spellcheck="false">
</cr-input>
</div>
</div>
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.js b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.js
index 1ec36ce4685..a184152c8af 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.js
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/address_edit_dialog.js
@@ -92,9 +92,23 @@ Polymer({
// Default to the last country used if no country code is provided.
const countryCode = this.countryCode_ || this.countries_[0].countryCode;
this.countryInfo.getAddressFormat(countryCode).then(format => {
- this.addressWrapper_ = format.components.map(
- component => component.row.map(
- c => new settings.address.AddressComponentUI(this.address, c)));
+ let filteredComponent =
+ format.components.map(component => component.row.filter(c => {
+ return (
+ loadTimeData.getBoolean('EnableCompanyName') ||
+ c.field !== chrome.autofillPrivate.AddressField.COMPANY_NAME);
+ }));
+ this.addressWrapper_ =
+ filteredComponent
+ .filter(component => {
+ return (component && component.length > 0);
+ })
+ .map(component => {
+ return component.map(c => {
+ return new settings.address.AddressComponentUI(
+ this.address, c);
+ });
+ });
// Flush dom before resize and savability updates.
Polymer.dom.flush();
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html
index 6883353a5c3..e9427a1e447 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.html
@@ -1,13 +1,8 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
-<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
-<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
-<link rel="import" href="chrome://resources/html/action_link.html">
-<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
-<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../settings_shared_css.html">
@@ -15,32 +10,11 @@
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="address_edit_dialog.html">
-<link rel="import" href="credit_card_edit_dialog.html">
<link rel="import" href="passwords_shared_css.html">
<dom-module id="settings-autofill-section">
<template>
- <style include="settings-shared passwords-shared action-link">
- .type-column {
- align-items: center;
- flex: 2;
- }
-
- .expiration-column {
- align-items: center;
- display: flex;
- flex: 1;
- }
-
- .expiration-date {
- flex: 1;
- }
-
- .payments-label {
- -webkit-margin-start: 16px;
- color: var(--cr-secondary-text-color);
- }
-
+ <style include="settings-shared passwords-shared">
#addressList .start {
display: flex;
overflow: hidden;
@@ -51,34 +25,22 @@
flex: 1;
overflow: hidden;
}
-
- .ellipses {
- flex: 1;
- max-width: fit-content;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- cr-policy-indicator {
- padding-right: 20px;
- width: 20px;
- }
</style>
- <settings-toggle-button id="autofillToggle"
- class="first"
+ <settings-toggle-button id="autofillProfileToggle"
+ class="settings-box first"
aria-label="$i18n{autofill}" no-extension-indicator
- label="$i18n{autofillFormsLabel}"
- pref="{{prefs.autofill.enabled}}">
+ label="$i18n{enableProfilesLabel}"
+ sub-label="$i18n{enableProfilesSublabel}"
+ pref="{{prefs.autofill.profile_enabled}}">
</settings-toggle-button>
- <template is="dom-if" if="[[prefs.autofill.enabled.extensionId]]">
+ <template is="dom-if" if="[[prefs.autofill.profile_enabled.extensionId]]">
<div class="settings-box continuation">
<extension-controlled-indicator class="start"
id="autofillExtensionIndicator"
- extension-id="[[prefs.autofill.enabled.extensionId]]"
- extension-name="[[prefs.autofill.enabled.controlledByName]]"
+ extension-id="[[prefs.autofill.profile_enabled.extensionId]]"
+ extension-name="[[prefs.autofill.profile_enabled.controlledByName]]"
extension-can-be-disabled="[[
- prefs.autofill.enabled.extensionCanBeDisabled]]">
+ prefs.autofill.profile_enabled.extensionCanBeDisabled]]">
</extension-controlled-indicator>
</div>
</template>
@@ -86,7 +48,8 @@
<h2 class="start">$i18n{addresses}</h2>
<paper-button id="addAddress"
class="secondary-button header-aligned-button"
- on-click="onAddAddressTap_">
+ on-click="onAddAddressTap_"
+ disabled$="[[!prefs.autofill.profile_enabled.value]]">
$i18n{add}
</paper-button>
</div>
@@ -103,9 +66,6 @@
[[item.metadata.summarySublabel]]
</span>
</span>
- <span class="payments-label" hidden$="[[item.metadata.isLocal]]">
- $i18n{googlePayments}
- </span>
</div>
<template is="dom-if" if="[[item.metadata.isLocal]]">
<paper-icon-button-light class="icon-more-vert">
@@ -135,81 +95,9 @@
</cr-action-menu>
<template is="dom-if" if="[[showAddressDialog_]]" restamp>
<settings-address-edit-dialog address="[[activeAddress]]"
- on-close="onAddressDialogClosed_">
+ on-close="onAddressDialogClose_">
</settings-address-edit-dialog>
</template>
- <div class="settings-box first">
- <h2 class="start">$i18n{creditCards}</h2>
- <paper-button id="addCreditCard"
- class="secondary-button header-aligned-button"
- on-click="onAddCreditCardTap_">
- $i18n{add}
- </paper-button>
- </div>
- <div class="list-frame">
- <div id="creditCardsHeading" class="list-item column-header"
- hidden$="[[!hasSome_(creditCards)]]">
- <div class="type-column">$i18n{creditCardType}</div>
- <div class="expiration-column">$i18n{creditCardExpiration}</div>
- </div>
- <div id="creditCardList" class="vertical-list list-with-header">
- <template is="dom-repeat" items="[[creditCards]]">
- <div class="list-item">
- <div class="type-column">
- <span id="creditCardLabel">[[item.metadata.summaryLabel]]</span>
- <span class="payments-label"
- hidden$="[[item.metadata.isLocal]]">
- <span hidden$="[[item.metadata.isCached]]">
- $i18n{googlePayments}
- </span>
- <span hidden$="[[!item.metadata.isCached]]">
- $i18n{googlePaymentsCached}
- </span>
- </span>
- </div>
- <div class="expiration-column">
- <div id="creditCardExpiration"
- class="expiration-date">[[expiration_(item)]]</div>
- <template is="dom-if" if="[[showDots_(item.metadata)]]">
- <paper-icon-button-light class="icon-more-vert">
- <button id="creditCardMenu" title="$i18n{moreActions}"
- on-click="onCreditCardMenuTap_">
- </button>
- </paper-icon-button-light>
- </template>
- <template is="dom-if" if="[[!showDots_(item.metadata)]]">
- <paper-icon-button-light actionable class="icon-external">
- <button id="remoteCreditCardLink"
- on-click="onRemoteEditCreditCardTap_">
- </button>
- </paper-icon-button-light>
- </template>
- </div>
- </div>
- </template>
- </div>
- <div id="noCreditCardsLabel" class="list-item"
- hidden$="[[hasSome_(creditCards)]]">
- $i18n{noCreditCardsFound}
- </div>
- </div>
- <cr-action-menu id="creditCardSharedMenu">
- <button id="menuEditCreditCard" slot="item" class="dropdown-item"
- on-click="onMenuEditCreditCardTap_">$i18n{edit}</button>
- <button id="menuRemoveCreditCard" slot="item" class="dropdown-item"
- hidden$="[[!activeCreditCard.metadata.isLocal]]"
- on-click="onMenuRemoveCreditCardTap_">$i18n{removeCreditCard}</button>
- <button id="menuClearCreditCard" slot="item" class="dropdown-item"
- on-click="onMenuClearCreditCardTap_"
- hidden$="[[!activeCreditCard.metadata.isCached]]">
- $i18n{clearCreditCard}
- </button>
- </cr-action-menu>
- <template is="dom-if" if="[[showCreditCardDialog_]]" restamp>
- <settings-credit-card-edit-dialog credit-card="[[activeCreditCard]]"
- on-close="onCreditCardDialogClosed_">
- </settings-credit-card-edit-dialog>
- </template>
</template>
<script src="autofill_section.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
index ef0055304d9..25bd70563bf 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/autofill_section.js
@@ -4,7 +4,7 @@
/**
* @fileoverview 'settings-autofill-section' is the section containing saved
- * addresses and credit cards for use in autofill.
+ * addresses for use in autofill and payments APIs.
*/
/**
@@ -38,44 +38,11 @@ class AutofillManager {
/** @param {string} guid The guid of the address to remove. */
removeAddress(guid) {}
-
- /**
- * Add an observer to the list of credit cards.
- * @param {function(!Array<!AutofillManager.CreditCardEntry>):void} listener
- */
- addCreditCardListChangedListener(listener) {}
-
- /**
- * Remove an observer from the list of credit cards.
- * @param {function(!Array<!AutofillManager.CreditCardEntry>):void} listener
- */
- removeCreditCardListChangedListener(listener) {}
-
- /**
- * Request the list of credit cards.
- * @param {function(!Array<!AutofillManager.CreditCardEntry>):void} callback
- */
- getCreditCardList(callback) {}
-
- /** @param {string} guid The GUID of the credit card to remove. */
- removeCreditCard(guid) {}
-
- /** @param {string} guid The GUID to credit card to remove from the cache. */
- clearCachedCreditCard(guid) {}
-
- /**
- * Saves the given credit card.
- * @param {!AutofillManager.CreditCardEntry} creditCard
- */
- saveCreditCard(creditCard) {}
}
/** @typedef {chrome.autofillPrivate.AddressEntry} */
AutofillManager.AddressEntry;
-/** @typedef {chrome.autofillPrivate.CreditCardEntry} */
-AutofillManager.CreditCardEntry;
-
/**
* Implementation that accesses the private API.
* @implements {AutofillManager}
@@ -105,36 +72,6 @@ class AutofillManagerImpl {
removeAddress(guid) {
chrome.autofillPrivate.removeEntry(assert(guid));
}
-
- /** @override */
- addCreditCardListChangedListener(listener) {
- chrome.autofillPrivate.onCreditCardListChanged.addListener(listener);
- }
-
- /** @override */
- removeCreditCardListChangedListener(listener) {
- chrome.autofillPrivate.onCreditCardListChanged.removeListener(listener);
- }
-
- /** @override */
- getCreditCardList(callback) {
- chrome.autofillPrivate.getCreditCardList(callback);
- }
-
- /** @override */
- removeCreditCard(guid) {
- chrome.autofillPrivate.removeEntry(assert(guid));
- }
-
- /** @override */
- clearCachedCreditCard(guid) {
- chrome.autofillPrivate.maskCreditCard(assert(guid));
- }
-
- /** @override */
- saveCreditCard(creditCard) {
- chrome.autofillPrivate.saveCreditCard(creditCard);
- }
}
cr.addSingletonGetter(AutofillManagerImpl);
@@ -145,8 +82,6 @@ cr.addSingletonGetter(AutofillManagerImpl);
Polymer({
is: 'settings-autofill-section',
- behaviors: [I18nBehavior],
-
properties: {
/**
* An array of saved addresses.
@@ -162,26 +97,10 @@ Polymer({
/** @private */
showAddressDialog_: Boolean,
-
- /**
- * An array of saved credit cards.
- * @type {!Array<!AutofillManager.CreditCardEntry>}
- */
- creditCards: Array,
-
- /**
- * The model for any credit card related action menus or dialogs.
- * @private {?chrome.autofillPrivate.CreditCardEntry}
- */
- activeCreditCard: Object,
-
- /** @private */
- showCreditCardDialog_: Boolean,
},
listeners: {
'save-address': 'saveAddress_',
- 'save-credit-card': 'saveCreditCard_',
},
/**
@@ -203,12 +122,6 @@ Polymer({
*/
setAddressesListener_: null,
- /**
- * @type {?function(!Array<!AutofillManager.CreditCardEntry>)}
- * @private
- */
- setCreditCardsListener_: null,
-
/** @override */
attached: function() {
// Create listener functions.
@@ -217,26 +130,17 @@ Polymer({
this.addresses = list;
};
- /** @type {function(!Array<!AutofillManager.CreditCardEntry>)} */
- const setCreditCardsListener = list => {
- this.creditCards = list;
- };
-
// Remember the bound reference in order to detach.
this.setAddressesListener_ = setAddressesListener;
- this.setCreditCardsListener_ = setCreditCardsListener;
// Set the managers. These can be overridden by tests.
this.autofillManager_ = AutofillManagerImpl.getInstance();
// Request initial data.
this.autofillManager_.getAddressList(setAddressesListener);
- this.autofillManager_.getCreditCardList(setCreditCardsListener);
// Listen for changes.
this.autofillManager_.addAddressListChangedListener(setAddressesListener);
- this.autofillManager_.addCreditCardListChangedListener(
- setCreditCardsListener);
},
/** @override */
@@ -244,19 +148,6 @@ Polymer({
this.autofillManager_.removeAddressListChangedListener(
/** @type {function(!Array<!AutofillManager.AddressEntry>)} */ (
this.setAddressesListener_));
- this.autofillManager_.removeCreditCardListChangedListener(
- /** @type {function(!Array<!AutofillManager.CreditCardEntry>)} */ (
- this.setCreditCardsListener_));
- },
-
- /**
- * Formats the expiration date so it's displayed as MM/YYYY.
- * @param {!chrome.autofillPrivate.CreditCardEntry} item
- * @return {string}
- * @private
- */
- expiration_: function(item) {
- return item.expirationMonth + '/' + item.expirationYear;
},
/**
@@ -297,7 +188,7 @@ Polymer({
},
/** @private */
- onAddressDialogClosed_: function() {
+ onAddressDialogClose_: function() {
this.showAddressDialog_ = false;
cr.ui.focusWithoutInk(assert(this.activeDialogAnchor_));
this.activeDialogAnchor_ = null;
@@ -316,7 +207,7 @@ Polymer({
/** @private */
onRemoteEditAddressTap_: function() {
- window.open(this.i18n('manageAddressesUrl'));
+ window.open(loadTimeData.getString('manageAddressesUrl'));
},
/**
@@ -330,107 +221,6 @@ Polymer({
},
/**
- * Opens the credit card action menu.
- * @param {!Event} e The polymer event.
- * @private
- */
- onCreditCardMenuTap_: function(e) {
- const menuEvent = /** @type {!{model: !{item: !Object}}} */ (e);
-
- /* TODO(scottchen): drop the [dataHost][dataHost] once this bug is fixed:
- https://github.com/Polymer/polymer/issues/2574 */
- // TODO(dpapad): The [dataHost][dataHost] workaround is only necessary for
- // Polymer 1. Remove once migration to Polymer 2 has completed.
- const item = Polymer.DomIf ? menuEvent.model.item :
- menuEvent.model['dataHost']['dataHost'].item;
-
- // Copy item so dialog won't update model on cancel.
- this.activeCreditCard =
- /** @type {!chrome.autofillPrivate.CreditCardEntry} */ (
- Object.assign({}, item));
-
- const dotsButton = /** @type {!HTMLElement} */ (Polymer.dom(e).localTarget);
- /** @type {!CrActionMenuElement} */ (this.$.creditCardSharedMenu)
- .showAt(dotsButton);
- this.activeDialogAnchor_ = dotsButton;
- },
-
- /**
- * Handles tapping on the "Add credit card" button.
- * @param {!Event} e
- * @private
- */
- onAddCreditCardTap_: function(e) {
- e.preventDefault();
- const date = new Date(); // Default to current month/year.
- const expirationMonth = date.getMonth() + 1; // Months are 0 based.
- this.activeCreditCard = {
- expirationMonth: expirationMonth.toString(),
- expirationYear: date.getFullYear().toString(),
- };
- this.showCreditCardDialog_ = true;
- this.activeDialogAnchor_ = this.$.addCreditCard;
- },
-
- /** @private */
- onCreditCardDialogClosed_: function() {
- this.showCreditCardDialog_ = false;
- cr.ui.focusWithoutInk(assert(this.activeDialogAnchor_));
- this.activeDialogAnchor_ = null;
- },
-
- /**
- * Handles tapping on the "Edit" credit card button.
- * @param {!Event} e The polymer event.
- * @private
- */
- onMenuEditCreditCardTap_: function(e) {
- e.preventDefault();
-
- if (this.activeCreditCard.metadata.isLocal)
- this.showCreditCardDialog_ = true;
- else
- this.onRemoteEditCreditCardTap_();
-
- this.$.creditCardSharedMenu.close();
- },
-
- /** @private */
- onRemoteEditCreditCardTap_: function() {
- window.open(this.i18n('manageCreditCardsUrl'));
- },
-
- /**
- * Handles tapping on the "Remove" credit card button.
- * @private
- */
- onMenuRemoveCreditCardTap_: function() {
- this.autofillManager_.removeCreditCard(
- /** @type {string} */ (this.activeCreditCard.guid));
- this.$.creditCardSharedMenu.close();
- },
-
- /**
- * Handles tapping on the "Clear copy" button for cached credit cards.
- * @private
- */
- onMenuClearCreditCardTap_: function() {
- this.autofillManager_.clearCachedCreditCard(
- /** @type {string} */ (this.activeCreditCard.guid));
- this.$.creditCardSharedMenu.close();
- },
-
- /**
- * The 3-dot menu should not be shown if the card is entirely remote.
- * @param {!chrome.autofillPrivate.AutofillMetadata} metadata
- * @return {boolean}
- * @private
- */
- showDots_: function(metadata) {
- return !!(metadata.isLocal || metadata.isCached);
- },
-
- /**
* Returns true if the list exists and has items.
* @param {Array<Object>} list
* @return {boolean}
@@ -448,23 +238,5 @@ Polymer({
saveAddress_: function(event) {
this.autofillManager_.saveAddress(event.detail);
},
-
- /**
- * Listens for the save-credit-card event, and calls the private API.
- * @param {!Event} event
- * @private
- */
- saveCreditCard_: function(event) {
- this.autofillManager_.saveCreditCard(event.detail);
- },
-
- /**
- * @private
- * @param {boolean} toggleValue
- * @return {string}
- */
- getOnOffLabel_: function(toggleValue) {
- return toggleValue ? this.i18n('toggleOn') : this.i18n('toggleOff');
- }
});
})();
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html
index d7228196d7f..7138118d0c4 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/credit_card_edit_dialog.html
@@ -19,7 +19,7 @@
}
.md-select + .md-select {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
/* Prevent focus-outline from being chopped by the bottom of dialog body.
@@ -54,7 +54,7 @@
<div slot="title">[[title_]]</div>
<div slot="body">
<cr-input id="nameInput" label="$i18n{creditCardName}"
- value="{{creditCard.name}}" autofocus
+ value="{{creditCard.name}}" autofocus spellcheck="false"
on-input="onCreditCardNameOrNumberChanged_">
</cr-input>
<cr-input id="numberInput" label="$i18n{creditCardNumber}"
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html
index 84ead164afc..9b7f575fca7 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_edit_dialog.html
@@ -35,8 +35,8 @@
}
paper-icon-button-light {
- -webkit-margin-start: 2px;
background-size: 24px; /* Other buttons are sized by --cr-icon-size. */
+ margin-inline-start: 2px;
}
</style>
<cr-dialog id="dialog" close-text="$i18n{close}">
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_list_item.js b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_list_item.js
index 862c1dd4dc3..0c97de354b1 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_list_item.js
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/password_list_item.js
@@ -10,14 +10,17 @@
Polymer({
is: 'password-list-item',
- behaviors: [FocusRowBehavior, ShowPasswordBehavior],
+ behaviors: [
+ FocusRowBehavior,
+ ShowPasswordBehavior,
+ ],
/**
* Selects the password on tap if revealed.
* @private
*/
onReadonlyInputTap_: function() {
- if (this.password)
+ if (this.item.password)
this.$$('#password').select();
},
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html
index 8a2376f9935..e1282d3061e 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.html
@@ -8,6 +8,7 @@
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="autofill_section.html">
<link rel="import" href="passwords_section.html">
+<link rel="import" href="payments_section.html">
<link rel="import" href="../controls/extension_controlled_indicator.html">
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../prefs/prefs.html">
@@ -27,6 +28,10 @@
id="autofillManagerButton" label="$i18n{autofill}"
sub-label="$i18n{autofillDetail}" on-click="onAutofillTap_">
</cr-link-row>
+ <cr-link-row icon-class="subpage-arrow"
+ id="paymentManagerButton" label="$i18n{creditCards}"
+ sub-label="$i18n{creditCardsDetail}" on-click="onPaymentsTap_">
+ </cr-link-row>
<div class="settings-box two-line">
<div class="start two-line" on-click="onPasswordsTap_" actionable
id="passwordManagerButton">
@@ -51,6 +56,14 @@
</settings-autofill-section>
</settings-subpage>
</template>
+ <template is="dom-if" route-path="/payments">
+ <settings-subpage
+ associated-control="[[$$('#paymentManagerButton')]]"
+ page-title="$i18n{creditCards}">
+ <settings-payments-section id="paymentSection" prefs="{{prefs}}">
+ </settings-payments-section>
+ </settings-subpage>
+ </template>
<template is="dom-if" route-path="/passwords">
<settings-subpage
associated-control="[[$$('#passwordManagerButton')]]"
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
index b5ec2f9ad89..eadb3769d0c 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_and_forms_page.js
@@ -39,11 +39,18 @@ Polymer({
},
/**
+ * Shows the manage payment methods sub page.
+ * @private
+ */
+ onPaymentsTap_: function() {
+ settings.navigateTo(settings.routes.PAYMENTS);
+ },
+
+ /**
* Shows the manage passwords sub page.
- * @param {!Event} event
* @private
*/
- onPasswordsTap_: function(event) {
+ onPasswordsTap_: function() {
settings.navigateTo(settings.routes.MANAGE_PASSWORDS);
},
});
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_export_dialog.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_export_dialog.html
index 33e3643e397..bb85a7e20b2 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_export_dialog.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_export_dialog.html
@@ -13,7 +13,7 @@
--paper-progress-active-color: var(--google-blue-500);
}
.action-button {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
</style>
<cr-dialog id="dialog_start" close-text="$i18n{close}">
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
index c9f66d0f5d9..eafabb70dbb 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.html
@@ -30,7 +30,7 @@
* columns. It is necessary due to the absence of the "more actions"
* button in the heading.
*/
- -webkit-padding-end: calc(
+ padding-inline-end: calc(
var(--cr-icon-ripple-size) + var(--cr-icon-button-margin-start));
}
@@ -44,7 +44,7 @@
}
#exportImportMenuButtonContainer {
- -webkit-margin-end: 0;
+ margin-inline-end: 0;
}
</style>
<settings-toggle-button id="passwordToggle"
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
index 243d81313d8..e5ec2b4ed72 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_section.js
@@ -150,25 +150,30 @@ Polymer({
/** @override */
attached: function() {
+ // The item uid is built from index, origin, and username for the
+ // following reasons: origin and username are enough to describe and
+ // uniquely identify an entry. It is impossible to have two entries
+ // that have the same origin and username, but different passwords,
+ // as the password update logic prevents these cases. The entry is
+ // required to force a refresh of entries, after a removal or undo of
+ // a removal has taken place. All entries before the point of
+ // modification are uneffected, but the ones following need to be
+ // refreshed. Including the index in the uid achieves this effect.
+ // See https://crbug.com/862119 how this could lead to bugs otherwise.
+ const getItemUid =
+ item => [item.entry.index, item.entry.loginPair.urls.origin,
+ item.entry.loginPair.username]
+ .join('_');
+
// Create listener functions.
- const setSavedPasswordsListener = list =>
- this.updateList('savedPasswords', item => {
- // The item uid is built from index, origin, and username for the
- // following reasons: origin and username are enough to describe and
- // uniquely identify an entry. It is impossible to have two entries
- // that have the same origin and username, but different passwords,
- // as the password update logic prevents these cases. The entry is
- // required to force a refresh of entries, after a removal or undo of
- // a removal has taken place. All entries before the point of
- // modification are uneffected, but the ones following need to be
- // refreshed. Including the index in the uid achieves this effect.
- // See https://crbug.com/862119 how this could lead to bugs otherwise.
- return item.entry.index + '_' + item.entry.loginPair.urls.origin +
- '_' + item.entry.loginPair.username;
- }, list.map(entry => ({
- entry: entry,
- password: '',
- })));
+ const setSavedPasswordsListener = list => {
+ const newList = list.map(entry => ({entry: entry, password: ''}));
+ this.updateList('savedPasswords', getItemUid, newList);
+ this.savedPasswords.forEach((item, index) => {
+ item.password = '';
+ this.$.passwordList.notifyPath(`items.${index}.password`);
+ });
+ };
const setPasswordExceptionsListener = list => {
this.passwordExceptions = list;
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html
index 5bcd1e903f9..62693628167 100644
--- a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/passwords_shared_css.html
@@ -34,6 +34,19 @@
height: 20px;
width: 0;
}
+
+ .type-column {
+ align-items: center;
+ flex: 2;
+ }
+
+ .ellipses {
+ flex: 1;
+ max-width: fit-content;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
</style>
</template>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.html b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.html
new file mode 100644
index 00000000000..c35d1f829df
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.html
@@ -0,0 +1,154 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
+<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
+<link rel="import" href="chrome://resources/html/assert.html">
+<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
+<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
+<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="../settings_shared_css.html">
+<link rel="import" href="../controls/settings_toggle_button.html">
+<link rel="import" href="../prefs/prefs.html">
+<link rel="import" href="../people_page/sync_browser_proxy.html">
+<link rel="import" href="credit_card_edit_dialog.html">
+<link rel="import" href="passwords_shared_css.html">
+
+<dom-module id="settings-payments-section">
+ <template>
+ <style include="settings-shared passwords-shared">
+ .expiration-column {
+ align-items: center;
+ display: flex;
+ flex: 1;
+ }
+
+ .expiration-date {
+ flex: 1;
+ }
+
+ .payments-label {
+ color: var(--cr-secondary-text-color);
+ margin-inline-start: 16px;
+ }
+
+ #migrateCreditCards {
+ border-bottom: var(--settings-separator-line);
+ border-top: none;
+ }
+
+ #migrateCreditCardsButton {
+ margin: 0 auto;
+ }
+ </style>
+ <settings-toggle-button id="autofillCreditCardToggle"
+ class="settings-box first"
+ aria-label="$i18n{creditCards}" no-extension-indicator
+ label="$i18n{enableCreditCardsLabel}"
+ sub-label="$i18n{enableCreditCardsSublabel}"
+ pref="{{prefs.autofill.credit_card_enabled}}">
+ </settings-toggle-button>
+ <template is="dom-if"
+ if="[[prefs.autofill.credit_card_enabled.extensionId]]">
+ <div class="settings-box continuation">
+ <extension-controlled-indicator class="start"
+ id="autofillExtensionIndicator"
+ extension-id="[[prefs.autofill.credit_card_enabled.extensionId]]"
+ extension-name="[[
+ prefs.autofill.credit_card_enabled.controlledByName]]"
+ extension-can-be-disabled="[[
+ prefs.autofill.credit_card_enabled.extensionCanBeDisabled]]">
+ </extension-controlled-indicator>
+ </div>
+ </template>
+ <div class="settings-box continuation">
+ <h2 class="start">$i18n{creditCards}</h2>
+ <paper-button id="addCreditCard"
+ class="secondary-button header-aligned-button"
+ on-click="onAddCreditCardTap_"
+ disabled$="[[!prefs.autofill.credit_card_enabled.value]]">
+ $i18n{add}
+ </paper-button>
+ </div>
+ <div class="settings-box two-line" id="migrateCreditCards"
+ hidden$="[[!checkIfMigratable_(syncStatus, creditCards,
+ prefs.autofill.credit_card_enabled.value)]]"
+ on-click="onMigrateCreditCardsClick_" actionable>
+ <div class="start">
+ [[migrateCreditCardsLabel_]]
+ <div class="secondary">
+ [[migratableCreditCardsInfo_]]
+ </div>
+ </div>
+ <paper-icon-button-light id="migrateCreditCardsButton"
+ class="subpage-arrow">
+ <button aria-label="[[migrateCreditCardsLabel_]]"></button>
+ </paper-icon-button-light>
+ </div>
+ <div class="list-frame">
+ <div id="creditCardsHeading" class="list-item column-header"
+ hidden$="[[!hasSome_(creditCards)]]">
+ <div class="type-column">$i18n{creditCardType}</div>
+ <div class="expiration-column">$i18n{creditCardExpiration}</div>
+ </div>
+ <div id="creditCardList" class="vertical-list list-with-header">
+ <template is="dom-repeat" items="[[creditCards]]">
+ <div class="list-item">
+ <div class="type-column">
+ <span id="creditCardLabel">[[item.metadata.summaryLabel]]</span>
+ <span class="payments-label"
+ hidden$="[[item.metadata.isLocal]]">
+ <span hidden$="[[item.metadata.isCached]]">
+ $i18n{googlePayments}
+ </span>
+ <span hidden$="[[!item.metadata.isCached]]">
+ $i18n{googlePaymentsCached}
+ </span>
+ </span>
+ </div>
+ <div class="expiration-column">
+ <div id="creditCardExpiration"
+ class="expiration-date">[[expiration_(item)]]</div>
+ <template is="dom-if" if="[[showDots_(item.metadata)]]">
+ <paper-icon-button-light class="icon-more-vert">
+ <button id="creditCardMenu" title="$i18n{moreActions}"
+ on-click="onCreditCardMenuTap_">
+ </button>
+ </paper-icon-button-light>
+ </template>
+ <template is="dom-if" if="[[!showDots_(item.metadata)]]">
+ <paper-icon-button-light actionable class="icon-external">
+ <button id="remoteCreditCardLink"
+ on-click="onRemoteEditCreditCardTap_">
+ </button>
+ </paper-icon-button-light>
+ </template>
+ </div>
+ </div>
+ </template>
+ </div>
+ <div id="noCreditCardsLabel" class="list-item"
+ hidden$="[[hasSome_(creditCards)]]">
+ $i18n{noCreditCardsFound}
+ </div>
+ </div>
+ <cr-action-menu id="creditCardSharedMenu">
+ <button id="menuEditCreditCard" slot="item" class="dropdown-item"
+ on-click="onMenuEditCreditCardTap_">$i18n{edit}</button>
+ <button id="menuRemoveCreditCard" slot="item" class="dropdown-item"
+ hidden$="[[!activeCreditCard.metadata.isLocal]]"
+ on-click="onMenuRemoveCreditCardTap_">$i18n{removeCreditCard}</button>
+ <button id="menuClearCreditCard" slot="item" class="dropdown-item"
+ on-click="onMenuClearCreditCardTap_"
+ hidden$="[[!activeCreditCard.metadata.isCached]]">
+ $i18n{clearCreditCard}
+ </button>
+ </cr-action-menu>
+ <template is="dom-if" if="[[showCreditCardDialog_]]" restamp>
+ <settings-credit-card-edit-dialog credit-card="[[activeCreditCard]]"
+ on-close="onCreditCardDialogClose_">
+ </settings-credit-card-edit-dialog>
+ </template>
+ </template>
+ <script src="payments_section.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.js b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.js
new file mode 100644
index 00000000000..e3c141a86b1
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/passwords_and_forms_page/payments_section.js
@@ -0,0 +1,421 @@
+// 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.
+
+/**
+ * @fileoverview 'settings-payments-section' is the section containing saved
+ * credit cards for use in autofill and payments APIs.
+ */
+
+/**
+ * Interface for all callbacks to the payments autofill API.
+ * @interface
+ */
+class PaymentsManager {
+ /**
+ * Add an observer to the list of credit cards.
+ * @param {function(!Array<!PaymentsManager.CreditCardEntry>):void} listener
+ */
+ addCreditCardListChangedListener(listener) {}
+
+ /**
+ * Remove an observer from the list of credit cards.
+ * @param {function(!Array<!PaymentsManager.CreditCardEntry>):void} listener
+ */
+ removeCreditCardListChangedListener(listener) {}
+
+ /**
+ * Request the list of credit cards.
+ * @param {function(!Array<!PaymentsManager.CreditCardEntry>):void} callback
+ */
+ getCreditCardList(callback) {}
+
+ /** @param {string} guid The GUID of the credit card to remove. */
+ removeCreditCard(guid) {}
+
+ /** @param {string} guid The GUID to credit card to remove from the cache. */
+ clearCachedCreditCard(guid) {}
+
+ /**
+ * Saves the given credit card.
+ * @param {!PaymentsManager.CreditCardEntry} creditCard
+ */
+ saveCreditCard(creditCard) {}
+
+ /**
+ * Migrate the local credit cards.
+ */
+ migrateCreditCards() {}
+}
+
+/** @typedef {chrome.autofillPrivate.CreditCardEntry} */
+PaymentsManager.CreditCardEntry;
+
+/**
+ * Implementation that accesses the private API.
+ * @implements {PaymentsManager}
+ */
+class PaymentsManagerImpl {
+ /** @override */
+ addCreditCardListChangedListener(listener) {
+ chrome.autofillPrivate.onCreditCardListChanged.addListener(listener);
+ }
+
+ /** @override */
+ removeCreditCardListChangedListener(listener) {
+ chrome.autofillPrivate.onCreditCardListChanged.removeListener(listener);
+ }
+
+ /** @override */
+ getCreditCardList(callback) {
+ chrome.autofillPrivate.getCreditCardList(callback);
+ }
+
+ /** @override */
+ removeCreditCard(guid) {
+ chrome.autofillPrivate.removeEntry(assert(guid));
+ }
+
+ /** @override */
+ clearCachedCreditCard(guid) {
+ chrome.autofillPrivate.maskCreditCard(assert(guid));
+ }
+
+ /** @override */
+ saveCreditCard(creditCard) {
+ chrome.autofillPrivate.saveCreditCard(creditCard);
+ }
+
+ /** @override */
+ migrateCreditCards() {
+ chrome.autofillPrivate.migrateCreditCards();
+ }
+}
+
+cr.addSingletonGetter(PaymentsManagerImpl);
+
+(function() {
+'use strict';
+
+Polymer({
+ is: 'settings-payments-section',
+
+ behaviors: [
+ WebUIListenerBehavior,
+ I18nBehavior,
+ ],
+
+ properties: {
+ /**
+ * An array of saved credit cards.
+ * @type {!Array<!PaymentsManager.CreditCardEntry>}
+ */
+ creditCards: Array,
+
+ /**
+ * The model for any credit card related action menus or dialogs.
+ * @private {?chrome.autofillPrivate.CreditCardEntry}
+ */
+ activeCreditCard: Object,
+
+ /** @private */
+ showCreditCardDialog_: Boolean,
+
+ /** @private */
+ migrateCreditCardsLabel_: String,
+
+ /** @private */
+ migratableCreditCardsInfo_: String,
+
+ /**
+ * The current sync status, supplied by SyncBrowserProxy.
+ * @type {?settings.SyncStatus}
+ */
+ syncStatus: Object,
+
+ /**
+ * Whether migration local card on settings page is enabled.
+ * @private
+ */
+ migrationEnabled_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('migrationEnabled');
+ },
+ readOnly: true,
+ },
+
+ /**
+ * Whether user has a Google Payments account.
+ * @private
+ */
+ hasGooglePaymentsAccount_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('hasGooglePaymentsAccount');
+ },
+ readOnly: true,
+ },
+ },
+
+ listeners: {
+ 'save-credit-card': 'saveCreditCard_',
+ },
+
+ /**
+ * The element to return focus to, when the currently active dialog is
+ * closed.
+ * @private {?HTMLElement}
+ */
+ activeDialogAnchor_: null,
+
+ /**
+ * @type {PaymentsManager}
+ * @private
+ */
+ PaymentsManager_: null,
+
+ /**
+ * @type {?function(!Array<!PaymentsManager.CreditCardEntry>)}
+ * @private
+ */
+ setCreditCardsListener_: null,
+
+ /** @private {?settings.SyncBrowserProxy} */
+ syncBrowserProxy_: null,
+
+ /** @override */
+ attached: function() {
+ // Create listener function.
+ /** @type {function(!Array<!PaymentsManager.CreditCardEntry>)} */
+ const setCreditCardsListener = list => {
+ this.creditCards = list;
+ };
+
+ // Remember the bound reference in order to detach.
+ this.setCreditCardsListener_ = setCreditCardsListener;
+
+ // Set the managers. These can be overridden by tests.
+ this.paymentsManager_ = PaymentsManagerImpl.getInstance();
+
+ // Request initial data.
+ this.paymentsManager_.getCreditCardList(setCreditCardsListener);
+
+ // Listen for changes.
+ this.paymentsManager_.addCreditCardListChangedListener(
+ setCreditCardsListener);
+
+ this.syncBrowserProxy_ = settings.SyncBrowserProxyImpl.getInstance();
+ this.syncBrowserProxy_.getSyncStatus().then(
+ this.handleSyncStatus_.bind(this));
+ this.addWebUIListener(
+ 'sync-status-changed', this.handleSyncStatus_.bind(this));
+ },
+
+ /** @override */
+ detached: function() {
+ this.paymentsManager_.removeCreditCardListChangedListener(
+ /** @type {function(!Array<!PaymentsManager.CreditCardEntry>)} */ (
+ this.setCreditCardsListener_));
+ },
+
+ /**
+ * Formats the expiration date so it's displayed as MM/YYYY.
+ * @param {!chrome.autofillPrivate.CreditCardEntry} item
+ * @return {string}
+ * @private
+ */
+ expiration_: function(item) {
+ return item.expirationMonth + '/' + item.expirationYear;
+ },
+
+ /**
+ * Opens the credit card action menu.
+ * @param {!Event} e The polymer event.
+ * @private
+ */
+ onCreditCardMenuTap_: function(e) {
+ const menuEvent = /** @type {!{model: !{item: !Object}}} */ (e);
+
+ /* TODO(scottchen): drop the [dataHost][dataHost] once this bug is fixed:
+ https://github.com/Polymer/polymer/issues/2574 */
+ // TODO(dpapad): The [dataHost][dataHost] workaround is only necessary for
+ // Polymer 1. Remove once migration to Polymer 2 has completed.
+ const item = Polymer.DomIf ? menuEvent.model.item :
+ menuEvent.model['dataHost']['dataHost'].item;
+
+ // Copy item so dialog won't update model on cancel.
+ this.activeCreditCard =
+ /** @type {!chrome.autofillPrivate.CreditCardEntry} */ (
+ Object.assign({}, item));
+
+ const dotsButton = /** @type {!HTMLElement} */ (Polymer.dom(e).localTarget);
+ /** @type {!CrActionMenuElement} */ (this.$.creditCardSharedMenu)
+ .showAt(dotsButton);
+ this.activeDialogAnchor_ = dotsButton;
+ },
+
+ /**
+ * Handles tapping on the "Add credit card" button.
+ * @param {!Event} e
+ * @private
+ */
+ onAddCreditCardTap_: function(e) {
+ e.preventDefault();
+ const date = new Date(); // Default to current month/year.
+ const expirationMonth = date.getMonth() + 1; // Months are 0 based.
+ this.activeCreditCard = {
+ expirationMonth: expirationMonth.toString(),
+ expirationYear: date.getFullYear().toString(),
+ };
+ this.showCreditCardDialog_ = true;
+ this.activeDialogAnchor_ = this.$.addCreditCard;
+ },
+
+ /** @private */
+ onCreditCardDialogClose_: function() {
+ this.showCreditCardDialog_ = false;
+ cr.ui.focusWithoutInk(assert(this.activeDialogAnchor_));
+ this.activeDialogAnchor_ = null;
+ this.activeCreditCard = null;
+ },
+
+ /**
+ * Handles tapping on the "Edit" credit card button.
+ * @param {!Event} e The polymer event.
+ * @private
+ */
+ onMenuEditCreditCardTap_: function(e) {
+ e.preventDefault();
+
+ if (this.activeCreditCard.metadata.isLocal)
+ this.showCreditCardDialog_ = true;
+ else
+ this.onRemoteEditCreditCardTap_();
+
+ this.$.creditCardSharedMenu.close();
+ },
+
+ /** @private */
+ onRemoteEditCreditCardTap_: function() {
+ window.open(loadTimeData.getString('manageCreditCardsUrl'));
+ },
+
+ /**
+ * Handles tapping on the "Remove" credit card button.
+ * @private
+ */
+ onMenuRemoveCreditCardTap_: function() {
+ this.paymentsManager_.removeCreditCard(
+ /** @type {string} */ (this.activeCreditCard.guid));
+ this.$.creditCardSharedMenu.close();
+ this.activeCreditCard = null;
+ },
+
+ /**
+ * Handles tapping on the "Clear copy" button for cached credit cards.
+ * @private
+ */
+ onMenuClearCreditCardTap_: function() {
+ this.paymentsManager_.clearCachedCreditCard(
+ /** @type {string} */ (this.activeCreditCard.guid));
+ this.$.creditCardSharedMenu.close();
+ this.activeCreditCard = null;
+ },
+
+ /**
+ * Handles clicking on the "Migrate" button for migrate local credit cards.
+ * @private
+ */
+ onMigrateCreditCardsClick_: function() {
+ this.paymentsManager_.migrateCreditCards();
+ },
+
+ /**
+ * The 3-dot menu should not be shown if the card is entirely remote.
+ * @param {!chrome.autofillPrivate.AutofillMetadata} metadata
+ * @return {boolean}
+ * @private
+ */
+ showDots_: function(metadata) {
+ return !!(metadata.isLocal || metadata.isCached);
+ },
+
+ /**
+ * Returns true if the list exists and has items.
+ * @param {Array<Object>} list
+ * @return {boolean}
+ * @private
+ */
+ hasSome_: function(list) {
+ return !!(list && list.length);
+ },
+
+ /**
+ * Listens for the save-credit-card event, and calls the private API.
+ * @param {!Event} event
+ * @private
+ */
+ saveCreditCard_: function(event) {
+ this.paymentsManager_.saveCreditCard(event.detail);
+ },
+
+ /**
+ * Handler for when the sync state is pushed from the browser.
+ * @param {?settings.SyncStatus} syncStatus
+ * @private
+ */
+ handleSyncStatus_: function(syncStatus) {
+ this.syncStatus = syncStatus;
+ },
+
+ /**
+ * @param {!settings.SyncStatus} syncStatus
+ * @param {!Array<!PaymentsManager.CreditCardEntry>} creditCards
+ * @param {boolean} creditCardEnabled
+ * @return {boolean} Whether to show the migration button. True iff at least
+ * one valid local card, enable migration, signed-in & synced and credit card
+ * pref enabled.
+ * @private
+ */
+ checkIfMigratable_: function(syncStatus, creditCards, creditCardEnabled) {
+ if (syncStatus == undefined)
+ return false;
+
+ // If user not enable migration experimental flag, return false.
+ if (!this.migrationEnabled_)
+ return false;
+
+ // If user does not have Google Payments Account, return false.
+ if (!this.hasGooglePaymentsAccount_)
+ return false;
+
+ // If credit card enabled pref is false, return false.
+ if (!creditCardEnabled)
+ return false;
+
+ // If user not signed-in and synced, return false.
+ if (!syncStatus.signedIn || !syncStatus.syncSystemEnabled)
+ return false;
+
+ let numberOfMigratableCreditCard =
+ creditCards.filter(card => card.metadata.isMigratable).length;
+ // Check whether exist at least one local valid card for migration.
+ if (numberOfMigratableCreditCard == 0)
+ return false;
+
+ // Update the display label depends on the number of migratable credit
+ // cards.
+ this.migrateCreditCardsLabel_ = numberOfMigratableCreditCard == 1 ?
+ this.i18n('migrateCreditCardsLabelSingle') :
+ this.i18n('migrateCreditCardsLabelMultiple');
+ // Update the display text depends on the number of migratable credit cards.
+ this.migratableCreditCardsInfo_ = numberOfMigratableCreditCard == 1 ?
+ this.i18n('migratableCardsInfoSingle') :
+ this.i18n('migratableCardsInfoMultiple');
+
+ return true;
+ },
+
+});
+})();
diff --git a/chromium/chrome/browser/resources/settings/people_page/BUILD.gn b/chromium/chrome/browser/resources/settings/people_page/BUILD.gn
index 6426f36e0e8..c2f8cc39834 100644
--- a/chromium/chrome/browser/resources/settings/people_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/people_page/BUILD.gn
@@ -14,19 +14,19 @@ js_type_check("closure_compile") {
":easy_unlock_turn_off_dialog",
":fingerprint_browser_proxy",
":fingerprint_list",
- ":fingerprint_progress_arc",
":import_data_browser_proxy",
":import_data_dialog",
":lock_screen",
":lock_screen_constants",
+ ":lock_screen_password_prompt_dialog",
":lock_state_behavior",
":manage_profile",
":manage_profile_browser_proxy",
- ":password_prompt_dialog",
":people_page",
":profile_info_browser_proxy",
":setup_fingerprint_dialog",
":setup_pin_dialog",
+ ":signout_dialog",
":sync_account_control",
":sync_browser_proxy",
":sync_page",
@@ -110,12 +110,6 @@ js_library("fingerprint_list") {
externs_list = [ "$externs_path/web_animations.js" ]
}
-js_library("fingerprint_progress_arc") {
- deps = [
- "//ui/webui/resources/js:cr",
- ]
-}
-
js_library("import_data_browser_proxy") {
deps = [
"//ui/webui/resources/js:cr",
@@ -128,8 +122,8 @@ js_library("lock_screen") {
":easy_unlock_turn_off_dialog",
":fingerprint_browser_proxy",
":lock_screen_constants",
+ ":lock_screen_password_prompt_dialog",
":lock_state_behavior",
- ":password_prompt_dialog",
"..:route",
"../controls:settings_dropdown_menu",
"../controls:settings_toggle_button",
@@ -176,14 +170,12 @@ js_library("manage_profile_browser_proxy") {
]
}
-js_library("password_prompt_dialog") {
+js_library("lock_screen_password_prompt_dialog") {
deps = [
":lock_screen_constants",
- "..:route",
- "//ui/webui/resources/cr_elements/cr_input:cr_input",
+ ":lock_state_behavior",
+ "../controls:password_prompt_dialog",
]
- externs_list = [ "$externs_path/quick_unlock_private.js" ]
- extra_sources = [ "$interfaces_path/quick_unlock_private_interface.js" ]
}
js_library("people_page") {
@@ -192,6 +184,7 @@ js_library("people_page") {
":lock_screen_constants",
":lock_state_behavior",
":profile_info_browser_proxy",
+ ":signout_dialog",
":sync_browser_proxy",
"..:page_visibility",
"..:route",
@@ -216,7 +209,7 @@ js_library("profile_info_browser_proxy") {
js_library("setup_fingerprint_dialog") {
deps = [
":fingerprint_browser_proxy",
- ":fingerprint_progress_arc",
+ "//ui/webui/resources/cr_elements/chromeos/fingerprint:cr_fingerprint_progress_arc",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
@@ -225,12 +218,25 @@ js_library("setup_fingerprint_dialog") {
js_library("setup_pin_dialog") {
deps = [
":lock_screen_constants",
- ":password_prompt_dialog",
+ ":lock_screen_password_prompt_dialog",
"..:route",
"//ui/webui/resources/js:i18n_behavior",
]
}
+js_library("signout_dialog") {
+ deps = [
+ ":profile_info_browser_proxy",
+ ":sync_browser_proxy",
+ "//ui/webui/resources/cr_elements/cr_dialog:cr_dialog",
+ "//ui/webui/resources/cr_elements/cr_expand_button:cr_expand_button",
+ "//ui/webui/resources/js:i18n_behavior",
+ "//ui/webui/resources/js:load_time_data",
+ "//ui/webui/resources/js:util",
+ "//ui/webui/resources/js:web_ui_listener_behavior",
+ ]
+}
+
js_library("sync_page") {
deps = [
":sync_browser_proxy",
diff --git a/chromium/chrome/browser/resources/settings/people_page/account_manager.html b/chromium/chrome/browser/resources/settings/people_page/account_manager.html
index 95750103025..f910659d1b4 100644
--- a/chromium/chrome/browser/resources/settings/people_page/account_manager.html
+++ b/chromium/chrome/browser/resources/settings/people_page/account_manager.html
@@ -1,9 +1,12 @@
<link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
+<link rel="import" href="chrome://resources/html/icon.html">
<link rel="import" href="chrome://resources/html/util.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
@@ -35,7 +38,7 @@
<h2>$i18n{accountListHeader}</h2>
</div>
<div id="outer" class="layout vertical nowrap">
- <template is="dom-repeat" items="[[accounts_]]">
+ <template is="dom-repeat" id="account-list" items="[[accounts_]]">
<div class="settings-box">
<div class="profile-icon"
style="background-image: [[getIconImageSet_(item.pic)]]"></div>
@@ -45,12 +48,25 @@
<div class="secondary">[[item.email]]</div>
</div>
</div>
+ <paper-icon-button-light class="icon-more-vert"
+ hidden="[[item.isDeviceAccount]]">
+ <button title="$i18n{moreActions}"
+ on-click="onAccountActionsMenuButtonTap_">
+ </button>
+ </paper-icon-button-light>
</div>
</template>
<div id="add-account-button" class="settings-box" on-tap="addAccount_">
$i18n{addAccountLabel}
</div>
<div class="clear settings-box"></div>
+
+ <cr-action-menu>
+ <button slot="item" class="dropdown-item"
+ on-click="onRemoveAccountTap_">
+ $i18n{removeAccountLabel}
+ </button>
+ </cr-action-menu>
</div>
</template>
<script src="account_manager.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/people_page/account_manager.js b/chromium/chrome/browser/resources/settings/people_page/account_manager.js
index f0c6ae8e166..e754d4ca049 100644
--- a/chromium/chrome/browser/resources/settings/people_page/account_manager.js
+++ b/chromium/chrome/browser/resources/settings/people_page/account_manager.js
@@ -27,6 +27,12 @@ Polymer({
return [];
},
},
+
+ /**
+ * The targeted account for menu operations.
+ * @private {?settings.Account}
+ */
+ actionMenuAccount_: Object,
},
/** @private {?settings.AccountManagerBrowserProxy} */
@@ -68,4 +74,34 @@ Polymer({
this.set('accounts_', accounts);
});
},
+
+ /**
+ * Opens the Account actions menu.
+ * @param {!{model: !{item: settings.Account}, target: !Element}} event
+ * @private
+ */
+ onAccountActionsMenuButtonTap_: function(event) {
+ this.actionMenuAccount_ = event.model.item;
+ /** @type {!CrActionMenuElement} */ (this.$$('cr-action-menu'))
+ .showAt(event.target);
+ },
+
+ /**
+ * Closes action menu and resets action menu model.
+ * @private
+ */
+ closeActionMenu_: function() {
+ this.$$('cr-action-menu').close();
+ this.actionMenuAccount_ = null;
+ },
+
+ /**
+ * Removes the account being pointed to by |this.actionMenuAccount_|.
+ * @private
+ */
+ onRemoveAccountTap_: function() {
+ this.browserProxy_.removeAccount(
+ /** @type {?settings.Account} */ (this.actionMenuAccount_));
+ this.closeActionMenu_();
+ }
});
diff --git a/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js b/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js
index c1257ade2d5..0c5f2e48723 100644
--- a/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/people_page/account_manager_browser_proxy.js
@@ -12,6 +12,9 @@ cr.exportPath('settings');
/**
* Information for an account managed by Chrome OS AccountManager.
* @typedef {{
+ * id: string,
+ * accountType: number,
+ * isDeviceAccount: boolean,
* fullName: string,
* email: string,
* pic: string,
@@ -32,6 +35,12 @@ cr.define('settings', function() {
* Triggers the 'Add account' flow.
*/
addAccount() {}
+
+ /**
+ * Removes |account| from Account Manager.
+ * @param {?settings.Account} account
+ */
+ removeAccount(account) {}
}
/**
@@ -47,6 +56,11 @@ cr.define('settings', function() {
addAccount() {
chrome.send('addAccount');
}
+
+ /** @override */
+ removeAccount(account) {
+ chrome.send('removeAccount', [account]);
+ }
}
cr.addSingletonGetter(AccountManagerBrowserProxyImpl);
diff --git a/chromium/chrome/browser/resources/settings/people_page/change_picture.html b/chromium/chrome/browser/resources/settings/people_page/change_picture.html
index f14495a8af7..941efeb015c 100644
--- a/chromium/chrome/browser/resources/settings/people_page/change_picture.html
+++ b/chromium/chrome/browser/resources/settings/people_page/change_picture.html
@@ -25,15 +25,15 @@
}
#title {
- -webkit-margin-start: 20px;
height: var(--title-height);
+ margin-inline-start: 20px;
padding-top: var(--title-padding);
}
#container {
- -webkit-margin-start: 20px;
align-items: flex-start;
display: flex;
+ margin-inline-start: 20px;
position: absolute;
top: calc(var(--cr-settings-header-height) +
var(--title-padding) +
@@ -42,9 +42,9 @@
#picturePane {
--cr-picture-image-size: 192px;
- -webkit-margin-end: 24px;
flex-shrink: 0;
height: 288px;
+ margin-inline-end: 24px;
margin-top: 6px;
position: relative;
width: 288px;
@@ -58,7 +58,6 @@
}
#pictureList {
- -webkit-margin-end: 16px;
/* TODO(reveman): Find a way to have height align to viewport
without using fixed position. */
height: calc(100vh -
@@ -66,6 +65,7 @@
var(--cr-settings-header-height) -
var(--title-padding) -
var(--title-height));
+ margin-inline-end: 16px;
margin-top: 0;
min-height: 332px;
overflow-x: hidden;
diff --git a/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.html b/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.html
index b0168a44cf2..42d5e7fa77c 100644
--- a/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.html
+++ b/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.html
@@ -72,7 +72,8 @@
<template is="dom-if" if="[[showSetupFingerprintDialog_]]" restamp>
<settings-setup-fingerprint-dialog
on-add-fingerprint="updateFingerprintsList_"
- on-close="onSetupFingerprintDialogClose_">
+ on-close="onSetupFingerprintDialogClose_"
+ allow-add-another-finger="[[allowAddAnotherFinger_]]">
</settings-setup-fingerprint-dialog>
</template>
</template>
diff --git a/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js b/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js
index ea245c45cc3..7c4ec5f1156 100644
--- a/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js
+++ b/chromium/chrome/browser/resources/settings/people_page/fingerprint_list.js
@@ -35,6 +35,16 @@ Polymer({
/** @private */
showSetupFingerprintDialog_: Boolean,
+
+ /**
+ * Whether add another finger is allowed.
+ * @type {boolean}
+ * @private
+ */
+ allowAddAnotherFinger_: {
+ type: Boolean,
+ value: true,
+ },
},
/** @private {?settings.FingerprintBrowserProxy} */
@@ -118,6 +128,7 @@ Polymer({
// Update iron-list.
this.fingerprints_ = fingerprintInfo.fingerprintsList.slice();
this.$$('.action-button').disabled = fingerprintInfo.isMaxed;
+ this.allowAddAnotherFinger_ = !fingerprintInfo.isMaxed;
},
/**
diff --git a/chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.html b/chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.html
deleted file mode 100644
index cb18a85530e..00000000000
--- a/chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<link rel="import" href="chrome://resources/html/polymer.html">
-
-<dom-module id="settings-fingerprint-progress-arc">
- <template>
- <style>
- #canvas {
- height: 100%;
- vertical-align: bottom;
- width: 100%;
- }
-
- #canvasDiv {
- height: var(--canvas-height);
- width: var(--canvas-width);
- }
- </style>
-
- <div id="canvasDiv">
- <canvas id="canvas"></canvas>
- </div>
- </template>
- <script src="fingerprint_progress_arc.js"></script>
-</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js b/chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js
deleted file mode 100644
index 2b3c38c77cc..00000000000
--- a/chromium/chrome/browser/resources/settings/people_page/fingerprint_progress_arc.js
+++ /dev/null
@@ -1,171 +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.
-
-(function() {
-
-/**
- * The time in milliseconds of the animation updates.
- * @type {number}
- */
-const ANIMATE_TICKS_MS = 20;
-
-/**
- * The duration in milliseconds of the animation of the progress circle when the
- * user is touching the scanner.
- * @type {number}
- */
-const ANIMATE_DURATION_MS = 200;
-
-/**
- * The radius of the add fingerprint progress circle.
- * @type {number}
- */
-const CANVAS_CIRCLE_RADIUS = 50;
-
-/**
- * The thickness of the add fingerprint progress circle.
- * @type {number}
- */
-const CANVAS_CIRCLE_STROKE_WIDTH = 4;
-
-/**
- * The color of the canvas circle background.
- * @type {string}
- */
-const CANVAS_CIRCLE_BACKGROUND_COLOR = 'rgba(66, 66, 66, 1.0)';
-
-/**
- * The color of the arc/circle which indicates setup progress.
- * @type {string}
- */
-const CANVAS_CIRCLE_PROGRESS_COLOR = 'rgba(53, 103, 214, 1.0)';
-
-/**
- * The color of the canvas circle shadow.
- * @type {string}
- */
-const CANVAS_CIRCLE_SHADOW_COLOR = 'rgba(0, 0, 0, 0.5)';
-
-Polymer({
- is: 'settings-fingerprint-progress-arc',
-
- // Also put these values as member values so they can be overriden by tests
- // and the tests do not need to be changed every time the UI is.
- /** @private {number} */
- canvasCircleRadius_: CANVAS_CIRCLE_RADIUS,
- /** @private {number} */
- canvasCircleStrokeWidth_: CANVAS_CIRCLE_STROKE_WIDTH,
- /** @private {string} */
- canvasCircleBackgroundColor_: CANVAS_CIRCLE_BACKGROUND_COLOR,
- /** @private {string} */
- canvasCircleProgressColor_: CANVAS_CIRCLE_PROGRESS_COLOR,
- /** @private {string} */
- canvasCircleShadowColor_: CANVAS_CIRCLE_SHADOW_COLOR,
-
- /**
- * Draws an arc on the canvas element around the center with radius
- * |CANVAS_CIRCLE_RADIUS|.
- * @param {number} startAngle The start angle of the arc we want to draw.
- * @param {number} endAngle The end angle of the arc we want to draw.
- * @param {string} color The color of the arc we want to draw. The string is
- * in the format rgba(r',g',b',a'). r', g', b' are values from [0-255]
- * and a' is a value from [0-1].
- */
- drawArc: function(startAngle, endAngle, color) {
- const c = this.$.canvas;
- const ctx = c.getContext('2d');
-
- ctx.beginPath();
- ctx.arc(
- c.width / 2, c.height / 2, this.canvasCircleRadius_, startAngle,
- endAngle);
- ctx.lineWidth = this.canvasCircleStrokeWidth_;
- ctx.strokeStyle = color;
- ctx.stroke();
- },
-
- /**
- * Draws a circle on the canvas element around the center with radius
- * |CANVAS_CIRCLE_RADIUS| and color |CANVAS_CIRCLE_BACKGROUND_COLOR|.
- */
- drawBackgroundCircle: function() {
- this.drawArc(0, 2 * Math.PI, this.canvasCircleBackgroundColor_);
- },
-
- /**
- * Draws a circular shadow around the center with radius
- * |CANVAS_CIRCLE_RADIUS|.
- * @param {number} blur
- * @param {number} offsetX
- * @param {number} offsetY
- */
- drawShadow: function(blur, offsetX, offsetY) {
- const c = this.$.canvas;
- const ctx = c.getContext('2d');
-
- ctx.beginPath();
- ctx.translate(-c.width, 0);
- ctx.shadowOffsetX = c.width + offsetX;
- ctx.shadowOffsetY = 0;
- ctx.shadowColor = this.canvasCircleShadowColor_;
- ctx.shadowBlur = blur;
- ctx.arc(
- c.width / 2, c.height / 2,
- this.canvasCircleRadius_ - this.canvasCircleStrokeWidth_ / 2 + blur / 2,
- 0, 2 * Math.PI);
- ctx.stroke();
- ctx.translate(c.width, 0);
- },
-
- /**
- * Animates the progress the circle. Animates an arc that starts at the top of
- * the circle to startAngle, to an arc that starts at the top of the circle to
- * endAngle.
- * @param {number} startAngle The start angle of the arc we want to draw.
- * @param {number} endAngle The end angle of the arc we want to draw.
- */
- animateProgress: function(startAngle, endAngle) {
- let currentAngle = startAngle;
- // The value to update the angle by each tick.
- const step =
- (endAngle - startAngle) / (ANIMATE_DURATION_MS / ANIMATE_TICKS_MS);
- const id = setInterval(doAnimate.bind(this), ANIMATE_TICKS_MS);
- // Circles on html canvas have 0 radians on the positive x-axis and go in
- // clockwise direction. We want to start at the top of the circle which is
- // 3pi/2.
- const start = 3 * Math.PI / 2;
-
- // Function that is called every tick of the interval, draws the arc a bit
- // closer to the final destination each tick, until it reaches the final
- // destination.
- function doAnimate() {
- if (currentAngle >= endAngle)
- clearInterval(id);
-
- // Clears the canvas and draws the new progress circle.
- this.clearCanvas();
- // Drawing two arcs to form a circle gives a nicer look than drawing an
- // arc on top of a circle. If |currentAngle| is 0, draw from |start| +
- // |currentAngle| to 7 * Math.PI / 2 (start is 3 * Math.PI / 2) otherwise
- // the regular draw from |start| to |currentAngle| will draw nothing which
- // will cause a flicker for one frame.
- this.drawArc(
- start, start + currentAngle, this.canvasCircleProgressColor_);
- this.drawArc(
- start + currentAngle, currentAngle <= 0 ? 7 * Math.PI / 2 : start,
- this.canvasCircleBackgroundColor_);
- currentAngle += step;
- }
- },
-
- /**
- * Clear the canvas of any renderings.
- */
- clearCanvas: function() {
- const c = this.$.canvas;
- const ctx = c.getContext('2d');
- ctx.clearRect(0, 0, c.width, c.height);
- },
-});
-})();
diff --git a/chromium/chrome/browser/resources/settings/people_page/lock_screen.html b/chromium/chrome/browser/resources/settings/people_page/lock_screen.html
index 49195e5e113..ef82ae02f76 100644
--- a/chromium/chrome/browser/resources/settings/people_page/lock_screen.html
+++ b/chromium/chrome/browser/resources/settings/people_page/lock_screen.html
@@ -13,7 +13,7 @@
<link rel="import" href="fingerprint_browser_proxy.html">
<link rel="import" href="lock_screen_constants.html">
<link rel="import" href="lock_state_behavior.html">
-<link rel="import" href="password_prompt_dialog.html">
+<link rel="import" href="lock_screen_password_prompt_dialog.html">
<link rel="import" href="setup_pin_dialog.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/prefs_behavior.html">
@@ -26,7 +26,7 @@
<template>
<style include="settings-shared">
cr-policy-indicator {
- -webkit-margin-start: auto;
+ margin-inline-start: auto;
/* Align the indicator with the h2 that it is associated with. */
padding-bottom: 12px;
padding-top: 24px;
@@ -126,32 +126,50 @@
</div>
</template>
+ <template is="dom-if" if="[[lockScreenNotificationsEnabled_]]">
+ <h2 class="settings-box">
+ $i18n{lockScreenNotificationTitle}
+ </h2>
+ <div class="list-frame">
+ <settings-radio-group
+ pref="{{prefs.ash.message_center.lock_screen_mode}}"
+ selectable="cr-radio-button">
+ <template is="dom-if"
+ if="[[lockScreenHideSensitiveNotificationSupported_]]">
+ <cr-radio-button name="hideSensitive" class="list-item underbar"
+ pref="[[prefs.ash.message_center.lock_screen_mode]]"
+ label="$i18n{lockScreenNotificationHideSensitive}">
+ </cr-radio-button>
+ </template>
+ <cr-radio-button name="show" class="list-item underbar"
+ pref="[[prefs.ash.message_center.lock_screen_mode]]"
+ label="$i18n{lockScreenNotificationShow}">
+ </cr-radio-button>
+ <cr-radio-button name="hide" class="list-item"
+ pref="[[prefs.ash.message_center.lock_screen_mode]]"
+ label="$i18n{lockScreenNotificationHide}">
+ </cr-radio-button>
+ </settings-radio-group>
+ </div>
+ </template>
+
<template is="dom-if" if="[[fingerprintUnlockEnabled_]]">
- <div id="fingerprintDiv">
- <settings-toggle-button class="continuation"
- pref="{{prefs.settings.enable_quick_unlock_fingerprint}}"
- label="$i18n{lockScreenFingerprintEnable}">
- </settings-toggle-button>
- <iron-collapse
- opened="[[prefs.settings.enable_quick_unlock_fingerprint.value]]">
- <div class="settings-box continuation">
- <div class="start">
- $i18n{lockScreenEditFingerprints}
- <div class="secondary" id="lockScreenEditFingerprintsSecondary">
- [[getDescriptionText_(numFingerprints_)]]
- </div>
- </div>
- <div class="separator"></div>
- <div class="secondary-action">
- <paper-button class="secondary-button"
- on-click="onEditFingerprints_"
- aria-label="$i18n{lockScreenEditFingerprints}"
- aria-descibedby="lockScreenEditFingerprintsSecondary">
- $i18n{lockScreenSetupFingerprintButton}
- </paper-button>
- </div>
+ <div id="fingerprintDiv" class="settings-box two-line">
+ <div class="start">
+ $i18n{lockScreenEditFingerprints}
+ <div class="secondary" id="lockScreenEditFingerprintsSecondary">
+ [[getDescriptionText_(numFingerprints_)]]
</div>
- </iron-collapse>
+ </div>
+ <div class="separator"></div>
+ <div class="secondary-action">
+ <paper-button class="secondary-button"
+ on-click="onEditFingerprints_"
+ aria-label="$i18n{lockScreenEditFingerprints}"
+ aria-descibedby="lockScreenEditFingerprintsSecondary">
+ $i18n{lockScreenSetupFingerprintButton}
+ </paper-button>
+ </div>
</div>
</template>
@@ -202,10 +220,11 @@
</template>
<template is="dom-if" if="[[showPasswordPromptDialog_]]" restamp>
- <settings-password-prompt-dialog id="passwordPrompt"
+ <settings-lock-screen-password-prompt-dialog
+ id="lockScreenPasswordPrompt"
on-close="onPasswordPromptDialogClose_" set-modes="{{setModes_}}"
auth-token="{{authToken_}}">
- </settings-password-prompt-dialog>
+ </settings-lock-screen-password-prompt-dialog>
</template>
<template is="dom-if" if="[[showSetupPinDialog_]]" restamp>
diff --git a/chromium/chrome/browser/resources/settings/people_page/lock_screen.js b/chromium/chrome/browser/resources/settings/people_page/lock_screen.js
index 9bc50d77a69..d0af6fa31b1 100644
--- a/chromium/chrome/browser/resources/settings/people_page/lock_screen.js
+++ b/chromium/chrome/browser/resources/settings/people_page/lock_screen.js
@@ -52,7 +52,7 @@ Polymer({
},
/**
- * Authentication token provided by password-prompt-dialog.
+ * Authentication token provided by lock-screen-password-prompt-dialog.
* @private
*/
authToken_: String,
@@ -164,6 +164,32 @@ Polymer({
readOnly: true,
},
+ /**
+ * Whether notifications on the lock screen are enable by the feature flag.
+ * @private
+ */
+ lockScreenNotificationsEnabled_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('lockScreenNotificationsEnabled');
+ },
+ readOnly: true,
+ },
+
+ /**
+ * Whether the "hide sensitive notification" option on the lock screen can
+ * be enable by the feature flag.
+ * @private
+ */
+ lockScreenHideSensitiveNotificationSupported_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean(
+ 'lockScreenHideSensitiveNotificationsSupported');
+ },
+ readOnly: true,
+ },
+
/** @private */
showEasyUnlockTurnOffDialog_: {
type: Boolean,
@@ -391,16 +417,6 @@ Polymer({
return enabled ? enabledStr : disabledStr;
},
- /**
- * @param {boolean} easyUnlockEnabled
- * @param {boolean} proximityDetectionAllowed
- * @private
- */
- getShowEasyUnlockToggle_: function(
- easyUnlockEnabled, proximityDetectionAllowed) {
- return easyUnlockEnabled && proximityDetectionAllowed;
- },
-
/** @private */
updateNumFingerprints_: function() {
if (this.fingerprintUnlockEnabled_ && this.fingerprintBrowserProxy_) {
diff --git a/chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.html b/chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.html
new file mode 100644
index 00000000000..c11f2730918
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.html
@@ -0,0 +1,16 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="lock_screen_constants.html">
+<link rel="import" href="lock_state_behavior.html">
+<link rel="import" href="../controls/password_prompt_dialog.html">
+
+<dom-module id="settings-lock-screen-password-prompt-dialog">
+ <template>
+ <settings-password-prompt-dialog
+ id="passwordPrompt"
+ password-prompt-text="[[selectPasswordPromptEnterPasswordString_(hasPinLogin)]]"
+ auth-token="{{authToken}}">
+ </settings-password-prompt-dialog>
+ </template>
+ <script src="lock_screen_password_prompt_dialog.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.js b/chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.js
new file mode 100644
index 00000000000..194495372d5
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/people_page/lock_screen_password_prompt_dialog.js
@@ -0,0 +1,119 @@
+// 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.
+
+/**
+ * @fileoverview
+ *
+ * 'settings-lock-screen-password-prompt-dialog' displays a password prompt to
+ * the user. Clients can determine if the user has authenticated if either the
+ * |authToken| string or |setModes| closure are present.
+ *
+ * The setModes binding is a wrapper around chrome.quickUnlockPrivate.setModes
+ * which has a prebound account password. The account password by itself is not
+ * available for other elements to access.
+ *
+ * Example:
+ *
+ * <settings-lock-screen-password-prompt-dialog
+ * id="lockScreenPasswordPrompt"
+ * set-modes="[[setModes]]">
+ * </settings-lock-screen-password-prompt-dialog>
+ */
+
+(function() {
+'use strict';
+
+Polymer({
+ is: 'settings-lock-screen-password-prompt-dialog',
+
+ behaviors: [
+ LockStateBehavior,
+ ],
+
+ properties: {
+ /**
+ * Authentication token returned by quickUnlockPrivate.getAuthToken. Should
+ * be passed to API calls which require authentication.
+ * @type {string}
+ */
+ authToken: {
+ type: String,
+ notify: true,
+ observer: 'authTokenChanged_',
+ },
+
+ /**
+ * A wrapper around chrome.quickUnlockPrivate.setModes with the account
+ * password already supplied. If this is null, the authentication screen
+ * needs to be redisplayed. This property will be cleared after the timeout
+ * returned by quickUnlockPrivate.getAuthToken.
+ * @type {?Function}
+ */
+ setModes: {
+ type: Object,
+ notify: true,
+ },
+
+ /**
+ * writeUma_ is a function that handles writing uma stats. It may be
+ * overridden for tests.
+ *
+ * @type {Function}
+ * @private
+ */
+ writeUma_: {
+ type: Object,
+ value: function() {
+ return settings.recordLockScreenProgress;
+ }
+ },
+ },
+
+ /** @override */
+ attached: function() {
+ this.writeUma_(LockScreenProgress.START_SCREEN_LOCK);
+ },
+
+ /**
+ * Called when the authToken changes. If the authToken is valid, that
+ * indicates the user authenticated successfully.
+ * @param {String} authToken
+ * @private
+ */
+ authTokenChanged_: function(authToken) {
+ if (!this.authToken) {
+ this.setModes = null;
+ return;
+ }
+
+ // The user successfully authenticated.
+ this.writeUma_(LockScreenProgress.ENTER_PASSWORD_CORRECTLY);
+
+ this.setModes = (modes, credentials, onComplete) => {
+ this.quickUnlockPrivate.setModes(
+ this.authToken, modes, credentials, () => {
+ let result = true;
+ if (chrome.runtime.lastError) {
+ console.error(
+ 'setModes failed: ' + chrome.runtime.lastError.message);
+ result = false;
+ }
+ onComplete(result);
+ });
+ };
+ },
+
+ /**
+ * Looks up the translation id, which depends on PIN login support.
+ * @param {boolean} hasPinLogin
+ * @return {string}
+ * @private
+ */
+ selectPasswordPromptEnterPasswordString_: function(hasPinLogin) {
+ if (hasPinLogin)
+ return this.i18n('passwordPromptEnterPasswordLoginLock');
+ return this.i18n('passwordPromptEnterPasswordLock');
+ },
+});
+})();
diff --git a/chromium/chrome/browser/resources/settings/people_page/people_page.html b/chromium/chrome/browser/resources/settings/people_page/people_page.html
index aeb069ba45e..6f9a04352a8 100644
--- a/chromium/chrome/browser/resources/settings/people_page/people_page.html
+++ b/chromium/chrome/browser/resources/settings/people_page/people_page.html
@@ -1,8 +1,5 @@
<link rel="import" href="chrome://resources/html/polymer.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
@@ -10,7 +7,6 @@
<link rel="import" href="chrome://resources/html/icon.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-animatable.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
@@ -25,7 +21,9 @@
<link rel="import" href="../settings_page/settings_subpage.html">
<link rel="import" href="../passwords_and_forms_page/autofill_section.html">
<link rel="import" href="../passwords_and_forms_page/passwords_section.html">
+<link rel="import" href="../passwords_and_forms_page/payments_section.html">
<link rel="import" href="../settings_shared_css.html">
+<link rel="import" href="signout_dialog.html">
<if expr="chromeos">
<link rel="import" href="account_manager.html">
@@ -48,7 +46,7 @@
<style include="settings-shared iron-flex">
setting-box.middle {
/* Per spec, middle text is indented 20px in this section. */
- -webkit-margin-start: 20px;
+ margin-inline-start: 20px;
}
#profile-icon {
@@ -96,23 +94,6 @@
width: 40px;
}
- #disconnectDialog [slot=footer] .settings-box {
- --settings-box-row-padding: 0;
- }
-
- .delete-profile-warning {
- -webkit-padding-end: var(--cr-section-padding);
- /* In order to line up with the checkbox text. */
- -webkit-padding-start: var(--cr-section-indent-padding);
- padding-bottom: 10px;
- padding-top: 10px;
- }
-
- #wideFooter {
- /* Override the cr-dialog footer padding. */
- padding: 16px 0;
- }
-
<if expr="not chromeos">
#toast {
color: white;
@@ -231,9 +212,6 @@
<if expr="not chromeos">
</template> <!-- if="[[!diceEnabled_]]" -->
</if>
- <div class="settings-box" hidden="[[syncStatus.signinAllowed]]">
- $i18n{syncDisabledByAdministrator}
- </div>
</template>
<if expr="not chromeos">
@@ -288,10 +266,10 @@
<cr-link-row id="paymentManagerButton"
start-icon="settings20:credit-card"
label="$i18n{creditCards}" icon-class="subpage-arrow"
- on-click="onAutofillTap_"></cr-link-row>
+ on-click="onPaymentsTap_"></cr-link-row>
<cr-link-row id="addressesManagerButton"
start-icon="settings20:location-on"
- label="$i18n{addresses}" icon-class="subpage-arrow"
+ label="$i18n{addressesTitle}" icon-class="subpage-arrow"
on-click="onAutofillTap_"></cr-link-row>
</template>
@@ -323,6 +301,16 @@
aria-describedby="lockScreenSecondary"></button>
</paper-icon-button-light>
</div>
+
+ <template is="dom-if" if="[[isAccountManagerEnabled_]]">
+ <div id="account-manager-subpage-trigger" class="settings-box"
+ actionable on-click="onAccountManagerTap_">
+ <div class="start">$i18n{accountManagerSubMenuLabel}</div>
+ <paper-icon-button-light class="subpage-arrow">
+ <button aria-label="$i18n{accountManagerSubMenuLabel}"></button>
+ </paper-icon-button-light>
+ </div>
+ </template>
</if>
<div id="manage-other-people-subpage-trigger"
@@ -387,6 +375,14 @@
</settings-autofill-section>
</settings-subpage>
</template>
+ <template is="dom-if" route-path="/payments">
+ <settings-subpage
+ associated-control="[[$$('#paymentManagerButton')]]"
+ page-title="$i18n{creditCards}">
+ <settings-payments-section id="paymentsSection" prefs="{{prefs}}">
+ </settings-payments-section>
+ </settings-subpage>
+ </template>
</template>
<if expr="chromeos">
@@ -441,51 +437,10 @@
</if>
</settings-animated-pages>
- <template is="dom-if" if="[[showDisconnectDialog_]]" restamp>
- <cr-dialog id="disconnectDialog"
- ignore-popstate ignore-enter-key
- on-close="onDisconnectClosed_" close-text="$i18n{close}">
- <div slot="title">$i18n{syncDisconnectTitle}</div>
- <div slot="body">
- <div inner-h-t-m-l="[[
- getDisconnectExplanationHtml_(syncStatus.domain)]]">
- </div>
- </div>
- <div slot="button-container">
- <paper-button on-click="onDisconnectCancel_" class="cancel-button">
- $i18n{cancel}
- </paper-button>
- <paper-button id="disconnectConfirm" class="action-button"
- hidden="[[syncStatus.domain]]" on-click="onDisconnectConfirm_">
- $i18n{syncDisconnect}
- </paper-button>
- <paper-button id="disconnectManagedProfileConfirm"
- class="action-button" hidden="[[!syncStatus.domain]]"
- on-click="onDisconnectConfirm_">
- $i18n{syncDisconnectConfirm}
- </paper-button>
- </div>
-<if expr="(not chromeos and is_posix) or is_win or is_macosx">
- <template is="dom-if" if="[[!syncStatus.domain]]">
- <div id="wideFooter" slot="footer">
- <div class="settings-box first">
- <cr-checkbox id="deleteProfile" class="start"
- checked="{{deleteProfile_}}">
- $i18n{syncDisconnectDeleteProfile}
- </cr-checkbox>
- <cr-expand-button expanded="{{deleteProfileWarningVisible_}}"
- alt="$i18n{deleteProfileWarningExpandA11yLabel}">
- </cr-expand-button>
- </div>
- <iron-collapse opened="[[deleteProfileWarningVisible_]]">
- <div class="delete-profile-warning">
- [[deleteProfileWarning_]]
- </div>
- </iron-collapse>
- </div>
- </template>
-</if>
- </cr-dialog>
+ <template is="dom-if" if="[[showSignoutDialog_]]" restamp>
+ <settings-signout-dialog sync-status="[[syncStatus]]"
+ on-close="onDisconnectDialogClosed_">
+ </settings-signout-dialog>
</template>
<template is="dom-if" if="[[showImportDataDialog_]]" restamp>
diff --git a/chromium/chrome/browser/resources/settings/people_page/people_page.js b/chromium/chrome/browser/resources/settings/people_page/people_page.js
index 5302d6ad270..e899dd2bf12 100644
--- a/chromium/chrome/browser/resources/settings/people_page/people_page.js
+++ b/chromium/chrome/browser/resources/settings/people_page/people_page.js
@@ -86,26 +86,6 @@ Polymer({
*/
profileName_: String,
- /**
- * The profile deletion warning. The message indicates the number of
- * profile stats that will be deleted if a non-zero count for the profile
- * stats is returned from the browser.
- * @private
- */
- deleteProfileWarning_: String,
-
- /**
- * True if the profile deletion warning is visible.
- * @private
- */
- deleteProfileWarningVisible_: Boolean,
-
- /**
- * True if the checkbox to delete the profile has been checked.
- * @private
- */
- deleteProfile_: Boolean,
-
// <if expr="not chromeos">
/** @private */
showImportDataDialog_: {
@@ -115,7 +95,7 @@ Polymer({
// </if>
/** @private */
- showDisconnectDialog_: Boolean,
+ showSignoutDialog_: Boolean,
// <if expr="chromeos">
/**
@@ -129,6 +109,18 @@ Polymer({
},
readOnly: true,
},
+
+ /**
+ * True if Chrome OS Account Manager is enabled.
+ * @private
+ */
+ isAccountManagerEnabled_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('isAccountManagerEnabled');
+ },
+ readOnly: true,
+ },
// </if>
/** @private {!Map<string, string>} */
@@ -147,7 +139,10 @@ Polymer({
settings.routes.MANAGE_PASSWORDS.path, '#passwordManagerButton');
}
if (settings.routes.AUTOFILL) {
- map.set(settings.routes.AUTOFILL.path, '#paymentManagerButton');
+ map.set(settings.routes.AUTOFILL.path, '#addressesManagerButton');
+ }
+ if (settings.routes.PAYMENTS) {
+ map.set(settings.routes.PAYMENTS.path, '#paymentManagerButton');
}
// <if expr="not chromeos">
if (settings.routes.MANAGE_PROFILE) {
@@ -172,6 +167,11 @@ Polymer({
settings.routes.ACCOUNTS.path,
'#manage-other-people-subpage-trigger .subpage-arrow button');
}
+ if (settings.routes.ACCOUNT_MANAGER) {
+ map.set(
+ settings.routes.ACCOUNT_MANAGER.path,
+ '#account-manager-subpage-trigger .subpage-arrow button');
+ }
// </if>
return map;
},
@@ -202,9 +202,6 @@ Polymer({
this.addWebUIListener(
'profile-info-changed', this.handleProfileInfo_.bind(this));
- this.addWebUIListener(
- 'profile-stats-count-ready', this.handleProfileStatsCount_.bind(this));
-
this.syncBrowserProxy_ = settings.SyncBrowserProxyImpl.getInstance();
this.syncBrowserProxy_.getSyncStatus().then(
this.handleSyncStatus_.bind(this));
@@ -223,22 +220,14 @@ Polymer({
settings.getCurrentRoute() == settings.routes.IMPORT_DATA;
if (settings.getCurrentRoute() == settings.routes.SIGN_OUT) {
- // <if expr="not chromeos">
- settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileStatsCount();
- // </if>
// If the sync status has not been fetched yet, optimistically display
- // the disconnect dialog. There is another check when the sync status is
- // fetched. The dialog will be closed then the user is not signed in.
+ // the sign-out dialog. There is another check when the sync status is
+ // fetched. The dialog will be closed when the user is not signed in.
if (this.syncStatus && !this.syncStatus.signedIn) {
settings.navigateToPreviousRoute();
} else {
- this.showDisconnectDialog_ = true;
- this.async(() => {
- this.$$('#disconnectDialog').showModal();
- });
+ this.showSignoutDialog_ = true;
}
- } else if (this.showDisconnectDialog_) {
- this.$$('#disconnectDialog').close();
}
},
@@ -276,24 +265,6 @@ Polymer({
},
/**
- * Handler for when the profile stats count is pushed from the browser.
- * @param {number} count
- * @private
- */
- handleProfileStatsCount_: function(count) {
- this.deleteProfileWarning_ = (count > 0) ?
- (count == 1) ? loadTimeData.getStringF(
- 'deleteProfileWarningWithCountsSingular',
- this.syncStatus.signedInUsername) :
- loadTimeData.getStringF(
- 'deleteProfileWarningWithCountsPlural', count,
- this.syncStatus.signedInUsername) :
- loadTimeData.getStringF(
- 'deleteProfileWarningWithoutCounts',
- this.syncStatus.signedInUsername);
- },
-
- /**
* Handler for when the sync state is pushed from the browser.
* @param {?settings.SyncStatus} syncStatus
* @private
@@ -305,9 +276,6 @@ Polymer({
const shouldRecordSigninImpression =
!this.syncStatus && syncStatus && this.showSignin_(syncStatus);
- if (!syncStatus.signedIn && this.showDisconnectDialog_)
- this.$$('#disconnectDialog').close();
-
this.syncStatus = syncStatus;
if (shouldRecordSigninImpression && !this.shouldShowSyncAccountControl_()) {
@@ -341,7 +309,7 @@ Polymer({
},
/**
- * Shows the manage autofill sub page.
+ * Shows the manage autofill addresses sub page.
* @param {!Event} event
* @private
*/
@@ -349,9 +317,18 @@ Polymer({
settings.navigateTo(settings.routes.AUTOFILL);
},
+ /**
+ * Shows the manage payment information sub page.
+ * @param {!Event} event
+ * @private
+ */
+ onPaymentsTap_: function(event) {
+ settings.navigateTo(settings.routes.PAYMENTS);
+ },
+
/** @private */
- onDisconnectClosed_: function() {
- this.showDisconnectDialog_ = false;
+ onDisconnectDialogClosed_: function(e) {
+ this.showSignoutDialog_ = false;
// <if expr="not chromeos">
if (!this.diceEnabled_) {
// If DICE-enabled, this button won't exist here.
@@ -365,7 +342,6 @@ Polymer({
if (settings.getCurrentRoute() == settings.routes.SIGN_OUT)
settings.navigateToPreviousRoute();
- this.fire('signout-dialog-closed');
},
/** @private */
@@ -374,27 +350,6 @@ Polymer({
},
/** @private */
- onDisconnectCancel_: function() {
- this.$$('#disconnectDialog').close();
- },
-
- /** @private */
- onDisconnectConfirm_: function() {
- const deleteProfile = !!this.syncStatus.domain || this.deleteProfile_;
- // Trigger the sign out event after the navigateToPreviousRoute().
- // So that the navigation to the setting page could be finished before the
- // sign out if navigateToPreviousRoute() returns synchronously even the
- // browser is closed after the sign out. Otherwise, the navigation will be
- // finished during session restore if the browser is closed before the async
- // callback executed.
- listenOnce(this, 'signout-dialog-closed', () => {
- this.syncBrowserProxy_.signOut(deleteProfile);
- });
-
- this.$$('#disconnectDialog').close();
- },
-
- /** @private */
onSyncTap_: function() {
// When unified-consent is enabled, users can go to sync subpage regardless
// of sync status.
@@ -453,6 +408,14 @@ Polymer({
e.preventDefault();
settings.navigateTo(settings.routes.LOCK_SCREEN);
},
+
+ /**
+ * @param {!Event} e
+ * @private
+ */
+ onAccountManagerTap_: function(e) {
+ settings.navigateTo(settings.routes.ACCOUNT_MANAGER);
+ },
// </if>
/** @private */
@@ -502,22 +465,6 @@ Polymer({
/**
* @private
- * @param {string} domain
- * @return {string}
- */
- getDisconnectExplanationHtml_: function(domain) {
- // <if expr="not chromeos">
- if (domain) {
- return loadTimeData.getStringF(
- 'syncDisconnectManagedProfileExplanation',
- '<span id="managed-by-domain-name">' + domain + '</span>');
- }
- // </if>
- return loadTimeData.getString('syncDisconnectExplanation');
- },
-
- /**
- * @private
* @param {?settings.SyncStatus} syncStatus
* @return {boolean}
*/
diff --git a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html
index 87adadc7479..626028ad75a 100644
--- a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html
+++ b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.html
@@ -1,5 +1,6 @@
<link rel="import" href="chrome://resources/html/polymer.html">
+<link rel="import" href="chrome://resources/cr_elements/chromeos/fingerprint/cr_fingerprint_progress_arc.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
@@ -10,16 +11,10 @@
<link rel="import" href="../icons.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="fingerprint_browser_proxy.html">
-<link rel="import" href="fingerprint_progress_arc.html">
<dom-module id="settings-setup-fingerprint-dialog">
<template>
<style include="settings-shared">
- #arc {
- --canvas-height: 200px;
- --canvas-width: 450px;
- }
-
#dialog {
--cr-dialog-native: {
min-width: 500px;
@@ -27,30 +22,21 @@
};
}
- #image {
- height: 80px;
- left: 185px;
- min-height: 80px;
- min-width: 80px;
- position: relative;
- top: -140px;
- width: 80px;
+ #scannerLocation {
+ background: url(chrome://theme/IDR_LOGIN_FINGERPRINT_SCANNER_ANIMATION);
+ background-position: center;
+ background-repeat: no-repeat;
+ background-size: 298px 205px;
+ height: 240px;
}
- #image[step='3'] {
- --iron-icon-fill-color: var(--google-blue-700);
- }
-
- /* Put the image in a separate div with 0 height, otherwise the div will
- take the height of the image, leaving us with a row of whitespace when
- we position the #image to be inside #arc. */
- #imageDiv {
- height: 0;
+ #messageDiv {
+ height: 20px;
}
/* Use this instead of hidden so that the dialog does not resize when the
- problem appears or disappears. */
- #problemDiv[invisible] {
+ message appears or disappears. */
+ #messageDiv[invisible] {
visibility: hidden;
}
</style>
@@ -58,25 +44,20 @@
<cr-dialog id="dialog" on-close="close"
close-text="$i18n{close}">
<div slot="title">$i18n{configureFingerprintTitle}</div>
- <div slot="body">
- <div class="settings-box first">
- <span class="middle">[[getInstructionMessage_(step_)]]</span>
- </div>
- <settings-fingerprint-progress-arc id="arc">
- </settings-fingerprint-progress-arc>
- <div id="imageDiv">
- <iron-icon id="image" icon="settings:fingerprint" step$="[[step_]]">
- </iron-icon>
+ <div slot="body" on-click="fakeScan_">
+ <div id="messageDiv"
+ invisible$="[[!getInstructionMessage_(step_, problemMessage_)]]">
+ <span>[[getInstructionMessage_(step_, problemMessage_)]]</span>
</div>
- <div id="problemDiv" class="settings-box first"
- invisible$="[[!problemMessage_]]">
- <iron-icon icon="cr:warning"></iron-icon>
- <span class="middle">[[problemMessage_]]</span>
+ <div id="scannerLocation" hidden="[[!showScannerLocation_(step_)]]">
</div>
+ <cr-fingerprint-progress-arc id="arc" circle-radius="100"
+ hidden="[[!showArc_(step_)]]">
+ </cr-fingerprint-progress-arc>
</div>
<div slot="button-container">
<paper-button id="addAnotherButton" on-click="onAddAnotherFingerprint_"
- hidden$="[[hideAddAnother_(step_)]]">
+ hidden$="[[hideAddAnother_(step_, allowAddAnotherFinger)]]">
$i18n{configureFingerprintAddAnotherButton}
</paper-button>
diff --git a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js
index 2332428b2e3..e41510792dc 100644
--- a/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js
+++ b/chromium/chrome/browser/resources/settings/people_page/setup_fingerprint_dialog.js
@@ -17,13 +17,6 @@ settings.FingerprintSetupStep = {
(function() {
/**
- * The duration in ms of a fingerprint icon flash when a user touches the
- * fingerprint sensor during an enroll session.
- * @type {number}
- */
-const FLASH_DURATION_MS = 300;
-
-/**
* The amount of milliseconds after a successful but not completed scan before a
* message shows up telling the user to scan their finger again.
* @type {number}
@@ -37,6 +30,15 @@ Polymer({
properties: {
/**
+ * Whether add another finger is allowed.
+ * @type {boolean}
+ */
+ allowAddAnotherFinger: {
+ type: Boolean,
+ value: true,
+ },
+
+ /**
* The problem message to display.
* @private
*/
@@ -51,6 +53,20 @@ Polymer({
* @private
*/
step_: {type: Number, value: settings.FingerprintSetupStep.LOCATE_SCANNER},
+
+ /**
+ * The percentage of completion that has been received during setup.
+ * This is used to approximate the progress of the setup.
+ * The value within [0, 100] represents the percent of enrollment
+ * completion.
+ * @type {number}
+ * @private
+ */
+ percentComplete_: {
+ type: Number,
+ value: 0,
+ observer: 'onProgressChanged_',
+ },
},
/**
@@ -64,24 +80,13 @@ Polymer({
/** @private {?settings.FingerprintBrowserProxy}*/
browserProxy_: null,
- /**
- * The percentage of completion that has been received during setup.
- * This is used to approximate the progress of the setup.
- * The value within [0, 100] represents the percent of enrollment completion.
- * @type {number}
- * @private
- */
- percentComplete_: 0,
-
/** @override */
attached: function() {
this.addWebUIListener(
'on-fingerprint-scan-received', this.onScanReceived_.bind(this));
this.browserProxy_ = settings.FingerprintBrowserProxyImpl.getInstance();
- this.$.arc.clearCanvas();
- this.$.arc.drawBackgroundCircle();
- this.$.arc.drawShadow(10, 0, 0);
+ this.$.arc.reset();
this.browserProxy_.startEnroll();
this.$.dialog.showModal();
},
@@ -95,9 +100,7 @@ Polymer({
// Note: Reset resets |step_| back to the default, so handle anything that
// checks |step_| before resetting.
- if (this.step_ == settings.FingerprintSetupStep.READY)
- this.fire('add-fingerprint');
- else
+ if (this.step_ != settings.FingerprintSetupStep.READY)
this.browserProxy_.cancelCurrentEnroll();
this.reset_();
@@ -119,7 +122,6 @@ Polymer({
reset_: function() {
this.step_ = settings.FingerprintSetupStep.LOCATE_SCANNER;
this.percentComplete_ = 0;
- this.$.arc.clearCanvas();
this.clearSensorMessageTimeout_();
},
@@ -141,41 +143,21 @@ Polymer({
onScanReceived_: function(scan) {
switch (this.step_) {
case settings.FingerprintSetupStep.LOCATE_SCANNER:
+ this.$.arc.reset();
+ this.step_ = settings.FingerprintSetupStep.MOVE_FINGER;
+ this.percentComplete_ = scan.percentComplete;
+ this.setProblem_(scan.result);
+ break;
case settings.FingerprintSetupStep.MOVE_FINGER:
- if (this.step_ == settings.FingerprintSetupStep.LOCATE_SCANNER) {
- // Clear canvas because there will be shadows present at this step.
- this.$.arc.clearCanvas();
- this.$.arc.drawBackgroundCircle();
-
- this.step_ = settings.FingerprintSetupStep.MOVE_FINGER;
- this.percentComplete_ = 0;
- }
- const slice = 2 * Math.PI / 100;
if (scan.isComplete) {
this.problemMessage_ = '';
this.step_ = settings.FingerprintSetupStep.READY;
- this.$.arc.animateProgress(
- this.percentComplete_ * slice, 2 * Math.PI);
this.clearSensorMessageTimeout_();
+ this.fire('add-fingerprint');
} else {
this.setProblem_(scan.result);
- if (scan.result == settings.FingerprintResultType.SUCCESS) {
- this.problemMessage_ = '';
- // Flash the fingerprint icon blue so that users get some feedback
- // when a successful scan has been registered.
- this.$.image.animate(
- {
- fill: ['var(--google-blue-700)', 'var(--google-grey-500)'],
- opacity: [0.7, 1.0],
- },
- FLASH_DURATION_MS);
- if (scan.percentComplete > this.percentComplete_) {
- this.$.arc.animateProgress(
- this.percentComplete_ * slice, scan.percentComplete * slice);
- this.percentComplete_ = scan.percentComplete;
- }
- }
}
+ this.percentComplete_ = scan.percentComplete;
break;
case settings.FingerprintSetupStep.READY:
break;
@@ -190,14 +172,15 @@ Polymer({
* on.
* @param {!settings.FingerprintSetupStep} step The current step the
* fingerprint setup is on.
+ * @param {string} problemMessage Message for the scan result.
* @private
*/
- getInstructionMessage_: function(step) {
+ getInstructionMessage_: function(step, problemMessage) {
switch (step) {
case settings.FingerprintSetupStep.LOCATE_SCANNER:
return this.i18n('configureFingerprintInstructionLocateScannerStep');
case settings.FingerprintSetupStep.MOVE_FINGER:
- return this.i18n('configureFingerprintInstructionMoveFingerStep');
+ return problemMessage;
case settings.FingerprintSetupStep.READY:
return this.i18n('configureFingerprintInstructionReadyStep');
}
@@ -220,20 +203,11 @@ Polymer({
}, SHOW_TAP_SENSOR_MESSAGE_DELAY_MS);
break;
case settings.FingerprintResultType.PARTIAL:
- this.problemMessage_ = this.i18n('configureFingerprintPartialData');
- break;
case settings.FingerprintResultType.INSUFFICIENT:
- this.problemMessage_ =
- this.i18n('configureFingerprintInsufficientData');
- break;
case settings.FingerprintResultType.SENSOR_DIRTY:
- this.problemMessage_ = this.i18n('configureFingerprintSensorDirty');
- break;
case settings.FingerprintResultType.TOO_SLOW:
- this.problemMessage_ = this.i18n('configureFingerprintTooSlow');
- break;
case settings.FingerprintResultType.TOO_FAST:
- this.problemMessage_ = this.i18n('configureFingerprintTooFast');
+ this.problemMessage_ = this.i18n('configureFingerprintTryAgain');
break;
case settings.FingerprintResultType.IMMOBILE:
this.problemMessage_ = this.i18n('configureFingerprintImmobile');
@@ -271,10 +245,12 @@ Polymer({
/**
* @param {!settings.FingerprintSetupStep} step
+ * @param {boolean} allowAddAnotherFinger
* @private
*/
- hideAddAnother_: function(step) {
- return step != settings.FingerprintSetupStep.READY;
+ hideAddAnother_: function(step, allowAddAnotherFinger) {
+ return step != settings.FingerprintSetupStep.READY ||
+ !allowAddAnotherFinger;
},
/**
@@ -283,11 +259,41 @@ Polymer({
* @private
*/
onAddAnotherFingerprint_: function() {
- this.fire('add-fingerprint');
this.reset_();
- this.$.arc.drawBackgroundCircle();
- this.$.arc.drawShadow(10, 0, 0);
+ this.$.arc.reset();
+ this.step_ = settings.FingerprintSetupStep.MOVE_FINGER;
this.browserProxy_.startEnroll();
},
+
+ /**
+ * Whether scanner location should be shown at the current step.
+ * @private
+ */
+ showScannerLocation_: function() {
+ return this.step_ == settings.FingerprintSetupStep.LOCATE_SCANNER;
+ },
+
+ /**
+ * Whether fingerprint progress circle should be shown at the current step.
+ * @private
+ */
+ showArc_: function() {
+ return this.step_ == settings.FingerprintSetupStep.MOVE_FINGER ||
+ this.step_ == settings.FingerprintSetupStep.READY;
+ },
+
+ /**
+ * Observer for percentComplete_.
+ * @private
+ */
+ onProgressChanged_: function(newValue, oldValue) {
+ // Start a new enrollment, so reset all enrollment related states.
+ if (newValue === 0) {
+ this.$.arc.reset();
+ return;
+ }
+
+ this.$.arc.setProgress(oldValue, newValue, newValue === 100);
+ },
});
})();
diff --git a/chromium/chrome/browser/resources/settings/people_page/setup_pin_dialog.js b/chromium/chrome/browser/resources/settings/people_page/setup_pin_dialog.js
index bddac27f2d1..39840b9fbba 100644
--- a/chromium/chrome/browser/resources/settings/people_page/setup_pin_dialog.js
+++ b/chromium/chrome/browser/resources/settings/people_page/setup_pin_dialog.js
@@ -263,6 +263,8 @@ Polymer({
this.quickUnlockPrivate_.checkCredential(
chrome.quickUnlockPrivate.QuickUnlockMode.PIN,
this.pinKeyboardValue_, this.processPinProblems_.bind(this));
+ } else {
+ this.enableSubmit_ = false;
}
return;
}
diff --git a/chromium/chrome/browser/resources/settings/people_page/signout_dialog.html b/chromium/chrome/browser/resources/settings/people_page/signout_dialog.html
new file mode 100644
index 00000000000..7dce40aec69
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/people_page/signout_dialog.html
@@ -0,0 +1,78 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="profile_info_browser_proxy.html">
+<link rel="import" href="sync_browser_proxy.html">
+<link rel="import" href="../settings_shared_css.html">
+
+<dom-module id="settings-signout-dialog">
+ <template>
+ <style include="settings-shared">
+ #dialog [slot=footer] .settings-box {
+ --settings-box-row-padding: 0;
+ }
+
+ .delete-profile-warning {
+ padding-bottom: 10px;
+ padding-inline-end: var(--cr-section-padding);
+ /* In order to line up with the checkbox text. */
+ padding-inline-start: var(--cr-section-indent-padding);
+ padding-top: 10px;
+ }
+
+ #wideFooter {
+ /* Override the cr-dialog footer padding. */
+ padding: 16px 0;
+ }
+ </style>
+
+ <cr-dialog id="dialog" ignore-enter-key close-text="$i18n{close}">
+ <div slot="title">$i18n{syncDisconnectTitle}</div>
+ <div slot="body">
+ <div inner-h-t-m-l="[[
+ getDisconnectExplanationHtml_(syncStatus.domain)]]">
+ </div>
+ </div>
+ <div slot="button-container">
+ <paper-button id="disconnectCancel" class="cancel-button"
+ on-click="onDisconnectCancel_" >
+ $i18n{cancel}
+ </paper-button>
+ <paper-button id="disconnectConfirm" class="action-button"
+ hidden="[[syncStatus.domain]]" on-click="onDisconnectConfirm_">
+ $i18n{syncDisconnect}
+ </paper-button>
+ <paper-button id="disconnectManagedProfileConfirm"
+ class="action-button" hidden="[[!syncStatus.domain]]"
+ on-click="onDisconnectConfirm_">
+ $i18n{syncDisconnectConfirm}
+ </paper-button>
+ </div>
+<if expr="(not chromeos and is_posix) or is_win or is_macosx">
+ <template is="dom-if" if="[[!syncStatus.domain]]">
+ <div id="wideFooter" slot="footer">
+ <div class="settings-box first">
+ <cr-checkbox id="deleteProfile" class="start"
+ checked="{{deleteProfile_}}">
+ $i18n{syncDisconnectDeleteProfile}
+ </cr-checkbox>
+ <cr-expand-button expanded="{{deleteProfileWarningVisible_}}"
+ alt="$i18n{deleteProfileWarningExpandA11yLabel}">
+ </cr-expand-button>
+ </div>
+ <iron-collapse opened="[[deleteProfileWarningVisible_]]">
+ <div class="delete-profile-warning">
+ [[deleteProfileWarning_]]
+ </div>
+ </iron-collapse>
+ </div>
+ </template>
+</if>
+ </cr-dialog>
+ </template>
+ <script src="signout_dialog.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/people_page/signout_dialog.js b/chromium/chrome/browser/resources/settings/people_page/signout_dialog.js
new file mode 100644
index 00000000000..d1564f24c31
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/people_page/signout_dialog.js
@@ -0,0 +1,120 @@
+// 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.
+
+/**
+ * @fileoverview 'settings-signout-dialog' is a dialog that allows the
+ * user to turn off sync and sign out of Chromium.
+ */
+Polymer({
+ is: 'settings-signout-dialog',
+
+ behaviors: [WebUIListenerBehavior],
+
+ properties: {
+ /**
+ * The current sync status, supplied by the parent.
+ * @type {?settings.SyncStatus}
+ */
+ syncStatus: {
+ type: Object,
+ observer: 'syncStatusChanged_',
+ },
+
+ /**
+ * True if the checkbox to delete the profile has been checked.
+ * @private
+ */
+ deleteProfile_: Boolean,
+
+ /**
+ * True if the profile deletion warning is visible.
+ * @private
+ */
+ deleteProfileWarningVisible_: Boolean,
+
+ /**
+ * The profile deletion warning. The message indicates the number of
+ * profile stats that will be deleted if a non-zero count for the profile
+ * stats is returned from the browser.
+ * @private
+ */
+ deleteProfileWarning_: String,
+ },
+
+ /** @override */
+ attached: function() {
+ this.addWebUIListener(
+ 'profile-stats-count-ready', this.handleProfileStatsCount_.bind(this));
+ // <if expr="not chromeos">
+ settings.ProfileInfoBrowserProxyImpl.getInstance().getProfileStatsCount();
+ // </if>
+ this.async(() => {
+ this.$.dialog.showModal();
+ });
+ },
+
+ /**
+ * Returns true when the user selected 'Confirm'.
+ * @return {boolean}
+ */
+ wasConfirmed: function() {
+ return this.$.dialog.getNative().returnValue == 'success';
+ },
+
+ /**
+ * Handler for when the profile stats count is pushed from the browser.
+ * @param {number} count
+ * @private
+ */
+ handleProfileStatsCount_: function(count) {
+ const username = this.syncStatus.signedInUsername || '';
+ if (count == 0) {
+ this.deleteProfileWarning_ = loadTimeData.getStringF(
+ 'deleteProfileWarningWithoutCounts', username);
+ } else if (count == 1) {
+ this.deleteProfileWarning_ = loadTimeData.getStringF(
+ 'deleteProfileWarningWithCountsSingular', username);
+ } else {
+ this.deleteProfileWarning_ = loadTimeData.getStringF(
+ 'deleteProfileWarningWithCountsPlural', count, username);
+ }
+ },
+
+ /**
+ * Polymer observer for syncStatus.
+ * @private
+ */
+ syncStatusChanged_: function() {
+ if (!this.syncStatus.signedIn && this.$.dialog.open)
+ this.$.dialog.close();
+ },
+
+ /**
+ * @private
+ * @param {string} domain
+ * @return {string}
+ */
+ getDisconnectExplanationHtml_: function(domain) {
+ // <if expr="not chromeos">
+ if (domain) {
+ return loadTimeData.getStringF(
+ 'syncDisconnectManagedProfileExplanation',
+ '<span id="managed-by-domain-name">' + domain + '</span>');
+ }
+ // </if>
+ return loadTimeData.getString('syncDisconnectExplanation');
+ },
+
+ /** @private */
+ onDisconnectCancel_: function() {
+ this.$.dialog.cancel();
+ },
+
+ /** @private */
+ onDisconnectConfirm_: function() {
+ this.$.dialog.close();
+ const deleteProfile = !!this.syncStatus.domain || this.deleteProfile_;
+ settings.SyncBrowserProxyImpl.getInstance().signOut(deleteProfile);
+ },
+});
diff --git a/chromium/chrome/browser/resources/settings/people_page/sync_account_control.html b/chromium/chrome/browser/resources/settings/people_page/sync_account_control.html
index fc1875cbb45..7726f002f48 100644
--- a/chromium/chrome/browser/resources/settings/people_page/sync_account_control.html
+++ b/chromium/chrome/browser/resources/settings/people_page/sync_account_control.html
@@ -24,7 +24,7 @@
setting-box.middle {
/* Per spec, middle text is indented 20px in this section. */
- -webkit-margin-start: 20px;
+ margin-inline-start: 20px;
}
.account-icon {
@@ -44,7 +44,7 @@
}
#menu .dropdown-item span {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
.flex {
@@ -54,6 +54,7 @@
}
#avatar-container {
+ height: var(--shown-avatar-size);
position: relative;
}
@@ -192,8 +193,7 @@
<paper-button id="sync-button" class="action-button"
hidden="[[syncStatus.signedIn]]" on-click="onSyncButtonTap_"
disabled="[[syncStatus.setupInProgress]]">
- [[getSubstituteLabel_(
- '$i18nPolymer{syncAsName}', shownAccount_.givenName)]]
+ $i18n{peopleSignIn}
</paper-button>
<paper-button id="turn-off" class="secondary-button"
hidden="[[!shouldShowTurnOffButton_(syncStatus.signedIn)]]"
diff --git a/chromium/chrome/browser/resources/settings/people_page/sync_account_control.js b/chromium/chrome/browser/resources/settings/people_page/sync_account_control.js
index 294ad84551f..6baa3667676 100644
--- a/chromium/chrome/browser/resources/settings/people_page/sync_account_control.js
+++ b/chromium/chrome/browser/resources/settings/people_page/sync_account_control.js
@@ -63,6 +63,14 @@ Polymer({
reflectToAttribute: true,
},
+ // This property should be set by the parent only and should not change
+ // after the element is created.
+ hideButtons: {
+ type: Boolean,
+ value: false,
+ reflectToAttribute: true,
+ },
+
/** @private {boolean} */
shouldShowAvatarRow_: {
type: Boolean,
@@ -162,25 +170,6 @@ Polymer({
},
/**
- * @param {string} syncErrorLabel
- * @param {string} authErrorLabel
- * @return {string}
- * @private
- */
- getErrorLabel_: function(syncErrorLabel, authErrorLabel) {
- if (this.syncStatus.hasError) {
- // Most of the time re-authenticate states are caused by intentional user
- // action, so they will be displayed differently as other errors.
- return this.syncStatus.statusAction ==
- settings.StatusAction.REAUTHENTICATE ?
- authErrorLabel :
- syncErrorLabel;
- }
-
- return '';
- },
-
- /**
* @param {string} label
* @param {string} account
* @return {string}
@@ -209,7 +198,9 @@ Polymer({
* @private
*/
getSyncIconStyle_: function() {
- if (this.syncStatus.hasError) {
+ if (!!this.syncStatus.hasUnrecoverableError)
+ return 'sync-problem';
+ if (!!this.syncStatus.hasError) {
return this.syncStatus.statusAction ==
settings.StatusAction.REAUTHENTICATE ?
'sync-paused' :
@@ -242,13 +233,16 @@ Polymer({
*/
getAvatarRowTitle_: function(
accountName, syncErrorLabel, authErrorLabel, disabledLabel) {
- if (!!this.syncStatus.disabled)
- return disabledLabel;
-
- if (this.syncStatus.hasError)
- return this.getErrorLabel_(syncErrorLabel, authErrorLabel);
-
- return accountName;
+ switch (this.getSyncIconStyle_()) {
+ case 'sync-problem':
+ return syncErrorLabel;
+ case 'sync-paused':
+ return authErrorLabel;
+ case 'sync-disabled':
+ return disabledLabel;
+ default:
+ return accountName;
+ }
},
/**
@@ -256,7 +250,8 @@ Polymer({
* @private
*/
shouldShowTurnOffButton_: function() {
- return !!this.syncStatus.signedIn && !this.embeddedInSubpage;
+ return !this.hideButtons && !!this.syncStatus.signedIn &&
+ !this.embeddedInSubpage;
},
/**
@@ -264,8 +259,8 @@ Polymer({
* @private
*/
shouldShowSigninAgainButton_: function() {
- return !!this.syncStatus.signedIn && this.embeddedInSubpage &&
- !!this.syncStatus.hasError &&
+ return !this.hideButtons && !!this.syncStatus.signedIn &&
+ this.embeddedInSubpage && !!this.syncStatus.hasError &&
this.syncStatus.statusAction == settings.StatusAction.REAUTHENTICATE;
},
diff --git a/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js b/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js
index 323a22b48b1..b2ab725ef47 100644
--- a/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/people_page/sync_browser_proxy.js
@@ -138,6 +138,11 @@ cr.define('settings', function() {
signOut(deleteProfile) {}
/**
+ * Invalidates the Sync token without signing the user out.
+ */
+ pauseSync() {}
+
+ /**
* Opens the multi-profile user manager.
*/
manageOtherPeople() {}
@@ -215,6 +220,13 @@ cr.define('settings', function() {
* Opens the Google Activity Controls url in a new tab.
*/
openActivityControlsUrl() {}
+
+ /**
+ * Function to invoke when the unified consent toggle state changes, to
+ * notify the C++ layer.
+ * @param {boolean} toggleChecked
+ */
+ unifiedConsentToggleChanged(toggleChecked) {}
}
/**
@@ -233,6 +245,11 @@ cr.define('settings', function() {
}
/** @override */
+ pauseSync() {
+ chrome.send('SyncSetupPauseSync');
+ }
+
+ /** @override */
manageOtherPeople() {
chrome.send('SyncSetupManageOtherPeople');
}
@@ -302,6 +319,11 @@ cr.define('settings', function() {
chrome.metricsPrivate.recordUserAction(
'Signin_AccountSettings_GoogleActivityControlsClicked');
}
+
+ /** @override */
+ unifiedConsentToggleChanged(toggleChecked) {
+ chrome.send('UnifiedConsentToggleChanged', [toggleChecked]);
+ }
}
cr.addSingletonGetter(SyncBrowserProxyImpl);
diff --git a/chromium/chrome/browser/resources/settings/people_page/sync_page.html b/chromium/chrome/browser/resources/settings/people_page/sync_page.html
index 1e4a02e5852..d1e99ea9e7b 100644
--- a/chromium/chrome/browser/resources/settings/people_page/sync_page.html
+++ b/chromium/chrome/browser/resources/settings/people_page/sync_page.html
@@ -27,11 +27,17 @@
<dom-module id="settings-sync-page">
<template>
<style include="settings-shared iron-flex">
- #create-password-box,
- #reset-sync-message-box-encryption,
- #reset-sync-message-box-user-events {
+ #sync-section-toggle:not([actionable]) {
+ opacity: var(--cr-disabled-opacity);
+ }
+
+ #create-password-box {
/* In order to line up with the encryption radio box text. */
- -webkit-margin-start: var(--settings-indent-width);
+ margin-inline-start: var(--settings-indent-width);
+ }
+
+ #create-password-box {
+ margin-bottom: 1em;
}
#create-password-box .list-item {
@@ -43,14 +49,14 @@
}
#existingPassphrase {
- /* This particular list frame is not indented. */
- -webkit-padding-start: var(--settings-box-row-padding);
border-bottom: var(--settings-separator-line);
+ /* This particular list frame is not indented. */
+ padding-inline-start: var(--settings-box-row-padding);
}
#submitExistingPassphrase {
/* The submit button for the existing passphrase is on the same line. */
- -webkit-margin-start: 16px;
+ margin-inline-start: 16px;
}
#passphraseRecoverHint {
@@ -65,6 +71,10 @@
border-top: var(--settings-separator-line);
}
+ .passphrase-reset-icon {
+ margin-right: 8px;
+ }
+
<if expr="not chromeos">
#toast {
color: white;
@@ -79,7 +89,7 @@
</if>
</style>
<if expr="not chromeos">
- <template is="dom-if" if="[[shouldShowSyncAccountControl_(diceEnabled,
+ <template is="dom-if" if="[[shouldShowSyncAccountControl_(
unifiedConsentEnabled, syncStatus.syncSystemEnabled,
syncStatus.signinAllowed)]]">
<settings-sync-account-control embedded-in-subpage
@@ -134,7 +144,8 @@
label="$i18n{syncUnifiedConsentToggleTitle}"
on-settings-boolean-control-change="onUnifiedConsentToggleChange_"
hidden="[[!shouldShowUnifiedConsentToggle_(unifiedConsentEnabled,
- syncStatus.disabled, syncStatus.signedIn)]]">
+ syncStatus.disabled, syncStatus.signedIn)]]"
+ disabled="[[syncPrefs.encryptAllData]]">
</settings-toggle-button>
<div class="settings-box two-line" id="sync-section-toggle"
actionable$="[[!syncSectionDisabled_]]"
@@ -352,19 +363,20 @@
<!-- User events is disabled and unchecked if data is encrypted or
typed urls are disabled. -->
<template is="dom-if" if="[[unifiedConsentEnabled]]">
- <div class="layout horizontal list-item"
- hidden="[[!syncPrefs.userEventsRegistered]]">
+ <div hidden="[[!syncPrefs.userEventsRegistered]]"
+ class$="[[getPassphraseHintLines_(syncPrefs.encryptAllData)]]
+ layout horizontal list-item">
<div class="start" id="userEventsCheckboxLabel">
- <div>$i18n{userEventsCheckboxLabel}</div>
+ $i18n{userEventsCheckboxLabel}
<div class="secondary">
$i18n{userEventsCheckboxText}
- </div>
- <div id="reset-sync-message-box-user-events" class="list-item"
- hidden="[[!syncPrefs.encryptAllData]]">
- <span>
- <iron-icon icon="settings:info-outline"></iron-icon>
- $i18nRaw{passphraseResetHint}
- </span>
+ <div id="reset-sync-message-box-user-events"
+ hidden="[[!syncPrefs.encryptAllData]]">
+ <iron-icon icon="settings:info-outline"
+ class="passphrase-reset-icon">
+ </iron-icon>
+ $i18nRaw{passphraseResetHintToggle}
+ </div>
</div>
</div>
<cr-toggle id="userEventsToggle"
@@ -398,8 +410,7 @@
$i18n{personalizeGoogleServicesTitle}
</div>
<paper-icon-button-light actionable class="icon-external">
- <button aria-label="$i18n{personalizeGoogleServicesTitle}">
- </button>
+ <button></button>
</paper-icon-button-light>
</a>
@@ -410,16 +421,25 @@
$i18n{manageSyncedDataTitle}
</div>
<paper-icon-button-light actionable class="icon-external">
- <button aria-label="$i18n{manageSyncedDataTitle}"></button>
+ <button></button>
</paper-icon-button-light>
</a>
<div id="encryptionDescription"
hidden="[[syncPrefs.passphraseRequired]]"
- class$="two-line single-column
+ class$="single-column
+ [[getPassphraseHintLines_(syncPrefs.encryptAllData)]]
[[getListItemClass_(unifiedConsentEnabled)]]">
- <div>$i18n{encryptionOptionsTitle}</div>
- <div class="secondary">$i18n{syncDataEncryptedText}</div>
+ $i18n{encryptionOptionsTitle}
+ <div class="secondary">
+ $i18n{syncDataEncryptedText}
+ <div hidden="[[!syncPrefs.encryptAllData]]">
+ <iron-icon icon="settings:info-outline"
+ class="passphrase-reset-icon">
+ </iron-icon>
+ $i18nRaw{passphraseResetHintEncryption}
+ </div>
+ </div>
</div>
<div id="encryptionRadioGroupContainer" class="list-frame"
@@ -431,31 +451,30 @@
on-paper-radio-group-changed=
"onEncryptionRadioSelectionChanged_">
<cr-radio-button name="encrypt-with-google"
- class="list-item" disabled="[[syncPrefs.encryptAllData]]">
+ class="list-item" disabled="[[syncPrefs.encryptAllData]]"
+ aria-label="$i18n{encryptWithGoogleCredentialsLabel}">
$i18n{encryptWithGoogleCredentialsLabel}
</cr-radio-button>
- <cr-radio-button name="encrypt-with-passphrase"
- class="list-item" disabled="[[syncPrefs.encryptAllData]]">
- <template is="dom-if" if="[[syncPrefs.fullEncryptionBody]]">
- <span>[[syncPrefs.fullEncryptionBody]]</span>
- </template>
- <template is="dom-if" if="[[!syncPrefs.fullEncryptionBody]]">
- <span on-click="onLearnMoreTap_">
+ <template is="dom-if" if="[[syncPrefs.fullEncryptionBody]]">
+ <cr-radio-button name="encrypt-with-passphrase"
+ class="list-item" disabled="[[syncPrefs.encryptAllData]]"
+ aria-labelledby="fullEncryptionBody">
+ <span id="fullEncryptionBody">
+ [[syncPrefs.fullEncryptionBody]]
+ </span>
+ </cr-radio-button>
+ </template>
+ <template is="dom-if" if="[[!syncPrefs.fullEncryptionBody]]">
+ <cr-radio-button name="encrypt-with-passphrase"
+ class="list-item" disabled="[[syncPrefs.encryptAllData]]"
+ aria-labelledby="encryptWithSyncPassphraseLabel">
+ <span id="encryptWithSyncPassphraseLabel"
+ on-click="onLearnMoreTap_">
$i18nRaw{encryptWithSyncPassphraseLabel}
</span>
- </template>
- </cr-radio-button>
+ </cr-radio-button>
+ </template>
</paper-radio-group>
-
- <!-- duplicated from above -->
- <div id="reset-sync-message-box-encryption" class="list-item"
- hidden="[[!syncPrefs.encryptAllData]]">
- <span>
- <iron-icon icon="settings:info-outline"></iron-icon>
- $i18nRaw{passphraseResetHint}
- </span>
- </div>
-
</div>
<template is="dom-if" if="[[creatingNewPassphrase_]]">
@@ -498,7 +517,7 @@
</div>
</div>
<cr-expand-button expanded="{{personalizeSectionOpened_}}"
- alt="$i18n{syncExpandA11yLabel}">
+ alt="$i18n{nonPersonalizedServicesExpandA11yLabel}">
</cr-expand-button>
</div>
<iron-collapse id="personalize-section"
diff --git a/chromium/chrome/browser/resources/settings/people_page/sync_page.js b/chromium/chrome/browser/resources/settings/people_page/sync_page.js
index a5520dbebd4..63aaa3b3af1 100644
--- a/chromium/chrome/browser/resources/settings/people_page/sync_page.js
+++ b/chromium/chrome/browser/resources/settings/people_page/sync_page.js
@@ -88,7 +88,6 @@ Polymer({
/** @type {settings.SyncStatus} */
syncStatus: {
type: Object,
- observer: 'onSyncStatusChanged_',
},
/**
@@ -130,6 +129,14 @@ Polymer({
},
/** @private */
+ signedIn_: {
+ type: Boolean,
+ value: true,
+ computed: 'computeSignedIn_(syncStatus.signedIn)',
+ observer: 'onSignedInChanged_',
+ },
+
+ /** @private */
syncSectionDisabled_: {
type: Boolean,
value: false,
@@ -229,12 +236,20 @@ Polymer({
* @return {boolean}
* @private
*/
- computeSyncSectionDisabled_() {
+ computeSignedIn_: function() {
+ return !!this.syncStatus.signedIn;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ computeSyncSectionDisabled_: function() {
return !!this.unifiedConsentEnabled &&
(!this.syncStatus.signedIn || !!this.syncStatus.disabled ||
(!!this.syncStatus.hasError &&
- this.syncStatus.statusAction ===
- settings.StatusAction.REAUTHENTICATE));
+ this.syncStatus.statusAction !==
+ settings.StatusAction.ENTER_PASSPHRASE));
},
/** @protected */
@@ -291,7 +306,10 @@ Polymer({
* @private
*/
onUnifiedConsentToggleChange_: function() {
- if(!this.$$('#unifiedConsentToggle').checked){
+ const checked = this.$$('#unifiedConsentToggle').checked;
+ this.browserProxy_.unifiedConsentToggleChanged(checked);
+
+ if (!checked) {
this.syncSectionOpened_ = true;
this.personalizeSectionOpened_ = true;
}
@@ -592,9 +610,12 @@ Polymer({
settings.navigateTo(settings.routes.BASIC);
},
- /** @private */
- onSyncStatusChanged_: function() {
- this.syncSectionOpened_ = !!this.syncStatus.signedIn;
+ /**
+ * Collapses/Expands the sync section if the signedIn state has changed.
+ * @private
+ */
+ onSignedInChanged_: function() {
+ this.syncSectionOpened_ = !!this.signedIn_;
},
/**
@@ -639,13 +660,23 @@ Polymer({
return this.unifiedConsentEnabled ? 'list-item' : 'settings-box';
},
+ /**
+ * When there is a sync passphrase, some items have an additional line for the
+ * passphrase reset hint, making them three lines rather than two.
+ * @return {string}
+ * @private
+ */
+ getPassphraseHintLines_: function() {
+ return this.syncPrefs.encryptAllData ? 'three-line' : 'two-line';
+ },
+
// <if expr="not chromeos">
/**
* @return {boolean}
* @private
*/
shouldShowSyncAccountControl_: function() {
- return !!this.diceEnabled && !!this.unifiedConsentEnabled &&
+ return !!this.unifiedConsentEnabled &&
!!this.syncStatus.syncSystemEnabled && !!this.syncStatus.signinAllowed;
},
// </if>
diff --git a/chromium/chrome/browser/resources/settings/people_page/user_list.html b/chromium/chrome/browser/resources/settings/people_page/user_list.html
index fd03c894e98..1a12c33141c 100644
--- a/chromium/chrome/browser/resources/settings/people_page/user_list.html
+++ b/chromium/chrome/browser/resources/settings/people_page/user_list.html
@@ -32,7 +32,7 @@
}
.user-info {
- -webkit-padding-start: 20px;
+ padding-inline-start: 20px;
}
</style>
<div class="user-list" scrollable>
diff --git a/chromium/chrome/browser/resources/settings/people_page/users_page.html b/chromium/chrome/browser/resources/settings/people_page/users_page.html
index 52376e685f4..fbf44a44520 100644
--- a/chromium/chrome/browser/resources/settings/people_page/users_page.html
+++ b/chromium/chrome/browser/resources/settings/people_page/users_page.html
@@ -19,7 +19,7 @@
#add-user-button {
/* Add user button must be lined up with the start of users' names. */
- -webkit-margin-start: var(--settings-box-row-indent);
+ margin-inline-start: var(--settings-box-row-indent);
}
.block {
diff --git a/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn b/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn
index c609a9e2437..5452ef37925 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/printing_page/BUILD.gn
@@ -8,6 +8,7 @@ js_type_check("closure_compile") {
deps = [
":cloud_printers",
":cups_add_printer_dialog",
+ ":cups_add_printer_dialog_elements",
":cups_add_printer_dialog_util",
":cups_edit_printer_dialog",
":cups_printers",
@@ -34,16 +35,22 @@ js_library("cups_add_printer_dialog") {
]
}
-js_library("cups_add_printer_dialog_util") {
+js_library("cups_add_printer_dialog_elements") {
deps = [
":cups_printers_browser_proxy",
- "//ui/webui/resources/cr_elements:cr_scrollable_behavior",
+ ]
+}
+
+js_library("cups_add_printer_dialog_util") {
+ deps = [
+ "//ui/webui/resources/js:cr",
]
}
js_library("cups_edit_printer_dialog") {
deps = [
":cups_set_manufacturer_model_behavior",
+ "//ui/webui/resources/cr_elements:cr_scrollable_behavior",
]
}
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
index ce81da6f79c..b0c64325fdc 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.html
@@ -1,11 +1,13 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.html">
<link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="cups_add_printer_dialog_elements.html">
<link rel="import" href="cups_add_printer_dialog_util.html">
<link rel="import" href="cups_printer_shared_css.html">
<link rel="import" href="cups_printers_browser_proxy.html">
@@ -28,9 +30,9 @@
#searchSpinner paper-spinner-lite {
--paper-spinner-stroke-width: 2px;
- -webkit-margin-end: 3px;
- -webkit-margin-start: 20px;
height: 15px;
+ margin-inline-end: 3px;
+ margin-inline-start: 20px;
width: 15px;
}
</style>
@@ -75,7 +77,7 @@
<template>
<style include="cups-printer-shared">
#discoverPrintersButton {
- -webkit-margin-end: 153px;
+ margin-inline-end: 153px;
}
.search-printer-box {
@@ -84,9 +86,9 @@
.search-printer-box paper-spinner-lite {
--paper-spinner-stroke-width: 2px;
- -webkit-margin-end: 3px;
- -webkit-margin-start: 20px;
height: 15px;
+ margin-inline-end: 3px;
+ margin-inline-start: 20px;
width: 15px;
}
@@ -174,16 +176,16 @@
<div slot="dialog-title">$i18n{selectManufacturerAndModelTitle}</div>
<div slot="dialog-body">
<div class="settings-box two-line">
- <drop-down-search-box items="[[manufacturerList]]"
+ <cr-searchable-drop-down items="[[manufacturerList]]"
label="$i18n{printerManufacturer}"
value="{{activePrinter.ppdManufacturer}}">
- </drop-down-search-box>
+ </cr-searchable-drop-down>
</div>
<div class="settings-box two-line">
- <drop-down-search-box items="[[modelList]]"
+ <cr-searchable-drop-down items="[[modelList]]"
label="$i18n{printerModel}"
value="{{activePrinter.ppdModel}}">
- </drop-down-search-box>
+ </cr-searchable-drop-down>
</div>
<div class="settings-box two-line last">
<cr-input class="browse-file-input" readonly value="[[newUserPPD_]]"
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
index fc6d7f1ad8a..c882c08b391 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog.js
@@ -193,49 +193,13 @@ Polymer({
},
/**
- * This function uses regular expressions to determine whether the provided
- * printer address is valid. Address can be either an ipv4/6 address or a
- * hostname followed by an optional port.
- * NOTE: The regular expression for hostnames will allow hostnames that are
- * over 255 characters.
- * @param {String} name
- * @param {String} address
+ * @param {string} name
+ * @param {string} address
* @return {boolean} Whether the add printer button is enabled.
* @private
*/
canAddPrinter_: function(name, address) {
- if (!name || !address)
- return false;
-
- const hostnamePrefix = '([a-z\\d]|[a-z\\d][a-z\\d\\-]{0,61}[a-z\\d])';
-
- // Matches an arbitrary number of 'prefix patterns' which are separated by a
- // dot.
- const hostnameSuffix = `(\\.${hostnamePrefix})*`;
-
- // Matches an optional port at the end of the address.
- const portNumber = '(:\\d+)?';
-
- const ipv6Full = '(([a-f\\d]){1,4}(:(:)?([a-f\\d]){1,4}){1,7})';
-
- // Special cases for addresses using a shorthand notation.
- const ipv6Prefix = '(::([a-f\\d]){1,4})';
- const ipv6Suffix = '(([a-f\\d]){1,4}::)';
- const ipv6Combined = `(${ipv6Full}|${ipv6Prefix}|${ipv6Suffix})`;
- const ipv6WithPort = `(\\[${ipv6Combined}\\]${portNumber})`;
-
- // Matches valid hostnames and ipv4 addresses.
- const hostnameRegex =
- new RegExp(`^${hostnamePrefix}${hostnameSuffix}${portNumber}$`, 'i');
-
- // Matches valid ipv6 addresses.
- const ipv6AddressRegex =
- new RegExp(`^(${ipv6Combined}|${ipv6WithPort})$`, 'i');
-
- const invalidIpv6Regex = new RegExp('.*::.*::.*');
-
- return hostnameRegex.test(address) ||
- (ipv6AddressRegex.test(address) && !invalidIpv6Regex.test(address));
+ return settings.printing.isNameAndAddressValid(name, address);
},
});
@@ -271,7 +235,8 @@ Polymer({
* @private
*/
canAddPrinter_: function(ppdManufacturer, ppdModel, printerPPDPath) {
- return !!((ppdManufacturer && ppdModel) || printerPPDPath);
+ return settings.printing.isPPDInfoValid(
+ ppdManufacturer, ppdModel, printerPPDPath);
},
});
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.html b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.html
new file mode 100644
index 00000000000..695ce6d9ec2
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.html
@@ -0,0 +1,58 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
+<link rel="import" href="chrome://resources/cr_elements/icons.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="cups_printer_shared_css.html">
+<link rel="import" href="cups_printers_browser_proxy.html">
+
+<dom-module id="add-printer-list">
+ <template>
+ <style include="cups-printer-shared">
+ .list-item {
+ padding: 0 20px;
+ }
+ </style>
+ <div>
+ <array-selector id="arraySelector" items="[[printers]]"
+ selected="{{selectedPrinter}}">
+ </array-selector>
+ <template is="dom-repeat" items="[[printers]]">
+ <button class="list-item" on-click="onSelect_">
+ [[item.printerName]]
+ </button>
+ </template>
+ </div>
+ </template>
+</dom-module>
+
+<dom-module id="add-printer-dialog">
+ <template>
+ <style include="settings-shared">
+ #dialog {
+ --cr-dialog-body-container: {
+ /* Force a bottom border regardless of scroll state. */
+ border-bottom: 1px solid var(--paper-grey-300) !important;
+ };
+ }
+ #dialog [slot=body] {
+ height: 350px;
+ padding-inline-end: 0;
+ padding-inline-start: 0;
+ }
+ </style>
+
+ <cr-dialog id="dialog" close-text="$i18n{close}">
+ <div slot="title">
+ <slot name="dialog-title"></slot>
+ </div>
+ <div slot="body">
+ <slot name="dialog-body"></slot>
+ </div>
+ <div slot="button-container">
+ <slot name="dialog-buttons"></slot>
+ </div>
+ </cr-dialog>
+ </template>
+ <script src="cups_add_printer_dialog_elements.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.js b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.js
new file mode 100644
index 00000000000..d27c65f58a8
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_elements.js
@@ -0,0 +1,44 @@
+// 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.
+
+/** 'add-printers-list' is the list of discovered printers. */
+Polymer({
+ is: 'add-printer-list',
+
+ properties: {
+ /** @type {!Array<!CupsPrinterInfo>} */
+ printers: {
+ type: Array,
+ notify: true,
+ },
+
+ /** @type {!CupsPrinterInfo} */
+ selectedPrinter: {
+ type: Object,
+ notify: true,
+ },
+ },
+
+ /**
+ * @param {{model:Object}} event
+ * @private
+ */
+ onSelect_: function(event) {
+ this.selectedPrinter = event.model.item;
+ },
+});
+
+/** 'add-printer-dialog' is the template of the Add Printer dialog. */
+Polymer({
+ is: 'add-printer-dialog',
+
+ /** @private */
+ attached: function() {
+ this.$.dialog.showModal();
+ },
+
+ close: function() {
+ this.$.dialog.close();
+ },
+});
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html
index e19f575f0ae..c7d68b6bd61 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.html
@@ -1,101 +1,2 @@
-<link rel="import" href="chrome://resources/html/polymer.html">
-
-<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
-<link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.html">
-<link rel="import" href="chrome://resources/cr_elements/icons.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-dropdown/iron-dropdown.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
-<link rel="import" href="cups_printer_shared_css.html">
-<link rel="import" href="cups_printers_browser_proxy.html">
-
-<dom-module id="add-printer-list">
- <template>
- <style include="cups-printer-shared">
- .list-item {
- padding: 0 20px;
- }
- </style>
- <div>
- <array-selector id="arraySelector" items="[[printers]]"
- selected="{{selectedPrinter}}">
- </array-selector>
- <template is="dom-repeat" items="[[printers]]">
- <button class="list-item" on-click="onSelect_">
- [[item.printerName]]
- </button>
- </template>
- </div>
- </template>
-</dom-module>
-
-<dom-module id="drop-down-search-box">
- <template>
- <style include="cups-printer-shared">
- cr-input {
- --cr-input-error-display: none;
- }
-
- iron-dropdown,
- cr-input {
- width: 270px;
- }
-
- iron-dropdown {
- height: 270px;
- }
-
- iron-dropdown [slot='dropdown-content'] {
- background-color: white;
- box-shadow: 0 2px 6px var(--paper-grey-500);
- min-width: 128px;
- padding: 8px 0;
- }
- </style>
- <!-- |value| is one-way binding on purpose so that it doesn't change
- immediately as the user types. -->
- <cr-input label="[[label]]" on-click="onClick_" value="[[value]]"
- on-value-changed="onInputValueChanged_" id="search">
- </cr-input>
- <iron-dropdown horizontal-align="left" vertical-align="top"
- vertical-offset="52">
- <div slot="dropdown-content">
- <template is="dom-repeat" items="[[items]]"
- filter="[[filterItems_(searchTerm_)]]">
- <button class="list-item" on-click="onSelect_">[[item]]</button>
- </template>
- </div>
- </iron-dropdown>
- </template>
-</dom-module>
-
-<dom-module id="add-printer-dialog">
- <template>
- <style include="settings-shared">
- #dialog {
- --cr-dialog-body-container: {
- /* Force a bottom border regardless of scroll state. */
- border-bottom: 1px solid var(--paper-grey-300) !important;
- };
- }
- #dialog [slot=body] {
- -webkit-padding-end: 0;
- -webkit-padding-start: 0;
- height: 350px;
- }
- </style>
-
- <cr-dialog id="dialog" close-text="$i18n{close}">
- <div slot="title">
- <slot name="dialog-title"></slot>
- </div>
- <div slot="body" scrollable>
- <slot name="dialog-body"></slot>
- </div>
- <div slot="button-container">
- <slot name="dialog-buttons"></slot>
- </div>
- </cr-dialog>
- </template>
- <script src="cups_add_printer_dialog_util.js"></script>
-</dom-module>
+<link rel="import" href="chrome://resources/html/cr.html">
+<script src="cups_add_printer_dialog_util.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js
index 77b61fdcdd3..6cff6ecf1b0 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_add_printer_dialog_util.js
@@ -1,104 +1,71 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
+// 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.
-/** 'add-printers-list' is the list of discovered printers. */
-Polymer({
- is: 'add-printer-list',
-
- properties: {
- /** @type {!Array<!CupsPrinterInfo>} */
- printers: {
- type: Array,
- notify: true,
- },
-
- /** @type {!CupsPrinterInfo} */
- selectedPrinter: {
- type: Object,
- notify: true,
- },
- },
+/**
+ * @fileoverview Utility functions that are used in Cups printer setup dialogs.
+ */
+cr.define('settings.printing', function() {
/**
- * @param {{model:Object}} event
- * @private
+ * Returns true if the printer's name and address is valid. This function
+ * uses regular expressions to determine whether the provided printer name
+ * and address are valid. Address can be either an ipv4/6 address or a
+ * hostname followed by an optional port.
+ * NOTE: The regular expression for hostnames will allow hostnames that are
+ * over 255 characters.
+ * @param {string} name
+ * @param {string} address
+ * @return {boolean}
*/
- onSelect_: function(event) {
- this.selectedPrinter = event.model.item;
- },
-});
-
-/** 'drop-down-search-box' implements a search box with suggestions dropdown. */
-Polymer({
- is: 'drop-down-search-box',
-
- properties: {
- /** @type {!Array<string>} */
- items: {
- type: Array,
- },
-
- /** @type {string} */
- value: {
- type: String,
- notify: true,
- },
-
- /** @private {string} */
- searchTerm_: String,
+ function isNameAndAddressValid(name, address) {
+ if (!name || !address)
+ return false;
- label: String,
- },
+ const hostnamePrefix = '([a-z\\d]|[a-z\\d][a-z\\d\\-]{0,61}[a-z\\d])';
- /**
- * @param {!Event} event
- * @private
- */
- onClick_: function(event) {
- this.$$('iron-dropdown').open();
- },
+ // Matches an arbitrary number of 'prefix patterns' which are separated by a
+ // dot.
+ const hostnameSuffix = `(\\.${hostnamePrefix})*`;
- /** @private */
- onInputValueChanged_: function() {
- this.searchTerm_ = this.$.search.value;
- },
+ // Matches an optional port at the end of the address.
+ const portNumber = '(:\\d+)?';
- /**
- * @param {{model:Object}} event
- * @private
- */
- onSelect_: function(event) {
- this.$$('iron-dropdown').close();
+ const ipv6Full = '(([a-f\\d]){1,4}(:(:)?([a-f\\d]){1,4}){1,7})';
- this.value = event.model.item;
- this.searchTerm_ = '';
- },
+ // Special cases for addresses using a shorthand notation.
+ const ipv6Prefix = '(::([a-f\\d]){1,4})';
+ const ipv6Suffix = '(([a-f\\d]){1,4}::)';
+ const ipv6Combined = `(${ipv6Full}|${ipv6Prefix}|${ipv6Suffix})`;
+ const ipv6WithPort = `(\\[${ipv6Combined}\\]${portNumber})`;
- /** @private */
- filterItems_: function(searchTerm) {
- if (!searchTerm)
- return null;
- return function(item) {
- return item.toLowerCase().includes(searchTerm.toLowerCase());
- };
- },
-});
+ // Matches valid hostnames and ipv4 addresses.
+ const hostnameRegex =
+ new RegExp(`^${hostnamePrefix}${hostnameSuffix}${portNumber}$`, 'i');
-/** 'add-printer-dialog' is the template of the Add Printer dialog. */
-Polymer({
- is: 'add-printer-dialog',
+ // Matches valid ipv6 addresses.
+ const ipv6AddressRegex =
+ new RegExp(`^(${ipv6Combined}|${ipv6WithPort})$`, 'i');
- behaviors: [
- CrScrollableBehavior,
- ],
+ const invalidIpv6Regex = new RegExp('.*::.*::.*');
- /** @private */
- attached: function() {
- this.$.dialog.showModal();
- },
+ return hostnameRegex.test(address) ||
+ (ipv6AddressRegex.test(address) && !invalidIpv6Regex.test(address));
+ }
- close: function() {
- this.$.dialog.close();
- },
+ /**
+ * Returns true if the printer's manufacturer and model or ppd path is valid.
+ * @param {string} manufacturer
+ * @param {string} model
+ * @param {string} ppdPath
+ * @return {boolean}
+ */
+ function isPPDInfoValid(manufacturer, model, ppdPath) {
+ return !!((manufacturer && model) || ppdPath);
+ }
+
+ return {
+ isNameAndAddressValid: isNameAndAddressValid,
+ isPPDInfoValid: isPPDInfoValid,
+ };
});
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html
index 0852b6feeea..c544bcf409d 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.html
@@ -1,7 +1,10 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_scrollable_behavior.html">
+<link rel="import" href="chrome://resources/cr_elements/cr_searchable_drop_down/cr_searchable_drop_down.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="cups_add_printer_dialog_elements.html">
<link rel="import" href="cups_add_printer_dialog_util.html">
<link rel="import" href="cups_printer_shared_css.html">
<link rel="import" href="cups_printers_browser_proxy.html">
@@ -20,7 +23,7 @@
</style>
<add-printer-dialog>
<div slot="dialog-title">$i18n{editPrinterDialogTitle}</div>
- <div slot="dialog-body">
+ <div slot="dialog-body" scrollable>
<div class="settings-box first two-line">
<cr-input class="printer-name-input" autofocus
value="{{activePrinter.printerName}}"
@@ -81,16 +84,16 @@
</cr-input>
</div>
<div class="settings-box two-line">
- <drop-down-search-box items="[[manufacturerList]]"
+ <cr-searchable-drop-down items="[[manufacturerList]]"
label="$i18n{printerManufacturer}"
value="{{activePrinter.ppdManufacturer}}">
- </drop-down-search-box>
+ </cr-searchable-drop-down>
</div>
<div class="settings-box two-line">
- <drop-down-search-box items="[[modelList]]"
+ <cr-searchable-drop-down items="[[modelList]]"
label="$i18n{printerModel}"
value="{{activePrinter.ppdModel}}">
- </drop-down-search-box>
+ </cr-searchable-drop-down>
</div>
<div class="settings-box two-line last">
<cr-input class="browse-file-input" readonly tabindex="-1"
@@ -114,7 +117,8 @@
on-click="onCancelTap_">
$i18n{cancel}
</paper-button>
- <paper-button class="action-button" on-click="onSaveTap_">
+ <paper-button class="action-button" on-click="onSaveTap_"
+ disabled="[[!canSavePrinter_(activePrinter.*)]]">
$i18n{editPrinterButtonText}
</paper-button>
</div>
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js
index 7b5543d7715..488afe05f3e 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_edit_printer_dialog.js
@@ -11,6 +11,7 @@ Polymer({
is: 'settings-cups-edit-printer-dialog',
behaviors: [
+ CrScrollableBehavior,
SetManufacturerModelBehavior,
],
@@ -135,4 +136,17 @@ Polymer({
isNetworkProtocol_: function(protocol) {
return ['ipp', 'ipps', 'http', 'https', 'socket', 'lpd'].includes(protocol);
},
+
+ /**
+ * @return {boolean} Whether the Save button is enabled.
+ * @private
+ */
+ canSavePrinter_: function() {
+ return settings.printing.isNameAndAddressValid(
+ this.activePrinter.printerName,
+ this.activePrinter.printerAddress) &&
+ settings.printing.isPPDInfoValid(
+ this.activePrinter.ppdManufacturer, this.activePrinter.ppdModel,
+ this.activePrinter.printerPPDPath);
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/printing_page/cups_printer_shared_css.html b/chromium/chrome/browser/resources/settings/printing_page/cups_printer_shared_css.html
index 7f1b7d0bc07..8b3f8c47bb3 100644
--- a/chromium/chrome/browser/resources/settings/printing_page/cups_printer_shared_css.html
+++ b/chromium/chrome/browser/resources/settings/printing_page/cups_printer_shared_css.html
@@ -47,7 +47,7 @@
}
[slot='dialog-body'] .settings-box .browse-button {
- -webkit-margin-start: 5px;
+ margin-inline-start: 5px;
}
[slot='dialog-body'] .last {
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn b/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn
index d2bb5b5324f..b938576c22c 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/privacy_page/BUILD.gn
@@ -37,6 +37,8 @@ js_library("privacy_page") {
"..:page_visibility",
"..:route",
"../controls:settings_toggle_button",
+ "../people_page:signout_dialog",
+ "../people_page:sync_browser_proxy",
"../settings_page:settings_animated_pages",
"../site_settings:constants",
"../site_settings:site_data_details_subpage",
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/personalization_options.html b/chromium/chrome/browser/resources/settings/privacy_page/personalization_options.html
index e50aef02669..843f10eeb1d 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/personalization_options.html
+++ b/chromium/chrome/browser/resources/settings/privacy_page/personalization_options.html
@@ -14,8 +14,8 @@
<style include="settings-shared">
:host(.list-frame) settings-toggle-button,
:host(.list-frame) .settings-box {
- -webkit-padding-end: 0;
- -webkit-padding-start: 0;
+ padding-inline-end: 0;
+ padding-inline-start: 0;
}
:host(.list-frame) settings-toggle-button:first-of-type {
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html
index f14f0e74725..aabd6fb0c8b 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html
+++ b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.html
@@ -11,6 +11,8 @@
<link rel="import" href="../clear_browsing_data_dialog/clear_browsing_data_dialog.html">
<link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../lifetime_browser_proxy.html">
+<link rel="import" href="../people_page/sync_browser_proxy.html">
+<link rel="import" href="../people_page/signout_dialog.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_page/settings_animated_pages.html">
<link rel="import" href="../settings_page/settings_subpage.html">
@@ -29,6 +31,9 @@
<link rel="import" href="../site_settings/zoom_levels.html">
<link rel="import" href="../site_settings_page/site_settings_page.html">
+<if expr="not chromeos">
+<link rel="import" href="chrome://resources/cr_elements/cr_toast/cr_toast.html">
+</if>
<if expr="use_nss_certs">
<link rel="import" href="chrome://resources/cr_components/certificate_manager/certificate_manager.html">
</if>
@@ -38,6 +43,18 @@
<dom-module id="settings-privacy-page">
<template>
<style include="settings-shared">
+<if expr="not chromeos">
+ #toast {
+ color: white;
+ left: 0;
+ z-index: 1;
+ }
+
+ :host-context([dir='rtl']) #toast {
+ left: auto;
+ right: 0;
+ }
+</if>
</style>
<template is="dom-if" if="[[showClearBrowsingDataDialog_]]" restamp>
<settings-clear-browsing-data-dialog prefs="{{prefs}}"
@@ -66,9 +83,22 @@
<settings-animated-pages id="pages" section="privacy"
focus-config="[[focusConfig_]]">
<neon-animatable route-path="default">
- <div class="settings-box first">
- <p class="privacy-explanation">$i18nRaw{improveBrowsingExperience}</p>
- </div>
+ <template is="dom-if" if="[[!unifiedConsentEnabled_]]">
+ <div class="settings-box first">
+ <p class="privacy-explanation">
+ $i18nRaw{improveBrowsingExperience}
+ </p>
+ </div>
+ </template>
+<if expr="not chromeos">
+ <settings-toggle-button id="signinAllowedToggle"
+ pref="{{prefs.signin.allowed_on_next_startup}}"
+ label="$i18n{signinAllowedTitle}"
+ sub-label="$i18n{signinAllowedDescription}"
+ on-settings-boolean-control-change="onSigninAllowedChange_"
+ no-set-pref>
+ </settings-toggle-button>
+</if><!-- not chromeos -->
<template is="dom-if" if="[[!unifiedConsentEnabled_]]">
<settings-personalization-options prefs="{{prefs}}"
page-visibility="[[pageVisibility]]"
@@ -173,7 +203,7 @@
<template is="dom-if" route-path="/content/all" no-search>
<settings-subpage page-title="$i18n{siteSettingsAllSites}">
- <all-sites></all-sites>
+ <all-sites focus-config="[[focusConfig_]]"></all-sites>
</settings-subpage>
</template>
<template is="dom-if" route-path="/content/automaticDownloads" no-search>
@@ -319,6 +349,15 @@
toggle-on-label="$i18n{siteSettingsSoundAllowRecommended}"
category="{{ContentSettingsTypes.SOUND}}">
</category-default-setting>
+ <settings-toggle-button
+ id="block-autoplay-setting"
+ label="$i18n{siteSettingsBlockAutoplaySetting}"
+ pref="{{blockAutoplayStatus_.pref}}"
+ disabled="[[!blockAutoplayStatus_.enabled]]"
+ hidden="[[!enableBlockAutoplayContentSetting_]]"
+ on-settings-boolean-control-change="onBlockAutoplayToggleChange_"
+ no-set-pref>
+ </settings-toggle-button>
<category-setting-exceptions
category="{{ContentSettingsTypes.SOUND}}"
block-header="$i18n{siteSettingsBlockSound}">
@@ -468,7 +507,10 @@
</template>
<template is="dom-if" route-path="/content/siteDetails" no-search>
<settings-subpage page-title="[[pageTitle]]">
- <site-details page-title="{{pageTitle}}"></site-details>
+ <site-details
+ page-title="{{pageTitle}}"
+ block-autoplay-enabled="[[blockAutoplayStatus_.pref.value]]">
+ </site-details>
</settings-subpage>
</template>
<template is="dom-if" route-path="/cookies/detail" no-search>
@@ -542,6 +584,21 @@
</template>
</template>
</settings-animated-pages>
+
+ <template is="dom-if" if="[[showSignoutDialog_]]" restamp>
+ <settings-signout-dialog sync-status="[[syncStatus]]"
+ on-close="onSignoutDialogClosed_">
+ </settings-signout-dialog>
+ </template>
+
+<if expr="not chromeos">
+ <cr-toast id="toast" open="[[showRestart_]]">
+ <div>$i18n{restartToApplyChanges}</div>
+ <paper-button on-click="onRestartTap_">
+ $i18n{restart}
+ </paper-button>
+ </cr-toast>
+</if>
</template>
<script src="privacy_page.js"></script>
</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js
index bc30d06c27d..a619084323d 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js
+++ b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -3,6 +3,14 @@
// found in the LICENSE file.
/**
+ * @typedef {{
+ * enabled: boolean,
+ * pref: !chrome.settingsPrivate.PrefObject
+ * }}
+ */
+let BlockAutoplayStatus;
+
+/**
* @fileoverview
* 'settings-privacy-page' is the settings page containing privacy and
* security settings.
@@ -28,6 +36,12 @@ Polymer({
},
/**
+ * The current sync status, supplied by SyncBrowserProxy.
+ * @type {?settings.SyncStatus}
+ */
+ syncStatus: Object,
+
+ /**
* Dictionary defining page visibility.
* @type {!PrivacyPageVisibility}
*/
@@ -67,6 +81,22 @@ Polymer({
},
/** @private */
+ enableBlockAutoplayContentSetting_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('enableBlockAutoplayContentSetting');
+ }
+ },
+
+ /** @private {BlockAutoplayStatus} */
+ blockAutoplayStatus_: {
+ type: Object,
+ value: function() {
+ return /** @type {BlockAutoplayStatus} */ ({});
+ }
+ },
+
+ /** @private */
enableClipboardContentSetting_: {
type: Boolean,
value: function() {
@@ -139,6 +169,14 @@ Polymer({
return loadTimeData.getBoolean('enableEphemeralFlashPermission');
},
},
+
+ // <if expr="not chromeos">
+ /** @private */
+ showRestart_: Boolean,
+ // </if>
+
+ /** @private */
+ showSignoutDialog_: Boolean,
},
listeners: {
@@ -150,6 +188,29 @@ Polymer({
this.ContentSettingsTypes = settings.ContentSettingsTypes;
this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance();
+
+ this.onBlockAutoplayStatusChanged_({
+ pref: /** @type {chrome.settingsPrivate.PrefObject} */ ({value: false}),
+ enabled: false
+ });
+
+ this.addWebUIListener(
+ 'onBlockAutoplayStatusChanged',
+ this.onBlockAutoplayStatusChanged_.bind(this));
+
+ settings.SyncBrowserProxyImpl.getInstance().getSyncStatus().then(
+ this.handleSyncStatus_.bind(this));
+ this.addWebUIListener(
+ 'sync-status-changed', this.handleSyncStatus_.bind(this));
+ },
+
+ /**
+ * Handler for when the sync state is pushed from the browser.
+ * @param {?settings.SyncStatus} syncStatus
+ * @private
+ */
+ handleSyncStatus_: function(syncStatus) {
+ this.syncStatus = syncStatus;
},
/** @protected */
@@ -168,6 +229,25 @@ Polymer({
},
/**
+ * Called when the block autoplay status changes.
+ * @param {BlockAutoplayStatus} autoplayStatus
+ * @private
+ */
+ onBlockAutoplayStatusChanged_: function(autoplayStatus) {
+ this.blockAutoplayStatus_ = autoplayStatus;
+ },
+
+ /**
+ * Updates the block autoplay pref when the toggle is changed.
+ * @param {!Event} event
+ * @private
+ */
+ onBlockAutoplayToggleChange_: function(event) {
+ const target = /** @type {!SettingsToggleButtonElement} */ (event.target);
+ this.browserProxy_.setBlockAutoplayEnabled(target.checked);
+ },
+
+ /**
* Handles the change event for the do-not-track toggle. Shows a
* confirmation dialog when enabling the setting.
* @param {!Event} event
@@ -300,5 +380,40 @@ Polymer({
return value ? this.i18n('siteSettingsProtectedContentEnableIdentifiers') :
this.i18n('siteSettingsBlocked');
},
+
+ /** @private */
+ onSigninAllowedChange_: function() {
+ if (this.syncStatus.signedIn && !this.$.signinAllowedToggle.checked) {
+ // Switch the toggle back on and show the signout dialog.
+ this.$.signinAllowedToggle.checked = true;
+ this.showSignoutDialog_ = true;
+ } else {
+ /** @type {!SettingsToggleButtonElement} */ (this.$.signinAllowedToggle)
+ .sendPrefChange();
+ this.showRestart_ = true;
+ }
+ },
+
+ /** @private */
+ onSignoutDialogClosed_: function() {
+ if (/** @type {!SettingsSignoutDialogElement} */ (
+ this.$$('settings-signout-dialog'))
+ .wasConfirmed()) {
+ this.$.signinAllowedToggle.checked = false;
+ /** @type {!SettingsToggleButtonElement} */ (this.$.signinAllowedToggle)
+ .sendPrefChange();
+ this.showRestart_ = true;
+ }
+ this.showSignoutDialog_ = false;
+ },
+
+ /**
+ * @param {!Event} e
+ * @private
+ */
+ onRestartTap_: function(e) {
+ e.stopPropagation();
+ settings.LifetimeBrowserProxyImpl.getInstance().restart();
+ },
});
})();
diff --git a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page_browser_proxy.js b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page_browser_proxy.js
index 63790dfadb2..c1e7d9fc333 100644
--- a/chromium/chrome/browser/resources/settings/privacy_page/privacy_page_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/privacy_page/privacy_page_browser_proxy.js
@@ -33,6 +33,9 @@ cr.define('settings', function() {
/** @param {boolean} enabled */
setSafeBrowsingExtendedReportingEnabled(enabled) {}
+
+ /** @param {boolean} enabled */
+ setBlockAutoplayEnabled(enabled) {}
}
/**
@@ -62,6 +65,11 @@ cr.define('settings', function() {
chrome.send('setSafeBrowsingExtendedReportingEnabled', [enabled]);
}
+ /** @override */
+ setBlockAutoplayEnabled(enabled) {
+ chrome.send('setBlockAutoplayEnabled', [enabled]);
+ }
+
// <if expr="is_win or is_macosx">
/** @override */
showManageSSLCertificates() {
diff --git a/chromium/chrome/browser/resources/settings/route.js b/chromium/chrome/browser/resources/settings/route.js
index 7c19ea2f49f..866453bdfdd 100644
--- a/chromium/chrome/browser/resources/settings/route.js
+++ b/chromium/chrome/browser/resources/settings/route.js
@@ -55,6 +55,7 @@
* NETWORK_DETAIL: (undefined|!settings.Route),
* ON_STARTUP: (undefined|!settings.Route),
* PASSWORDS: (undefined|!settings.Route),
+ * PAYMENTS: (undefined|!settings.Route),
* PEOPLE: (undefined|!settings.Route),
* POINTERS: (undefined|!settings.Route),
* POWER: (undefined|!settings.Route),
@@ -275,6 +276,7 @@ cr.define('settings', function() {
if (autofillHomeEnabled) {
r.AUTOFILL = r.PEOPLE.createChild('/autofill');
r.MANAGE_PASSWORDS = r.PEOPLE.createChild('/passwords');
+ r.PAYMENTS = r.PEOPLE.createChild('/payments');
}
// <if expr="not chromeos">
r.MANAGE_PROFILE = r.PEOPLE.createChild('/manageProfile');
@@ -375,6 +377,7 @@ cr.define('settings', function() {
r.ADVANCED.createSection('/passwordsAndForms', 'passwordsAndForms');
r.AUTOFILL = r.PASSWORDS.createChild('/autofill');
r.MANAGE_PASSWORDS = r.PASSWORDS.createChild('/passwords');
+ r.PAYMENTS = r.PASSWORDS.createChild('/payments');
}
r.LANGUAGES = r.ADVANCED.createSection('/languages', 'languages');
diff --git a/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html b/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html
index 26f24c1a061..b181ac3e909 100644
--- a/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html
+++ b/chromium/chrome/browser/resources/settings/search_engines_page/omnibox_extension_entry.html
@@ -24,7 +24,7 @@
}
.favicon-image + span {
- -webkit-margin-end: 8px;
+ margin-inline-end: 8px;
}
</style>
<div class="list-item" focus-row-container>
diff --git a/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html b/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html
index 4f058e297eb..413a1e34eea 100644
--- a/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html
+++ b/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry.html
@@ -32,7 +32,7 @@
#keyword-column > div,
.favicon-image + div {
- -webkit-margin-end: 8px;
+ margin-inline-end: 8px;
}
#url-column {
diff --git a/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry_css.html b/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry_css.html
index 46bf166feff..2770ff9ff3f 100644
--- a/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry_css.html
+++ b/chromium/chrome/browser/resources/settings/search_engines_page/search_engine_entry_css.html
@@ -2,11 +2,11 @@
<template>
<style>
.favicon-image {
- -webkit-margin-end: 8px;
background-repeat: no-repeat;
background-size: contain;
display: inline-block;
height: 20px;
+ margin-inline-end: 8px;
min-width: 20px;
vertical-align: middle;
}
diff --git a/chromium/chrome/browser/resources/settings/search_engines_page/search_engines_list.html b/chromium/chrome/browser/resources/settings/search_engines_page/search_engines_list.html
index 2b6698fe907..6ebb6002de7 100644
--- a/chromium/chrome/browser/resources/settings/search_engines_page/search_engines_list.html
+++ b/chromium/chrome/browser/resources/settings/search_engines_page/search_engines_list.html
@@ -38,8 +38,8 @@
}
.icon-placeholder {
- -webkit-margin-end: 0;
- -webkit-margin-start: var(--cr-icon-button-margin-start);
+ margin-inline-end: 0;
+ margin-inline-start: var(--cr-icon-button-margin-start);
width: var(--cr-icon-ripple-size);
}
</style>
diff --git a/chromium/chrome/browser/resources/settings/search_page/search_page.html b/chromium/chrome/browser/resources/settings/search_page/search_page.html
index 34ee2bdf1dc..0fa27b3f0d4 100644
--- a/chromium/chrome/browser/resources/settings/search_page/search_page.html
+++ b/chromium/chrome/browser/resources/settings/search_page/search_page.html
@@ -34,11 +34,11 @@
}
iron-icon {
- -webkit-padding-end: 16px;
+ padding-inline-end: 16px;
}
.indented {
- -webkit-margin-start: var(--settings-indent-width);
+ margin-inline-start: var(--settings-indent-width);
}
</style>
<settings-animated-pages id="pages" section="search"
@@ -47,9 +47,9 @@
<!-- Omnibox search engine -->
<div class="settings-box first block">
<div id="search-wrapper">
- <p id="searchExplanation" class="start">
+ <div id="searchExplanation" class="start">
$i18nRaw{searchExplanation}
- </p>
+ </div>
<template is="dom-if" if="[[isDefaultSearchControlledByPolicy_(
prefs.default_search_provider_data.template_url_data)]]">
<cr-policy-pref-indicator pref="[[
diff --git a/chromium/chrome/browser/resources/settings/search_page/search_page.js b/chromium/chrome/browser/resources/settings/search_page/search_page.js
index 1b229698d03..8a66f1d2b38 100644
--- a/chromium/chrome/browser/resources/settings/search_page/search_page.js
+++ b/chromium/chrome/browser/resources/settings/search_page/search_page.js
@@ -150,7 +150,7 @@ Polymer({
*/
isAssistantTurnedOn_: function(
arcEnabled, valuePropAccepted, assistantFeatureEnabled) {
- return (arcEnabled || assistantFeatureEnabled) && valuePropAccepted;
+ return (arcEnabled && valuePropAccepted) || assistantFeatureEnabled;
},
// </if>
diff --git a/chromium/chrome/browser/resources/settings/search_settings.js b/chromium/chrome/browser/resources/settings/search_settings.js
index 19c3a1e609e..0d068f770e2 100644
--- a/chromium/chrome/browser/resources/settings/search_settings.js
+++ b/chromium/chrome/browser/resources/settings/search_settings.js
@@ -381,13 +381,13 @@ cr.define('settings', function() {
class SearchRequest {
/**
* @param {string} rawQuery
- * @param {!HTMLElement} root
+ * @param {!Element} root
*/
constructor(rawQuery, root) {
/** @private {string} */
this.rawQuery_ = rawQuery;
- /** @private {!HTMLElement} */
+ /** @private {!Element} */
this.root_ = root;
/** @type {?RegExp} */
@@ -516,7 +516,7 @@ cr.define('settings', function() {
class SearchManager {
/**
* @param {string} text The text to search for.
- * @param {!Node} page
+ * @param {!Element} page
* @return {!Promise<!settings.SearchRequest>} A signal indicating that
* searching finished.
*/
@@ -566,11 +566,15 @@ cr.define('settings', function() {
});
}
}
- cr.addSingletonGetter(SearchManagerImpl);
+
+ /** @type {?SearchManager} */
+ let instance = null;
/** @return {!SearchManager} */
function getSearchManager() {
- return SearchManagerImpl.getInstance();
+ if (instance === null)
+ instance = new SearchManagerImpl();
+ return instance;
}
/**
@@ -578,7 +582,7 @@ cr.define('settings', function() {
* @param {!SearchManager} searchManager
*/
function setSearchManagerForTesting(searchManager) {
- SearchManagerImpl.instance_ = searchManager;
+ instance = searchManager;
}
return {
diff --git a/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html b/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
index 0e4e060b522..f8f22e9b9c9 100644
--- a/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
+++ b/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
@@ -23,15 +23,15 @@
--cr-selectable-focus: {
outline: auto 5px -webkit-focus-ring-color;
};
- -webkit-margin-end: 2px; /* Margin so selected outline is visible. */
- -webkit-margin-start: 1px;
- -webkit-padding-start: 23px; /* 24px - 1px from margin for outline. */
align-items: center;
color: var(--settings-nav-grey);
display: flex;
font-weight: 500;
+ margin-inline-end: 2px; /* Margin so selected outline is visible. */
+ margin-inline-start: 1px;
min-height: 20px;
padding-bottom: 10px;
+ padding-inline-start: 23px; /* 24px - 1px from margin for outline. */
padding-top: 10px;
}
@@ -41,7 +41,7 @@
iron-icon {
--iron-icon-fill-color: var(--settings-nav-grey);
- -webkit-margin-end: 24px;
+ margin-inline-end: 24px;
pointer-events: none;
vertical-align: top;
}
@@ -51,12 +51,12 @@
}
#advancedButton {
- -webkit-padding-end: 0;
background-color: unset;
border: none;
border-radius: initial;
height: unset;
margin-top: 8px;
+ padding-inline-end: 0;
text-transform: none;
}
@@ -77,7 +77,7 @@
#advancedButton > iron-icon,
#extensionsLink > iron-icon {
@apply --cr-icon-height-width;
- -webkit-margin-end: 14px; /* 16px - 2px from margin for outline. */
+ margin-inline-end: 14px; /* 16px - 2px from margin for outline. */
}
#menuSeparator {
diff --git a/chromium/chrome/browser/resources/settings/settings_page/BUILD.gn b/chromium/chrome/browser/resources/settings/settings_page/BUILD.gn
index d354bfa4fd3..9114c55812a 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/settings_page/BUILD.gn
@@ -46,6 +46,7 @@ js_library("settings_section") {
js_library("settings_subpage") {
deps = [
":settings_subpage_search",
+ "..:find_shortcut_behavior",
"..:route",
"//third_party/polymer/v1_0/components-chromium/iron-resizable-behavior:iron-resizable-behavior-extracted",
"//third_party/polymer/v1_0/components-chromium/neon-animation:neon-animatable-behavior-extracted",
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.html b/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.html
index 655b3faa8a0..10c922d3ff9 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.html
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.html
@@ -4,6 +4,7 @@
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/cr/ui.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
+<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/slide-from-left-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/slide-from-right-animation.html">
<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/animations/slide-left-animation.html">
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.js b/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
index 7492cde177e..1fe497be49b 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
@@ -32,9 +32,9 @@ Polymer({
/**
* A Map specifying which element should be focused when exiting a subpage.
* The key of the map holds a settings.Route path, and the value holds
- * either a query selector that identifies the desired element or a function
- * to be run when a neon-animation-finish event is handled.
- * @type {?Map<string, (string|Function)>}
+ * either a query selector that identifies the desired element, an element
+ * or a function to be run when a neon-animation-finish event is handled.
+ * @type {?Map<string, (string|Element|Function)>}
*/
focusConfig: Object,
},
@@ -88,6 +88,9 @@ Polymer({
if (settings.routes.SITE_SETTINGS_SITE_DATA)
subpagePaths.push(settings.routes.SITE_SETTINGS_SITE_DATA.path);
+ if (settings.routes.SITE_SETTINGS_ALL)
+ subpagePaths.push(settings.routes.SITE_SETTINGS_ALL.path);
+
// <if expr="chromeos">
if (settings.routes.INTERNET_NETWORKS)
subpagePaths.push(settings.routes.INTERNET_NETWORKS.path);
@@ -104,20 +107,23 @@ Polymer({
if (!e.detail.item.matches(query))
return;
- const selectorOrFunction = this.focusConfig.get(this.previousRoute_.path);
- if (selectorOrFunction) {
+ let pathConfig = this.focusConfig.get(this.previousRoute_.path);
+ if (pathConfig) {
+ let handler;
+ if (typeof pathConfig == 'function') {
+ handler = pathConfig;
+ } else {
+ handler = () => {
+ if (typeof pathConfig == 'string')
+ pathConfig = assert(this.querySelector(pathConfig));
+ cr.ui.focusWithoutInk(/** @type {!Element} */ (pathConfig));
+ };
+ }
// neon-animatable has "display: none" until the animation finishes,
// so calling focus() on any of its children has no effect until
// "display:none" is removed. Therefore, don't set focus from within
// the currentRouteChanged callback.
- listenOnce(this, 'neon-animation-finish', () => {
- if (typeof selectorOrFunction == 'function') {
- selectorOrFunction();
- } else {
- const selector = /** @type {string} */ (selectorOrFunction);
- cr.ui.focusWithoutInk(assert(this.querySelector(selector)));
- }
- });
+ listenOnce(this, 'neon-animation-finish', handler);
}
},
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_section.html b/chromium/chrome/browser/resources/settings/settings_page/settings_section.html
index 24bb6386339..7599a515645 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_section.html
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_section.html
@@ -7,11 +7,11 @@
<template>
<style>
:host {
- -webkit-margin-end: 3px;
- -webkit-margin-start: 3px;
display: flex;
flex-direction: column;
/* Margin so the box-shadow isn't clipped during animations. */
+ margin-inline-end: 3px;
+ margin-inline-start: 3px;
position: relative;
}
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html
index e736d4fd182..b940d7f9423 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.html
@@ -7,6 +7,7 @@
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-ripple/paper-ripple.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-spinner/paper-spinner-lite.html">
+<link rel="import" href="../find_shortcut_behavior.html">
<link rel="import" href="../icons.html">
<link rel="import" href="../route.html">
<link rel="import" href="settings_subpage_search.html">
@@ -38,8 +39,8 @@
paper-icon-button-light {
/* Centers the ripple on the icon with appropriate margin on right. */
- -webkit-margin-end: 10px;
- -webkit-margin-start: -10px;
+ margin-inline-end: 10px;
+ margin-inline-start: -10px;
}
paper-spinner-lite {
@@ -54,7 +55,7 @@
settings-subpage-search {
/* Keep normal icon spacing from subpage-title-extra controls. */
- -webkit-margin-start: 16px;
+ margin-inline-start: 16px;
}
</style>
<div class="settings-box first" id="headerLine">
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js
index 32880610425..82fecc6a084 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage.js
@@ -15,6 +15,8 @@ Polymer({
// TODO(michaelpg): phase out NeonAnimatableBehavior.
Polymer.NeonAnimatableBehavior,
Polymer.IronResizableBehavior,
+ settings.FindShortcutBehavior,
+ settings.RouteObserverBehavior,
],
properties: {
@@ -47,6 +49,13 @@ Polymer({
type: Object,
value: null,
},
+
+ /** @private */
+ active_: {
+ type: Boolean,
+ value: false,
+ observer: 'onActiveChanged_',
+ },
},
/** @override */
@@ -71,6 +80,22 @@ Polymer({
this, () => cr.ui.focusWithoutInk(this.$.closeButton));
},
+ /** @protected */
+ currentRouteChanged: function(route) {
+ this.active_ = this.getAttribute('route-path') == route.path;
+ },
+
+ /** @private */
+ onActiveChanged_: function() {
+ if (!this.searchLabel)
+ return;
+
+ if (this.active_)
+ this.becomeActiveFindShortcutListener();
+ else
+ this.removeSelfAsFindShortcutListener();
+ },
+
/**
* Clear the value of the search field.
* @param {!Event} e
@@ -89,4 +114,15 @@ Polymer({
onSearchChanged_: function(e) {
this.searchTerm = e.detail;
},
+
+ // Override settings.FindShortcutBehavior methods.
+ handleFindShortcut: function(modalContextOpen) {
+ if (modalContextOpen)
+ return false;
+ const subpageSearch = this.$$('settings-subpage-search');
+ const searchInput = subpageSearch.getSearchInput();
+ if (searchInput != subpageSearch.shadowRoot.activeElement)
+ searchInput.focus();
+ return true;
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage_search.html b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage_search.html
index bad6b43ebe5..100316f9b1e 100644
--- a/chromium/chrome/browser/resources/settings/settings_page/settings_subpage_search.html
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_subpage_search.html
@@ -29,29 +29,19 @@
--cr-input-error-display: none;
--cr-input-input: {
background-color: white;
- -webkit-padding-end: 0;
- -webkit-padding-start: 0;
- padding-bottom: 2px;
- padding-top: 2px;
border-bottom: 1px solid var(--google-grey-900);
}
+ --cr-input-padding-end: 0;
+ --cr-input-padding-start: 0;
+ --cr-input-padding-bottom: 2px;
+ --cr-input-padding-top: 2px;
display: inline-block;
vertical-align: middle;
width: 160px; /* Special width for search input. */
}
:host([has-search-text]) cr-input {
- /* Unfortunately we have to duplicate most of this mixin, due to how
- redeclaration overrides the entire mixin, but the only value that
- changes is padding-end. */
- --cr-input-input: {
- background-color: white;
- -webkit-padding-end: 20px;
- -webkit-padding-start: 0;
- padding-bottom: 2px;
- padding-top: 2px;
- border-bottom: 1px solid var(--google-grey-900);
- }
+ --cr-input-padding-end: 20px;
}
#searchInput {
@@ -64,12 +54,11 @@
}
#clearSearchContainer {
- -webkit-margin-end: -4px;
- -webkit-margin-start: 4px;
-
/* A 16px icon that fits on the input line. */
background-size: 16px;
height: 24px;
+ margin-inline-end: -4px;
+ margin-inline-start: 4px;
position: absolute;
right: 0;
width: 24px;
diff --git a/chromium/chrome/browser/resources/settings/settings_resources.grd b/chromium/chrome/browser/resources/settings/settings_resources.grd
index 12684438ba7..abd10caf92b 100644
--- a/chromium/chrome/browser/resources/settings/settings_resources.grd
+++ b/chromium/chrome/browser/resources/settings/settings_resources.grd
@@ -368,7 +368,8 @@
type="chrome_html" />
<structure name="IDR_SETTINGS_CLEAR_BROWSING_DATA_DIALOG_JS"
file="clear_browsing_data_dialog/clear_browsing_data_dialog.js"
- type="chrome_html" />
+ type="chrome_html"
+ preprocess="true" />
<structure name="IDR_SETTINGS_HISTORY_DELETION_DIALOG_HTML"
file="clear_browsing_data_dialog/history_deletion_dialog.html"
type="chrome_html" />
@@ -411,6 +412,14 @@
<structure name="IDR_SETTINGS_CONTROLS_DROPDOWN_MENU_JS"
file="controls/settings_dropdown_menu.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_CONTROLS_PASSWORD_PROMPT_DIALOG_JS"
+ file="controls/password_prompt_dialog.js"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_CONTROLS_PASSWORD_PROMPT_DIALOG_HTML"
+ file="controls/password_prompt_dialog.html"
+ type="chrome_html"
+ preprocess="true"
+ allowexternalscript="true" />
<structure name="IDR_SETTINGS_CONTROLS_PREF_CONTROL_BEHAVIOR_HTML"
file="controls/pref_control_behavior.html"
type="chrome_html" />
@@ -567,6 +576,7 @@
type="chrome_html" />
<structure name="IDR_SETTINGS_DOWNLOADS_BROWSER_PROXY_JS"
file="downloads_page/downloads_browser_proxy.js"
+ preprocess="true"
type="chrome_html" />
<structure name="IDR_SETTINGS_DOWNLOADS_PAGE_HTML"
file="downloads_page/downloads_page.html"
@@ -609,8 +619,7 @@
type="chrome_html" />
<structure name="IDR_SETTINGS_FIND_SHORTCUT_BEHAVIOR_JS"
file ="find_shortcut_behavior.js"
- type="chrome_html"
- preprocess="true" />
+ type="chrome_html" />
<structure name="IDR_SETTINGS_POWERWASH_DIALOG_HTML"
file="reset_page/powerwash_dialog.html"
type="chrome_html" />
@@ -761,6 +770,12 @@
<structure name="IDR_SETTINGS_PASSWORDS_EXPORT_DIALOG_JS"
file="passwords_and_forms_page/passwords_export_dialog.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_PAYMENTS_SECTION_HTML"
+ file="passwords_and_forms_page/payments_section.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_PAYMENTS_SECTION_JS"
+ file="passwords_and_forms_page/payments_section.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_PEOPLE_PAGE_HTML"
file="people_page/people_page.html"
type="chrome_html"
@@ -807,6 +822,14 @@
file="people_page/manage_profile_browser_proxy.js"
type="chrome_html" />
</if>
+ <structure name="IDR_SETTINGS_PEOPLE_PAGE_SIGNOUT_DIALOG_HTML"
+ file="people_page/signout_dialog.html"
+ type="chrome_html"
+ preprocess="true" />
+ <structure name="IDR_SETTINGS_PEOPLE_PAGE_SIGNOUT_DIALOG_JS"
+ file="people_page/signout_dialog.js"
+ type="chrome_html"
+ preprocess="true" />
<structure name="IDR_SETTINGS_PEOPLE_PAGE_PROFILE_INFO_BROWSER_PROXY_HTML"
file="people_page/profile_info_browser_proxy.html"
type="chrome_html" />
@@ -894,6 +917,12 @@
<structure name="IDR_SETTINGS_CUPS_ADD_PRINTER_DIALOG_JS"
file="printing_page/cups_add_printer_dialog.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_CUPS_ADD_PRINTER_DIALOG_ELEMENTS_HTML"
+ file="printing_page/cups_add_printer_dialog_elements.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_CUPS_ADD_PRINTER_DIALOG_ELEMENTS_JS"
+ file="printing_page/cups_add_printer_dialog_elements.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_CUPS_ADD_PRINTER_DIALOG_UTIL_HTML"
file="printing_page/cups_add_printer_dialog_util.html"
type="chrome_html" />
@@ -998,6 +1027,12 @@
<structure name="IDR_SETTINGS_SITE_LIST_JS"
file="site_settings/site_list.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_SITE_LIST_ENTRY_HTML"
+ file="site_settings/site_list_entry.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_SITE_LIST_ENTRY_JS"
+ file="site_settings/site_list_entry.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_SITE_SETTINGS_BEHAVIOR_HTML"
file="site_settings/site_settings_behavior.html"
type="chrome_html" />
@@ -1312,12 +1347,24 @@
<structure name="IDR_SETTINGS_MULTIDEVICE_CONSTANTS_JS"
file="multidevice_page/multidevice_constants.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_MULTIDEVICE_FEATURE_BEHAVIOR_HTML"
+ file="multidevice_page/multidevice_feature_behavior.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_MULTIDEVICE_FEATURE_BEHAVIOR_JS"
+ file="multidevice_page/multidevice_feature_behavior.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_MULTIDEVICE_FEATURE_ITEM_HTML"
file="multidevice_page/multidevice_feature_item.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_MULTIDEVICE_FEATURE_ITEM_JS"
file="multidevice_page/multidevice_feature_item.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_MULTIDEVICE_FEATURE_TOGGLE_HTML"
+ file="multidevice_page/multidevice_feature_toggle.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_MULTIDEVICE_FEATURE_TOGGLE_JS"
+ file="multidevice_page/multidevice_feature_toggle.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_MULTIDEVICE_PAGE_HTML"
file="multidevice_page/multidevice_page.html"
type="chrome_html" />
@@ -1336,18 +1383,18 @@
<structure name="IDR_SETTINGS_MULTIDEVICE_SUBPAGE_JS"
file="multidevice_page/multidevice_subpage.js"
type="chrome_html" />
+ <structure name="IDR_SETTINGS_MULTIDEVICE_TETHER_ITEM_HTML"
+ file="multidevice_page/multidevice_tether_item.html"
+ type="chrome_html" />
+ <structure name="IDR_SETTINGS_MULTIDEVICE_TETHER_ITEM_JS"
+ file="multidevice_page/multidevice_tether_item.js"
+ type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_PROXY_SECTION_HTML"
file="internet_page/network_proxy_section.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_PROXY_SECTION_JS"
file="internet_page/network_proxy_section.js"
type="chrome_html" />
- <structure name="IDR_SETTINGS_NETWORK_LISTENER_BEHAVIOR_HTML"
- file="internet_page/network_listener_behavior.html"
- type="chrome_html" />
- <structure name="IDR_SETTINGS_NETWORK_LISTENER_BEHAVIOR_JS"
- file="internet_page/network_listener_behavior.js"
- type="chrome_html" />
<structure name="IDR_SETTINGS_NETWORK_SUMMARY_HTML"
file="internet_page/network_summary.html"
type="chrome_html" />
@@ -1416,11 +1463,11 @@
type="chrome_html"
preprocess="true"
allowexternalscript="true" />
- <structure name="IDR_SETTINGS_PEOPLE_PASSWORD_PROMPT_DIALOG_JS"
- file="people_page/password_prompt_dialog.js"
+ <structure name="IDR_SETTINGS_PEOPLE_LOCK_SCREEN_PASSWORD_PROMPT_DIALOG_JS"
+ file="people_page/lock_screen_password_prompt_dialog.js"
type="chrome_html" />
- <structure name="IDR_SETTINGS_PEOPLE_PASSWORD_PROMPT_DIALOG_HTML"
- file="people_page/password_prompt_dialog.html"
+ <structure name="IDR_SETTINGS_PEOPLE_LOCK_SCREEN_PASSWORD_PROMPT_DIALOG_HTML"
+ file="people_page/lock_screen_password_prompt_dialog.html"
type="chrome_html"
preprocess="true"
allowexternalscript="true" />
@@ -1468,12 +1515,6 @@
<structure name="IDR_SETTINGS_PEOPLE_SETUP_FINGERPRINT_DIALOG_HTML"
file="people_page/setup_fingerprint_dialog.html"
type="chrome_html" />
- <structure name="IDR_SETTINGS_PEOPLE_FINGERPRINT_PROGRESS_ARC_JS"
- file="people_page/fingerprint_progress_arc.js"
- type="chrome_html" />
- <structure name="IDR_SETTINGS_PEOPLE_FINGERPRINT_PROGRESS_ARC_HTML"
- file="people_page/fingerprint_progress_arc.html"
- type="chrome_html" />
<structure name="IDR_SETTINGS_PEOPLE_FINGERPRINT_BROWSER_PROXY_JS"
file="people_page/fingerprint_browser_proxy.js"
type="chrome_html" />
diff --git a/chromium/chrome/browser/resources/settings/settings_resources_vulcanized.grd b/chromium/chrome/browser/resources/settings/settings_resources_vulcanized.grd
index fcd5540c552..46a832e137a 100644
--- a/chromium/chrome/browser/resources/settings/settings_resources_vulcanized.grd
+++ b/chromium/chrome/browser/resources/settings/settings_resources_vulcanized.grd
@@ -13,8 +13,10 @@
<release seq="1">
<includes>
<include name="IDR_MD_SETTINGS_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\settings\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_MD_SETTINGS_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\settings\vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_MD_SETTINGS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\settings\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
<include name="IDR_MD_SETTINGS_LAZY_LOAD_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\settings\lazy_load.vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_MD_SETTINGS_LAZY_LOAD_VULCANIZED_P2_HTML" file="${root_gen_dir}\chrome\browser\resources\settings\lazy_load.vulcanized.p2.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
<include name="IDR_MD_SETTINGS_LAZY_LOAD_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\settings\lazy_load.crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
</includes>
</release>
diff --git a/chromium/chrome/browser/resources/settings/settings_shared_css.html b/chromium/chrome/browser/resources/settings/settings_shared_css.html
index 6d0d0090e3b..f78d3de53ca 100644
--- a/chromium/chrome/browser/resources/settings/settings_shared_css.html
+++ b/chromium/chrome/browser/resources/settings/settings_shared_css.html
@@ -38,7 +38,7 @@
}
iron-icon.policy {
- -webkit-margin-end: var(--cr-controlled-by-spacing);
+ margin-inline-end: var(--cr-controlled-by-spacing);
}
iron-list {
@@ -61,7 +61,7 @@
}
.separator + paper-icon-button-light {
- -webkit-margin-start: var(--cr-icon-ripple-margin);
+ margin-inline-start: var(--cr-icon-ripple-margin);
}
neon-animatable {
@@ -76,16 +76,16 @@
/* Special case for buttons inside of toggle-buttons. */
.settings-box settings-toggle-button paper-button:last-of-type {
- -webkit-margin-end: 16px;
+ margin-inline-end: 16px;
}
/* Space out multiple buttons in the same row. */
.settings-box paper-button + paper-button {
- -webkit-margin-start: 16px;
+ margin-inline-start: 16px;
}
span ~ a {
- -webkit-margin-start: 4px;
+ margin-inline-start: 4px;
}
a[href] {
@@ -196,6 +196,12 @@
min-height: var(--settings-row-two-line-min-height);
}
+ /* A row with three lines of text. Often the lower lines will be
+ * .secondary. */
+ .three-line {
+ min-height: var(--settings-row-three-line-min-height);
+ }
+
/* A settings-box is a horizontal row of text or controls within a
* setting section (page or subpage). */
.settings-box {
@@ -241,7 +247,7 @@
/* A settings-box that is embedded in another settings-box (e.g. a control
* that is associated with a toggle button). */
.settings-box.embedded {
- -webkit-padding-start: var(--settings-box-row-indent);
+ padding-inline-start: var(--settings-box-row-indent);
}
/* The lower line of text in a two-line row. */
@@ -260,9 +266,9 @@
/* The middle part (horizontally) of a row. */
.settings-box .middle {
- -webkit-padding-start: 16px;
align-items: center;
flex: auto;
+ padding-inline-start: 16px;
}
.settings-box .middle.two-line,
@@ -296,8 +302,8 @@
iron-list,
.list-item {
--cr-paper-icon-button-margin: {
- -webkit-margin-end: 0;
- -webkit-margin-start: var(--cr-icon-button-margin-start);
+ margin-inline-end: 0;
+ margin-inline-start: var(--cr-icon-button-margin-start);
};
}
@@ -310,7 +316,7 @@
* the other way. An example is near the |sign out| button on the People
* settings. */
.separator {
- -webkit-border-start: var(--settings-separator-line);
+ border-inline-start: var(--settings-separator-line);
flex-shrink: 0;
/* Match paper-button's default height. */
height: 32px;
diff --git a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
index cfe71c9f412..37ebe94a487 100644
--- a/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
+++ b/chromium/chrome/browser/resources/settings/settings_ui/settings_ui.js
@@ -80,15 +80,6 @@ Polymer({
'refresh-pref': 'onRefreshPref_',
},
- /**
- * Tracks if any cr-dialog is open anywhere in the UI. An assumption is being
- * made that only one cr-dialog is open at a time. If this assumption changes
- * |dialogOpen_| should be replaced with a count of the number of dialogs that
- * are open.
- * @private {boolean}
- */
- dialogOpen_: false,
-
/** @override */
created: function() {
settings.initializeRouteFromUrl();
@@ -157,7 +148,7 @@ Polymer({
loadTimeData.getBoolean('androidAppsVisible');
this.showCrostini_ = loadTimeData.valueExists('showCrostini') &&
loadTimeData.getBoolean('showCrostini');
- this.showMultidevice_ = this.showAndroidApps_ &&
+ this.showMultidevice_ =
loadTimeData.valueExists('enableMultideviceSettings') &&
loadTimeData.getBoolean('enableMultideviceSettings');
this.havePlayStoreApp_ = loadTimeData.valueExists('havePlayStoreApp') &&
@@ -173,15 +164,6 @@ Polymer({
this.addEventListener('hide-container', () => {
this.$.container.style.visibility = 'hidden';
});
-
- this.addEventListener('cr-dialog-open', () => {
- this.dialogOpen_ = true;
- });
-
- this.addEventListener('close', e => {
- if (e.composedPath()[0].nodeName == 'CR-DIALOG')
- this.dialogOpen_ = false;
- });
},
/** @override */
@@ -215,6 +197,8 @@ Polymer({
scrollToTop(e.detail.bottom - this.$.container.clientHeight)
.then(e.detail.callback);
});
+
+ this.becomeActiveFindShortcutListener();
},
/** @override */
@@ -246,12 +230,11 @@ Polymer({
},
// Override settings.FindShortcutBehavior methods.
- canHandleFindShortcut: function() {
- return !this.$.drawer.open && !this.dialogOpen_;
- },
-
- handleFindShortcut: function() {
+ handleFindShortcut: function(modalContextOpen) {
+ if (modalContextOpen)
+ return false;
this.$$('cr-toolbar').getSearchField().showAndFocus();
+ return true;
},
/**
diff --git a/chromium/chrome/browser/resources/settings/settings_vars_css.html b/chromium/chrome/browser/resources/settings/settings_vars_css.html
index e9236860967..174fcfb2167 100644
--- a/chromium/chrome/browser/resources/settings/settings_vars_css.html
+++ b/chromium/chrome/browser/resources/settings/settings_vars_css.html
@@ -22,8 +22,8 @@
--settings-error-color: var(--google-red-700);
--settings-list-frame-padding: {
- -webkit-padding-end: var(--settings-box-row-padding);
- -webkit-padding-start: var(--settings-box-row-indent);
+ padding-inline-end: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-indent);
padding-bottom: 0;
padding-top: 0;
}
diff --git a/chromium/chrome/browser/resources/settings/site_settings/BUILD.gn b/chromium/chrome/browser/resources/settings/site_settings/BUILD.gn
index ea34fe26d1b..6fe64dd78ec 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/site_settings/BUILD.gn
@@ -22,6 +22,7 @@ js_type_check("closure_compile") {
":site_details_permission",
":site_entry",
":site_list",
+ ":site_list_entry",
":site_settings_behavior",
":site_settings_prefs_browser_proxy",
":usb_devices",
@@ -154,6 +155,7 @@ js_library("site_data_entry") {
":local_data_browser_proxy",
"..:focus_row_behavior",
"//ui/webui/resources/js:cr",
+ "//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:icon",
]
}
@@ -179,6 +181,7 @@ js_library("site_details_permission") {
":site_settings_behavior",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
+ "//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
@@ -203,8 +206,8 @@ js_library("site_entry") {
js_library("site_list") {
deps = [
":constants",
+ ":site_list_entry",
":site_settings_behavior",
- "..:route",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:cr",
@@ -215,6 +218,17 @@ js_library("site_list") {
externs_list = [ "$externs_path/settings_private.js" ]
}
+js_library("site_list_entry") {
+ deps = [
+ ":constants",
+ ":site_settings_behavior",
+ "..:focus_row_behavior",
+ "..:route",
+ "//ui/webui/resources/cr_elements/policy:cr_policy_pref_indicator",
+ "//ui/webui/resources/js:cr",
+ ]
+}
+
js_library("site_settings_behavior") {
deps = [
":constants",
@@ -250,6 +264,7 @@ js_library("website_usage_private_api") {
js_library("zoom_levels") {
deps = [
":site_settings_behavior",
+ "//ui/webui/resources/js:list_property_update_behavior",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
}
diff --git a/chromium/chrome/browser/resources/settings/site_settings/all_sites.html b/chromium/chrome/browser/resources/settings/site_settings/all_sites.html
index d08b1bd09ec..6577af68090 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/all_sites.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/all_sites.html
@@ -22,13 +22,13 @@
}
#sortMethod {
- -webkit-margin-start: 1em;
+ margin-inline-start: 1em;
}
/* There is only one top-level heading for All Sites, so remove the
* additional leading padding used for lists. */
.list-frame.without-heading {
- -webkit-padding-start: var(--settings-box-row-padding);
+ padding-inline-start: var(--settings-box-row-padding);
}
</style>
<div id="searchAndSort">
@@ -40,23 +40,28 @@
<label id="sortLabel">$i18n{siteSettingsAllSitesSort}</label>
<select id="sortMethod" class="md-select" aria-labelledby="sortLabel"
on-change="onSortMethodChanged_">
- <!-- TODO(https://crbug.com/835712): Implement remaining two sort
- methods. -->
+ <option value="[[sortMethods_.mostVisited]]">
+ $i18n{siteSettingsAllSitesSortMethodMostVisited}
+ </option>
+ <option value="[[sortMethods_.storage]]">
+ $i18n{siteSettingsAllSitesSortMethodStorage}
+ </option>
<option value="[[sortMethods_.name]]">
$i18n{siteSettingsAllSitesSortMethodName}
</option>
</select>
</div>
</div>
- <div class="list-frame" hidden$="[[siteGroupList.length]]">
+ <div class="list-frame" hidden$="[[siteGroupMap.size]]">
<div class="list-item secondary">$i18n{noSitesAdded}</div>
</div>
<div class="list-frame without-heading" id="listContainer">
<iron-list id="allSitesList"
- items="[[filterPopulatedList_(siteGroupList, searchQuery_)]]"
+ items="[[filterPopulatedList_(siteGroupMap, searchQuery_)]]"
scroll-target="[[subpageScrollTarget]]">
<template>
- <site-entry site-group="[[item]]" list-index="[[index]]"></site-entry>
+ <site-entry site-group="[[item]]" list-index="[[index]]"
+ tabindex$="[[tabIndex]]"></site-entry>
</template>
</iron-list>
</div>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/all_sites.js b/chromium/chrome/browser/resources/settings/site_settings/all_sites.js
index 537bc46b0f3..b424251d1de 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/all_sites.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/all_sites.js
@@ -19,13 +19,14 @@ Polymer({
properties: {
/**
- * Array of sites to display in the widget, grouped into their eTLD+1s.
- * @type {!Array<!SiteGroup>}
+ * Map containing sites to display in the widget, grouped into their
+ * eTLD+1 names.
+ * @type {!Map<string, !SiteGroup>}
*/
- siteGroupList: {
- type: Array,
+ siteGroupMap: {
+ type: Object,
value: function() {
- return [];
+ return new Map();
},
},
@@ -51,30 +52,64 @@ Polymer({
/**
* All possible sort methods.
- * @type {Object}
+ * @type {!{name: string, mostVisited: string, storage: string}}
* @private
*/
sortMethods_: {
type: Object,
- value: function() {
- return {
- name: 'name',
- mostVisited: 'most-visited',
- storage: 'data-stored',
- };
+ value: {
+ name: 'name',
+ mostVisited: 'most-visited',
+ storage: 'data-stored',
},
readOnly: true,
},
+
+ /**
+ * Stores the last selected item in the All Sites list.
+ * @type {?{item: !SiteGroup, index: number}}
+ * @private
+ */
+ selectedItem_: Object,
+
+ /**
+ * Used to determine focus between settings pages.
+ * @type {!Map<string, (string|Function)>}
+ */
+ focusConfig: {
+ type: Object,
+ observer: 'focusConfigChanged_',
+ },
+ },
+
+ /** @private {?settings.LocalDataBrowserProxy} */
+ localDataBrowserProxy_: null,
+
+ /** @override */
+ created: function() {
+ this.localDataBrowserProxy_ =
+ settings.LocalDataBrowserProxyImpl.getInstance();
},
/** @override */
ready: function() {
- this.browserProxy_ =
- settings.SiteSettingsPrefsBrowserProxyImpl.getInstance();
+ this.addWebUIListener(
+ 'onLocalStorageListFetched', this.onLocalStorageListFetched.bind(this));
this.addWebUIListener(
'contentSettingSitePermissionChanged', this.populateList_.bind(this));
this.addEventListener(
- 'site-entry-resized', this.resizeListIfScrollTargetActive_.bind(this));
+ 'site-entry-selected',
+ (/** @type {!{detail: !{item: !SiteGroup, index: number}}} */ e) => {
+ this.selectedItem_ = e.detail;
+ });
+ this.addEventListener('site-entry-storage-updated', () => {
+ this.debounce('site-entry-storage-updated', () => {
+ if (this.sortMethods_ &&
+ this.$.sortMethod.value == this.sortMethods_.storage) {
+ this.onSortMethodChanged_();
+ }
+ }, 500);
+ });
this.populateList_();
},
@@ -99,27 +134,62 @@ Polymer({
if (!contentTypes.includes(settings.ContentSettingsTypes.COOKIES))
contentTypes.push(settings.ContentSettingsTypes.COOKIES);
- this.browserProxy_.getAllSites(contentTypes).then((response) => {
- this.siteGroupList = this.sortSiteGroupList_(response);
+ this.browserProxy.getAllSites(contentTypes).then((response) => {
+ response.forEach(siteGroup => {
+ this.siteGroupMap.set(siteGroup.etldPlus1, siteGroup);
+ });
+ this.forceListUpdate_();
+ });
+ },
+
+ /**
+ * Integrate sites using local storage into the existing sites map, as there
+ * may be overlap between the existing sites.
+ * @param {!Array<!SiteGroup>} list The list of sites using local storage.
+ */
+ onLocalStorageListFetched: function(list) {
+ list.forEach(storageSiteGroup => {
+ if (this.siteGroupMap.has(storageSiteGroup.etldPlus1)) {
+ const siteGroup = this.siteGroupMap.get(storageSiteGroup.etldPlus1);
+ const storageOriginInfoMap = new Map();
+ storageSiteGroup.origins.forEach(
+ originInfo =>
+ storageOriginInfoMap.set(originInfo.origin, originInfo));
+
+ // If there is an overlapping origin, update the original
+ // |originInfo|.
+ siteGroup.origins.forEach(originInfo => {
+ if (!storageOriginInfoMap.has(originInfo.origin))
+ return;
+ Object.apply(originInfo, storageOriginInfoMap.get(originInfo.origin));
+ storageOriginInfoMap.delete(originInfo.origin);
+ });
+ // Otherwise, add it to the list.
+ storageOriginInfoMap.forEach(
+ originInfo => siteGroup.origins.push(originInfo));
+ } else {
+ this.siteGroupMap.set(storageSiteGroup.etldPlus1, storageSiteGroup);
+ }
});
+ this.forceListUpdate_();
},
/**
- * Filters |this.siteGroupList| with the given search query text.
- * @param {!Array<!SiteGroup>} siteGroupList The list of sites to filter.
+ * Filters the all sites list with the given search query text.
+ * @param {!Map<string, !SiteGroup>} siteGroupMap The map of sites to filter.
* @param {string} searchQuery The filter text.
* @return {!Array<!SiteGroup>}
* @private
*/
- filterPopulatedList_: function(siteGroupList, searchQuery) {
- if (searchQuery.length == 0)
- return siteGroupList;
-
- return siteGroupList.filter((siteGroup) => {
- return siteGroup.origins.find(origin => {
- return origin.includes(searchQuery);
- });
- });
+ filterPopulatedList_: function(siteGroupMap, searchQuery) {
+ const result = [];
+ for (const [etldPlus1, siteGroup] of siteGroupMap) {
+ if (siteGroup.origins.find(
+ originInfo => originInfo.origin.includes(searchQuery))) {
+ result.push(siteGroup);
+ }
+ }
+ return this.sortSiteGroupList_(result);
},
/**
@@ -130,11 +200,89 @@ Polymer({
*/
sortSiteGroupList_: function(siteGroupList) {
const sortMethod = this.$.sortMethod.value;
- if (sortMethod == this.sortMethods_.name)
+ if (!this.sortMethods_)
+ return siteGroupList;
+
+ if (sortMethod == this.sortMethods_.mostVisited) {
+ siteGroupList.sort(this.mostVisitedComparator_);
+ } else if (sortMethod == this.sortMethods_.storage) {
+ // Storage is loaded asynchronously, so make sure it's updated for every
+ // item in the list to ensure the sorting is correct.
+ const etldPlus1List = siteGroupList.reduce((list, siteGroup) => {
+ if (siteGroup.origins.length > 1 && siteGroup.etldPlus1.length > 0)
+ list.push(siteGroup.etldPlus1);
+ return list;
+ }, []);
+
+ this.localDataBrowserProxy_.getNumCookiesList(etldPlus1List)
+ .then(numCookiesList => {
+ assert(etldPlus1List.length == numCookiesList.length);
+ numCookiesList.forEach(cookiesPerEtldPlus1 => {
+ this.siteGroupMap.get(cookiesPerEtldPlus1.etldPlus1).numCookies =
+ cookiesPerEtldPlus1.numCookies;
+ });
+
+ // |siteGroupList| by this point should have already been provided
+ // to the iron list, so just sort in-place here and make sure to
+ // re-render the item order.
+ siteGroupList.sort(this.storageComparator_);
+ this.$.allSitesList.fire('iron-resize');
+ });
+ } else if (sortMethod == this.sortMethods_.name) {
siteGroupList.sort(this.nameComparator_);
+ }
return siteGroupList;
},
+ /**
+ * Comparator used to sort SiteGroups by the amount of engagement the user has
+ * with the origins listed inside it. Note only the maximum engagement is used
+ * for each SiteGroup (as opposed to the sum) in order to prevent domains with
+ * higher numbers of origins from always floating to the top of the list.
+ * @param {!SiteGroup} siteGroup1
+ * @param {!SiteGroup} siteGroup2
+ * @private
+ */
+ mostVisitedComparator_: function(siteGroup1, siteGroup2) {
+ const getMaxEngagement = (max, originInfo) => {
+ return (max > originInfo.engagement) ? max : originInfo.engagement;
+ };
+ const score1 = siteGroup1.origins.reduce(getMaxEngagement, 0);
+ const score2 = siteGroup2.origins.reduce(getMaxEngagement, 0);
+ return score2 - score1;
+ },
+
+ /**
+ * Comparator used to sort SiteGroups by the amount of storage they use. Note
+ * this sorts in descending order.
+ * TODO(https://crbug.com/835712): Account for website storage in sorting by
+ * storage used.
+ * @param {!SiteGroup} siteGroup1
+ * @param {!SiteGroup} siteGroup2
+ * @private
+ */
+ storageComparator_: function(siteGroup1, siteGroup2) {
+ const getOverallUsage = siteGroup => {
+ let usage = 0;
+ siteGroup.origins.forEach(originInfo => {
+ usage += originInfo.usage;
+ });
+ return usage;
+ };
+
+ const siteGroup1Size = getOverallUsage(siteGroup1);
+ const siteGroup2Size = getOverallUsage(siteGroup2);
+ // Use the number of cookies as a tie breaker.
+ return siteGroup2Size - siteGroup1Size ||
+ siteGroup2.numCookies - siteGroup1.numCookies;
+ },
+
+ /**
+ * Comparator used to sort SiteGroups by their eTLD+1 name (domain).
+ * @param {!SiteGroup} siteGroup1
+ * @param {!SiteGroup} siteGroup2
+ * @private
+ */
nameComparator_: function(siteGroup1, siteGroup2) {
return siteGroup1.etldPlus1.localeCompare(siteGroup2.etldPlus1);
},
@@ -154,18 +302,52 @@ Polymer({
* @private
*/
onSortMethodChanged_: function() {
- this.siteGroupList = this.sortSiteGroupList_(this.siteGroupList);
+ this.$.allSitesList.items =
+ this.sortSiteGroupList_(this.$.allSitesList.items);
// Force the iron-list to rerender its items, as the order has changed.
this.$.allSitesList.fire('iron-resize');
},
/**
- * Called when a list item changes its size, and thus the positions and sizes
- * of the items in the entire list also need updating.
+ * Forces the all sites list to update its list of items, taking into account
+ * the search query and the sort method, then re-renders it.
+ * @private
+ */
+ forceListUpdate_: function() {
+ this.$.allSitesList.items =
+ this.filterPopulatedList_(this.siteGroupMap, this.searchQuery_);
+ this.$.allSitesList.fire('iron-resize');
+ },
+
+ /**
+ * @param {!Map<string, (string|Function)>} newConfig
+ * @param {?Map<string, (string|Function)>} oldConfig
* @private
*/
- resizeListIfScrollTargetActive_: function() {
- if (settings.getCurrentRoute() == this.subpageRoute)
- this.$.allSitesList.fire('iron-resize');
+ focusConfigChanged_: function(newConfig, oldConfig) {
+ // focusConfig is set only once on the parent, so this observer should only
+ // fire once.
+ assert(!oldConfig);
+
+ if (!settings.routes.SITE_SETTINGS_ALL)
+ return;
+
+ const onNavigatedTo = () => {
+ this.async(() => {
+ if (this.selectedItem_ == null || this.siteGroupMap.size == 0)
+ return;
+
+ // Focus the site-entry to ensure the iron-list renders it, otherwise
+ // the query selector will not be able to find it. Note the index is
+ // used here instead of the item, in case the item was already removed.
+ const index = Math.max(
+ 0, Math.min(this.selectedItem_.index, this.siteGroupMap.size));
+ this.$.allSitesList.focusItem(index);
+ this.selectedItem_ = null;
+ });
+ };
+
+ this.focusConfig.set(
+ settings.routes.SITE_SETTINGS_SITE_DETAILS.path, onNavigatedTo);
},
});
diff --git a/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js b/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js
index f23a71fe70c..19db72fabf6 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.js
@@ -33,6 +33,15 @@ let LocalDataItem;
*/
let LocalDataList;
+/**
+ * Number of cookies attached to a given domain / eTLD+1.
+ * @typedef {{
+ * etldPlus1: string,
+ * numCookies: number,
+ * }}
+ */
+let EtldPlus1CookieNumber;
+
cr.define('settings', function() {
/** @interface */
class LocalDataBrowserProxy {
@@ -69,11 +78,20 @@ cr.define('settings', function() {
getCookieDetails(site) {}
/**
- * Gets the number of cookies formatted in a plural string, given a site.
- * @param {string} site The site to count cookies for.
+ * Gets a list containing the number of cookies for each domain (eTLD+1
+ * names) given in |siteList|. This will always return a result array the
+ * same length and in the same order as |siteList|.
+ * @param {!Array<string>} siteList The list of sites to count cookies for.
+ * @return {!Promise<!Array<!EtldPlus1CookieNumber>>}
+ */
+ getNumCookiesList(siteList) {}
+
+ /**
+ * Gets the plural string for a given number of cookies.
+ * @param {number} numCookies The number of cookies.
* @return {!Promise<string>}
*/
- getNumCookiesString(site) {}
+ getNumCookiesString(numCookies) {}
/**
* Reloads all local data.
@@ -120,8 +138,13 @@ cr.define('settings', function() {
}
/** @override */
- getNumCookiesString(site) {
- return cr.sendWithPromise('localData.getNumCookiesString', site);
+ getNumCookiesList(siteList) {
+ return cr.sendWithPromise('localData.getNumCookiesList', siteList);
+ }
+
+ /** @override */
+ getNumCookiesString(numCookies) {
+ return cr.sendWithPromise('localData.getNumCookiesString', numCookies);
}
/** @override */
diff --git a/chromium/chrome/browser/resources/settings/site_settings/protocol_handlers.html b/chromium/chrome/browser/resources/settings/site_settings/protocol_handlers.html
index 70aa00c55f8..cfea2a1c20e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/protocol_handlers.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/protocol_handlers.html
@@ -18,8 +18,8 @@
}
.column-header {
- -webkit-margin-start: 20px;
margin-bottom: 15px;
+ margin-inline-start: 20px;
margin-top: 15px;
}
</style>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data.html b/chromium/chrome/browser/resources/settings/site_settings/site_data.html
index 78e9124cba9..4fa8b7af5ac 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_data.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_data.html
@@ -33,7 +33,7 @@
}
#removeShowingSites {
- -webkit-margin-start: auto;
+ margin-inline-start: auto;
}
</style>
<div class="settings-box continuation">
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_data.js b/chromium/chrome/browser/resources/settings/site_settings/site_data.js
index a1caa294965..235ea12a488 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_data.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_data.js
@@ -158,13 +158,7 @@ Polymer({
lastSelectedIndex :
this.sites.length - 1;
const index = indexFromId > -1 ? indexFromId : indexFallback;
- const ironList =
- /** @type {!IronListElement} */ (this.$$('iron-list'));
- ironList.focusItem(index);
- const siteToSelect = this.sites[index].site.replace(/[.]/g, '\\.');
- const button =
- this.$$(`#siteItem_${siteToSelect}`).$$('.subpage-arrow button');
- cr.ui.focusWithoutInk(assert(button));
+ this.focusOnSiteSelectButton_(index);
});
this.focusConfig.set(
settings.routes.SITE_SETTINGS_DATA_DETAILS.path, onNavigatedTo);
@@ -172,6 +166,20 @@ Polymer({
},
/**
+ * @param {number} index
+ * @private
+ */
+ focusOnSiteSelectButton_: function(index) {
+ const ironList =
+ /** @type {!IronListElement} */ (this.$$('iron-list'));
+ ironList.focusItem(index);
+ const siteToSelect = this.sites[index].site.replace(/[.]/g, '\\.');
+ const button =
+ this.$$(`#siteItem_${siteToSelect}`).$$('.subpage-arrow button');
+ cr.ui.focusWithoutInk(assert(button));
+ },
+
+ /**
* Gather all the site data.
* @private
*/
@@ -239,6 +247,10 @@ Polymer({
* @private
*/
onSiteClick_: function(event) {
+ // If any delete button is selected, the focus will be in a bad state when
+ // returning to this page. To avoid this, the site select button is given
+ // focus. See https://crbug.com/872197.
+ this.focusOnSiteSelectButton_(event.model.index);
settings.navigateTo(
settings.routes.SITE_SETTINGS_DATA_DETAILS,
new URLSearchParams('site=' + event.model.item.site));
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details.html b/chromium/chrome/browser/resources/settings/site_settings/site_details.html
index 5741588cba2..730957b9612 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_details.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_details.html
@@ -22,15 +22,15 @@
}
#storage {
- -webkit-padding-end: 0;
+ padding-inline-end: 0;
}
/* When 'Usage' is omitted, subheadings are removed. Reduce the start
* padding allowed for lists without headings and add back vertical space
* that would normally be provided by the subheading. */
.list-frame.without-heading {
- -webkit-padding-start: var(--settings-box-row-padding);
margin-top: 12px;
+ padding-inline-start: var(--settings-box-row-padding);
}
div#resetSettingsButton {
@@ -148,7 +148,8 @@
</site-details-permission>
<site-details-permission category="{{ContentSettingsTypes.SOUND}}"
icon="settings:volume-up" id="sound"
- label="$i18n{siteSettingsSound}">
+ label="$i18n{siteSettingsSound}"
+ use-automatic-label="[[blockAutoplayEnabled]]">
</site-details-permission>
<site-details-permission
category="{{ContentSettingsTypes.AUTOMATIC_DOWNLOADS}}"
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details.js b/chromium/chrome/browser/resources/settings/site_settings/site_details.js
index 155cc28763b..8906a2a47ea 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_details.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_details.js
@@ -17,6 +17,11 @@ Polymer({
properties: {
/**
+ * Whether unified autoplay blocking is enabled.
+ */
+ blockAutoplayEnabled: Boolean,
+
+ /**
* The origin that this widget is showing details for.
* @private
*/
@@ -72,6 +77,9 @@ Polymer({
this.addWebUIListener(
'prefEnableDrmChanged', this.prefEnableDrmChanged_.bind(this));
// </if>
+
+ // Refresh block autoplay status from the backend.
+ this.browserProxy.fetchBlockAutoplayStatus();
},
/** @override */
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.html b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.html
index 3e305be016a..9da49da8d4e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.html
@@ -3,6 +3,7 @@
<link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
+<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
<link rel="import" href="constants.html">
@@ -53,16 +54,18 @@
<option id="default" value$="[[ContentSetting.DEFAULT]]">
[[defaultSettingString_(
defaultSetting_,
- '$i18nPolymer{siteSettingsActionAskDefault}',
- '$i18nPolymer{siteSettingsActionAllowDefault}',
- '$i18nPolymer{siteSettingsActionBlockDefault}')]]
+ category,
+ useAutomaticLabel)]]
</option>
<option id="allow" value$="[[ContentSetting.ALLOW]]"
hidden$="[[!showAllowedSetting_(category)]]">
$i18n{siteSettingsActionAllow}
</option>
<option id="block" value$="[[ContentSetting.BLOCK]]">
- $i18n{siteSettingsActionBlock}
+ [[blockSettingString_(
+ category,
+ '$i18n{siteSettingsActionBlock}',
+ '$i18n{siteSettingsActionMute}')]]
</option>
<option id="ask" value$="[[ContentSetting.ASK]]"
hidden$="[[!showAskSetting_(category, site.setting,
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js
index d559c00baae..8802f151211 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_details_permission.js
@@ -10,10 +10,17 @@
Polymer({
is: 'site-details-permission',
- behaviors: [SiteSettingsBehavior, WebUIListenerBehavior],
+ behaviors: [I18nBehavior, SiteSettingsBehavior, WebUIListenerBehavior],
properties: {
/**
+ * If this is a sound content setting, then this controls whether it
+ * should use "Automatic" instead of "Allow" as the default setting
+ * allow label.
+ */
+ useAutomaticLabel: {type: Boolean, value: false},
+
+ /**
* The site that this widget is showing details for.
* @type {RawSiteException}
*/
@@ -99,30 +106,63 @@ Polymer({
},
/**
+ * Returns if we should use the custom labels for the sound type.
+ * @param {!settings.ContentSettingsTypes} category The permission type.
+ * @return {boolean}
+ * @private
+ */
+ useCustomSoundLabels_: function(category) {
+ return category == settings.ContentSettingsTypes.SOUND &&
+ loadTimeData.getBoolean('enableBlockAutoplayContentSetting');
+ },
+
+ /**
* Updates the string used for this permission category's default setting.
* @param {!settings.ContentSetting} defaultSetting Value of the default
* setting for this permission category.
- * @param {string} askString 'Ask' label, e.g. 'Ask (default)'.
- * @param {string} allowString 'Allow' label, e.g. 'Allow (default)'.
- * @param {string} blockString 'Block' label, e.g. 'Blocked (default)'.
+ * @param {!settings.ContentSettingsTypes} category The permission type.
+ * @param {boolean} useAutomaticLabel Whether to use the automatic label
+ * if the default setting value is allow.
* @return {string}
* @private
*/
- defaultSettingString_: function(
- defaultSetting, askString, allowString, blockString) {
+ defaultSettingString_: function(defaultSetting, category, useAutomaticLabel) {
+ if (defaultSetting == undefined || category == undefined ||
+ useAutomaticLabel == undefined) {
+ return '';
+ }
+
if (defaultSetting == settings.ContentSetting.ASK ||
defaultSetting == settings.ContentSetting.IMPORTANT_CONTENT) {
- return askString;
+ return this.i18n('siteSettingsActionAskDefault');
} else if (defaultSetting == settings.ContentSetting.ALLOW) {
- return allowString;
+ if (this.useCustomSoundLabels_(category) && useAutomaticLabel)
+ return this.i18n('siteSettingsActionAutomaticDefault');
+ return this.i18n('siteSettingsActionAllowDefault');
} else if (defaultSetting == settings.ContentSetting.BLOCK) {
- return blockString;
+ if (this.useCustomSoundLabels_(category))
+ return this.i18n('siteSettingsActionMuteDefault');
+ return this.i18n('siteSettingsActionBlockDefault');
}
assertNotReached(
`No string for ${this.category}'s default of ${defaultSetting}`);
},
/**
+ * Updates the string used for this permission category's block setting.
+ * @param {!settings.ContentSettingsTypes} category The permission type.
+ * @param {string} blockString 'Block' label.
+ * @param {string} muteString 'Mute' label.
+ * @return {string}
+ * @private
+ */
+ blockSettingString_: function(category, blockString, muteString) {
+ if (this.useCustomSoundLabels_(category))
+ return muteString;
+ return blockString;
+ },
+
+ /**
* Returns true if there's a string to display that provides more information
* about this permission's setting. Currently, this only gets called when
* |this.site| is updated.
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_entry.html b/chromium/chrome/browser/resources/settings/site_settings/site_entry.html
index 6305a2b4af0..cd3876ef5dd 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_entry.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_entry.html
@@ -26,9 +26,23 @@
display: flex;
}
- #cookies {
+ .second-line {
margin-top: 0.1em;
}
+
+ /* Data units such as "0 KB" should always read left-to-right. */
+ .data-unit {
+ direction: ltr;
+ unicode-bidi: isolate;
+ }
+
+ #collapseChild .data-unit {
+ padding-inline-start: 1ch;
+ }
+
+ .list-frame {
+ padding-inline-end: 0;
+ }
</style>
<div id="collapseParent">
<div class$="settings-box list-item [[getClassForIndex_(listIndex)]]">
@@ -47,8 +61,11 @@
[[scheme_(siteGroup, -1)]]
</span>
</div>
- <div id="cookies" class="secondary" hidden$="[[!cookieString_]]">
- [[cookieString_]]
+ <div class="second-line secondary">
+ <span class="data-unit">[[overallUsageString_]]</span>
+ <span id="cookies" hidden$="[[!siteGroup.numCookies]]">
+ &middot; [[cookieString_]]
+ </span>
</div>
</div>
<paper-icon-button-light id="expandIcon" class="icon-expand-more"
@@ -77,10 +94,11 @@
<template is="dom-repeat" items="[[siteGroup.origins]]">
<div class="settings-box list-item" on-click="onOriginTap_"
actionable>
- <div class="favicon-image" style$="[[computeSiteIcon(item)]]">
+ <div class="favicon-image"
+ style$="[[computeSiteIcon(item.origin)]]">
</div>
<div class="site-representation middle text-elide">
- <span class="url-directionality">
+ <span id="originSiteRepresentation" class="url-directionality">
[[siteRepresentation_(siteGroup, index)]]
</span>
<span class="secondary"
@@ -91,7 +109,13 @@
hidden$="[[!scheme_(siteGroup, index)]]">
[[scheme_(siteGroup, index)]]
</span>
+ <span class="secondary data-unit" hidden$="[[!item.usage]]">
+ [[originUsagesItem_(originUsages_.*, index)]]
+ </span>
</div>
+ <paper-icon-button-light class="subpage-arrow">
+ <button aria-labelledby$="originSiteRepresentation"></button>
+ </paper-icon-button-light>
</div>
</template>
</div>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_entry.js b/chromium/chrome/browser/resources/settings/site_settings/site_entry.js
index e5fc84d167c..2b3e9833329 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_entry.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_entry.js
@@ -32,10 +32,38 @@ Polymer({
* The string to display when there is a non-zero number of cookies.
* @private
*/
- cookieString_: {
- type: String,
- value: '',
+ cookieString_: String,
+
+ /**
+ * The position of this site-entry in its parent list.
+ */
+ listIndex: {
+ type: Number,
+ value: -1,
},
+
+ /**
+ * The string to display showing the overall usage of this site-entry.
+ * @private
+ */
+ overallUsageString_: String,
+
+ /**
+ * An array containing the strings to display showing the individual disk
+ * usage for each origin in |siteGroup|.
+ * @type {!Array<string>}
+ * @private
+ */
+ originUsages_: {
+ type: Array,
+ value: function() {
+ return [];
+ },
+ },
+ },
+
+ listeners: {
+ 'focus': 'onFocus_',
},
/** @private {?settings.LocalDataBrowserProxy} */
@@ -81,7 +109,7 @@ Polymer({
// was computed.
}
originIndex = this.getIndexBoundToOriginList_(siteGroup, originIndex);
- const url = this.toUrl(siteGroup.origins[originIndex]);
+ const url = this.toUrl(siteGroup.origins[originIndex].origin);
return url.host;
},
@@ -97,21 +125,32 @@ Polymer({
if (this.$.collapseChild.opened)
this.toggleCollapsible_();
// Ungrouped site-entries should not show cookies.
- if (this.cookieString_) {
+ if (this.cookieString_)
this.cookieString_ = '';
- this.fire('site-entry-resized');
- }
}
- if (!siteGroup || !this.grouped_(siteGroup))
+ if (!siteGroup)
return;
+ this.calculateUsageInfo_(siteGroup);
- this.localDataBrowserProxy_.getNumCookiesString(this.displayName_)
- .then(string => {
- // If there was no cookie string previously and now there is, or vice
- // versa, the height of this site-entry will have changed.
- if ((this.cookieString_ == '') != (string == ''))
- this.fire('site-entry-resized');
+ if (!this.grouped_(siteGroup))
+ return;
+
+ const siteList = [this.displayName_];
+ this.localDataBrowserProxy_.getNumCookiesList(siteList)
+ .then(numCookiesList => {
+ assert(siteList.length == numCookiesList.length);
+ const numCookies = numCookiesList[0].numCookies;
+ if (siteGroup.numCookies != numCookies)
+ this.fire('site-entry-storage-updated');
+ siteGroup.numCookies = numCookies;
+ this.notifyPath('siteGroup.numCookies');
+
+ return numCookies == 0 ?
+ Promise.resolve('') :
+ this.localDataBrowserProxy_.getNumCookiesString(numCookies);
+ })
+ .then(string => {
this.cookieString_ = string;
});
},
@@ -131,7 +170,7 @@ Polymer({
return '';
originIndex = this.getIndexBoundToOriginList_(siteGroup, originIndex);
- const url = this.toUrl(siteGroup.origins[originIndex]);
+ const url = this.toUrl(siteGroup.origins[originIndex].origin);
const scheme = url.protocol.replace(new RegExp(':*$'), '');
/** @type{string} */ const HTTPS_SCHEME = 'https';
if (scheme == HTTPS_SCHEME)
@@ -149,7 +188,48 @@ Polymer({
getSiteGroupIcon_: function(siteGroup) {
// TODO(https://crbug.com/835712): Implement heuristic for finding a good
// favicon.
- return this.computeSiteIcon(siteGroup.origins[0]);
+ return this.computeSiteIcon(siteGroup.origins[0].origin);
+ },
+
+ /**
+ * Calculates the amount of disk storage used by the given group of origins
+ * and eTLD+1. Also updates the corresponding display strings.
+ * TODO(https://crbug.com/835712): Add website storage as well.
+ * @param {SiteGroup} siteGroup The eTLD+1 group of origins.
+ * @private
+ */
+ calculateUsageInfo_: function(siteGroup) {
+ const getFormattedBytesForSize = (numBytes) => {
+ if (numBytes == 0)
+ return Promise.resolve('0 B');
+ return this.browserProxy.getFormattedBytes(numBytes);
+ };
+
+ let overallUsage = 0;
+ this.originUsages_ = new Array(siteGroup.origins.length);
+ siteGroup.origins.forEach((originInfo, i) => {
+ overallUsage += originInfo.usage;
+ if (this.grouped_(siteGroup)) {
+ getFormattedBytesForSize(originInfo.usage).then((string) => {
+ this.set(`originUsages_.${i}`, string);
+ });
+ }
+ });
+
+ getFormattedBytesForSize(overallUsage).then(string => {
+ this.overallUsageString_ = string;
+ });
+ },
+
+ /**
+ * Array binding for the |originUsages_| array for use in the HTML.
+ * @param {!{base: !Array<string>}} change The change record for the array.
+ * @param {number} index The index of the array item.
+ * @return {string}
+ * @private
+ */
+ originUsagesItem_: function(change, index) {
+ return change.base[index];
},
/**
@@ -159,6 +239,8 @@ Polymer({
* @private
*/
navigateToSiteDetails_: function(origin) {
+ this.fire(
+ 'site-entry-selected', {item: this.siteGroup, index: this.listIndex});
settings.navigateTo(
settings.routes.SITE_SETTINGS_SITE_DETAILS,
new URLSearchParams('site=' + origin));
@@ -170,7 +252,7 @@ Polymer({
* @private
*/
onOriginTap_: function(e) {
- this.navigateToSiteDetails_(this.siteGroup.origins[e.model.index]);
+ this.navigateToSiteDetails_(this.siteGroup.origins[e.model.index].origin);
},
/**
@@ -181,7 +263,7 @@ Polymer({
onSiteEntryTap_: function() {
// Individual origins don't expand - just go straight to Site Details.
if (!this.grouped_(this.siteGroup)) {
- this.navigateToSiteDetails_(this.siteGroup.origins[0]);
+ this.navigateToSiteDetails_(this.siteGroup.origins[0].origin);
return;
}
this.toggleCollapsible_();
@@ -196,7 +278,7 @@ Polymer({
* @private
*/
toggleCollapsible_: function() {
- let collapseChild =
+ const collapseChild =
/** @type {IronCollapseElement} */ (this.$.collapseChild);
collapseChild.toggle();
this.$.toggleButton.setAttribute('aria-expanded', collapseChild.opened);
@@ -238,7 +320,7 @@ Polymer({
onResetSettings_: function(e) {
const contentSettingsTypes = this.getCategoryList();
for (let i = 0; i < this.siteGroup.origins.length; ++i) {
- const origin = this.siteGroup.origins[i];
+ const origin = this.siteGroup.origins[i].origin;
this.browserProxy.setOriginPermissions(
origin, contentSettingsTypes, settings.ContentSetting.DEFAULT);
if (contentSettingsTypes.includes(settings.ContentSettingsTypes.PLUGINS))
@@ -282,4 +364,15 @@ Polymer({
return 'first';
return '';
},
+
+ /**
+ * Focuses the first focusable button in this site-entry.
+ * @private
+ */
+ onFocus_: function() {
+ const button = /** @type Element */
+ (this.root.querySelector('#toggleButton *:not([hidden]) button'));
+ button.focus();
+ this.tabIndex = -1;
+ },
});
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list.html b/chromium/chrome/browser/resources/settings/site_settings/site_list.html
index 10c0cfc9d24..1ba4ce4a4e5 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_list.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_list.html
@@ -3,27 +3,26 @@
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/cr_elements/cr_action_menu/cr_action_menu.html">
-<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
+<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/html/list_property_update_behavior.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-tooltip/paper-tooltip.html">
<link rel="import" href="../i18n_setup.html">
-<link rel="import" href="../icons.html">
-<link rel="import" href="../route.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="add_site_dialog.html">
<link rel="import" href="constants.html">
<link rel="import" href="edit_exception_dialog.html">
+<link rel="import" href="site_list_entry.html">
<link rel="import" href="site_settings_behavior.html">
<link rel="import" href="site_settings_prefs_browser_proxy.html">
<dom-module id="site-list">
<template>
<style include="settings-shared">
- .settings-row {
- flex: 1
+ paper-tooltip {
+ --paper-tooltip: var(--cr-tooltip);
}
</style>
<div id="category">
@@ -64,55 +63,21 @@
<div class="list-item secondary">$i18n{noSitesAdded}</div>
</div>
<div class="list-frame menu-content vertical-list" id="listContainer">
- <template is="dom-repeat" items="[[sites]]">
- <div class="list-item">
- <div class="settings-row"
- actionable$="[[enableSiteSettings_]]" on-click="onOriginTap_">
- <div class="favicon-image"
- style$="[[computeSiteIcon(item.origin)]]">
- </div>
- <div class="middle no-min-width">
- <div class="text-elide">
- <span class="url-directionality">[[item.displayName]]</span>
- </div>
-
- <!-- This div must not contain extra whitespace. -->
- <div class="secondary text-elide"
- id="siteDescription">[[computeSiteDescription_(item)]]</div>
- </div>
- <template is="dom-if" if="[[enableSiteSettings_]]">
- <div on-click="onOriginTap_" actionable>
- <paper-icon-button-light class="subpage-arrow">
- <button aria-label$="[[item.displayName]]"
- aria-describedby="siteDescription"></button>
- </paper-icon-button-light>
- </div>
- <div class="separator"></div>
- </template>
- </div>
- <template is="dom-if" if="[[item.controlledBy]]">
- <cr-policy-pref-indicator pref="[[item]]"
- icon-aria-label="[[label]]">
- </cr-policy-pref-indicator>
- </template>
- <paper-icon-button-light id="resetSiteContainer"
- class="icon-delete-gray"
- hidden="[[shouldHideResetButton_(item, readOnlyList)]]">
- <button id="resetSite" on-click="onResetButtonTap_"
- aria-label="$i18n{siteSettingsActionReset}">
- </button>
- </paper-icon-button-light>
- <paper-icon-button-light id="actionMenuButtonContainer"
- class="icon-more-vert"
- hidden="[[shouldHideActionMenu_(item, readOnlyList)]]">
- <button id="actionMenuButton" on-click="onShowActionMenuTap_"
- title="$i18n{moreActions}">
- </button>
- </paper-icon-button-light>
- </div>
- </template>
+ <iron-list items="[[sites]]" preserve-focus risk-selection>
+ <template>
+ <site-list-entry model="[[item]]" read-only-list="[[readOnlyList]]"
+ on-show-action-menu="onShowActionMenu_" tabindex$="[[tabIndex]]"
+ first$="[[!index]]" iron-list-tab-index="[[tabIndex]]"
+ last-focused="{{lastFocused_}}"
+ on-show-tooltip="onShowTooltip_">
+ </site-list-entry>
+ </template>
+ </iron-list>
</div>
</div>
+ <paper-tooltip id="tooltip" manual-mode position="top">
+ [[tooltipText_]]
+ </paper-tooltip>
<template is="dom-if" if="[[showEditExceptionDialog_]]" restamp>
<settings-edit-exception-dialog model="[[actionMenuSite_]]"
on-close="onEditExceptionDialogClosed_">
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list.js b/chromium/chrome/browser/resources/settings/site_settings/site_list.js
index 1781ec33bb8..578fb2bd8f3 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_list.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_list.js
@@ -8,7 +8,6 @@
* category.
*/
Polymer({
-
is: 'site-list',
behaviors: [
@@ -18,14 +17,6 @@ Polymer({
],
properties: {
- /** @private */
- enableSiteSettings_: {
- type: Boolean,
- value: function() {
- return loadTimeData.getBoolean('enableSiteSettings');
- },
- },
-
/**
* Some content types (like Location) do not allow the user to manually
* edit the exception list from within Settings.
@@ -108,6 +99,12 @@ Polymer({
SESSION_ONLY: 'SessionOnly',
}
},
+
+ /** @private */
+ lastFocused_: Object,
+
+ /** @private */
+ tooltipText_: String,
},
/**
@@ -193,30 +190,6 @@ Polymer({
},
/**
- * @param {!SiteException} exception The content setting exception.
- * @param {boolean} readOnlyList Whether the site exception list is read-only.
- * @return {boolean}
- * @private
- */
- shouldHideResetButton_: function(exception, readOnlyList) {
- return exception.enforcement ==
- chrome.settingsPrivate.Enforcement.ENFORCED ||
- !(readOnlyList || !!exception.embeddingOrigin);
- },
-
- /**
- * @param {!SiteException} exception The content setting exception.
- * @param {boolean} readOnlyList Whether the site exception list is read-only.
- * @return {boolean}
- * @private
- */
- shouldHideActionMenu_: function(exception, readOnlyList) {
- return exception.enforcement ==
- chrome.settingsPrivate.Enforcement.ENFORCED ||
- readOnlyList || !!exception.embeddingOrigin;
- },
-
- /**
* A handler for the Add Site button.
* @private
*/
@@ -232,6 +205,36 @@ Polymer({
},
/**
+ * Need to use common tooltip since the tooltip in the entry is cut off from
+ * the iron-list.
+ * @param {!{detail: {target: HTMLElement, text: string}}} e
+ * @private
+ */
+ onShowTooltip_: function(e) {
+ this.tooltipText_ = e.detail.text;
+ const target = e.detail.target;
+ // paper-tooltip normally determines the target from the |for| property,
+ // which is a selector. Here paper-tooltip is being reused by multiple
+ // potential targets. Since paper-tooltip does not expose a public property
+ // or method to update the target, the private property |_target| is
+ // updated directly.
+ this.$.tooltip._target = target;
+ /** @type {{updatePosition: Function}} */ (this.$.tooltip).updatePosition();
+ const hide = () => {
+ this.$.tooltip.hide();
+ target.removeEventListener('mouseleave', hide);
+ target.removeEventListener('blur', hide);
+ target.removeEventListener('tap', hide);
+ this.$.tooltip.removeEventListener('mouseenter', hide);
+ };
+ target.addEventListener('mouseleave', hide);
+ target.addEventListener('blur', hide);
+ target.addEventListener('tap', hide);
+ this.$.tooltip.addEventListener('mouseenter', hide);
+ this.$.tooltip.show();
+ },
+
+ /**
* Populate the sites list for display.
* @private
*/
@@ -287,29 +290,6 @@ Polymer({
},
/**
- * A handler for selecting a site (by clicking on the origin).
- * @param {!{model: !{item: !SiteException}}} event
- * @private
- */
- onOriginTap_: function(event) {
- if (!this.enableSiteSettings_)
- return;
- settings.navigateTo(
- settings.routes.SITE_SETTINGS_SITE_DETAILS,
- new URLSearchParams('site=' + event.model.item.origin));
- },
-
- /**
- * @param {?SiteException} site
- * @private
- */
- resetPermissionForOrigin_: function(site) {
- assert(site);
- this.browserProxy.resetCategoryPermissionForPattern(
- site.origin, site.embeddingOrigin, this.category, site.incognito);
- },
-
- /**
* @param {!settings.ContentSetting} contentSetting
* @private
*/
@@ -359,51 +339,20 @@ Polymer({
/** @private */
onResetTap_: function() {
- this.resetPermissionForOrigin_(this.actionMenuSite_);
+ const site = this.actionMenuSite_;
+ assert(site);
+ this.browserProxy.resetCategoryPermissionForPattern(
+ site.origin, site.embeddingOrigin, this.category, site.incognito);
this.closeActionMenu_();
},
/**
- * Returns the appropriate site description to display. This can, for example,
- * be blank, an 'embedded on <site>' or 'Current incognito session' (or a
- * mix of the last two).
- * @param {SiteException} item The site exception entry.
- * @return {string} The site description.
- */
- computeSiteDescription_: function(item) {
- let displayName = '';
- if (item.embeddingOrigin) {
- displayName = loadTimeData.getStringF(
- 'embeddedOnHost', this.sanitizePort(item.embeddingOrigin));
- } else if (this.category == settings.ContentSettingsTypes.GEOLOCATION) {
- displayName = loadTimeData.getString('embeddedOnAnyHost');
- }
-
- if (item.incognito) {
- if (displayName.length > 0)
- return loadTimeData.getStringF('embeddedIncognitoSite', displayName);
- return loadTimeData.getString('incognitoSite');
- }
- return displayName;
- },
-
- /**
- * @param {!{model: !{item: !SiteException}}} e
+ * @param {!Event} e
* @private
*/
- onResetButtonTap_: function(e) {
- this.resetPermissionForOrigin_(e.model.item);
- },
-
- /**
- * @param {!{model: !{item: !SiteException}}} e
- * @private
- */
- onShowActionMenuTap_: function(e) {
- this.activeDialogAnchor_ = /** @type {!HTMLElement} */ (
- Polymer.dom(/** @type {!Event} */ (e)).localTarget);
-
- this.actionMenuSite_ = e.model.item;
+ onShowActionMenu_: function(e) {
+ this.activeDialogAnchor_ = /** @type {!HTMLElement} */ (e.detail.anchor);
+ this.actionMenuSite_ = e.detail.model;
/** @type {!CrActionMenuElement} */ (this.$$('cr-action-menu'))
.showAt(this.activeDialogAnchor_);
},
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list_entry.html b/chromium/chrome/browser/resources/settings/site_settings/site_list_entry.html
new file mode 100644
index 00000000000..448e7d21f53
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_list_entry.html
@@ -0,0 +1,80 @@
+<link rel="import" href="chrome://resources/html/polymer.html">
+
+<link rel="import" href="chrome://resources/cr_elements/icons.html">
+<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_pref_indicator.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/web-animations.html">
+<link rel="import" href="../focus_row_behavior.html">
+<link rel="import" href="../i18n_setup.html">
+<link rel="import" href="../icons.html">
+<link rel="import" href="../route.html">
+<link rel="import" href="../settings_shared_css.html">
+<link rel="import" href="constants.html">
+<link rel="import" href="site_settings_behavior.html">
+<link rel="import" href="site_settings_prefs_browser_proxy.html">
+
+<dom-module id="site-list-entry">
+ <template>
+ <style include="settings-shared">
+ .settings-row {
+ flex: 1
+ }
+
+ /* Tooltip is hidden since site-list will display a common tooltip. */
+ cr-policy-pref-indicator {
+ --cr-tooltip: {
+ display: none;
+ };
+ }
+ </style>
+ <div class="list-item" focus-row-container>
+ <div class="settings-row"
+ actionable$="[[enableSiteSettings_]]" on-click="onOriginTap_">
+ <div class="favicon-image"
+ style$="[[computeSiteIcon(model.origin)]]">
+ </div>
+ <div class="middle no-min-width">
+ <div class="text-elide">
+ <span class="url-directionality">[[model.displayName]]</span>
+ </div>
+
+ <!-- This div must not contain extra whitespace. -->
+ <div class="secondary text-elide"
+ id="siteDescription">[[siteDescription_]]</div>
+ </div>
+ <template is="dom-if" if="[[enableSiteSettings_]]">
+ <div on-click="onOriginTap_" actionable>
+ <paper-icon-button-light class="subpage-arrow">
+ <button aria-label$="[[model.displayName]]"
+ aria-describedby="siteDescription" focus-row-control
+ focus-type="site-details"></button>
+ </paper-icon-button-light>
+ </div>
+ <div class="separator"></div>
+ </template>
+ </div>
+ <template is="dom-if" if="[[showPolicyPrefIndicator_]]">
+ <cr-policy-pref-indicator pref="[[model]]"
+ icon-aria-label="[[label]]" on-mouseenter="onShowTooltip_"
+ on-focus="onShowTooltip_" focus-row-control focus-type="policy">
+ </cr-policy-pref-indicator>
+ </template>
+ <paper-icon-button-light id="resetSiteContainer"
+ class="icon-delete-gray"
+ hidden="[[shouldHideResetButton_(model, readOnlyList)]]">
+ <button id="resetSite" on-click="onResetButtonTap_"
+ aria-label="$i18n{siteSettingsActionReset}" focus-row-control
+ focus-type="reset"></button>
+ </paper-icon-button-light>
+ <paper-icon-button-light id="actionMenuButtonContainer"
+ class="icon-more-vert"
+ hidden="[[shouldHideActionMenu_(model, readOnlyList)]]">
+ <button id="actionMenuButton" on-click="onShowActionMenuTap_"
+ title="$i18n{moreActions}" focus-row-control focus-type="menu">
+ </button>
+ </paper-icon-button-light>
+ </div>
+ </template>
+ <script src="site_list_entry.js"></script>
+</dom-module>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_list_entry.js b/chromium/chrome/browser/resources/settings/site_settings/site_list_entry.js
new file mode 100644
index 00000000000..37168658a56
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_list_entry.js
@@ -0,0 +1,145 @@
+// 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.
+
+/**
+ * @fileoverview
+ * 'site-list-entry' shows an Allowed and Blocked site for a given category.
+ */
+Polymer({
+ is: 'site-list-entry',
+
+ behaviors: [
+ SiteSettingsBehavior,
+ FocusRowBehavior,
+ ],
+
+ properties: {
+ /** @private */
+ enableSiteSettings_: {
+ type: Boolean,
+ value: function() {
+ return loadTimeData.getBoolean('enableSiteSettings');
+ },
+ },
+
+ /**
+ * Some content types (like Location) do not allow the user to manually
+ * edit the exception list from within Settings.
+ * @private
+ */
+ readOnlyList: {
+ type: Boolean,
+ value: false,
+ },
+
+ /**
+ * Site to display in the widget.
+ * @type {!SiteException}
+ */
+ model: Object,
+
+ /** @private */
+ siteDescription_: {
+ type: String,
+ computed: 'computeSiteDescription_(model)',
+ },
+
+ /** @private */
+ showPolicyPrefIndicator_: {
+ type: Boolean,
+ computed: 'computeShowPolicyPrefIndicator_(model)',
+ },
+ },
+
+ /** @private */
+ onShowTooltip_: function() {
+ const indicator = assert(this.$$('cr-policy-pref-indicator'));
+ // The tooltip text is used by an paper-tooltip contained inside the
+ // cr-policy-pref-indicator. The text is currently held in a private
+ // property. This text is needed here to send up to the common tooltip
+ // component.
+ const text = indicator.indicatorTooltip_;
+ this.fire('show-tooltip', {target: indicator, text});
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ shouldHideResetButton_: function() {
+ return this.model.enforcement ==
+ chrome.settingsPrivate.Enforcement.ENFORCED ||
+ !(this.readOnlyList || !!this.model.embeddingOrigin);
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ shouldHideActionMenu_: function() {
+ return this.model.enforcement ==
+ chrome.settingsPrivate.Enforcement.ENFORCED ||
+ this.readOnlyList || !!this.model.embeddingOrigin;
+ },
+
+ /**
+ * A handler for selecting a site (by clicking on the origin).
+ * @param {!{model: !{item: !SiteException}}} event
+ * @private
+ */
+ onOriginTap_: function(event) {
+ if (!this.enableSiteSettings_)
+ return;
+ settings.navigateTo(
+ settings.routes.SITE_SETTINGS_SITE_DETAILS,
+ new URLSearchParams('site=' + this.model.origin));
+ },
+
+ /**
+ * Returns the appropriate site description to display. This can, for example,
+ * be blank, an 'embedded on <site>' or 'Current incognito session' (or a
+ * mix of the last two).
+ * @return {string} The site description.
+ */
+ computeSiteDescription_: function() {
+ let displayName = '';
+ if (this.model.embeddingOrigin) {
+ displayName = loadTimeData.getStringF(
+ 'embeddedOnHost', this.sanitizePort(this.model.embeddingOrigin));
+ } else if (this.category == settings.ContentSettingsTypes.GEOLOCATION) {
+ displayName = loadTimeData.getString('embeddedOnAnyHost');
+ }
+
+ if (this.model.incognito) {
+ if (displayName.length > 0)
+ return loadTimeData.getStringF('embeddedIncognitoSite', displayName);
+ return loadTimeData.getString('incognitoSite');
+ }
+ return displayName;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
+ computeShowPolicyPrefIndicator_: function() {
+ return this.model.enforcement ==
+ chrome.settingsPrivate.Enforcement.ENFORCED &&
+ !!this.model.controlledBy;
+ },
+
+ /** @private */
+ onResetButtonTap_: function() {
+ this.browserProxy.resetCategoryPermissionForPattern(
+ this.model.origin, this.model.embeddingOrigin, this.model.category,
+ this.model.incognito);
+ },
+
+ /** @private */
+ onShowActionMenuTap_: function() {
+ this.fire(
+ 'show-action-menu',
+ {anchor: this.$.actionMenuButton, model: this.model});
+ },
+});
diff --git a/chromium/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js b/chromium/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
index 9ee9e90fc87..eaad4f24177 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js
@@ -19,12 +19,21 @@ const ContentSettingProvider = {
};
/**
+ * Stores origin information.
+ * @typedef {{origin: string,
+ * engagement: number,
+ * usage: number}}
+ */
+let OriginInfo;
+
+/**
* Represents a list of sites, grouped under the same eTLD+1. For example, an
* origin "https://www.example.com" would be grouped together with
* "https://login.example.com" and "http://example.com" under a common eTLD+1 of
* "example.com".
* @typedef {{etldPlus1: string,
- * origins: Array<string>}}
+ * numCookies: number,
+ * origins: Array<OriginInfo>}}
*/
let SiteGroup;
@@ -118,13 +127,21 @@ cr.define('settings', function() {
/**
* Gets a list of sites, grouped by eTLD+1, affected by any of the content
* settings specified by |contentTypes|.
- * @param {string} contentTypes A list of the content types to retrieve
- * sites for.
+ * @param {!Array<!settings.ContentSettingsTypes>} contentTypes A list of
+ * the content types to retrieve sites for.
* @return {!Promise<!Array<!SiteGroup>>}
*/
getAllSites(contentTypes) {}
/**
+ * Converts a given number of bytes into a human-readable format, with data
+ * units.
+ * @param {number} numBytes The number of bytes to convert.
+ * @return {!Promise<string>}
+ */
+ getFormattedBytes(numBytes) {}
+
+ /**
* Gets the exceptions (site list) for a particular category.
* @param {string} contentType The name of the category to query.
* @return {!Promise<!Array<!RawSiteException>>}
@@ -300,6 +317,12 @@ cr.define('settings', function() {
*/
showAndroidManageAppLinks() {}
// </if>
+
+ /**
+ * Fetches the current block autoplay state. Returns the results via
+ * onBlockAutoplayStatusChanged.
+ */
+ fetchBlockAutoplayStatus() {}
}
/**
@@ -322,6 +345,11 @@ cr.define('settings', function() {
}
/** @override */
+ getFormattedBytes(numBytes) {
+ return cr.sendWithPromise('getFormattedBytes', numBytes);
+ }
+
+ /** @override */
getExceptionList(contentType) {
return cr.sendWithPromise('getExceptionList', contentType);
}
@@ -437,6 +465,11 @@ cr.define('settings', function() {
chrome.send('showAndroidManageAppLinks');
}
// </if>
+
+ /** @override */
+ fetchBlockAutoplayStatus() {
+ chrome.send('fetchBlockAutoplayStatus');
+ }
}
// The singleton instance_ is replaced with a test version of this wrapper
diff --git a/chromium/chrome/browser/resources/settings/site_settings/usb_devices.html b/chromium/chrome/browser/resources/settings/site_settings/usb_devices.html
index 178400c6c86..770b302d6f5 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/usb_devices.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/usb_devices.html
@@ -15,8 +15,8 @@
}
.column-header {
- -webkit-margin-start: 20px;
margin-bottom: 15px;
+ margin-inline-start: 20px;
margin-top: 15px;
}
</style>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.html b/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.html
index 414569dc440..559e7613d7e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.html
+++ b/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.html
@@ -2,8 +2,9 @@
<link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
+<link rel="import" href="chrome://resources/html/list_property_update_behavior.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="site_settings_behavior.html">
@@ -17,37 +18,46 @@
}
.zoom-label {
- -webkit-margin-end: 16px;
color: var(--cr-secondary-text-color);
+ margin-inline-end: 16px;
}
#empty {
margin-top: 15px;
}
+
+ .list-item .favicon-image {
+ flex-shrink: 0;
+ }
+
+ .list-item .middle {
+ overflow-x: hidden;
+ text-overflow: ellipsis;
+ }
</style>
<div class="list-frame vertical-list" id="listContainer">
- <template is="dom-repeat" items="[[sites_]]" id="list">
- <div class="list-item">
- <div class="favicon-image"
- style$="[[computeSiteIcon(item.originForFavicon)]]">
- </div>
- <div class="middle">
- <span class="url-directionality">[[item.displayName]]</span>
- </div>
- <div class="zoom-label">[[item.zoom]]</div>
- <div>
+ <iron-list id="list" preserve-focus items="[[sites_]]"
+ class="cr-separators" risk-selection>
+ <template>
+ <div class="list-item" first$="[[!index]]">
+ <div class="favicon-image"
+ style$="[[computeSiteIcon(item.originForFavicon)]]">
+ </div>
+ <div class="middle">
+ <span class="url-directionality">[[item.displayName]]</span>
+ </div>
+ <div class="zoom-label">[[item.zoom]]</div>
<paper-icon-button-light class="icon-clear">
<button on-click="removeZoomLevel_"
- title="$i18n{siteSettingsRemoveZoomLevel}"></button>
+ title="$i18n{siteSettingsRemoveZoomLevel}"
+ tabindex$="[[tabIndex]]"></button>
</paper-icon-button-light>
</div>
- </div>
- </template>
- <template is="dom-if" if="[[!sites_.length]]">
- <div id="empty">
- $i18n{siteSettingsNoZoomedSites}
- </div>
- </template>
+ </template>
+ </iron-list>
+ <div id="empty" hidden$="[[!showNoSites_]]">
+ $i18n{siteSettingsNoZoomedSites}
+ </div>
</div>
</template>
<script src="zoom_levels.js"></script>
diff --git a/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.js b/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.js
index eeeb057da00..1614243c0be 100644
--- a/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.js
+++ b/chromium/chrome/browser/resources/settings/site_settings/zoom_levels.js
@@ -11,14 +11,27 @@
Polymer({
is: 'zoom-levels',
- behaviors: [SiteSettingsBehavior, WebUIListenerBehavior],
+ behaviors: [
+ ListPropertyUpdateBehavior,
+ SiteSettingsBehavior,
+ WebUIListenerBehavior,
+ ],
properties: {
/**
* Array of sites that are zoomed in or out.
* @type {!Array<ZoomLevelEntry>}
*/
- sites_: Array,
+ sites_: {
+ type: Array,
+ value: () => [],
+ },
+
+ /** @private */
+ showNoSites_: {
+ type: Boolean,
+ value: false,
+ },
},
/** @override */
@@ -34,7 +47,8 @@ Polymer({
* their zoom levels.
*/
onZoomLevelsChanged_: function(sites) {
- this.sites_ = sites;
+ this.updateList('sites_', item => `${item.origin}_${item.zoom}`, sites);
+ this.showNoSites_ = this.sites_.length == 0;
},
/**
diff --git a/chromium/chrome/browser/resources/settings/site_settings_page/BUILD.gn b/chromium/chrome/browser/resources/settings/site_settings_page/BUILD.gn
index ea35eff8914..7467e9e011e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings_page/BUILD.gn
+++ b/chromium/chrome/browser/resources/settings/site_settings_page/BUILD.gn
@@ -20,5 +20,6 @@ js_library("site_settings_page") {
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:web_ui_listener_behavior",
+ "//ui/webui/resources/js/cr/ui:focus_without_ink",
]
}
diff --git a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
index 92c863fcf9e..b2894017d19 100644
--- a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
+++ b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.html
@@ -1,6 +1,7 @@
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html">
+<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="../icons.html">
@@ -14,7 +15,7 @@
<template>
<style include="settings-shared">
.settings-box iron-icon + .middle {
- -webkit-padding-start: 20px;
+ padding-inline-start: 20px;
}
</style>
<template is="dom-if" if="[[enableSiteSettings_]]">
diff --git a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
index 72f0f5db31e..c6213ed665e 100644
--- a/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
+++ b/chromium/chrome/browser/resources/settings/site_settings_page/site_settings_page.js
@@ -84,7 +84,7 @@ Polymer({
}
},
- /** @type {!Map<string, string>} */
+ /** @type {!Map<string, (string|Function)>} */
focusConfig: {
type: Object,
observer: 'focusConfigChanged_',
@@ -136,8 +136,9 @@ Polymer({
pairs.forEach(pair => {
const route = pair[0];
const id = pair[1];
- this.focusConfig.set(
- route.path, '* /deep/ #' + id + ' .subpage-arrow button');
+ this.focusConfig.set(route.path, () => this.async(() => {
+ cr.ui.focusWithoutInk(assert(this.$$(`#${id} .subpage-arrow button`)));
+ }));
});
},
diff --git a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/BUILD.gn b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/BUILD.gn
index ccb77ab6332..6f36b5e3c54 100644
--- a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/BUILD.gn
+++ b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/BUILD.gn
@@ -24,6 +24,7 @@ js_library("sync_confirmation_app") {
":sync_confirmation_browser_proxy",
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
+ "//ui/webui/resources/js:web_ui_listener_behavior",
]
}
diff --git a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html
index a3c5e3b4c2b..940392875cb 100644
--- a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html
+++ b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.html
@@ -5,6 +5,7 @@
<link rel="import" href="chrome://resources/cr_elements/paper_button_style_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/load_time_data.html">
+<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html">
@@ -36,14 +37,14 @@
}
paper-button:not(.action-button) {
- -webkit-margin-start: 16px;
+ margin-inline-start: 16px;
}
<if expr="is_macosx or is_linux">
/* This works together with the button-flip in signin-dialog-shared. */
paper-button:not(.action-button) {
- -webkit-margin-end: 16px;
- -webkit-margin-start: 0;
+ margin-inline-end: 16px;
+ margin-inline-start: 0;
}
</if>
@@ -108,10 +109,10 @@
}
.logo {
- -webkit-margin-end: 16px;
background-size: cover;
flex-shrink: 0;
height: 16px;
+ margin-inline-end: 16px;
margin-top: 2px;
position: relative;
width: 16px;
@@ -119,9 +120,9 @@
#personalize-logo {
/* Need the following rules to adjust for white spacing in the svg. */
- -webkit-margin-end: 14px;
fill: var(--google-blue-700);
height: 18px;
+ margin-inline-end: 14px;
width: 18px;
}
@@ -145,10 +146,10 @@
}
#options-container {
- -webkit-margin-start: 16px;
background: white;
bottom: 0;
left: 0;
+ margin-inline-start: 16px;
position: absolute;
right: 0;
top: 0;
@@ -161,8 +162,8 @@
}
#options-description {
- -webkit-padding-end: 24px;
padding-bottom: 25px;
+ padding-inline-end: 24px;
}
cr-radio-button {
diff --git a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.js b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.js
index 9ed4b8ee82e..0d11ed91219 100644
--- a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.js
+++ b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_app.js
@@ -5,6 +5,10 @@
Polymer({
is: 'sync-confirmation-app',
+ behaviors: [
+ WebUIListenerBehavior,
+ ],
+
properties: {
/** @private */
isConsentBump_: {
@@ -44,6 +48,9 @@ Polymer({
// window opens initially, the focus level is only on document, so the key
// event is not captured by "this".
document.addEventListener('keydown', this.boundKeyDownHandler_);
+ this.addWebUIListener(
+ 'account-image-changed', this.handleAccountImageChanged_.bind(this));
+ this.syncConfirmationBrowserProxy_.requestAccountImage();
},
/** @override */
@@ -129,4 +136,13 @@ Polymer({
this.showMoreOptions_ = false;
},
+ /**
+ * Called when the account image changes.
+ * @param {string} imageSrc
+ * @private
+ */
+ handleAccountImageChanged_: function(imageSrc) {
+ this.accountImageSrc_ = imageSrc;
+ },
+
});
diff --git a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_browser_proxy.js b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_browser_proxy.js
index e6527d87212..2a82e247036 100644
--- a/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_browser_proxy.js
+++ b/chromium/chrome/browser/resources/signin/dice_sync_confirmation/sync_confirmation_browser_proxy.js
@@ -70,6 +70,11 @@ cr.define('sync.confirmation', function() {
/** @param {!Array<number>} height */
initializedWithSize(height) {}
+
+ /**
+ * Called when the WebUIListener for "account-image-changed" was added.
+ */
+ requestAccountImage() {}
}
/** @implements {sync.confirmation.SyncConfirmationBrowserProxy} */
@@ -107,6 +112,11 @@ cr.define('sync.confirmation', function() {
chrome.send('initializedWithSize', height);
}
+ /** @override */
+ requestAccountImage() {
+ chrome.send('accountImageRequest');
+ }
+
/** @private */
recordConsentBumpAction_(action) {
chrome.metricsPrivate.recordEnumerationValue(
diff --git a/chromium/chrome/browser/resources/signin/signin_email_confirmation/signin_email_confirmation.html b/chromium/chrome/browser/resources/signin/signin_email_confirmation/signin_email_confirmation.html
index 4936de02de1..2d92bfcbba7 100644
--- a/chromium/chrome/browser/resources/signin/signin_email_confirmation/signin_email_confirmation.html
+++ b/chromium/chrome/browser/resources/signin/signin_email_confirmation/signin_email_confirmation.html
@@ -22,8 +22,8 @@
}
.details {
- -webkit-margin-start: -8px;
line-height: 20px;
+ margin-inline-start: -8px;
padding: 8px 24px 0;
}
@@ -49,13 +49,13 @@
}
#closeButton {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
<if expr="is_macosx or is_linux">
#closeButton {
- -webkit-margin-end: 8px;
- -webkit-margin-start: 0;
+ margin-inline-end: 8px;
+ margin-inline-start: 0;
}
</if>
</style>
diff --git a/chromium/chrome/browser/resources/signin/signin_error/signin_error.html b/chromium/chrome/browser/resources/signin/signin_error/signin_error.html
index b85910d8d9e..00219666b3f 100644
--- a/chromium/chrome/browser/resources/signin/signin_error/signin_error.html
+++ b/chromium/chrome/browser/resources/signin/signin_error/signin_error.html
@@ -24,7 +24,7 @@
}
#closeButton {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
#normal-error-message p:empty,
@@ -37,11 +37,11 @@
}
#profile-blocking-error-message p {
- -webkit-padding-start: 35px;
background-position: 0 3px;
background-repeat: no-repeat;
background-size: 20px;
line-height: 18px;
+ padding-inline-start: 35px;
}
html[dir=rtl] #profile-blocking-error-message p {
@@ -64,8 +64,8 @@
<if expr="is_macosx or is_linux">
#closeButton {
- -webkit-margin-end: 8px;
- -webkit-margin-start: 0;
+ margin-inline-end: 8px;
+ margin-inline-start: 0;
}
</if>
</style>
diff --git a/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.css b/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.css
index 79e5343ae56..74a0daf1300 100644
--- a/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.css
+++ b/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.css
@@ -21,8 +21,8 @@
}
.picture {
- -webkit-margin-start: 84px;
height: 96px;
+ margin-inline-start: 84px;
position: relative;
width: 96px;
}
@@ -42,10 +42,10 @@
}
.message-container .logo {
- -webkit-margin-end: 20px;
background-size: cover;
flex-shrink: 0;
height: 20px;
+ margin-inline-end: 20px;
position: relative;
top: -2px;
width: 20px;
@@ -73,11 +73,11 @@
}
.message-container #activityControlsCheckbox {
- -webkit-margin-start: 40px;
+ margin-inline-start: 40px;
}
#undoButton {
- -webkit-margin-start: 8px;
+ margin-inline-start: 8px;
}
#syncDisabledDetails {
diff --git a/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.html b/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.html
index b689de42ad6..2b93303dc17 100644
--- a/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.html
+++ b/chromium/chrome/browser/resources/signin/sync_confirmation/sync_confirmation.html
@@ -12,8 +12,8 @@
<style is="custom-style" include="signin-dialog-shared paper-button-style">
<if expr="is_macosx or is_linux">
#undoButton {
- -webkit-margin-end: 8px;
- -webkit-margin-start: 0;
+ margin-inline-end: 8px;
+ margin-inline-start: 0;
}
</if>
</style>
diff --git a/chromium/chrome/browser/resources/sync_file_system_internals/OWNERS b/chromium/chrome/browser/resources/sync_file_system_internals/OWNERS
index 6bf7d0a8f63..8fb67bb4690 100644
--- a/chromium/chrome/browser/resources/sync_file_system_internals/OWNERS
+++ b/chromium/chrome/browser/resources/sync_file_system_internals/OWNERS
@@ -1,6 +1,7 @@
calvinlo@chromium.org
kinuko@chromium.org
nhiroki@chromium.org
+pwnall@chomium.org
tzik@chromium.org
# TEAM: storage-dev@chromium.org
diff --git a/chromium/chrome/browser/resources/sync_file_system_internals/main.css b/chromium/chrome/browser/resources/sync_file_system_internals/main.css
index 857f05218ee..828f7fc01cc 100644
--- a/chromium/chrome/browser/resources/sync_file_system_internals/main.css
+++ b/chromium/chrome/browser/resources/sync_file_system_internals/main.css
@@ -59,8 +59,8 @@ tbody tr:nth-child(odd) {
}
.file-icon-cell {
- -webkit-padding-start: 0;
display: inline-block; /* Makes the cell content start-align in RTL. */
+ padding-inline-start: 0;
}
.file-icon-cell > div {
diff --git a/chromium/chrome/browser/resources/task_scheduler_internals/OWNERS b/chromium/chrome/browser/resources/task_scheduler_internals/OWNERS
index ffc802c14e6..495a17c74d4 100644
--- a/chromium/chrome/browser/resources/task_scheduler_internals/OWNERS
+++ b/chromium/chrome/browser/resources/task_scheduler_internals/OWNERS
@@ -1 +1 @@
-file://base/task_scheduler/OWNERS
+file://base/task/task_scheduler/OWNERS
diff --git a/chromium/chrome/browser/resources/uber_shared.css b/chromium/chrome/browser/resources/uber_shared.css
index 1aa69c4a5f3..cafb3d52eb5 100644
--- a/chromium/chrome/browser/resources/uber_shared.css
+++ b/chromium/chrome/browser/resources/uber_shared.css
@@ -3,12 +3,12 @@
* found in the LICENSE file. */
body {
- -webkit-margin-start: 23px;
color: rgb(48, 57, 66);
+ margin-inline-start: 23px;
}
body.uber-frame {
- -webkit-margin-start: 155px;
+ margin-inline-start: 155px;
}
html[dir='rtl'] body.uber-frame {
@@ -23,7 +23,7 @@ body #extension-settings.page,
body #mainview-content .page,
body .subpage-sheet-container .page,
body > .page {
- -webkit-margin-end: 24px;
+ margin-inline-end: 24px;
min-width: 576px;
padding-bottom: 20px;
padding-top: 55px;
@@ -35,7 +35,7 @@ body header {
rgba(255, 255, 255, 0.92));
left: 23px;
/* <section>s in options currently amount to 638px total, broken up into
- * 600px max-width + 18px -webkit-padding-start + 20px -webkit-margin-end
+ * 600px max-width + 18px padding-inline-start + 20px margin-inline-end
* so we mirror this value here so the headers match width and horizontal
* alignment when scrolling sideways.
* other-devices.css' .device width depends on this, please keep in sync. */
@@ -91,11 +91,11 @@ body header > h1 {
/* Create a border under the h1 (but before anything that gets appended
* to the end of the header). */
body header > h1::after {
- -webkit-margin-end: 20px;
background-color: #eee;
content: ' ';
display: block;
height: 1px;
+ margin-inline-end: 20px;
position: relative;
top: 13px;
}
@@ -112,10 +112,10 @@ body footer {
/* Sections are used in options pages, help page and history page. This defines
* the section metrics to match the header metrics above. */
body section {
- -webkit-padding-start: 18px;
margin-bottom: 24px;
margin-top: 8px;
max-width: 600px;
+ padding-inline-start: 18px;
}
body section:last-of-type {
@@ -123,7 +123,7 @@ body section:last-of-type {
}
body section > h3 {
- -webkit-margin-start: -18px;
+ margin-inline-start: -18px;
}
body section > div:only-of-type {
@@ -131,8 +131,8 @@ body section > div:only-of-type {
}
body .section-header {
- -webkit-margin-start: -18px;
margin-bottom: 0.8em;
+ margin-inline-start: -18px;
margin-top: 1.2em;
}
@@ -165,20 +165,20 @@ body .section-header > h3 {
}
.page-banner .page-banner-gradient {
- -webkit-margin-end: 20px;
- -webkit-margin-start: 0;
margin-bottom: 9px;
+ margin-inline-end: 20px;
+ margin-inline-start: 0;
}
.page-banner-text {
- -webkit-padding-end: 8px;
- -webkit-padding-start: 26px;
background-image: url(../../../ui/webui/resources/images/business.svg);
background-position: 0 center;
background-repeat: no-repeat;
background-size: 18px;
display: block;
padding-bottom: 8px;
+ padding-inline-end: 8px;
+ padding-inline-start: 26px;
padding-top: 8px;
}
diff --git a/chromium/chrome/browser/resources/webapks/about_webapks.css b/chromium/chrome/browser/resources/webapks/about_webapks.css
index a6cbc37a6d5..f96c7a092d6 100644
--- a/chromium/chrome/browser/resources/webapks/about_webapks.css
+++ b/chromium/chrome/browser/resources/webapks/about_webapks.css
@@ -17,9 +17,9 @@ body {
}
.label {
- -webkit-padding-end: 5px;
font-size: 1.5em;
font-weight: bold;
+ padding-inline-end: 5px;
text-align: start;
white-space: nowrap;
}
@@ -32,17 +32,17 @@ body {
}
.app-name {
- -webkit-padding-end: 5px;
display: block;
font-size: 1.2em;
font-weight: bold;
margin-top: 20px;
+ padding-inline-end: 5px;
white-space: nowrap;
}
.app-property-label {
- -webkit-padding-end: 5px;
font-weight: bold;
+ padding-inline-end: 5px;
text-align: start;
white-space: nowrap;
}
diff --git a/chromium/chrome/browser/resources/welcome/welcome_win10.html b/chromium/chrome/browser/resources/welcome/welcome_win10.html
index 39269c558e2..f021f1ac326 100644
--- a/chromium/chrome/browser/resources/welcome/welcome_win10.html
+++ b/chromium/chrome/browser/resources/welcome/welcome_win10.html
@@ -125,9 +125,9 @@
}
.section-steps li {
- -webkit-margin-start: 1.25em;
- -webkit-padding-start: 1em;
margin-bottom: 1em;
+ margin-inline-start: 1.25em;
+ padding-inline-start: 1em;
}
.section-steps li:last-child {
diff --git a/chromium/chrome/browser/safe_browsing/BUILD.gn b/chromium/chrome/browser/safe_browsing/BUILD.gn
index 215c3edd221..36feab76ada 100644
--- a/chromium/chrome/browser/safe_browsing/BUILD.gn
+++ b/chromium/chrome/browser/safe_browsing/BUILD.gn
@@ -5,12 +5,6 @@
import("//extensions/buildflags/buildflags.gni")
import("//third_party/protobuf/proto_library.gni")
-proto_library("chunk_proto") {
- sources = [
- "chunk.proto",
- ]
-}
-
static_library("safe_browsing") {
sources = [
"chrome_cleaner/chrome_cleaner_controller_impl_win.cc",
@@ -112,7 +106,6 @@ static_library("safe_browsing") {
"ui_manager.h",
]
deps += [
- "//chrome/browser/safe_browsing:chunk_proto",
"//chrome/common/safe_browsing:proto",
"//components/safe_browsing:csd_proto",
"//components/safe_browsing:safe_browsing",
@@ -141,8 +134,6 @@ static_library("safe_browsing") {
"browser_features.h",
"chrome_password_protection_service.cc",
"chrome_password_protection_service.h",
- "chunk_range.cc",
- "chunk_range.h",
"client_side_detection_host.cc",
"client_side_detection_host.h",
"client_side_detection_service.cc",
@@ -216,32 +207,20 @@ static_library("safe_browsing") {
"incident_reporting/state_store.h",
"incident_reporting/tracked_preference_incident.cc",
"incident_reporting/tracked_preference_incident.h",
- "local_database_manager.cc",
- "local_database_manager.h",
- "protocol_manager.cc",
- "protocol_manager.h",
- "protocol_parser.cc",
- "protocol_parser.h",
- "safe_browsing_database.cc",
- "safe_browsing_database.h",
- "safe_browsing_store.cc",
- "safe_browsing_store.h",
- "safe_browsing_store_file.cc",
- "safe_browsing_store_file.h",
- "safe_browsing_util.cc",
- "safe_browsing_util.h",
"services_delegate_impl.cc",
"services_delegate_impl.h",
"signature_evaluator_mac.h",
"signature_evaluator_mac.mm",
]
deps += [
+ ":advanced_protection",
"//chrome/services/file_util/public/cpp",
"//components/content_settings/core/browser:browser",
"//components/language/core/common:common",
"//components/prefs:prefs",
"//components/safe_browsing/db:db",
"//components/security_interstitials/content:security_interstitial_page",
+ "//components/signin/core/browser:browser",
"//content/public/browser:browser",
"//net:net",
]
@@ -259,3 +238,20 @@ static_library("safe_browsing") {
}
}
}
+
+static_library("advanced_protection") {
+ sources = [
+ "advanced_protection_status_manager.cc",
+ "advanced_protection_status_manager.h",
+ "advanced_protection_status_manager_factory.cc",
+ "advanced_protection_status_manager_factory.h",
+ ]
+
+ deps = [
+ "//components/prefs:prefs",
+ "//components/safe_browsing/common:common",
+ "//components/safe_browsing/common:safe_browsing_prefs",
+ "//components/signin/core/browser:browser",
+ "//content/public/browser:browser",
+ ]
+}
diff --git a/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
index 5ad42fc6183..57871c6ecef 100644
--- a/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
+++ b/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
@@ -16,9 +16,9 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
+#include "base/task/post_task.h"
#include "base/task_runner_util.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/threading/scoped_blocking_call.h"
#include "chrome/common/chrome_constants.h"
#include "components/spellcheck/browser/spellcheck_host_metrics.h"
#include "components/spellcheck/common/spellcheck_common.h"
@@ -63,11 +63,14 @@ enum ChangeSanitationResult {
// invalid checksum, then returns ChecksumStatus::INVALID and clears |words|.
ChecksumStatus LoadFile(const base::FilePath& file_path,
std::set<std::string>* words) {
- base::AssertBlockingAllowed();
DCHECK(words);
words->clear();
std::string contents;
- base::ReadFileToString(file_path, &contents);
+ {
+ base::ScopedBlockingCall scoped_blocking_call(
+ base::BlockingType::MAY_BLOCK);
+ base::ReadFileToString(file_path, &contents);
+ }
size_t pos = contents.rfind(CHECKSUM_PREFIX);
if (pos != std::string::npos) {
std::string checksum = contents.substr(pos + strlen(CHECKSUM_PREFIX));
@@ -122,7 +125,6 @@ int SanitizeWordsToAdd(const std::set<std::string>& existing,
// called on the file thread.
std::unique_ptr<SpellcheckCustomDictionary::LoadFileResult>
LoadDictionaryFileReliably(const base::FilePath& path) {
- base::AssertBlockingAllowed();
// Load the contents and verify the checksum.
std::unique_ptr<SpellcheckCustomDictionary::LoadFileResult> result(
new SpellcheckCustomDictionary::LoadFileResult);
@@ -144,22 +146,24 @@ LoadDictionaryFileReliably(const base::FilePath& path) {
// the custom spellcheck dictionary at |path|.
void SaveDictionaryFileReliably(const base::FilePath& path,
const std::set<std::string>& custom_words) {
- base::AssertBlockingAllowed();
std::stringstream content;
for (const std::string& word : custom_words)
content << word << '\n';
std::string checksum = base::MD5String(content.str());
content << CHECKSUM_PREFIX << checksum;
- base::CopyFile(path, path.AddExtension(BACKUP_EXTENSION));
- base::ImportantFileWriter::WriteFileAtomically(path, content.str());
+ {
+ base::ScopedBlockingCall scoped_blocking_call(
+ base::BlockingType::MAY_BLOCK);
+ base::CopyFile(path, path.AddExtension(BACKUP_EXTENSION));
+ base::ImportantFileWriter::WriteFileAtomically(path, content.str());
+ }
}
void SavePassedWordsToDictionaryFileReliably(
const base::FilePath& path,
std::unique_ptr<SpellcheckCustomDictionary::LoadFileResult>
load_file_result) {
- base::AssertBlockingAllowed();
DCHECK(load_file_result);
SaveDictionaryFileReliably(path, load_file_result->words);
}
@@ -391,7 +395,6 @@ SpellcheckCustomDictionary::LoadFileResult::~LoadFileResult() {}
// static
std::unique_ptr<SpellcheckCustomDictionary::LoadFileResult>
SpellcheckCustomDictionary::LoadDictionaryFile(const base::FilePath& path) {
- base::AssertBlockingAllowed();
std::unique_ptr<LoadFileResult> result = LoadDictionaryFileReliably(path);
SpellCheckHostMetrics::RecordCustomWordCountStats(result->words.size());
return result;
@@ -401,7 +404,6 @@ SpellcheckCustomDictionary::LoadDictionaryFile(const base::FilePath& path) {
void SpellcheckCustomDictionary::UpdateDictionaryFile(
std::unique_ptr<Change> dictionary_change,
const base::FilePath& path) {
- base::AssertBlockingAllowed();
DCHECK(dictionary_change);
if (dictionary_change->empty())
diff --git a/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.h b/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
index e5cb273e8d6..24cb54df2a1 100644
--- a/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
+++ b/chromium/chrome/browser/spellchecker/spellcheck_custom_dictionary.h
@@ -208,7 +208,7 @@ class SpellcheckCustomDictionary : public SpellcheckDictionary,
base::FilePath custom_dictionary_path_;
// Observers for dictionary load and content changes.
- base::ObserverList<Observer> observers_;
+ base::ObserverList<Observer>::Unchecked observers_;
// Used to send local changes to the sync infrastructure.
std::unique_ptr<syncer::SyncChangeProcessor> sync_processor_;
diff --git a/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index 6a7fa0ccb4d..5259be40f20 100644
--- a/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -14,9 +14,9 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/single_thread_task_runner.h"
+#include "base/task/post_task.h"
#include "base/task_runner_util.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
@@ -49,7 +49,7 @@ base::LazyInstance<GURL>::Leaky g_download_url_for_testing =
// Close the file.
void CloseDictionary(base::File file) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
file.Close();
}
@@ -57,7 +57,7 @@ void CloseDictionary(base::File file) {
// returns false.
bool SaveDictionaryData(std::unique_ptr<std::string> data,
const base::FilePath& path) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
size_t bytes_written =
base::WriteFile(path, data->data(), data->length());
@@ -318,7 +318,7 @@ void SpellcheckHunspellDictionary::DownloadDictionary(GURL url) {
// static
SpellcheckHunspellDictionary::DictionaryFile
SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
// The default_dictionary_file can either come from the standard list of
// hunspell dictionaries (determined in InitializeDictionaryLocation), or it
@@ -370,7 +370,7 @@ SpellcheckHunspellDictionary::OpenDictionaryFile(const base::FilePath& path) {
SpellcheckHunspellDictionary::DictionaryFile
SpellcheckHunspellDictionary::InitializeDictionaryLocation(
const std::string& language) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
// The default place where the spellcheck dictionary resides is
// chrome::DIR_APP_DICTIONARIES.
diff --git a/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
index 6a36c25c60b..715378b8763 100644
--- a/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
+++ b/chromium/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h
@@ -165,7 +165,7 @@ class SpellcheckHunspellDictionary
#endif
// Observers of Hunspell dictionary events.
- base::ObserverList<Observer> observers_;
+ base::ObserverList<Observer>::Unchecked observers_;
// Status of the dictionary download.
DownloadStatus download_status_;
diff --git a/chromium/chrome/browser/ui/BUILD.gn b/chromium/chrome/browser/ui/BUILD.gn
index 1b14d628a63..ea8b1a687eb 100644
--- a/chromium/chrome/browser/ui/BUILD.gn
+++ b/chromium/chrome/browser/ui/BUILD.gn
@@ -5,6 +5,7 @@ import("//build/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/crypto.gni")
import("//build/config/features.gni")
+import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
import("//chrome/common/features.gni")
@@ -28,7 +29,7 @@ config("ui_warnings") {
# Use a static library here because many test binaries depend on this but don't
# require many files from it. This makes linking more efficient.
-split_static_library("ui") {
+jumbo_split_static_library("ui") {
# Split into multiple static libraries on Windows builds. We have hit size
# limits on Windows official builds and on goma builds when symbol_level = 2
# is selected. Always splitting on Windows builds is simpler than trying to
@@ -79,8 +80,6 @@ split_static_library("ui") {
"cocoa/background_gradient_view.mm",
"cocoa/base_bubble_controller.h",
"cocoa/base_bubble_controller.mm",
- "cocoa/bookmarks/bookmark_all_tabs_controller.h",
- "cocoa/bookmarks/bookmark_all_tabs_controller.mm",
"cocoa/bookmarks/bookmark_bar_bridge.h",
"cocoa/bookmarks/bookmark_bar_bridge.mm",
"cocoa/bookmarks/bookmark_bar_constants.h",
@@ -101,8 +100,6 @@ split_static_library("ui") {
"cocoa/bookmarks/bookmark_bar_toolbar_view.mm",
"cocoa/bookmarks/bookmark_bar_view_cocoa.h",
"cocoa/bookmarks/bookmark_bar_view_cocoa.mm",
- "cocoa/bookmarks/bookmark_bubble_controller.h",
- "cocoa/bookmarks/bookmark_bubble_controller.mm",
"cocoa/bookmarks/bookmark_bubble_observer_cocoa.h",
"cocoa/bookmarks/bookmark_bubble_observer_cocoa.mm",
"cocoa/bookmarks/bookmark_bar_util.h",
@@ -114,16 +111,10 @@ split_static_library("ui") {
"cocoa/bookmarks/bookmark_context_menu_cocoa_controller.h",
"cocoa/bookmarks/bookmark_context_menu_cocoa_controller.mm",
"cocoa/bookmarks/bookmark_drag_drop_cocoa.mm",
- "cocoa/bookmarks/bookmark_editor_base_controller.h",
- "cocoa/bookmarks/bookmark_editor_base_controller.mm",
- "cocoa/bookmarks/bookmark_editor_controller.h",
- "cocoa/bookmarks/bookmark_editor_controller.mm",
"cocoa/bookmarks/bookmark_folder_target.h",
"cocoa/bookmarks/bookmark_folder_target.mm",
"cocoa/bookmarks/bookmark_model_observer_for_cocoa.h",
"cocoa/bookmarks/bookmark_model_observer_for_cocoa.mm",
- "cocoa/bookmarks/bookmark_name_folder_controller.h",
- "cocoa/bookmarks/bookmark_name_folder_controller.mm",
"cocoa/bookmarks/bookmark_tree_browser_cell.h",
"cocoa/bookmarks/bookmark_tree_browser_cell.mm",
"cocoa/browser/exclusive_access_controller_views.h",
@@ -153,8 +144,6 @@ split_static_library("ui") {
"cocoa/bubble_anchor_util_views_mac.mm",
"cocoa/bubble_combobox.h",
"cocoa/bubble_combobox.mm",
- "cocoa/bubble_sync_promo_controller.h",
- "cocoa/bubble_sync_promo_controller.mm",
"cocoa/bubble_view.h",
"cocoa/bubble_view.mm",
"cocoa/certificate_viewer_mac_cocoa.h",
@@ -187,30 +176,13 @@ split_static_library("ui") {
"cocoa/constrained_window/constrained_window_sheet_info.mm",
"cocoa/constrained_window/constrained_window_web_dialog_sheet.h",
"cocoa/constrained_window/constrained_window_web_dialog_sheet.mm",
- "cocoa/content_settings/blocked_plugin_bubble_controller.h",
- "cocoa/content_settings/blocked_plugin_bubble_controller.mm",
- "cocoa/content_settings/collected_cookies_mac.h",
- "cocoa/content_settings/collected_cookies_mac.mm",
- "cocoa/content_settings/content_setting_bubble_cocoa.h",
- "cocoa/content_settings/content_setting_bubble_cocoa.mm",
- "cocoa/content_settings/cookie_details.h",
- "cocoa/content_settings/cookie_details.mm",
- "cocoa/content_settings/cookie_details_view_controller.h",
- "cocoa/content_settings/cookie_details_view_controller.mm",
- "cocoa/content_settings/cookie_tree_node.h",
- "cocoa/content_settings/cookie_tree_node.mm",
- "cocoa/content_settings/cookies_tree_controller_bridge.h",
- "cocoa/content_settings/cookies_tree_controller_bridge.mm",
"cocoa/create_native_web_modal_manager_cocoa.mm",
"cocoa/dev_tools_controller.h",
"cocoa/dev_tools_controller.mm",
"cocoa/device_chooser_content_view_cocoa.h",
"cocoa/device_chooser_content_view_cocoa.mm",
- "cocoa/dialog_text_field_editor.h",
- "cocoa/dialog_text_field_editor.mm",
"cocoa/download/background_theme.h",
"cocoa/download/background_theme.mm",
- "cocoa/download/download_danger_prompt_impl.cc",
"cocoa/download/download_item_button.h",
"cocoa/download/download_item_button.mm",
"cocoa/download/download_item_cell.h",
@@ -250,27 +222,12 @@ split_static_library("ui") {
"cocoa/extensions/browser_actions_container_view.mm",
"cocoa/extensions/browser_actions_controller.h",
"cocoa/extensions/browser_actions_controller.mm",
- "cocoa/extensions/chooser_dialog_cocoa.h",
- "cocoa/extensions/chooser_dialog_cocoa.mm",
- "cocoa/extensions/chooser_dialog_cocoa_controller.h",
- "cocoa/extensions/chooser_dialog_cocoa_controller.mm",
"cocoa/extensions/extension_action_platform_delegate_cocoa.h",
"cocoa/extensions/extension_action_platform_delegate_cocoa.mm",
- "cocoa/extensions/extension_install_dialog_controller.h",
- "cocoa/extensions/extension_install_dialog_controller.mm",
- "cocoa/extensions/extension_install_view_controller.h",
- "cocoa/extensions/extension_install_view_controller.mm",
- "cocoa/extensions/extension_installed_bubble_controller.h",
- "cocoa/extensions/extension_installed_bubble_controller.mm",
"cocoa/extensions/extension_keybinding_registry_cocoa.h",
"cocoa/extensions/extension_keybinding_registry_cocoa.mm",
- "cocoa/extensions/extension_popup_controller.h",
- "cocoa/extensions/extension_popup_controller.mm",
"cocoa/extensions/extension_popup_views_mac.h",
"cocoa/extensions/extension_popup_views_mac.mm",
- "cocoa/extensions/extension_uninstall_dialog_cocoa.mm",
- "cocoa/extensions/extension_view_mac.h",
- "cocoa/extensions/extension_view_mac.mm",
"cocoa/extensions/media_galleries_dialog_cocoa.h",
"cocoa/extensions/media_galleries_dialog_cocoa.mm",
"cocoa/extensions/media_gallery_list_entry_view.h",
@@ -279,11 +236,6 @@ split_static_library("ui") {
"cocoa/extensions/toolbar_actions_bar_bubble_mac.mm",
"cocoa/extensions/toolbar_actions_bar_bubble_views_presenter.h",
"cocoa/extensions/toolbar_actions_bar_bubble_views_presenter.mm",
- "cocoa/extensions/windowed_install_dialog_controller.h",
- "cocoa/extensions/windowed_install_dialog_controller.mm",
- "cocoa/external_protocol_dialog.h",
- "cocoa/external_protocol_dialog_cocoa.mm",
- "cocoa/external_protocol_dialog_views_mac.mm",
"cocoa/fast_resize_view.h",
"cocoa/fast_resize_view.mm",
"cocoa/find_bar/find_bar_bridge.h",
@@ -320,9 +272,6 @@ split_static_library("ui") {
"cocoa/fullscreen_placeholder_view.mm",
"cocoa/fullscreen_window.h",
"cocoa/fullscreen_window.mm",
- "cocoa/global_error_bubble_controller.h",
- "cocoa/global_error_bubble_controller.mm",
- "cocoa/global_error_bubble_controller_views.mm",
"cocoa/gradient_button_cell.h",
"cocoa/gradient_button_cell.mm",
"cocoa/harmony_button.h",
@@ -424,18 +373,6 @@ split_static_library("ui") {
"cocoa/one_click_signin_dialog_controller.mm",
"cocoa/one_click_signin_view_controller.h",
"cocoa/one_click_signin_view_controller.mm",
- "cocoa/page_info/page_info_bubble_controller.h",
- "cocoa/page_info/page_info_bubble_controller.mm",
- "cocoa/page_info/page_info_utils_cocoa.h",
- "cocoa/page_info/page_info_utils_cocoa.mm",
- "cocoa/page_info/permission_selector_button.h",
- "cocoa/page_info/permission_selector_button.mm",
- "cocoa/page_info/split_block_button.h",
- "cocoa/page_info/split_block_button.mm",
- "cocoa/password_reuse_warning_dialog_cocoa.h",
- "cocoa/password_reuse_warning_dialog_cocoa.mm",
- "cocoa/password_reuse_warning_view_controller.h",
- "cocoa/password_reuse_warning_view_controller.mm",
"cocoa/permission_bubble/chooser_bubble_ui_cocoa.h",
"cocoa/permission_bubble/chooser_bubble_ui_cocoa.mm",
"cocoa/permission_bubble/chooser_bubble_ui_views_mac.mm",
@@ -482,8 +419,6 @@ split_static_library("ui") {
"cocoa/styled_text_field.mm",
"cocoa/styled_text_field_cell.h",
"cocoa/styled_text_field_cell.mm",
- "cocoa/subresource_filter/subresource_filter_bubble_controller.h",
- "cocoa/subresource_filter/subresource_filter_bubble_controller.mm",
"cocoa/tab_contents/favicon_util_mac.h",
"cocoa/tab_contents/favicon_util_mac.mm",
"cocoa/tab_contents/overlayable_contents_controller.h",
@@ -544,18 +479,14 @@ split_static_library("ui") {
"cocoa/toolbar/toolbar_view_cocoa.mm",
"cocoa/touchbar/credit_card_autofill_touch_bar_controller.h",
"cocoa/touchbar/credit_card_autofill_touch_bar_controller.mm",
- "cocoa/touchbar/suggested_text_touch_bar_controller.h",
- "cocoa/touchbar/suggested_text_touch_bar_controller.mm",
+ "cocoa/touchbar/text_suggestions_touch_bar_controller.h",
+ "cocoa/touchbar/text_suggestions_touch_bar_controller.mm",
"cocoa/touchbar/web_textfield_touch_bar_controller.h",
"cocoa/touchbar/web_textfield_touch_bar_controller.mm",
"cocoa/translate/translate_bubble_bridge_views.h",
"cocoa/translate/translate_bubble_bridge_views.mm",
- "cocoa/translate/translate_bubble_controller.h",
- "cocoa/translate/translate_bubble_controller.mm",
"cocoa/url_drop_target.h",
"cocoa/url_drop_target.mm",
- "cocoa/vertical_gradient_view.h",
- "cocoa/vertical_gradient_view.mm",
"cocoa/view_id_util.h",
"cocoa/view_id_util.mm",
"cocoa/view_resizer.h",
@@ -689,6 +620,8 @@ split_static_library("ui") {
"passwords/password_manager_presenter.h",
"passwords/password_ui_view.h",
"permission_bubble/permission_prompt.h",
+ "prefs/pref_watcher.cc",
+ "prefs/pref_watcher.h",
"prefs/prefs_tab_helper.cc",
"prefs/prefs_tab_helper.h",
"profile_chooser_constants.h",
@@ -844,6 +777,8 @@ split_static_library("ui") {
"webui/translate_internals/translate_internals_handler.h",
"webui/translate_internals/translate_internals_ui.cc",
"webui/translate_internals/translate_internals_ui.h",
+ "webui/ukm/ukm_internals_ui.cc",
+ "webui/ukm/ukm_internals_ui.h",
"webui/usb_internals/usb_internals_page_handler.cc",
"webui/usb_internals/usb_internals_page_handler.h",
"webui/usb_internals/usb_internals_ui.cc",
@@ -869,14 +804,6 @@ split_static_library("ui") {
allow_circular_includes_from = []
defines = []
- if (is_win) {
- # For version_ui.cc:
- if (use_lld) {
- defines += [ "CHROMIUM_LINKER_NAME=\"lld-link\"" ]
- } else {
- defines += [ "CHROMIUM_LINKER_NAME=\"link.exe\"" ]
- }
- }
libs = []
configs += [
@@ -963,6 +890,7 @@ split_static_library("ui") {
"//components/keyed_service/core",
"//components/language/core/browser",
"//components/language/core/common",
+ "//components/metrics_services_manager",
"//components/navigation_metrics",
"//components/net_log",
"//components/ntp_snippets",
@@ -1015,6 +943,7 @@ split_static_library("ui") {
"//components/ui_devtools",
"//components/ukm:ukm",
"//components/ukm/content",
+ "//components/ukm/debug:util",
"//components/undo",
"//components/unified_consent",
"//components/update_client",
@@ -1170,6 +1099,8 @@ split_static_library("ui") {
"android/infobars/instant_apps_infobar.h",
"android/infobars/near_oom_infobar.cc",
"android/infobars/near_oom_infobar.h",
+ "android/infobars/near_oom_reduction_infobar.cc",
+ "android/infobars/near_oom_reduction_infobar.h",
"android/infobars/permission_infobar.cc",
"android/infobars/permission_infobar.h",
"android/infobars/previews_infobar.cc",
@@ -1406,6 +1337,10 @@ split_static_library("ui") {
"media_router/media_router_ui_base.h",
"media_router/media_router_ui_helper.cc",
"media_router/media_router_ui_helper.h",
+ "media_router/media_router_ui_service.cc",
+ "media_router/media_router_ui_service.h",
+ "media_router/media_router_ui_service_factory.cc",
+ "media_router/media_router_ui_service_factory.h",
"media_router/media_sink_with_cast_modes.cc",
"media_router/media_sink_with_cast_modes.h",
"media_router/presentation_receiver_window.h",
@@ -1428,6 +1363,8 @@ split_static_library("ui") {
"omnibox/chrome_omnibox_navigation_observer.h",
"omnibox/clipboard_utils.cc",
"omnibox/clipboard_utils.h",
+ "omnibox/lookalike_url_navigation_observer.cc",
+ "omnibox/lookalike_url_navigation_observer.h",
"omnibox/omnibox_theme.cc",
"omnibox/omnibox_theme.h",
"page_action/page_action_icon_container.h",
@@ -1579,6 +1516,8 @@ split_static_library("ui") {
"webui/constrained_web_dialog_delegate_base.h",
"webui/devtools_ui.cc",
"webui/devtools_ui.h",
+ "webui/extensions/extensions_internals_source.cc",
+ "webui/extensions/extensions_internals_source.h",
"webui/extensions/extensions_ui.cc",
"webui/extensions/extensions_ui.h",
"webui/foreign_session_handler.cc",
@@ -1614,10 +1553,6 @@ split_static_library("ui") {
"webui/media_router/media_router_resources_provider.h",
"webui/media_router/media_router_ui.cc",
"webui/media_router/media_router_ui.h",
- "webui/media_router/media_router_ui_service.cc",
- "webui/media_router/media_router_ui_service.h",
- "webui/media_router/media_router_ui_service_factory.cc",
- "webui/media_router/media_router_ui_service_factory.h",
"webui/media_router/media_router_webui_message_handler.cc",
"webui/media_router/media_router_webui_message_handler.h",
"webui/media_router/web_contents_display_observer.h",
@@ -1763,14 +1698,16 @@ split_static_library("ui") {
"//ui/events",
]
+ if (use_ozone && !is_chromeos) {
+ deps += [ "//ui/ozone" ]
+ }
+
if (!toolkit_views) {
sources += [ "media_router/cloud_services_dialog.cc" ]
}
if (enable_extensions) {
deps += [
- # TODO(loyso): Remove the first dependency. http://crbug.com/862049
- "//chrome/browser/web_applications",
"//chrome/browser/web_applications/components",
"//chrome/browser/web_applications/extensions",
]
@@ -1787,6 +1724,7 @@ split_static_library("ui") {
if (is_chromeos) {
assert(enable_extensions)
assert(toolkit_views)
+ never_build_jumbo = true
sources += [
"app_list/app_sync_ui_state.cc",
"app_list/app_sync_ui_state.h",
@@ -1817,6 +1755,8 @@ split_static_library("ui") {
"ash/chrome_browser_main_extra_parts_ash.h",
"ash/chrome_keyboard_ui.cc",
"ash/chrome_keyboard_ui.h",
+ "ash/chrome_keyboard_web_contents.cc",
+ "ash/chrome_keyboard_web_contents.h",
"ash/chrome_launcher_prefs.cc",
"ash/chrome_launcher_prefs.h",
"ash/chrome_new_window_client.cc",
@@ -1848,6 +1788,8 @@ split_static_library("ui") {
"ash/launcher/chrome_launcher_controller.h",
"ash/launcher/chrome_launcher_controller_util.cc",
"ash/launcher/chrome_launcher_controller_util.h",
+ "ash/launcher/discover_window_observer.cc",
+ "ash/launcher/discover_window_observer.h",
"ash/launcher/extension_app_window_launcher_controller.cc",
"ash/launcher/extension_app_window_launcher_controller.h",
"ash/launcher/extension_app_window_launcher_item_controller.cc",
@@ -1894,16 +1836,14 @@ split_static_library("ui") {
"ash/network/network_portal_notification_controller.h",
"ash/network/network_state_notifier.cc",
"ash/network/network_state_notifier.h",
- "ash/network/networking_config_delegate_chromeos.cc",
- "ash/network/networking_config_delegate_chromeos.h",
"ash/network/tether_notification_presenter.cc",
"ash/network/tether_notification_presenter.h",
+ "ash/screen_orientation_delegate_chromeos.cc",
+ "ash/screen_orientation_delegate_chromeos.h",
"ash/session_controller_client.cc",
"ash/session_controller_client.h",
"ash/session_util.cc",
"ash/session_util.h",
- "ash/shell_state_client.cc",
- "ash/shell_state_client.h",
"ash/system_tray_client.cc",
"ash/system_tray_client.h",
"ash/tab_scrubber.cc",
@@ -1911,6 +1851,8 @@ split_static_library("ui") {
"ash/tablet_mode_client.cc",
"ash/tablet_mode_client.h",
"ash/tablet_mode_client_observer.h",
+ "ash/test_ime_controller.cc",
+ "ash/test_ime_controller.h",
"ash/volume_controller.cc",
"ash/volume_controller.h",
"ash/vpn_list_forwarder.cc",
@@ -1944,6 +1886,8 @@ split_static_library("ui") {
"views/frame/browser_non_client_frame_view_ash.h",
"views/frame/immersive_context_mus.cc",
"views/frame/immersive_context_mus.h",
+ "views/frame/immersive_focus_watcher_mus.cc",
+ "views/frame/immersive_focus_watcher_mus.h",
"views/frame/immersive_handler_factory_mus.cc",
"views/frame/immersive_handler_factory_mus.h",
"views/frame/immersive_mode_controller_ash.cc",
@@ -1963,14 +1907,12 @@ split_static_library("ui") {
"views/select_file_dialog_extension.h",
"views/select_file_dialog_extension_factory.cc",
"views/select_file_dialog_extension_factory.h",
- "views/tabs/window_finder_ash.cc",
"webui/chromeos/assistant_optin/assistant_optin_handler.cc",
"webui/chromeos/assistant_optin/assistant_optin_handler.h",
- "webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h",
"webui/chromeos/assistant_optin/assistant_optin_ui.cc",
"webui/chromeos/assistant_optin/assistant_optin_ui.h",
- "webui/chromeos/assistant_optin/confirm_reject_screen_handler.cc",
- "webui/chromeos/assistant_optin/confirm_reject_screen_handler.h",
+ "webui/chromeos/assistant_optin/assistant_optin_utils.cc",
+ "webui/chromeos/assistant_optin/assistant_optin_utils.h",
"webui/chromeos/assistant_optin/get_more_screen_handler.cc",
"webui/chromeos/assistant_optin/get_more_screen_handler.h",
"webui/chromeos/assistant_optin/ready_screen_handler.cc",
@@ -2015,6 +1957,8 @@ split_static_library("ui") {
"webui/chromeos/login/arc_kiosk_splash_screen_handler.h",
"webui/chromeos/login/arc_terms_of_service_screen_handler.cc",
"webui/chromeos/login/arc_terms_of_service_screen_handler.h",
+ "webui/chromeos/login/assistant_optin_flow_screen_handler.cc",
+ "webui/chromeos/login/assistant_optin_flow_screen_handler.h",
"webui/chromeos/login/auto_enrollment_check_screen_handler.cc",
"webui/chromeos/login/auto_enrollment_check_screen_handler.h",
"webui/chromeos/login/base_screen_handler.cc",
@@ -2037,6 +1981,15 @@ split_static_library("ui") {
"webui/chromeos/login/discover/discover_manager.h",
"webui/chromeos/login/discover/discover_ui.cc",
"webui/chromeos/login/discover/discover_ui.h",
+ "webui/chromeos/login/discover/discover_window_manager.cc",
+ "webui/chromeos/login/discover/discover_window_manager.h",
+ "webui/chromeos/login/discover/discover_window_manager_observer.h",
+ "webui/chromeos/login/discover/modules/discover_module_launch_help_app.cc",
+ "webui/chromeos/login/discover/modules/discover_module_launch_help_app.h",
+ "webui/chromeos/login/discover/modules/discover_module_redeem_offers.cc",
+ "webui/chromeos/login/discover/modules/discover_module_redeem_offers.h",
+ "webui/chromeos/login/discover/modules/discover_module_sync_files.cc",
+ "webui/chromeos/login/discover/modules/discover_module_sync_files.h",
"webui/chromeos/login/discover/modules/discover_module_welcome.cc",
"webui/chromeos/login/discover/modules/discover_module_welcome.h",
"webui/chromeos/login/discover_screen_handler.cc",
@@ -2051,6 +2004,8 @@ split_static_library("ui") {
"webui/chromeos/login/error_screen_handler.h",
"webui/chromeos/login/eula_screen_handler.cc",
"webui/chromeos/login/eula_screen_handler.h",
+ "webui/chromeos/login/fingerprint_setup_screen_handler.cc",
+ "webui/chromeos/login/fingerprint_setup_screen_handler.h",
"webui/chromeos/login/gaia_screen_handler.cc",
"webui/chromeos/login/gaia_screen_handler.h",
"webui/chromeos/login/hid_detection_screen_handler.cc",
@@ -2065,9 +2020,13 @@ split_static_library("ui") {
"webui/chromeos/login/kiosk_enable_screen_handler.h",
"webui/chromeos/login/l10n_util.cc",
"webui/chromeos/login/l10n_util.h",
+ "webui/chromeos/login/marketing_opt_in_screen_handler.cc",
+ "webui/chromeos/login/marketing_opt_in_screen_handler.h",
"webui/chromeos/login/native_window_delegate.h",
"webui/chromeos/login/network_dropdown_handler.cc",
"webui/chromeos/login/network_dropdown_handler.h",
+ "webui/chromeos/login/network_screen_handler.cc",
+ "webui/chromeos/login/network_screen_handler.h",
"webui/chromeos/login/network_state_informer.cc",
"webui/chromeos/login/network_state_informer.h",
"webui/chromeos/login/oobe_display_chooser.cc",
@@ -2112,6 +2071,8 @@ split_static_library("ui") {
"webui/chromeos/mobile_setup_ui.h",
"webui/chromeos/multidevice_setup/multidevice_setup_dialog.cc",
"webui/chromeos/multidevice_setup/multidevice_setup_dialog.h",
+ "webui/chromeos/multidevice_setup/multidevice_setup_handler.cc",
+ "webui/chromeos/multidevice_setup/multidevice_setup_handler.h",
"webui/chromeos/network_element_localized_strings_provider.cc",
"webui/chromeos/network_element_localized_strings_provider.h",
"webui/chromeos/network_ui.cc",
@@ -2199,8 +2160,12 @@ split_static_library("ui") {
"//chromeos/components/proximity_auth/logging",
"//chromeos/components/proximity_auth/webui",
"//chromeos/components/tether",
+ "//chromeos/resources:resources_grit",
"//chromeos/services/assistant/public/mojom",
"//chromeos/services/assistant/public/proto:proto",
+ "//chromeos/services/multidevice_setup/public/cpp:cpp",
+ "//chromeos/services/multidevice_setup/public/cpp:url_provider",
+ "//chromeos/services/multidevice_setup/public/mojom",
"//components/arc",
"//components/captive_portal",
"//components/consent_auditor:consent_auditor",
@@ -2213,8 +2178,8 @@ split_static_library("ui") {
"//services/data_decoder/public/cpp",
"//services/device/public/cpp:device_features",
"//services/device/public/mojom",
- "//services/ui/public/cpp",
- "//services/ui/public/interfaces",
+ "//services/ws/public/cpp",
+ "//services/ws/public/mojom",
"//ui/base/ime",
"//ui/chromeos",
"//ui/chromeos/events",
@@ -2224,10 +2189,6 @@ split_static_library("ui") {
]
allow_circular_includes_from += [ "//chrome/browser/chromeos" ]
- if (enable_rlz) {
- deps += [ "//chrome/browser:rlz" ]
- }
-
if (!is_official_build) {
sources += [
"webui/chromeos/emulator/device_emulator_message_handler.cc",
@@ -2371,10 +2332,11 @@ split_static_library("ui") {
sources += [
"input_method/input_method_engine.cc",
"input_method/input_method_engine.h",
- "views/confirm_quit_bubble.cc",
- "views/confirm_quit_bubble.h",
- "views/confirm_quit_bubble_controller.cc",
- "views/confirm_quit_bubble_controller.h",
+ "views/quit_instruction_bubble.cc",
+ "views/quit_instruction_bubble.h",
+ "views/quit_instruction_bubble_base.h",
+ "views/quit_instruction_bubble_controller.cc",
+ "views/quit_instruction_bubble_controller.h",
]
}
}
@@ -2444,9 +2406,6 @@ split_static_library("ui") {
"cocoa/confirm_quit_panel_controller.mm",
"cocoa/dock_icon.h",
"cocoa/dock_icon.mm",
- "cocoa/download/download_item_drag_mac.mm",
- "cocoa/download/download_util_mac.h",
- "cocoa/download/download_util_mac.mm",
"cocoa/first_run_dialog.h",
"cocoa/first_run_dialog.mm",
"cocoa/first_run_dialog_controller.h",
@@ -2470,6 +2429,8 @@ split_static_library("ui") {
"cocoa/l10n_util.mm",
"cocoa/last_active_browser_cocoa.cc",
"cocoa/last_active_browser_cocoa.h",
+ "cocoa/main_menu_builder.h",
+ "cocoa/main_menu_builder.mm",
"cocoa/md_hover_button.h",
"cocoa/md_hover_button.mm",
"cocoa/md_util.h",
@@ -2534,10 +2495,11 @@ split_static_library("ui") {
sources += cocoa_browser_sources
+ allow_circular_includes_from += [ "//chrome/browser/apps/app_shim" ]
+
deps += [
"//chrome/app/nibs:localizer_table",
"//chrome/browser/apps/app_shim",
- "//third_party/apple_sample_code",
"//third_party/google_toolbox_for_mac",
"//third_party/molokocacao",
"//third_party/mozilla",
@@ -2576,58 +2538,11 @@ split_static_library("ui") {
# are obsolete before mac_views_browser will ever ship, so they aren't
# linked in at all.
sources -= [
- "cocoa/bookmarks/bookmark_all_tabs_controller.h",
- "cocoa/bookmarks/bookmark_all_tabs_controller.mm",
- "cocoa/bookmarks/bookmark_bubble_controller.h",
- "cocoa/bookmarks/bookmark_bubble_controller.mm",
- "cocoa/bookmarks/bookmark_editor_base_controller.h",
- "cocoa/bookmarks/bookmark_editor_base_controller.mm",
- "cocoa/bookmarks/bookmark_editor_controller.h",
- "cocoa/bookmarks/bookmark_editor_controller.mm",
"cocoa/constrained_web_dialog_delegate_mac.mm",
- "cocoa/content_settings/blocked_plugin_bubble_controller.h",
- "cocoa/content_settings/blocked_plugin_bubble_controller.mm",
- "cocoa/content_settings/collected_cookies_mac.h",
- "cocoa/content_settings/collected_cookies_mac.mm",
- "cocoa/content_settings/content_setting_bubble_cocoa.h",
- "cocoa/content_settings/content_setting_bubble_cocoa.mm",
- "cocoa/content_settings/cookie_details.h",
- "cocoa/content_settings/cookie_details.mm",
- "cocoa/content_settings/cookie_details_view_controller.h",
- "cocoa/content_settings/cookie_details_view_controller.mm",
- "cocoa/content_settings/cookie_tree_node.h",
- "cocoa/content_settings/cookie_tree_node.mm",
- "cocoa/content_settings/cookies_tree_controller_bridge.h",
- "cocoa/content_settings/cookies_tree_controller_bridge.mm",
- "cocoa/download/download_danger_prompt_impl.cc",
- "cocoa/extensions/chooser_dialog_cocoa.h",
- "cocoa/extensions/chooser_dialog_cocoa.mm",
- "cocoa/extensions/chooser_dialog_cocoa_controller.h",
- "cocoa/extensions/chooser_dialog_cocoa_controller.mm",
- "cocoa/extensions/extension_install_dialog_controller.h",
- "cocoa/extensions/extension_install_dialog_controller.mm",
- "cocoa/extensions/extension_install_view_controller.h",
- "cocoa/extensions/extension_install_view_controller.mm",
- "cocoa/extensions/extension_installed_bubble_controller.h",
- "cocoa/extensions/extension_installed_bubble_controller.mm",
- "cocoa/extensions/extension_uninstall_dialog_cocoa.mm",
- "cocoa/extensions/windowed_install_dialog_controller.h",
- "cocoa/extensions/windowed_install_dialog_controller.mm",
- "cocoa/external_protocol_dialog_views_mac.mm",
- "cocoa/global_error_bubble_controller.h",
- "cocoa/global_error_bubble_controller.mm",
"cocoa/importer/import_lock_dialog_cocoa.mm",
"cocoa/login_handler_cocoa.h",
"cocoa/login_handler_cocoa.mm",
- "cocoa/page_info/page_info_bubble_controller.h",
- "cocoa/page_info/page_info_bubble_controller.mm",
- "cocoa/password_reuse_warning_dialog_cocoa.h",
- "cocoa/password_reuse_warning_dialog_cocoa.mm",
- "cocoa/password_reuse_warning_view_controller.h",
- "cocoa/password_reuse_warning_view_controller.mm",
"cocoa/simple_message_box_bridge_views.mm",
- "cocoa/subresource_filter/subresource_filter_bubble_controller.h",
- "cocoa/subresource_filter/subresource_filter_bubble_controller.mm",
]
}
} else { # non-Mac.
@@ -2837,9 +2752,15 @@ split_static_library("ui") {
"autofill/local_card_migration_bubble.h",
"autofill/local_card_migration_bubble_controller_impl.cc",
"autofill/local_card_migration_bubble_controller_impl.h",
+ "autofill/local_card_migration_dialog.h",
+ "autofill/local_card_migration_dialog_controller_impl.cc",
+ "autofill/local_card_migration_dialog_controller_impl.h",
+ "autofill/local_card_migration_dialog_factory.h",
+ "autofill/local_card_migration_dialog_state.h",
"autofill/save_card_bubble_controller_impl.cc",
"autofill/save_card_bubble_controller_impl.h",
"autofill/save_card_bubble_view.h",
+ "autofill/save_card_ui.h",
"bubble_anchor_util.h",
"desktop_ios_promotion/desktop_ios_promotion_footnote_delegate.h",
@@ -2874,8 +2795,18 @@ split_static_library("ui") {
"views/autofill/card_unmask_prompt_views.h",
"views/autofill/local_card_migration_bubble_views.cc",
"views/autofill/local_card_migration_bubble_views.h",
+ "views/autofill/local_card_migration_dialog_view.cc",
+ "views/autofill/local_card_migration_dialog_view.h",
+ "views/autofill/migratable_card_view.cc",
+ "views/autofill/migratable_card_view.h",
"views/autofill/save_card_bubble_views.cc",
"views/autofill/save_card_bubble_views.h",
+ "views/autofill/save_card_manage_cards_bubble_views.cc",
+ "views/autofill/save_card_manage_cards_bubble_views.h",
+ "views/autofill/save_card_offer_bubble_views.cc",
+ "views/autofill/save_card_offer_bubble_views.h",
+ "views/autofill/save_card_sign_in_promo_bubble_views.cc",
+ "views/autofill/save_card_sign_in_promo_bubble_views.h",
"views/autofill/view_util.cc",
"views/autofill/view_util.h",
"views/bookmarks/bookmark_bubble_view.cc",
@@ -2883,12 +2814,20 @@ split_static_library("ui") {
"views/bookmarks/bookmark_editor_view.cc",
"views/bookmarks/bookmark_editor_view.h",
"views/bubble_anchor_util_views.h",
+ "views/bulleted_label_list_view.cc",
+ "views/bulleted_label_list_view.h",
"views/chrome_browser_main_extra_parts_views.cc",
"views/chrome_browser_main_extra_parts_views.h",
"views/chrome_constrained_window_views_client.cc",
"views/chrome_constrained_window_views_client.h",
+ "views/chrome_layout_provider.cc",
+ "views/chrome_layout_provider.h",
"views/chrome_platform_style.cc",
"views/chrome_platform_style.h",
+ "views/chrome_typography.cc",
+ "views/chrome_typography.h",
+ "views/chrome_typography_provider.cc",
+ "views/chrome_typography_provider.h",
"views/chrome_views_delegate.cc",
"views/chrome_views_delegate.h",
"views/collected_cookies_views.cc",
@@ -2934,20 +2873,6 @@ split_static_library("ui") {
"views/fullscreen_control/fullscreen_control_view.h",
"views/global_error_bubble_view.cc",
"views/global_error_bubble_view.h",
- "views/harmony/bulleted_label_list_view.cc",
- "views/harmony/bulleted_label_list_view.h",
- "views/harmony/chrome_layout_provider.cc",
- "views/harmony/chrome_layout_provider.h",
- "views/harmony/chrome_typography.cc",
- "views/harmony/chrome_typography.h",
- "views/harmony/harmony_layout_provider.cc",
- "views/harmony/harmony_layout_provider.h",
- "views/harmony/harmony_typography_provider.cc",
- "views/harmony/harmony_typography_provider.h",
- "views/harmony/material_refresh_layout_provider.cc",
- "views/harmony/material_refresh_layout_provider.h",
- "views/harmony/textfield_layout.cc",
- "views/harmony/textfield_layout.h",
"views/hover_button.cc",
"views/hover_button.h",
"views/importer/import_lock_dialog_view.cc",
@@ -2959,8 +2884,12 @@ split_static_library("ui") {
"views/login_handler_views.cc",
"views/login_view.cc",
"views/login_view.h",
+ "views/material_refresh_layout_provider.cc",
+ "views/material_refresh_layout_provider.h",
"views/overlay/close_image_button.cc",
"views/overlay/close_image_button.h",
+ "views/overlay/control_image_button.cc",
+ "views/overlay/control_image_button.h",
"views/overlay/overlay_window_views.cc",
"views/overlay/overlay_window_views.h",
"views/page_info/chosen_object_view.cc",
@@ -3038,6 +2967,16 @@ split_static_library("ui") {
"views/permission_bubble/chooser_bubble_ui.h",
"views/permission_bubble/permission_prompt_impl.cc",
"views/permission_bubble/permission_prompt_impl.h",
+ "views/relaunch_notification/relaunch_notification_controller.cc",
+ "views/relaunch_notification/relaunch_notification_controller.h",
+ "views/relaunch_notification/relaunch_notification_metrics.cc",
+ "views/relaunch_notification/relaunch_notification_metrics.h",
+ "views/relaunch_notification/relaunch_recommended_timer.cc",
+ "views/relaunch_notification/relaunch_recommended_timer.h",
+ "views/relaunch_notification/relaunch_required_timer.cc",
+ "views/relaunch_notification/relaunch_required_timer.h",
+ "views/relaunch_notification/relaunch_required_timer_internal.cc",
+ "views/relaunch_notification/relaunch_required_timer_internal.h",
"views/safe_browsing/password_reuse_modal_warning_dialog.cc",
"views/safe_browsing/password_reuse_modal_warning_dialog.h",
"views/session_crashed_bubble_view.cc",
@@ -3052,6 +2991,8 @@ split_static_library("ui") {
"views/sync/profile_signin_confirmation_dialog_views.h",
"views/task_manager_view.cc",
"views/task_manager_view.h",
+ "views/textfield_layout.cc",
+ "views/textfield_layout.h",
"views/toolbar/toolbar_actions_bar_bubble_views.cc",
"views/toolbar/toolbar_actions_bar_bubble_views.h",
"views/touch_uma/touch_uma.cc",
@@ -3071,15 +3012,19 @@ split_static_library("ui") {
"views/webauthn/transport_list_view.cc",
"views/webauthn/transport_list_view.h",
"webauthn/authenticator_request_sheet_model.h",
+ "webauthn/other_transports_menu_model.cc",
+ "webauthn/other_transports_menu_model.h",
"webauthn/sheet_models.cc",
"webauthn/sheet_models.h",
+ "webauthn/transport_utils.cc",
+ "webauthn/transport_utils.h",
]
deps += [
"//chrome/browser/ui/views",
"//components/constrained_window",
"//components/payments/content",
"//components/payments/core",
- "//services/ui/public/cpp/input_devices",
+ "//services/ws/public/cpp/input_devices",
]
allow_circular_includes_from += [ "//chrome/browser/ui/views" ]
@@ -3109,8 +3054,6 @@ split_static_library("ui") {
"views/ime_driver/remote_text_input_client.h",
"views/ime_driver/simple_input_method.cc",
"views/ime_driver/simple_input_method.h",
- "views/tabs/window_finder_mus.cc",
- "views/tabs/window_finder_mus.h",
]
deps += [ "//ui/views/mus" ]
@@ -3150,7 +3093,6 @@ split_static_library("ui") {
"views/bubble_anchor_util_views.cc",
"views/certificate_selector.cc",
"views/certificate_selector.h",
- "views/chrome_javascript_native_dialog_factory_views.cc",
"views/chrome_web_dialog_view.cc",
"views/constrained_web_dialog_delegate_views.cc",
"views/download/download_feedback_dialog_view.cc",
@@ -3205,6 +3147,8 @@ split_static_library("ui") {
"views/frame/hosted_app_button_container.h",
"views/frame/hosted_app_menu_button.cc",
"views/frame/hosted_app_menu_button.h",
+ "views/frame/hosted_app_origin_text.cc",
+ "views/frame/hosted_app_origin_text.h",
"views/frame/immersive_mode_controller.cc",
"views/frame/immersive_mode_controller.h",
"views/frame/immersive_mode_controller_factory_views.cc",
@@ -3265,6 +3209,8 @@ split_static_library("ui") {
"views/media_router/cast_dialog_sink_button.h",
"views/media_router/cast_dialog_view.cc",
"views/media_router/cast_dialog_view.h",
+ "views/media_router/cast_toolbar_button.cc",
+ "views/media_router/cast_toolbar_button.h",
"views/media_router/cloud_services_dialog_view.cc",
"views/media_router/cloud_services_dialog_view.h",
"views/media_router/media_remoting_dialog_view.cc",
@@ -3353,7 +3299,6 @@ split_static_library("ui") {
"views/tabs/tab_strip_controller.h",
"views/tabs/tab_strip_layout.cc",
"views/tabs/tab_strip_layout.h",
- "views/tabs/window_finder.cc",
"views/tabs/window_finder.h",
"views/theme_copying_widget.cc",
"views/theme_copying_widget.h",
@@ -3422,13 +3367,14 @@ split_static_library("ui") {
"views/profiles/forced_reauthentication_dialog_view.h",
"views/sync/one_click_signin_dialog_view.cc",
"views/sync/one_click_signin_dialog_view.h",
+ "views/tabs/window_finder.cc",
]
}
if (use_aura) {
deps += [
- "//services/ui/public/cpp",
- "//services/ui/public/interfaces",
+ "//services/ws/public/cpp",
+ "//services/ws/public/mojom",
]
}
}
@@ -3487,22 +3433,30 @@ split_static_library("ui") {
}
}
- if (!is_chromeos) {
+ if (is_chromeos) {
+ sources += [
+ "views/relaunch_notification/relaunch_notification_controller_platform_impl_chromeos.cc",
+ "views/relaunch_notification/relaunch_notification_controller_platform_impl_chromeos.h",
+ ]
+ } else {
sources += [
- "views/relaunch_notification/relaunch_notification_controller.cc",
- "views/relaunch_notification/relaunch_notification_controller.h",
+ "views/relaunch_notification/relaunch_notification_controller_platform_impl_desktop.cc",
+ "views/relaunch_notification/relaunch_notification_controller_platform_impl_desktop.h",
"views/relaunch_notification/relaunch_recommended_bubble_view.cc",
"views/relaunch_notification/relaunch_recommended_bubble_view.h",
"views/relaunch_notification/relaunch_required_dialog_view.cc",
"views/relaunch_notification/relaunch_required_dialog_view.h",
"views/screen_capture_notification_ui_views.cc",
]
- if (is_mac) {
- sources += [
- "views/relaunch_notification/get_app_menu_anchor_point.h",
- "views/relaunch_notification/get_app_menu_anchor_point.mm",
- ]
- }
+ }
+
+ if (is_mac) {
+ sources += [
+ "views/policy/enterprise_startup_dialog_mac_util.h",
+ "views/policy/enterprise_startup_dialog_mac_util.mm",
+ "views/relaunch_notification/get_app_menu_anchor_point.h",
+ "views/relaunch_notification/get_app_menu_anchor_point.mm",
+ ]
}
if (is_chrome_branded) {
@@ -3675,6 +3629,10 @@ split_static_library("ui") {
"app_list/search/search_provider.h",
"app_list/search/search_resource_manager.cc",
"app_list/search/search_resource_manager.h",
+ "app_list/search/search_result_ranker/app_launch_predictor.cc",
+ "app_list/search/search_result_ranker/app_launch_predictor.h",
+ "app_list/search/search_result_ranker/app_search_result_ranker.cc",
+ "app_list/search/search_result_ranker/app_search_result_ranker.h",
"app_list/search/search_util.cc",
"app_list/search/search_util.h",
"app_list/search/search_webstore_result.cc",
@@ -3709,6 +3667,8 @@ split_static_library("ui") {
"app_list/arc/arc_app_dialog.h",
"app_list/arc/arc_app_icon.cc",
"app_list/arc/arc_app_icon.h",
+ "app_list/arc/arc_app_icon_descriptor.cc",
+ "app_list/arc/arc_app_icon_descriptor.h",
"app_list/arc/arc_app_icon_loader.cc",
"app_list/arc/arc_app_icon_loader.h",
"app_list/arc/arc_app_item.cc",
@@ -3808,6 +3768,8 @@ split_static_library("ui") {
"views/crostini/crostini_installer_view.h",
"views/crostini/crostini_uninstaller_view.cc",
"views/crostini/crostini_uninstaller_view.h",
+ "views/crostini/crostini_upgrade_view.cc",
+ "views/crostini/crostini_upgrade_view.h",
]
deps += [ "//mash/common" ]
}
@@ -3839,7 +3801,8 @@ split_static_library("ui") {
if (enable_extensions) {
deps += [
"//apps",
- "//chrome/browser/apps/platform_apps",
+ "//chrome/browser/apps",
+ "//chrome/browser/apps/platform_apps", # TODO(loyso): Remove this dep.
"//chrome/browser/extensions",
"//chrome/common/extensions/api",
"//components/drive",
@@ -3919,6 +3882,7 @@ split_static_library("ui") {
}
if (use_aura) {
sources += [
+ "views/chrome_javascript_native_dialog_factory_views.cc",
"views/extensions/extension_popup_aura.cc",
"views/extensions/extension_popup_aura.h",
]
@@ -3935,7 +3899,11 @@ split_static_library("ui") {
}
if (is_win && is_chrome_branded) {
- deps += [ "//components/nux_google_apps:nux_google_apps_feature" ]
+ deps += [
+ "//components/nux:constants",
+ "//components/nux:email_feature",
+ "//components/nux:google_apps_feature",
+ ]
}
if (enable_plugins) {
@@ -3971,6 +3939,8 @@ split_static_library("ui") {
"webui/print_preview/extension_printer_handler.h",
"webui/print_preview/pdf_printer_handler.cc",
"webui/print_preview/pdf_printer_handler.h",
+ "webui/print_preview/policy_settings.cc",
+ "webui/print_preview/policy_settings.h",
"webui/print_preview/print_preview_handler.cc",
"webui/print_preview/print_preview_handler.h",
"webui/print_preview/print_preview_ui.cc",
@@ -4017,7 +3987,6 @@ split_static_library("ui") {
if (safe_browsing_mode == 1) {
deps += [
- "//chrome/browser/safe_browsing:chunk_proto",
"//chrome/browser/ui/webui/reset_password:mojo_bindings",
"//chrome/common/safe_browsing:proto",
"//components/safe_browsing:csd_proto",
diff --git a/chromium/chrome/browser/ui/libgtkui/BUILD.gn b/chromium/chrome/browser/ui/libgtkui/BUILD.gn
index de40baffe51..3932e0c8521 100644
--- a/chromium/chrome/browser/ui/libgtkui/BUILD.gn
+++ b/chromium/chrome/browser/ui/libgtkui/BUILD.gn
@@ -8,155 +8,122 @@ import("//build/config/features.gni")
import("//build/config/linux/gtk/gtk.gni")
import("//printing/buildflags/buildflags.gni")
-# Automatically depends on the GTK version associated with the current build
-# flags.
-group("libgtkui") {
- if (use_gtk3) {
- public_deps = [
- ":libgtk3ui",
- ]
- } else {
- public_deps = [
- ":libgtk2ui",
+component("libgtkui") {
+ sources = [
+ "app_indicator_icon.cc",
+ "app_indicator_icon.h",
+ "app_indicator_icon_menu.cc",
+ "app_indicator_icon_menu.h",
+ "chrome_gtk_menu_subclasses.cc",
+ "chrome_gtk_menu_subclasses.h",
+ "gtk_background_painter.cc",
+ "gtk_background_painter.h",
+ "gtk_event_loop.cc",
+ "gtk_event_loop.h",
+ "gtk_key_bindings_handler.cc",
+ "gtk_key_bindings_handler.h",
+ "gtk_signal.h",
+ "gtk_ui.cc",
+ "gtk_ui.h",
+ "gtk_util.cc",
+ "gtk_util.h",
+ "libgtkui_export.h",
+ "menu_util.cc",
+ "menu_util.h",
+ "native_theme_gtk.cc",
+ "native_theme_gtk.h",
+ "nav_button_provider_gtk.cc",
+ "nav_button_provider_gtk.h",
+ "print_dialog_gtk.cc",
+ "print_dialog_gtk.h",
+ "printing_gtk_util.cc",
+ "printing_gtk_util.h",
+ "select_file_dialog_impl.cc",
+ "select_file_dialog_impl.h",
+ "select_file_dialog_impl_gtk.cc",
+ "select_file_dialog_impl_gtk.h",
+ "select_file_dialog_impl_kde.cc",
+ "settings_provider.h",
+ "settings_provider_gtk.cc",
+ "settings_provider_gtk.h",
+ "skia_utils_gtk.cc",
+ "skia_utils_gtk.h",
+ "unity_service.cc",
+ "unity_service.h",
+ "x11_input_method_context_impl_gtk.cc",
+ "x11_input_method_context_impl_gtk.h",
+ ]
+
+ if (gtk_version <= 3) {
+ sources += [
+ "gtk_status_icon.cc",
+ "gtk_status_icon.h",
]
}
-}
-template("libgtkui") {
- component(target_name) {
- sources = invoker.sources + [
- "app_indicator_icon.cc",
- "app_indicator_icon.h",
- "app_indicator_icon_menu.cc",
- "app_indicator_icon_menu.h",
- "chrome_gtk_frame.cc",
- "chrome_gtk_frame.h",
- "chrome_gtk_menu_subclasses.cc",
- "chrome_gtk_menu_subclasses.h",
- "gtk_event_loop.cc",
- "gtk_event_loop.h",
- "gtk_key_bindings_handler.cc",
- "gtk_key_bindings_handler.h",
- "gtk_signal.h",
- "gtk_status_icon.cc",
- "gtk_status_icon.h",
- "gtk_ui.cc",
- "gtk_ui.h",
- "gtk_util.cc",
- "gtk_util.h",
- "libgtkui_export.h",
- "menu_util.cc",
- "menu_util.h",
- "settings_provider.h",
- "print_dialog_gtk.cc",
- "print_dialog_gtk.h",
- "printing_gtk_util.cc",
- "printing_gtk_util.h",
- "select_file_dialog_impl.cc",
- "select_file_dialog_impl.h",
- "select_file_dialog_impl_gtk.cc",
- "select_file_dialog_impl_gtk.h",
- "select_file_dialog_impl_kde.cc",
- "skia_utils_gtk.cc",
- "skia_utils_gtk.h",
- "unity_service.cc",
- "unity_service.h",
- "x11_input_method_context_impl_gtk.cc",
- "x11_input_method_context_impl_gtk.h",
- ]
+ configs += [
+ "//build/config/linux/pangocairo",
+ "//build/config/linux:x11",
+ ]
- configs += [
- "//build/config/linux/pangocairo",
- "//build/config/linux:x11",
+ if (use_gio) {
+ sources += [
+ "settings_provider_gsettings.cc",
+ "settings_provider_gsettings.h",
]
+ configs += [ "//build/linux:gio_config" ]
+ }
- if (use_gio) {
- sources += [
- "settings_provider_gsettings.cc",
- "settings_provider_gsettings.h",
- ]
- configs += [ "//build/linux:gio_config" ]
- }
-
- if (use_cups) {
- configs += [ "//printing:cups" ]
- }
-
- defines = [ "LIBGTKUI_IMPLEMENTATION" ]
+ if (use_cups) {
+ configs += [ "//printing:cups" ]
+ }
- deps = invoker.deps + [
- "//chrome/browser/ui/views",
- "//chrome/common:constants",
- "//base",
- "//base:i18n",
- "//base/third_party/dynamic_annotations",
- "//cc/paint",
- "//chrome/common:buildflags",
- "//chrome:extra_resources",
- "//chrome:resources",
- "//chrome:strings",
- "//chrome/app:command_ids",
- "//chrome/app/theme:theme_resources",
- "//components/prefs",
- "//components/resources",
- "//content/public/browser",
- "//printing",
- "//skia",
+ defines = [ "LIBGTKUI_IMPLEMENTATION" ]
- # GTK pulls pangoft2, which requires HarfBuzz symbols. When linking
- # our own HarfBuzz avoid mixing symbols from system HarfBuzz and
- # our own through the indirect dependency to harfbuzz-ng here.
- "//third_party:freetype_harfbuzz",
- "//ui/aura",
- "//ui/base",
- "//ui/base/ime",
- "//ui/display",
- "//ui/events",
- "//ui/events:dom_keyboard_layout",
- "//ui/events:dom_keycode_converter",
- "//ui/events:events_base",
- "//ui/events/platform/x11",
- "//ui/gfx",
- "//ui/gfx/geometry",
- "//ui/gfx/x",
- "//ui/native_theme",
- "//ui/resources",
- "//ui/shell_dialogs",
- "//ui/strings",
- "//ui/views",
- ]
- public_deps = [
- "//chrome/browser:theme_properties",
- ]
- }
-}
+ deps = [
+ "//base",
+ "//base:i18n",
+ "//base/third_party/dynamic_annotations",
+ "//build/config/linux/gtk",
+ "//build/config/linux/gtk:gtkprint",
+ "//cc/paint",
+ "//chrome:extra_resources",
+ "//chrome:resources",
+ "//chrome:strings",
+ "//chrome/app:command_ids",
+ "//chrome/app/theme:theme_resources",
+ "//chrome/browser/ui/views",
+ "//chrome/common:buildflags",
+ "//chrome/common:constants",
+ "//components/prefs",
+ "//components/resources",
+ "//content/public/browser",
+ "//printing",
+ "//skia",
-if (use_gtk3) {
- libgtkui("libgtk3ui") {
- sources = [
- "gtk3_background_painter.cc",
- "gtk3_background_painter.h",
- "native_theme_gtk3.cc",
- "native_theme_gtk3.h",
- "nav_button_provider_gtk3.cc",
- "nav_button_provider_gtk3.h",
- "settings_provider_gtk3.cc",
- "settings_provider_gtk3.h",
- ]
- deps = [
- "//build/config/linux/gtk3",
- "//build/config/linux/gtk3:gtkprint3",
- ]
- }
-} else {
- libgtkui("libgtk2ui") {
- sources = [
- "native_theme_gtk2.cc",
- "native_theme_gtk2.h",
- ]
- deps = [
- "//build/config/linux/gtk2",
- "//build/config/linux/gtk2:gtkprint2",
- ]
- }
+ # GTK pulls pangoft2, which requires HarfBuzz symbols. When linking
+ # our own HarfBuzz avoid mixing symbols from system HarfBuzz and
+ # our own through the indirect dependency to harfbuzz-ng here.
+ "//third_party:freetype_harfbuzz",
+ "//ui/aura",
+ "//ui/base",
+ "//ui/base/ime",
+ "//ui/display",
+ "//ui/events",
+ "//ui/events:dom_keyboard_layout",
+ "//ui/events:dom_keycode_converter",
+ "//ui/events:events_base",
+ "//ui/events/platform/x11",
+ "//ui/gfx",
+ "//ui/gfx/geometry",
+ "//ui/gfx/x",
+ "//ui/native_theme",
+ "//ui/resources",
+ "//ui/shell_dialogs",
+ "//ui/strings",
+ "//ui/views",
+ ]
+ public_deps = [
+ "//chrome/browser:theme_properties",
+ ]
}
diff --git a/chromium/chrome/browser/ui/webui/DEPS b/chromium/chrome/browser/ui/webui/DEPS
index ab5553d0edf..1c49a311295 100644
--- a/chromium/chrome/browser/ui/webui/DEPS
+++ b/chromium/chrome/browser/ui/webui/DEPS
@@ -1,14 +1,6 @@
include_rules = [
# TODO(mash): Remove. http://crbug.com/628715
"+ash/strings",
- "+components/about_ui",
- "+components/invalidation",
- "+components/onc",
- "+components/proximity_auth",
- "+components/sync/engine/events",
- "+components/sync/sessions",
- "+components/sync/base/weak_handle.h",
- "+components/sync/js",
"+device/bluetooth",
"+extensions/strings/grit/extensions_strings.h",
@@ -19,8 +11,4 @@ include_rules = [
"+third_party/angle", # For ANGLE version.
"+third_party/brotli", # For compressed resources.
"+third_party/zlib/zlib.h", # For compression level constants.
-
- # DOM Distiller.
- "+components/dom_distiller/core",
- "+components/dom_distiller/webui",
]
diff --git a/chromium/chrome/browser/ui/webui/about_ui.cc b/chromium/chrome/browser/ui/webui/about_ui.cc
index 6153c0f51c9..f17784247a4 100644
--- a/chromium/chrome/browser/ui/webui/about_ui.cc
+++ b/chromium/chrome/browser/ui/webui/about_ui.cc
@@ -31,9 +31,9 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/sys_info.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
+#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread.h"
-#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/about_flags.h"
@@ -136,7 +136,8 @@ class ChromeOSTermsHandler
}
void LoadOemEulaFileAsync() {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(
+ base::BlockingType::MAY_BLOCK);
const chromeos::StartupCustomizationDocument* customization =
chromeos::StartupCustomizationDocument::GetInstance();
@@ -153,7 +154,8 @@ class ChromeOSTermsHandler
}
void LoadEulaFileAsync() {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(
+ base::BlockingType::MAY_BLOCK);
std::string file_path =
base::StringPrintf(chrome::kEULAPathFormat, locale_.c_str());
@@ -223,7 +225,7 @@ class ChromeOSCreditsHandler
}
// Load local Chrome OS credits from the disk.
base::PostTaskWithTraitsAndReply(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&ChromeOSCreditsHandler::LoadCreditsFileAsync, this),
base::Bind(&ChromeOSCreditsHandler::ResponseOnUIThread, this));
}
diff --git a/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc b/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc
index d804302e241..3bb63dbd340 100644
--- a/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc
+++ b/chromium/chrome/browser/ui/webui/app_launcher_page_ui.cc
@@ -55,9 +55,9 @@ AppLauncherPageUI::AppLauncherPageUI(content::WebUI* web_ui)
// earlier.
web_ui->AddMessageHandler(std::make_unique<ThemeHandler>());
- std::unique_ptr<HTMLSource> html_source(
- new HTMLSource(GetProfile()->GetOriginalProfile()));
- content::URLDataSource::Add(GetProfile(), html_source.release());
+ content::URLDataSource::Add(
+ GetProfile(),
+ std::make_unique<HTMLSource>(GetProfile()->GetOriginalProfile()));
}
AppLauncherPageUI::~AppLauncherPageUI() {
diff --git a/chromium/chrome/browser/ui/webui/browsing_history_handler.cc b/chromium/chrome/browser/ui/webui/browsing_history_handler.cc
index 4b542481235..73a0891dcac 100644
--- a/chromium/chrome/browser/ui/webui/browsing_history_handler.cc
+++ b/chromium/chrome/browser/ui/webui/browsing_history_handler.cc
@@ -245,7 +245,8 @@ void BrowsingHistoryHandler::RegisterMessages() {
this, local_history, sync_service);
// Create our favicon data source.
- content::URLDataSource::Add(profile, new FaviconSource(profile));
+ content::URLDataSource::Add(profile,
+ std::make_unique<FaviconSource>(profile));
web_ui()->RegisterMessageCallback(
"queryHistory",
diff --git a/chromium/chrome/browser/ui/webui/browsing_history_handler_unittest.cc b/chromium/chrome/browser/ui/webui/browsing_history_handler_unittest.cc
index d789c144fe7..e73ade2e2e0 100644
--- a/chromium/chrome/browser/ui/webui/browsing_history_handler_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/browsing_history_handler_unittest.cc
@@ -61,21 +61,25 @@ class TestSyncService : public browser_sync::TestProfileSyncService {
explicit TestSyncService(Profile* profile)
: browser_sync::TestProfileSyncService(
CreateProfileSyncServiceParamsForTest(profile)),
- state_(State::ACTIVE) {}
+ state_(TransportState::ACTIVE) {}
- State GetState() const override { return state_; }
+ TransportState GetTransportState() const override { return state_; }
+
+ int GetDisableReasons() const override { return DISABLE_REASON_NONE; }
+
+ bool IsFirstSetupComplete() const override { return true; }
syncer::ModelTypeSet GetActiveDataTypes() const override {
return syncer::ModelTypeSet::All();
}
- void SetState(State state) {
+ void SetTransportState(TransportState state) {
state_ = state;
NotifyObservers();
}
private:
- State state_;
+ TransportState state_;
DISALLOW_COPY_AND_ASSIGN(TestSyncService);
};
@@ -169,7 +173,8 @@ TEST_F(BrowsingHistoryHandlerTest, ObservingWebHistoryDeletions) {
// BrowsingHistoryHandler is informed about WebHistoryService history
// deletions.
{
- sync_service()->SetState(syncer::SyncService::State::ACTIVE);
+ sync_service()->SetTransportState(
+ syncer::SyncService::TransportState::ACTIVE);
BrowsingHistoryHandlerWithWebUIForTesting handler(web_ui());
handler.RegisterMessages();
@@ -184,10 +189,12 @@ TEST_F(BrowsingHistoryHandlerTest, ObservingWebHistoryDeletions) {
// BrowsingHistoryHandler will be informed about WebHistoryService deletions
// even if history sync is activated later.
{
- sync_service()->SetState(syncer::SyncService::State::INITIALIZING);
+ sync_service()->SetTransportState(
+ syncer::SyncService::TransportState::INITIALIZING);
BrowsingHistoryHandlerWithWebUIForTesting handler(web_ui());
handler.RegisterMessages();
- sync_service()->SetState(syncer::SyncService::State::ACTIVE);
+ sync_service()->SetTransportState(
+ syncer::SyncService::TransportState::ACTIVE);
web_history_service()->ExpireHistoryBetween(
std::set<GURL>(), base::Time(), base::Time::Max(), callback,
@@ -200,7 +207,8 @@ TEST_F(BrowsingHistoryHandlerTest, ObservingWebHistoryDeletions) {
// BrowsingHistoryHandler does not fire historyDeleted while a web history
// delete request is happening.
{
- sync_service()->SetState(syncer::SyncService::State::ACTIVE);
+ sync_service()->SetTransportState(
+ syncer::SyncService::TransportState::ACTIVE);
BrowsingHistoryHandlerWithWebUIForTesting handler(web_ui());
handler.RegisterMessages();
@@ -222,7 +230,8 @@ TEST_F(BrowsingHistoryHandlerTest, ObservingWebHistoryDeletions) {
// deletions. The WebHistoryService object still exists (because it's a
// BrowserContextKeyedService), but is not visible to BrowsingHistoryHandler.
{
- sync_service()->SetState(syncer::SyncService::State::INITIALIZING);
+ sync_service()->SetTransportState(
+ syncer::SyncService::TransportState::INITIALIZING);
BrowsingHistoryHandlerWithWebUIForTesting handler(web_ui());
handler.RegisterMessages();
diff --git a/chromium/chrome/browser/ui/webui/certificates_handler.cc b/chromium/chrome/browser/ui/webui/certificates_handler.cc
index 71beb63980b..57ccbca195b 100644
--- a/chromium/chrome/browser/ui/webui/certificates_handler.cc
+++ b/chromium/chrome/browser/ui/webui/certificates_handler.cc
@@ -21,8 +21,8 @@
#include "base/posix/safe_strerror.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/task_scheduler/task_traits.h"
+#include "base/task/post_task.h"
+#include "base/task/task_traits.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
@@ -42,11 +42,6 @@
#include "net/der/parser.h"
#include "ui/base/l10n/l10n_util.h"
-#if defined(OS_CHROMEOS)
-#include "chrome/browser/chromeos/policy/user_network_configuration_updater.h"
-#include "chrome/browser/chromeos/policy/user_network_configuration_updater_factory.h"
-#endif
-
using base::UTF8ToUTF16;
namespace {
@@ -57,10 +52,13 @@ static const char kCertificatesHandlerExtractableField[] = "extractable";
static const char kCertificatesHandlerKeyField[] = "id";
static const char kCertificatesHandlerNameField[] = "name";
static const char kCertificatesHandlerObjSignField[] = "objSign";
-static const char kCertificatesHandlerPolicyField[] = "policy";
+static const char kCertificatesHandlerPolicyInstalledField[] = "policy";
+static const char kCertificatesHandlerWebTrustAnchorField[] = "webTrustAnchor";
static const char kCertificatesHandlerReadonlyField[] = "readonly";
static const char kCertificatesHandlerSslField[] = "ssl";
static const char kCertificatesHandlerSubnodesField[] = "subnodes";
+static const char kCertificatesHandlerContainsPolicyCertsField[] =
+ "containsPolicyCerts";
static const char kCertificatesHandlerUntrustedField[] = "untrusted";
// Field names for communicating erros to JS.
@@ -70,7 +68,7 @@ static const char kCertificatesHandlerErrorField[] = "error";
static const char kCertificatesHandlerErrorTitle[] = "title";
// Enumeration of different callers of SelectFile. (Start counting at 1 so
-// if SelectFile is accidentally called with params=NULL it won't match any.)
+// if SelectFile is accidentally called with params=nullptr it won't match any.)
enum {
EXPORT_PERSONAL_FILE_SELECTED = 1,
IMPORT_PERSONAL_FILE_SELECTED,
@@ -99,7 +97,7 @@ struct DictionaryIdComparator {
base::string16 b_str;
a_dict->GetString(kCertificatesHandlerNameField, &a_str);
b_dict->GetString(kCertificatesHandlerNameField, &b_str);
- if (collator_ == NULL)
+ if (collator_ == nullptr)
return a_str < b_str;
return base::i18n::CompareString16WithCollator(*collator_, a_str, b_str) ==
UCOL_LESS;
@@ -132,13 +130,6 @@ struct CertEquals {
CERTCertificate* cert_;
};
-// Determine whether a certificate was stored with web trust by a policy.
-bool IsPolicyInstalledWithWebTrust(const net::CertificateList& web_trust_certs,
- CERTCertificate* cert) {
- return std::find_if(web_trust_certs.begin(), web_trust_certs.end(),
- CertEquals(cert)) != web_trust_certs.end();
-}
-
// Determine if |data| could be a PFX Protocol Data Unit.
// This only does the minimum parsing necessary to distinguish a PFX file from a
// DER encoded Certificate.
@@ -226,12 +217,12 @@ CERTCertificate* CertIdMap::IdToCert(const std::string& id) {
CERTCertificate* CertIdMap::CallbackArgsToCert(const base::ListValue* args) {
std::string node_id;
if (!args->GetString(0, &node_id))
- return NULL;
+ return nullptr;
CERTCertificate* cert = IdToCert(node_id);
if (!cert) {
NOTREACHED();
- return NULL;
+ return nullptr;
}
return cert;
@@ -287,7 +278,7 @@ base::CancelableTaskTracker::TaskId FileAccessProvider::StartRead(
// Post task to a background sequence to read file.
auto task_runner = base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND});
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT});
return tracker->PostTaskAndReply(
task_runner.get(), FROM_HERE,
base::BindOnce(&FileAccessProvider::DoRead, this, path, saved_errno,
@@ -306,7 +297,7 @@ base::CancelableTaskTracker::TaskId FileAccessProvider::StartWrite(
// This task blocks shutdown because it saves critical user data.
auto task_runner = base::CreateTaskRunnerWithTraits(
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN});
return tracker->PostTaskAndReply(
task_runner.get(), FROM_HERE,
@@ -414,18 +405,10 @@ void CertificatesHandler::RegisterMessages() {
}
void CertificatesHandler::CertificatesRefreshed() {
- net::CertificateList web_trusted_certs;
-#if defined(OS_CHROMEOS)
- policy::UserNetworkConfigurationUpdater* service =
- policy::UserNetworkConfigurationUpdaterFactory::GetForProfile(
- Profile::FromWebUI(web_ui()));
- if (service)
- service->GetWebTrustedCertificates(&web_trusted_certs);
-#endif
- PopulateTree("personalCerts", net::USER_CERT, web_trusted_certs);
- PopulateTree("serverCerts", net::SERVER_CERT, web_trusted_certs);
- PopulateTree("caCerts", net::CA_CERT, web_trusted_certs);
- PopulateTree("otherCerts", net::OTHER_CERT, web_trusted_certs);
+ PopulateTree("personalCerts", net::USER_CERT);
+ PopulateTree("serverCerts", net::SERVER_CERT);
+ PopulateTree("caCerts", net::CA_CERT);
+ PopulateTree("otherCerts", net::OTHER_CERT);
}
void CertificatesHandler::FileSelected(const base::FilePath& path,
@@ -785,7 +768,7 @@ void CertificatesHandler::ImportExportCleanup() {
// away so they don't try and call back to us.
if (select_file_dialog_.get())
select_file_dialog_->ListenerDestroyed();
- select_file_dialog_ = NULL;
+ select_file_dialog_ = nullptr;
}
void CertificatesHandler::HandleImportServer(const base::ListValue* args) {
@@ -1023,74 +1006,72 @@ void CertificatesHandler::HandleRefreshCertificates(
// to do anything.
}
-void CertificatesHandler::PopulateTree(
- const std::string& tab_name,
- net::CertType type,
- const net::CertificateList& web_trust_certs) {
+void CertificatesHandler::PopulateTree(const std::string& tab_name,
+ net::CertType type) {
std::unique_ptr<icu::Collator> collator;
UErrorCode error = U_ZERO_ERROR;
collator.reset(icu::Collator::createInstance(
icu::Locale(g_browser_process->GetApplicationLocale().c_str()), error));
if (U_FAILURE(error))
- collator.reset(NULL);
+ collator.reset();
DictionaryIdComparator comparator(collator.get());
- CertificateManagerModel::OrgGroupingMap map;
-
- certificate_manager_model_->FilterAndBuildOrgGroupingMap(type, &map);
-
- {
- std::unique_ptr<base::ListValue> nodes =
- std::make_unique<base::ListValue>();
- for (CertificateManagerModel::OrgGroupingMap::iterator i = map.begin();
- i != map.end(); ++i) {
- // Populate first level (org name).
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
- dict->SetString(kCertificatesHandlerKeyField, OrgNameToId(i->first));
- dict->SetString(kCertificatesHandlerNameField, i->first);
-
- // Populate second level (certs).
- auto subnodes = std::make_unique<base::ListValue>();
- for (net::ScopedCERTCertificateList::const_iterator org_cert_it =
- i->second.begin();
- org_cert_it != i->second.end(); ++org_cert_it) {
- std::unique_ptr<base::DictionaryValue> cert_dict(
- new base::DictionaryValue);
- CERTCertificate* cert = org_cert_it->get();
- cert_dict->SetString(kCertificatesHandlerKeyField,
- cert_id_map_->CertToId(cert));
- cert_dict->SetString(
- kCertificatesHandlerNameField,
- certificate_manager_model_->GetColumnText(
- cert, CertificateManagerModel::COL_SUBJECT_NAME));
- cert_dict->SetBoolean(
- kCertificatesHandlerReadonlyField,
- certificate_manager_model_->cert_db()->IsReadOnly(cert));
- // Policy-installed certificates with web trust are trusted.
- bool policy_trusted =
- IsPolicyInstalledWithWebTrust(web_trust_certs, cert);
- cert_dict->SetBoolean(
- kCertificatesHandlerUntrustedField,
- !policy_trusted &&
- certificate_manager_model_->cert_db()->IsUntrusted(cert));
- cert_dict->SetBoolean(kCertificatesHandlerPolicyField, policy_trusted);
- // TODO(hshi): This should be determined by testing for PKCS #11
- // CKA_EXTRACTABLE attribute. We may need to use the NSS function
- // PK11_ReadRawAttribute to do that.
- cert_dict->SetBoolean(
- kCertificatesHandlerExtractableField,
- !certificate_manager_model_->IsHardwareBacked(cert));
- // TODO(mattm): Other columns.
- subnodes->Append(std::move(cert_dict));
- }
- std::sort(subnodes->begin(), subnodes->end(), comparator);
-
- dict->Set(kCertificatesHandlerSubnodesField, std::move(subnodes));
- nodes->Append(std::move(dict));
+ CertificateManagerModel::OrgGroupingMap org_grouping_map;
+
+ certificate_manager_model_->FilterAndBuildOrgGroupingMap(type,
+ &org_grouping_map);
+
+ base::ListValue nodes;
+ for (const auto& org_grouping_map_entry : org_grouping_map) {
+ // Populate first level (org name).
+ base::DictionaryValue org_dict;
+ org_dict.SetKey(kCertificatesHandlerKeyField,
+ base::Value(OrgNameToId(org_grouping_map_entry.first)));
+ org_dict.SetKey(kCertificatesHandlerNameField,
+ base::Value(org_grouping_map_entry.first));
+
+ // Populate second level (certs).
+ base::ListValue subnodes;
+ bool contains_policy_certs = false;
+ for (const auto& org_cert : org_grouping_map_entry.second) {
+ base::DictionaryValue cert_dict;
+ CERTCertificate* cert = org_cert->cert();
+ cert_dict.SetKey(kCertificatesHandlerKeyField,
+ base::Value(cert_id_map_->CertToId(cert)));
+ cert_dict.SetKey(kCertificatesHandlerNameField,
+ base::Value(org_cert->name()));
+ cert_dict.SetKey(kCertificatesHandlerReadonlyField,
+ base::Value(org_cert->read_only()));
+ cert_dict.SetKey(kCertificatesHandlerUntrustedField,
+ base::Value(org_cert->untrusted()));
+ cert_dict.SetKey(
+ kCertificatesHandlerPolicyInstalledField,
+ base::Value(org_cert->source() ==
+ CertificateManagerModel::CertInfo::Source::kPolicy));
+ cert_dict.SetKey(kCertificatesHandlerWebTrustAnchorField,
+ base::Value(org_cert->web_trust_anchor()));
+ // TODO(hshi): This should be determined by testing for PKCS #11
+ // CKA_EXTRACTABLE attribute. We may need to use the NSS function
+ // PK11_ReadRawAttribute to do that.
+ cert_dict.SetKey(kCertificatesHandlerExtractableField,
+ base::Value(!org_cert->hardware_backed()));
+ // TODO(mattm): Other columns.
+ subnodes.GetList().push_back(std::move(cert_dict));
+
+ contains_policy_certs |=
+ org_cert->source() ==
+ CertificateManagerModel::CertInfo::Source::kPolicy;
}
- std::sort(nodes->begin(), nodes->end(), comparator);
+ std::sort(subnodes.GetList().begin(), subnodes.GetList().end(), comparator);
- FireWebUIListener("certificates-changed", base::Value(tab_name), *nodes);
+ org_dict.SetKey(kCertificatesHandlerContainsPolicyCertsField,
+ base::Value(contains_policy_certs));
+ org_dict.SetKey(kCertificatesHandlerSubnodesField, std::move(subnodes));
+ nodes.GetList().push_back(std::move(org_dict));
}
+ std::sort(nodes.GetList().begin(), nodes.GetList().end(), comparator);
+
+ FireWebUIListener("certificates-changed", base::Value(tab_name),
+ std::move(nodes));
}
void CertificatesHandler::ResolveCallback(const base::Value& response) {
diff --git a/chromium/chrome/browser/ui/webui/certificates_handler.h b/chromium/chrome/browser/ui/webui/certificates_handler.h
index fa6047677ec..3e69636d8a7 100644
--- a/chromium/chrome/browser/ui/webui/certificates_handler.h
+++ b/chromium/chrome/browser/ui/webui/certificates_handler.h
@@ -136,14 +136,7 @@ class CertificatesHandler : public content::WebUIMessageHandler,
void HandleRefreshCertificates(const base::ListValue* args);
// Populate the given tab's tree.
- void PopulateTree(const std::string& tab_name,
- net::CertType type,
- const net::CertificateList& web_trust_certs);
-
- // Populate the tree after retrieving the list of policy-installed
- // web-trusted certificates.
- void OnPolicyWebTrustCertsRetrieved(
- const net::CertificateList& web_trust_certs);
+ void PopulateTree(const std::string& tab_name, net::CertType type);
void ResolveCallback(const base::Value& response);
void RejectCallback(const base::Value& response);
diff --git a/chromium/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chromium/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index 3940cb02397..ce230a0a720 100644
--- a/chromium/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chromium/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -15,6 +15,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/about_flags.h"
+#include "chrome/browser/accessibility/accessibility_ui.h"
#include "chrome/browser/devtools/devtools_ui_bindings.h"
#include "chrome/browser/dom_distiller/dom_distiller_service_factory.h"
#include "chrome/browser/engagement/site_engagement_service.h"
@@ -59,6 +60,7 @@
#include "chrome/browser/ui/webui/sync_internals_ui.h"
#include "chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.h"
#include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h"
+#include "chrome/browser/ui/webui/ukm/ukm_internals_ui.h"
#include "chrome/browser/ui/webui/usb_internals/usb_internals_ui.h"
#include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
#include "chrome/browser/ui/webui/version_ui.h"
@@ -349,6 +351,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
// All platform builds of Chrome will need to have a cloud printing
// dialog as backup. It's just that on Chrome OS, it's the only
// print dialog.
+ if (url.host_piece() == chrome::kChromeUIAccessibilityHost)
+ return &NewWebUI<AccessibilityUI>;
if (url.host_piece() == chrome::kChromeUIBluetoothInternalsHost)
return &NewWebUI<BluetoothInternalsUI>;
if (url.host_piece() == chrome::kChromeUIComponentsHost)
@@ -409,6 +413,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<TaskSchedulerInternalsUI>;
if (url.host_piece() == chrome::kChromeUITranslateInternalsHost)
return &NewWebUI<TranslateInternalsUI>;
+ if (url.host_piece() == chrome::kChromeUIUkmHost)
+ return &NewWebUI<UkmInternalsUI>;
if (url.host_piece() == chrome::kChromeUIUsbInternalsHost)
return &NewWebUI<UsbInternalsUI>;
if (url.host_piece() == chrome::kChromeUIUserActionsHost)
@@ -482,7 +488,7 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
if (url.host_piece() == chrome::kChromeUIKeyboardOverlayHost)
return &NewWebUI<KeyboardOverlayUI>;
if (url.host_piece() == chrome::kChromeUIMobileSetupHost)
- return &NewWebUI<MobileSetupUI>;
+ return &NewWebUI<chromeos::MobileSetupUI>;
if (url.host_piece() == chrome::kChromeUIMultiDeviceSetupHost)
return &NewWebUI<chromeos::multidevice_setup::MultiDeviceSetupDialogUI>;
if (url.host_piece() == chrome::kChromeUINetworkHost)
diff --git a/chromium/chrome/browser/ui/webui/chromeos/DEPS b/chromium/chrome/browser/ui/webui/chromeos/DEPS
index 3a2bdd04a8d..ef0d6e148d1 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/DEPS
+++ b/chromium/chrome/browser/ui/webui/chromeos/DEPS
@@ -1,14 +1,9 @@
include_rules = [
- "+components/login",
- "+components/user_manager",
"+media/audio/sounds",
"+services/device/public/mojom",
]
specific_include_rules = {
- "drive_internals_ui\.cc": [
- "+components/drive"
- ],
"keyboard_overlay_ui\.cc": [
# TODO(mash): Remove. http://crbug.com/770866
"+ash/shell.h",
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.cc
index 8ad3c438e86..c550b13ee46 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.cc
@@ -4,202 +4,20 @@
#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/grit/browser_resources.h"
-#include "chrome/grit/generated_resources.h"
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
#include "chromeos/services/assistant/public/mojom/constants.mojom.h"
#include "chromeos/services/assistant/public/proto/settings_ui.pb.h"
#include "components/arc/arc_prefs.h"
#include "components/login/localized_values_builder.h"
#include "components/prefs/pref_service.h"
#include "services/service_manager/public/cpp/connector.h"
-#include "ui/base/l10n/l10n_util.h"
namespace chromeos {
namespace {
-constexpr char kJsScreenPath[] = "assistantOptin";
-
-// Construct SettingsUiSelector for the ConsentFlow UI.
-assistant::SettingsUiSelector GetSettingsUiSelector() {
- assistant::SettingsUiSelector selector;
- assistant::ConsentFlowUiSelector* consent_flow_ui =
- selector.mutable_consent_flow_ui_selector();
- consent_flow_ui->set_flow_id(assistant::ActivityControlSettingsUiSelector::
- ASSISTANT_SUW_ONBOARDING_ON_CHROME_OS);
- selector.set_email_opt_in(true);
- return selector;
-}
-
-// Construct SettingsUiUpdate for user opt-in.
-assistant::SettingsUiUpdate GetSettingsUiUpdate(
- const std::string& consent_token) {
- assistant::SettingsUiUpdate update;
- assistant::ConsentFlowUiUpdate* consent_flow_update =
- update.mutable_consent_flow_ui_update();
- consent_flow_update->set_flow_id(
- assistant::ActivityControlSettingsUiSelector::
- ASSISTANT_SUW_ONBOARDING_ON_CHROME_OS);
- consent_flow_update->set_consent_token(consent_token);
-
- return update;
-}
-
-// Construct SettingsUiUpdate for email opt-in.
-assistant::SettingsUiUpdate GetEmailOptInUpdate(bool opted_in) {
- assistant::SettingsUiUpdate update;
- assistant::EmailOptInUpdate* email_optin_update =
- update.mutable_email_opt_in_update();
- email_optin_update->set_email_opt_in_update_state(
- opted_in ? assistant::EmailOptInUpdate::OPT_IN
- : assistant::EmailOptInUpdate::OPT_OUT);
-
- return update;
-}
-
-using SettingZippyList = google::protobuf::RepeatedPtrField<
- assistant::ClassicActivityControlUiTexts::SettingZippy>;
-// Helper method to create zippy data.
-base::ListValue CreateZippyData(const SettingZippyList& zippy_list) {
- base::ListValue zippy_data;
- for (auto& setting_zippy : zippy_list) {
- base::DictionaryValue data;
- data.SetString("title", setting_zippy.title());
- if (setting_zippy.description_paragraph_size()) {
- data.SetString("description", setting_zippy.description_paragraph(0));
- }
- if (setting_zippy.additional_info_paragraph_size()) {
- data.SetString("additionalInfo",
- setting_zippy.additional_info_paragraph(0));
- }
- data.SetString("iconUri", setting_zippy.icon_uri());
- zippy_data.GetList().push_back(std::move(data));
- }
- return zippy_data;
-}
-
-// Helper method to create disclosure data.
-base::ListValue CreateDisclosureData(const SettingZippyList& disclosure_list) {
- base::ListValue disclosure_data;
- for (auto& disclosure : disclosure_list) {
- base::DictionaryValue data;
- data.SetString("title", disclosure.title());
- if (disclosure.description_paragraph_size()) {
- data.SetString("description", disclosure.description_paragraph(0));
- }
- if (disclosure.additional_info_paragraph_size()) {
- data.SetString("additionalInfo", disclosure.additional_info_paragraph(0));
- }
- data.SetString("iconUri", disclosure.icon_uri());
- disclosure_data.GetList().push_back(std::move(data));
- }
- return disclosure_data;
-}
-
-// Helper method to create get more screen data.
-base::ListValue CreateGetMoreData(
- bool email_optin_needed,
- const assistant::EmailOptInUi& email_optin_ui) {
- base::ListValue get_more_data;
-
- // Process screen context data.
- base::DictionaryValue context_data;
- context_data.SetString(
- "title", l10n_util::GetStringUTF16(IDS_ASSISTANT_SCREEN_CONTEXT_TITLE));
- context_data.SetString("description", l10n_util::GetStringUTF16(
- IDS_ASSISTANT_SCREEN_CONTEXT_DESC));
- context_data.SetBoolean("defaultEnabled", true);
- context_data.SetString("iconUri",
- "https://www.gstatic.com/images/icons/material/system/"
- "2x/laptop_chromebook_grey600_24dp.png");
- get_more_data.GetList().push_back(std::move(context_data));
-
- // Process email optin data.
- if (email_optin_needed) {
- base::DictionaryValue data;
- data.SetString("title", email_optin_ui.title());
- data.SetString("description", email_optin_ui.description());
- data.SetBoolean("defaultEnabled", email_optin_ui.default_enabled());
- data.SetString("iconUri", email_optin_ui.icon_uri());
- get_more_data.GetList().push_back(std::move(data));
- }
-
- return get_more_data;
-}
-
-// Get string constants for settings ui.
-base::DictionaryValue GetSettingsUiStrings(
- const assistant::SettingsUi& settings_ui,
- bool activity_control_needed) {
- auto consent_ui = settings_ui.consent_flow_ui().consent_ui();
- auto confirm_reject_ui = consent_ui.activity_control_confirm_reject_ui();
- auto activity_control_ui = consent_ui.activity_control_ui();
- auto third_party_disclosure_ui = consent_ui.third_party_disclosure_ui();
- base::DictionaryValue dictionary;
-
- // Add activity controll string constants.
- if (activity_control_needed) {
- dictionary.SetString("valuePropIdentity", activity_control_ui.identity());
- if (activity_control_ui.intro_text_paragraph_size()) {
- dictionary.SetString("valuePropIntro",
- activity_control_ui.intro_text_paragraph(0));
- }
- if (activity_control_ui.footer_paragraph_size()) {
- dictionary.SetString("valuePropFooter",
- activity_control_ui.footer_paragraph(0));
- }
- dictionary.SetString("valuePropNextButton",
- consent_ui.accept_button_text());
- dictionary.SetString("valuePropSkipButton",
- consent_ui.reject_button_text());
- }
-
- // Add confirm reject screen string constants.
- // TODO(updowndota) Use remote strings after server bug fixed.
- dictionary.SetString(
- "confirmRejectTitle",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONFIRM_SCREEN_TITLE));
- dictionary.SetString(
- "confirmRejectAcceptTitle",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONFIRM_SCREEN_ACCEPT_TITLE));
- dictionary.SetString(
- "confirmRejectAcceptMessage",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONFIRM_SCREEN_ACCEPT_MESSAGE));
- dictionary.SetString(
- "confirmRejectAcceptMessageExpanded",
- l10n_util::GetStringUTF16(
- IDS_ASSISTANT_CONFIRM_SCREEN_ACCEPT_MESSAGE_EXPANDED));
- dictionary.SetString(
- "confirmRejectRejectTitle",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONFIRM_SCREEN_REJECT_TITLE));
- dictionary.SetString(
- "confirmRejectRejectMessage",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONFIRM_SCREEN_REJECT_MESSAGE));
- dictionary.SetString(
- "confirmRejectContinueButton",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONTINUE_BUTTON));
-
- // Add third party string constants.
- dictionary.SetString(
- "thirdPartyTitle",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_THIRD_PARTY_SCREEN_TITLE));
- dictionary.SetString(
- "thirdPartyContinueButton",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONTINUE_BUTTON));
- dictionary.SetString("thirdPartyFooter", consent_ui.tos_pp_links());
-
- // Add get more screen string constants.
- dictionary.SetString(
- "getMoreTitle",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_GET_MORE_SCREEN_TITLE));
- dictionary.SetString(
- "getMoreContinueButton",
- l10n_util::GetStringUTF16(IDS_ASSISTANT_CONTINUE_BUTTON));
-
- return dictionary;
-}
+constexpr char kJsScreenPath[] = "assistantOptInFlow";
} // namespace
@@ -211,19 +29,25 @@ AssistantOptInHandler::AssistantOptInHandler(
}
AssistantOptInHandler::~AssistantOptInHandler() {
- arc::VoiceInteractionControllerClient::Get()->RemoveObserver(this);
+ if (arc::VoiceInteractionControllerClient::Get()) {
+ arc::VoiceInteractionControllerClient::Get()->RemoveObserver(this);
+ }
}
void AssistantOptInHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) {}
void AssistantOptInHandler::RegisterMessages() {
- AddCallback("initialized", &AssistantOptInHandler::HandleInitialized);
+ AddPrefixedCallback("initialized", &AssistantOptInHandler::HandleInitialized);
+ AddPrefixedCallback("hotwordResult",
+ &AssistantOptInHandler::HandleHotwordResult);
+ AddPrefixedCallback("flowFinished",
+ &AssistantOptInHandler::HandleFlowFinished);
}
void AssistantOptInHandler::Initialize() {
- if (arc::VoiceInteractionControllerClient::Get()->voice_interaction_state() !=
- ash::mojom::VoiceInteractionState::RUNNING) {
+ if (arc::VoiceInteractionControllerClient::Get()->voice_interaction_state() ==
+ ash::mojom::VoiceInteractionState::NOT_READY) {
arc::VoiceInteractionControllerClient::Get()->AddObserver(this);
} else {
BindAssistantSettingsManager();
@@ -235,19 +59,21 @@ void AssistantOptInHandler::ShowNextScreen() {
}
void AssistantOptInHandler::OnActivityControlOptInResult(bool opted_in) {
+ Profile* profile = Profile::FromWebUI(web_ui());
if (opted_in) {
+ RecordAssistantOptInStatus(ACTIVITY_CONTROL_ACCEPTED);
settings_manager_->UpdateSettings(
GetSettingsUiUpdate(consent_token_).SerializeAsString(),
base::BindOnce(&AssistantOptInHandler::OnUpdateSettingsResponse,
weak_factory_.GetWeakPtr()));
} else {
- PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
- prefs->SetBoolean(arc::prefs::kVoiceInteractionActivityControlAccepted,
- false);
- prefs->SetBoolean(arc::prefs::kVoiceInteractionEnabled, true);
- prefs->SetBoolean(arc::prefs::kVoiceInteractionHotwordEnabled, true);
+ RecordAssistantOptInStatus(ACTIVITY_CONTROL_SKIPPED);
+ profile->GetPrefs()->SetBoolean(
+ arc::prefs::kVoiceInteractionActivityControlAccepted, false);
CallJSOrDefer("closeDialog");
}
+
+ RecordActivityControlConsent(profile, ui_audit_key_, opted_in);
}
void AssistantOptInHandler::OnEmailOptInResult(bool opted_in) {
@@ -257,6 +83,7 @@ void AssistantOptInHandler::OnEmailOptInResult(bool opted_in) {
return;
}
+ RecordAssistantOptInStatus(opted_in ? EMAIL_OPTED_IN : EMAIL_OPTED_OUT);
settings_manager_->UpdateSettings(
GetEmailOptInUpdate(opted_in).SerializeAsString(),
base::BindOnce(&AssistantOptInHandler::OnUpdateSettingsResponse,
@@ -265,8 +92,10 @@ void AssistantOptInHandler::OnEmailOptInResult(bool opted_in) {
void AssistantOptInHandler::OnStateChanged(
ash::mojom::VoiceInteractionState state) {
- if (state == ash::mojom::VoiceInteractionState::RUNNING)
+ if (state != ash::mojom::VoiceInteractionState::NOT_READY) {
BindAssistantSettingsManager();
+ arc::VoiceInteractionControllerClient::Get()->RemoveObserver(this);
+ }
}
void AssistantOptInHandler::BindAssistantSettingsManager() {
@@ -290,12 +119,12 @@ void AssistantOptInHandler::SendGetSettingsRequest() {
weak_factory_.GetWeakPtr()));
}
-void AssistantOptInHandler::ReloadContent(const base::DictionaryValue& dict) {
+void AssistantOptInHandler::ReloadContent(const base::Value& dict) {
CallJSOrDefer("reloadContent", dict);
}
void AssistantOptInHandler::AddSettingZippy(const std::string& type,
- const base::ListValue& data) {
+ const base::Value& data) {
CallJSOrDefer("addSettingZippy", type, data);
}
@@ -304,12 +133,14 @@ void AssistantOptInHandler::OnGetSettingsResponse(const std::string& settings) {
settings_ui.ParseFromString(settings);
DCHECK(settings_ui.has_consent_flow_ui());
+
+ RecordAssistantOptInStatus(FLOW_STARTED);
auto consent_ui = settings_ui.consent_flow_ui().consent_ui();
auto activity_control_ui = consent_ui.activity_control_ui();
- auto confirm_reject_ui = consent_ui.activity_control_confirm_reject_ui();
auto third_party_disclosure_ui = consent_ui.third_party_disclosure_ui();
consent_token_ = activity_control_ui.consent_token();
+ ui_audit_key_ = activity_control_ui.ui_audit_key();
// Process activity control data.
if (!activity_control_ui.setting_zippy().size()) {
@@ -318,8 +149,6 @@ void AssistantOptInHandler::OnGetSettingsResponse(const std::string& settings) {
PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
prefs->SetBoolean(arc::prefs::kVoiceInteractionActivityControlAccepted,
true);
- prefs->SetBoolean(arc::prefs::kVoiceInteractionEnabled, true);
- prefs->SetBoolean(arc::prefs::kVoiceInteractionHotwordEnabled, true);
ShowNextScreen();
} else {
AddSettingZippy("settings",
@@ -355,8 +184,6 @@ void AssistantOptInHandler::OnUpdateSettingsResponse(
PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
prefs->SetBoolean(arc::prefs::kVoiceInteractionActivityControlAccepted,
true);
- prefs->SetBoolean(arc::prefs::kVoiceInteractionEnabled, true);
- prefs->SetBoolean(arc::prefs::kVoiceInteractionHotwordEnabled, true);
}
}
@@ -366,6 +193,12 @@ void AssistantOptInHandler::OnUpdateSettingsResponse(
// TODO(updowndta): Handle email optin update failure.
LOG(ERROR) << "Email OptIn udpate error.";
}
+ // Update hotword will cause Assistant restart. In order to make sure email
+ // optin request is successfully sent to server, update the hotword after
+ // email optin result has been received.
+ PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionHotwordEnabled,
+ enable_hotword_);
}
ShowNextScreen();
@@ -375,4 +208,20 @@ void AssistantOptInHandler::HandleInitialized() {
ExecuteDeferredJSCalls();
}
+void AssistantOptInHandler::HandleHotwordResult(bool enable_hotword) {
+ enable_hotword_ = enable_hotword;
+
+ if (!email_optin_needed_) {
+ // No need to send email optin result. Safe to update hotword pref and
+ // restart Assistant here.
+ PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionHotwordEnabled,
+ enable_hotword);
+ }
+}
+
+void AssistantOptInHandler::HandleFlowFinished() {
+ CallJSOrDefer("closeDialog");
+}
+
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.h
index 5f3dd0e5187..833d94ccf03 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.h
@@ -46,8 +46,8 @@ class AssistantOptInHandler
void SendGetSettingsRequest();
// Send message and consent data to the page.
- void ReloadContent(const base::DictionaryValue& dict);
- void AddSettingZippy(const std::string& type, const base::ListValue& data);
+ void ReloadContent(const base::Value& dict);
+ void AddSettingZippy(const std::string& type, const base::Value& data);
// Handle response from the settings manager.
void OnGetSettingsResponse(const std::string& settings);
@@ -55,16 +55,24 @@ class AssistantOptInHandler
// Handler for JS WebUI message.
void HandleInitialized();
+ void HandleHotwordResult(bool enable_hotword);
+ void HandleFlowFinished();
// Consent token used to complete the opt-in.
std::string consent_token_;
+ // An opaque token for audit record.
+ std::string ui_audit_key_;
+
// Whether activity control is needed for user.
bool activity_control_needed_ = true;
// Whether email optin is needed for user.
bool email_optin_needed_ = false;
+ // Whether user chose to enable hotword.
+ bool enable_hotword_ = true;
+
assistant::mojom::AssistantSettingsManagerPtr settings_manager_;
base::WeakPtrFactory<AssistantOptInHandler> weak_factory_;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h
deleted file mode 100644
index 40986386f49..00000000000
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_ASSISTANT_OPTIN_SCREEN_EXIT_CODE_H_
-#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_ASSISTANT_OPTIN_SCREEN_EXIT_CODE_H_
-
-#include <string>
-
-#include "base/callback.h"
-
-namespace chromeos {
-
-enum class AssistantOptInScreenExitCode {
- VALUE_PROP_SKIPPED = 0,
- VALUE_PROP_ACCEPTED = 1,
- THIRD_PARTY_CONTINUED = 2,
- EMAIL_OPTED_IN = 3,
- EMAIL_OPTED_OUT = 4,
- CONFIRM_ACCEPTED = 5,
- CONFIRM_REJECTED = 6,
- EXIT_CODES_COUNT
-};
-
-using OnAssistantOptInScreenExitCallback =
- base::OnceCallback<void(AssistantOptInScreenExitCode exit_code)>;
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_ASSISTANT_OPTIN_SCREEN_EXIT_CODE_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc
index 754e9533c04..16f3211e37d 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.cc
@@ -6,11 +6,12 @@
#include <memory>
+#include "ash/public/cpp/shell_window_ids.h"
#include "base/bind.h"
#include "base/macros.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.h"
+#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.h"
@@ -29,8 +30,8 @@ namespace {
bool is_active = false;
-constexpr int kAssistantOptInDialogWidth = 576;
-constexpr int kAssistantOptInDialogHeight = 480;
+constexpr int kAssistantOptInDialogWidth = 768;
+constexpr int kAssistantOptInDialogHeight = 640;
} // namespace
@@ -50,13 +51,12 @@ AssistantOptInUI::AssistantOptInUI(content::WebUI* web_ui)
AddScreenHandler(std::make_unique<ValuePropScreenHandler>(
base::BindOnce(&AssistantOptInUI::OnExit, weak_factory_.GetWeakPtr())));
- AddScreenHandler(std::make_unique<ConfirmRejectScreenHandler>(
- base::BindOnce(&AssistantOptInUI::OnExit, weak_factory_.GetWeakPtr())));
AddScreenHandler(std::make_unique<ThirdPartyScreenHandler>(
base::BindOnce(&AssistantOptInUI::OnExit, weak_factory_.GetWeakPtr())));
AddScreenHandler(std::make_unique<GetMoreScreenHandler>(
base::BindOnce(&AssistantOptInUI::OnExit, weak_factory_.GetWeakPtr())));
- AddScreenHandler(std::make_unique<ReadyScreenHandler>());
+ AddScreenHandler(std::make_unique<ReadyScreenHandler>(
+ base::BindOnce(&AssistantOptInUI::OnExit, weak_factory_.GetWeakPtr())));
base::DictionaryValue localized_strings;
for (auto* handler : screen_handlers_)
@@ -68,6 +68,10 @@ AssistantOptInUI::AssistantOptInUI(content::WebUI* web_ui)
source->AddResourcePath("assistant_logo.png", IDR_ASSISTANT_LOGO_PNG);
source->SetDefaultResource(IDR_ASSISTANT_OPTIN_HTML);
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source);
+
+ // Make sure enable Assistant service since we need it during the flow.
+ PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionEnabled, true);
}
AssistantOptInUI::~AssistantOptInUI() = default;
@@ -81,17 +85,11 @@ void AssistantOptInUI::AddScreenHandler(
void AssistantOptInUI::OnExit(AssistantOptInScreenExitCode exit_code) {
switch (exit_code) {
case AssistantOptInScreenExitCode::VALUE_PROP_SKIPPED:
- assistant_handler_->ShowNextScreen();
+ assistant_handler_->OnActivityControlOptInResult(false);
break;
case AssistantOptInScreenExitCode::VALUE_PROP_ACCEPTED:
assistant_handler_->OnActivityControlOptInResult(true);
break;
- case AssistantOptInScreenExitCode::CONFIRM_ACCEPTED:
- assistant_handler_->OnActivityControlOptInResult(true);
- break;
- case AssistantOptInScreenExitCode::CONFIRM_REJECTED:
- assistant_handler_->OnActivityControlOptInResult(false);
- break;
case AssistantOptInScreenExitCode::THIRD_PARTY_CONTINUED:
assistant_handler_->ShowNextScreen();
break;
@@ -101,6 +99,9 @@ void AssistantOptInUI::OnExit(AssistantOptInScreenExitCode exit_code) {
case AssistantOptInScreenExitCode::EMAIL_OPTED_OUT:
assistant_handler_->OnEmailOptInResult(false);
break;
+ case AssistantOptInScreenExitCode::READY_SCREEN_CONTINUED:
+ CloseDialog(nullptr);
+ break;
default:
NOTREACHED();
}
@@ -113,7 +114,12 @@ void AssistantOptInDialog::Show(
ash::mojom::AssistantSetup::StartAssistantOptInFlowCallback callback) {
DCHECK(!is_active);
AssistantOptInDialog* dialog = new AssistantOptInDialog(std::move(callback));
- dialog->ShowSystemDialog(true);
+
+ int container_id = dialog->GetDialogModalType() == ui::MODAL_TYPE_NONE
+ ? ash::kShellWindowId_DefaultContainer
+ : ash::kShellWindowId_LockSystemModalContainer;
+ chrome::ShowWebDialogInContainer(
+ container_id, ProfileManager::GetActiveUserProfile(), dialog, true);
}
// static
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h
index 4174b738e37..062cf1b49be 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_ui.h
@@ -11,7 +11,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_handler.h"
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
#include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h"
#include "content/public/browser/web_ui_controller.h"
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.cc
new file mode 100644
index 00000000000..fbce386db70
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.cc
@@ -0,0 +1,225 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
+
+#include "base/metrics/histogram_macros.h"
+#include "chrome/browser/consent_auditor/consent_auditor_factory.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/ui/webui/chromeos/user_image_source.h"
+#include "chrome/grit/browser_resources.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/arc/arc_prefs.h"
+#include "components/consent_auditor/consent_auditor.h"
+#include "components/signin/core/browser/signin_manager_base.h"
+#include "components/user_manager/user_manager.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/webui/web_ui_util.h"
+
+namespace chromeos {
+
+void RecordAssistantOptInStatus(AssistantOptInFlowStatus status) {
+ UMA_HISTOGRAM_ENUMERATION("Assistant.OptInFlowStatus", status, kMaxValue + 1);
+}
+
+// Construct SettingsUiSelector for the ConsentFlow UI.
+assistant::SettingsUiSelector GetSettingsUiSelector() {
+ assistant::SettingsUiSelector selector;
+ assistant::ConsentFlowUiSelector* consent_flow_ui =
+ selector.mutable_consent_flow_ui_selector();
+ consent_flow_ui->set_flow_id(assistant::ActivityControlSettingsUiSelector::
+ ASSISTANT_SUW_ONBOARDING_ON_CHROME_OS);
+ selector.set_email_opt_in(true);
+ return selector;
+}
+
+// Construct SettingsUiUpdate for user opt-in.
+assistant::SettingsUiUpdate GetSettingsUiUpdate(
+ const std::string& consent_token) {
+ assistant::SettingsUiUpdate update;
+ assistant::ConsentFlowUiUpdate* consent_flow_update =
+ update.mutable_consent_flow_ui_update();
+ consent_flow_update->set_flow_id(
+ assistant::ActivityControlSettingsUiSelector::
+ ASSISTANT_SUW_ONBOARDING_ON_CHROME_OS);
+ consent_flow_update->set_consent_token(consent_token);
+
+ return update;
+}
+
+// Construct SettingsUiUpdate for email opt-in.
+assistant::SettingsUiUpdate GetEmailOptInUpdate(bool opted_in) {
+ assistant::SettingsUiUpdate update;
+ assistant::EmailOptInUpdate* email_optin_update =
+ update.mutable_email_opt_in_update();
+ email_optin_update->set_email_opt_in_update_state(
+ opted_in ? assistant::EmailOptInUpdate::OPT_IN
+ : assistant::EmailOptInUpdate::OPT_OUT);
+
+ return update;
+}
+
+// Helper method to create zippy data.
+base::Value CreateZippyData(const SettingZippyList& zippy_list) {
+ base::Value zippy_data(base::Value::Type::LIST);
+ for (auto& setting_zippy : zippy_list) {
+ base::Value data(base::Value::Type::DICTIONARY);
+ data.SetKey("title", base::Value(setting_zippy.title()));
+ if (setting_zippy.description_paragraph_size()) {
+ data.SetKey("description",
+ base::Value(setting_zippy.description_paragraph(0)));
+ }
+ if (setting_zippy.additional_info_paragraph_size()) {
+ data.SetKey("additionalInfo",
+ base::Value(setting_zippy.additional_info_paragraph(0)));
+ }
+ data.SetKey("iconUri", base::Value(setting_zippy.icon_uri()));
+ data.SetKey("popupLink", base::Value(l10n_util::GetStringUTF16(
+ IDS_ASSISTANT_ACTIVITY_CONTROL_POPUP_LINK)));
+ zippy_data.GetList().push_back(std::move(data));
+ }
+ return zippy_data;
+}
+
+// Helper method to create disclosure data.
+base::Value CreateDisclosureData(const SettingZippyList& disclosure_list) {
+ base::Value disclosure_data(base::Value::Type::LIST);
+ for (auto& disclosure : disclosure_list) {
+ base::Value data(base::Value::Type::DICTIONARY);
+ data.SetKey("title", base::Value(disclosure.title()));
+ if (disclosure.description_paragraph_size()) {
+ data.SetKey("description",
+ base::Value(disclosure.description_paragraph(0)));
+ }
+ if (disclosure.additional_info_paragraph_size()) {
+ data.SetKey("additionalInfo",
+ base::Value(disclosure.additional_info_paragraph(0)));
+ }
+ data.SetKey("iconUri", base::Value(disclosure.icon_uri()));
+ disclosure_data.GetList().push_back(std::move(data));
+ }
+ return disclosure_data;
+}
+
+// Helper method to create get more screen data.
+base::Value CreateGetMoreData(bool email_optin_needed,
+ const assistant::EmailOptInUi& email_optin_ui) {
+ base::Value get_more_data(base::Value::Type::LIST);
+
+ // Process hotword data.
+ base::Value hotword_data(base::Value::Type::DICTIONARY);
+ hotword_data.SetKey(
+ "title",
+ base::Value(l10n_util::GetStringUTF16(IDS_ASSISTANT_HOTWORD_TITLE)));
+ hotword_data.SetKey(
+ "description",
+ base::Value(l10n_util::GetStringUTF16(IDS_ASSISTANT_HOTWORD_DESC)));
+ hotword_data.SetKey("defaultEnabled", base::Value(true));
+ hotword_data.SetKey(
+ "iconUri",
+ base::Value("https://www.gstatic.com/images/icons/material/system/"
+ "2x/mic_none_grey600_48dp.png"));
+ get_more_data.GetList().push_back(std::move(hotword_data));
+
+ // Process screen context data.
+ base::Value context_data(base::Value::Type::DICTIONARY);
+ context_data.SetKey("title", base::Value(l10n_util::GetStringUTF16(
+ IDS_ASSISTANT_SCREEN_CONTEXT_TITLE)));
+ context_data.SetKey("description", base::Value(l10n_util::GetStringUTF16(
+ IDS_ASSISTANT_SCREEN_CONTEXT_DESC)));
+ context_data.SetKey("defaultEnabled", base::Value(true));
+ context_data.SetKey(
+ "iconUri",
+ base::Value("https://www.gstatic.com/images/icons/material/system/"
+ "2x/laptop_chromebook_grey600_24dp.png"));
+ get_more_data.GetList().push_back(std::move(context_data));
+
+ // Process email optin data.
+ if (email_optin_needed) {
+ base::Value data(base::Value::Type::DICTIONARY);
+ data.SetKey("title", base::Value(email_optin_ui.title()));
+ data.SetKey("description", base::Value(email_optin_ui.description()));
+ data.SetKey("defaultEnabled",
+ base::Value(email_optin_ui.default_enabled()));
+ data.SetKey("iconUri", base::Value(email_optin_ui.icon_uri()));
+ data.SetKey("legalText", base::Value(email_optin_ui.legal_text()));
+ get_more_data.GetList().push_back(std::move(data));
+ }
+
+ return get_more_data;
+}
+
+// Get string constants for settings ui.
+base::Value GetSettingsUiStrings(const assistant::SettingsUi& settings_ui,
+ bool activity_control_needed) {
+ auto consent_ui = settings_ui.consent_flow_ui().consent_ui();
+ auto activity_control_ui = consent_ui.activity_control_ui();
+ auto third_party_disclosure_ui = consent_ui.third_party_disclosure_ui();
+ base::Value dictionary(base::Value::Type::DICTIONARY);
+
+ // Add activity controll string constants.
+ if (activity_control_needed) {
+ scoped_refptr<base::RefCountedMemory> image =
+ chromeos::UserImageSource::GetUserImage(
+ user_manager::UserManager::Get()->GetActiveUser()->GetAccountId());
+ std::string icon_url = webui::GetPngDataUrl(image->front(), image->size());
+ dictionary.SetKey("valuePropUserImage", base::Value(icon_url));
+
+ dictionary.SetKey("valuePropIdentity",
+ base::Value(activity_control_ui.identity()));
+ dictionary.SetKey("valuePropTitle",
+ base::Value(activity_control_ui.title()));
+ if (activity_control_ui.intro_text_paragraph_size()) {
+ dictionary.SetKey(
+ "valuePropIntro",
+ base::Value(activity_control_ui.intro_text_paragraph(0)));
+ }
+ if (activity_control_ui.footer_paragraph_size()) {
+ dictionary.SetKey("valuePropFooter",
+ base::Value(activity_control_ui.footer_paragraph(0)));
+ }
+ dictionary.SetKey("valuePropNextButton",
+ base::Value(consent_ui.accept_button_text()));
+ dictionary.SetKey("valuePropSkipButton",
+ base::Value(consent_ui.reject_button_text()));
+ }
+
+ // Add third party string constants.
+ dictionary.SetKey("thirdPartyTitle",
+ base::Value(third_party_disclosure_ui.title()));
+ dictionary.SetKey("thirdPartyContinueButton",
+ base::Value(third_party_disclosure_ui.button_continue()));
+ dictionary.SetKey("thirdPartyFooter", base::Value(consent_ui.tos_pp_links()));
+
+ // Add get more screen string constants.
+ dictionary.SetKey("getMoreTitle", base::Value(l10n_util::GetStringUTF16(
+ IDS_ASSISTANT_GET_MORE_SCREEN_TITLE)));
+ dictionary.SetKey("getMoreIntro", base::Value(l10n_util::GetStringUTF16(
+ IDS_ASSISTANT_GET_MORE_SCREEN_INTRO)));
+ dictionary.SetKey(
+ "getMoreContinueButton",
+ base::Value(l10n_util::GetStringUTF16(IDS_ASSISTANT_CONTINUE_BUTTON)));
+
+ return dictionary;
+}
+
+using sync_pb::UserConsentTypes;
+void RecordActivityControlConsent(Profile* profile,
+ std::string ui_audit_key,
+ bool opted_in) {
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(profile);
+ DCHECK(signin_manager->IsAuthenticated());
+ std::string account_id = signin_manager->GetAuthenticatedAccountId();
+
+ UserConsentTypes::AssistantActivityControlConsent consent;
+ consent.set_ui_audit_key(ui_audit_key);
+ consent.set_status(opted_in ? UserConsentTypes::GIVEN
+ : UserConsentTypes::NOT_GIVEN);
+
+ ConsentAuditorFactory::GetForProfile(profile)
+ ->RecordAssistantActivityControlConsent(account_id, consent);
+}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h
new file mode 100644
index 00000000000..b1d35c07ce5
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h
@@ -0,0 +1,85 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_ASSISTANT_OPTIN_UTILS_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_ASSISTANT_OPTIN_UTILS_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chromeos/services/assistant/public/mojom/constants.mojom.h"
+#include "chromeos/services/assistant/public/proto/settings_ui.pb.h"
+#include "components/prefs/pref_service.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace chromeos {
+
+enum class AssistantOptInScreenExitCode {
+ VALUE_PROP_SKIPPED = 0,
+ VALUE_PROP_ACCEPTED = 1,
+ THIRD_PARTY_CONTINUED = 2,
+ EMAIL_OPTED_IN = 3,
+ EMAIL_OPTED_OUT = 4,
+ READY_SCREEN_CONTINUED = 5,
+ EXIT_CODES_COUNT
+};
+
+// Type of Assistant opt-in flow status. This enum is used to back an UMA
+// histogram and should be treated as append-only.
+enum AssistantOptInFlowStatus {
+ FLOW_STARTED = 0,
+ ACTIVITY_CONTROL_SHOWN,
+ ACTIVITY_CONTROL_ACCEPTED,
+ ACTIVITY_CONTROL_SKIPPED,
+ THIRD_PARTY_SHOWN,
+ THIRD_PARTY_CONTINUED,
+ GET_MORE_SHOWN,
+ EMAIL_OPTED_IN,
+ EMAIL_OPTED_OUT,
+ GET_MORE_CONTINUED,
+ READY_SCREEN_SHOWN,
+ READY_SCREEN_CONTINUED,
+ // Magic constant used by the histogram macros.
+ kMaxValue = READY_SCREEN_CONTINUED
+};
+
+using OnAssistantOptInScreenExitCallback =
+ base::OnceCallback<void(AssistantOptInScreenExitCode exit_code)>;
+
+void RecordAssistantOptInStatus(AssistantOptInFlowStatus);
+
+// Construct SettingsUiSelector for the ConsentFlow UI.
+assistant::SettingsUiSelector GetSettingsUiSelector();
+
+// Construct SettingsUiUpdate for user opt-in.
+assistant::SettingsUiUpdate GetSettingsUiUpdate(
+ const std::string& consent_token);
+
+// Construct SettingsUiUpdate for email opt-in.
+assistant::SettingsUiUpdate GetEmailOptInUpdate(bool opted_in);
+
+using SettingZippyList = google::protobuf::RepeatedPtrField<
+ assistant::ClassicActivityControlUiTexts::SettingZippy>;
+// Helper method to create zippy data.
+base::Value CreateZippyData(const SettingZippyList& zippy_list);
+
+// Helper method to create disclosure data.
+base::Value CreateDisclosureData(const SettingZippyList& disclosure_list);
+
+// Helper method to create get more screen data.
+base::Value CreateGetMoreData(bool email_optin_needed,
+ const assistant::EmailOptInUi& email_optin_ui);
+
+// Get string constants for settings ui.
+base::Value GetSettingsUiStrings(const assistant::SettingsUi& settings_ui,
+ bool activity_control_needed);
+
+void RecordActivityControlConsent(Profile* profile,
+ std::string ui_audit_key,
+ bool opted_in);
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_ASSISTANT_OPTIN_UTILS_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.cc
deleted file mode 100644
index 821e080e85c..00000000000
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.h"
-
-#include "chrome/browser/browser_process.h"
-#include "chrome/grit/generated_resources.h"
-#include "components/login/localized_values_builder.h"
-
-namespace {
-
-constexpr char kJsScreenPath[] = "AssistantConfirmRejectScreen";
-
-} // namespace
-
-namespace chromeos {
-
-ConfirmRejectScreenHandler::ConfirmRejectScreenHandler(
- OnAssistantOptInScreenExitCallback callback)
- : BaseWebUIHandler(), exit_callback_(std::move(callback)) {
- set_call_js_prefix(kJsScreenPath);
-}
-
-ConfirmRejectScreenHandler::~ConfirmRejectScreenHandler() = default;
-
-void ConfirmRejectScreenHandler::DeclareLocalizedValues(
- ::login::LocalizedValuesBuilder* builder) {}
-
-void ConfirmRejectScreenHandler::RegisterMessages() {
- AddPrefixedCallback("userActed",
- &ConfirmRejectScreenHandler::HandleUserAction);
-}
-
-void ConfirmRejectScreenHandler::Initialize() {}
-
-void ConfirmRejectScreenHandler::HandleUserAction(bool confirm_result) {
- DCHECK(exit_callback_);
- if (confirm_result) {
- std::move(exit_callback_)
- .Run(AssistantOptInScreenExitCode::CONFIRM_ACCEPTED);
- } else {
- std::move(exit_callback_)
- .Run(AssistantOptInScreenExitCode::CONFIRM_REJECTED);
- }
-}
-
-} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.h
deleted file mode 100644
index b1022678261..00000000000
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.h
+++ /dev/null
@@ -1,39 +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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_CONFIRM_REJECT_SCREEN_HANDLER_H_
-#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_CONFIRM_REJECT_SCREEN_HANDLER_H_
-
-#include <memory>
-#include <string>
-
-#include "base/macros.h"
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
-#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
-
-namespace chromeos {
-
-class ConfirmRejectScreenHandler : public BaseWebUIHandler {
- public:
- explicit ConfirmRejectScreenHandler(
- OnAssistantOptInScreenExitCallback callback);
- ~ConfirmRejectScreenHandler() override;
-
- // BaseWebUIHandler:
- void DeclareLocalizedValues(
- ::login::LocalizedValuesBuilder* builder) override;
- void RegisterMessages() override;
- void Initialize() override;
-
- private:
- void HandleUserAction(bool confirm_result);
-
- OnAssistantOptInScreenExitCallback exit_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(ConfirmRejectScreenHandler);
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_CONFIRM_REJECT_SCREEN_HANDLER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.cc
index d9864c4668f..2bfb15b9fe0 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.cc
@@ -13,7 +13,7 @@
namespace {
-constexpr char kJsScreenPath[] = "AssistantGetMoreScreen";
+constexpr char kJsScreenPath[] = "assistant.GetMoreScreen";
} // namespace
@@ -32,6 +32,7 @@ void GetMoreScreenHandler::DeclareLocalizedValues(
void GetMoreScreenHandler::RegisterMessages() {
AddPrefixedCallback("userActed", &GetMoreScreenHandler::HandleUserAction);
+ AddPrefixedCallback("screenShown", &GetMoreScreenHandler::HandleScreenShown);
}
void GetMoreScreenHandler::Initialize() {}
@@ -42,6 +43,7 @@ void GetMoreScreenHandler::HandleUserAction(const bool screen_context,
prefs->SetBoolean(arc::prefs::kVoiceInteractionContextEnabled,
screen_context);
+ RecordAssistantOptInStatus(GET_MORE_CONTINUED);
DCHECK(exit_callback_);
if (email_opted_in) {
std::move(exit_callback_).Run(AssistantOptInScreenExitCode::EMAIL_OPTED_IN);
@@ -51,4 +53,8 @@ void GetMoreScreenHandler::HandleUserAction(const bool screen_context,
}
}
+void GetMoreScreenHandler::HandleScreenShown() {
+ RecordAssistantOptInStatus(GET_MORE_SHOWN);
+}
+
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.h
index 5ee693ac156..4429fc55184 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/get_more_screen_handler.h
@@ -9,7 +9,7 @@
#include <string>
#include "base/macros.h"
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
namespace chromeos {
@@ -27,6 +27,7 @@ class GetMoreScreenHandler : public BaseWebUIHandler {
private:
void HandleUserAction(const bool screen_context, const bool email_opted_in);
+ void HandleScreenShown();
OnAssistantOptInScreenExitCallback exit_callback_;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.cc
index 268ce349dd3..1a1f4487bdc 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.cc
@@ -8,9 +8,21 @@
#include "chrome/grit/generated_resources.h"
#include "components/login/localized_values_builder.h"
+namespace {
+
+constexpr char kJsScreenPath[] = "assistant.ReadyScreen";
+
+constexpr char kUserActionNextPressed[] = "next-pressed";
+
+} // namespace
+
namespace chromeos {
-ReadyScreenHandler::ReadyScreenHandler() : BaseWebUIHandler() {}
+ReadyScreenHandler::ReadyScreenHandler(
+ OnAssistantOptInScreenExitCallback callback)
+ : BaseWebUIHandler(), exit_callback_(std::move(callback)) {
+ set_call_js_prefix(kJsScreenPath);
+}
ReadyScreenHandler::~ReadyScreenHandler() = default;
@@ -21,6 +33,24 @@ void ReadyScreenHandler::DeclareLocalizedValues(
builder->Add("assistantReadyButton", IDS_ASSISTANT_DONE_BUTTON);
}
+void ReadyScreenHandler::RegisterMessages() {
+ AddPrefixedCallback("userActed", &ReadyScreenHandler::HandleUserAction);
+ AddPrefixedCallback("screenShown", &ReadyScreenHandler::HandleScreenShown);
+}
+
void ReadyScreenHandler::Initialize() {}
+void ReadyScreenHandler::HandleUserAction(const std::string& action) {
+ DCHECK(exit_callback_);
+ if (action == kUserActionNextPressed) {
+ RecordAssistantOptInStatus(READY_SCREEN_CONTINUED);
+ std::move(exit_callback_)
+ .Run(AssistantOptInScreenExitCode::READY_SCREEN_CONTINUED);
+ }
+}
+
+void ReadyScreenHandler::HandleScreenShown() {
+ RecordAssistantOptInStatus(READY_SCREEN_SHOWN);
+}
+
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.h
index 0975ce8032d..6e71856a97d 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.h
@@ -9,22 +9,28 @@
#include <string>
#include "base/macros.h"
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
namespace chromeos {
class ReadyScreenHandler : public BaseWebUIHandler {
public:
- ReadyScreenHandler();
+ explicit ReadyScreenHandler(OnAssistantOptInScreenExitCallback callback);
~ReadyScreenHandler() override;
// BaseWebUIHandler:
void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override;
+ void RegisterMessages() override;
void Initialize() override;
private:
+ void HandleUserAction(const std::string& action);
+ void HandleScreenShown();
+
+ OnAssistantOptInScreenExitCallback exit_callback_;
+
DISALLOW_COPY_AND_ASSIGN(ReadyScreenHandler);
};
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.cc
index 6489db3a11f..cdaed48da8d 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.cc
@@ -10,7 +10,7 @@
namespace {
-constexpr char kJsScreenPath[] = "AssistantThirdPartyScreen";
+constexpr char kJsScreenPath[] = "assistant.ThirdPartyScreen";
constexpr char kUserActionNextPressed[] = "next-pressed";
@@ -31,6 +31,8 @@ void ThirdPartyScreenHandler::DeclareLocalizedValues(
void ThirdPartyScreenHandler::RegisterMessages() {
AddPrefixedCallback("userActed", &ThirdPartyScreenHandler::HandleUserAction);
+ AddPrefixedCallback("screenShown",
+ &ThirdPartyScreenHandler::HandleScreenShown);
}
void ThirdPartyScreenHandler::Initialize() {}
@@ -38,9 +40,14 @@ void ThirdPartyScreenHandler::Initialize() {}
void ThirdPartyScreenHandler::HandleUserAction(const std::string& action) {
DCHECK(exit_callback_);
if (action == kUserActionNextPressed) {
+ RecordAssistantOptInStatus(THIRD_PARTY_CONTINUED);
std::move(exit_callback_)
.Run(AssistantOptInScreenExitCode::THIRD_PARTY_CONTINUED);
}
}
+void ThirdPartyScreenHandler::HandleScreenShown() {
+ RecordAssistantOptInStatus(THIRD_PARTY_SHOWN);
+}
+
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.h
index 97228314c42..558b448709e 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/third_party_screen_handler.h
@@ -9,7 +9,7 @@
#include <string>
#include "base/macros.h"
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
namespace chromeos {
@@ -27,6 +27,7 @@ class ThirdPartyScreenHandler : public BaseWebUIHandler {
private:
void HandleUserAction(const std::string& action);
+ void HandleScreenShown();
OnAssistantOptInScreenExitCallback exit_callback_;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.cc
index 095484482a4..5f05a52abc7 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.cc
@@ -10,7 +10,7 @@
namespace {
-constexpr char kJsScreenPath[] = "AssistantValuePropScreen";
+constexpr char kJsScreenPath[] = "assistant.ValuePropScreen";
constexpr char kUserActionSkipPressed[] = "skip-pressed";
constexpr char kUserActionNextPressed[] = "next-pressed";
@@ -38,16 +38,19 @@ void ValuePropScreenHandler::DeclareLocalizedValues(
IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_TITLE);
builder->Add("assistantOptinLoadErrorMessage",
IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_MESSAGE);
+ builder->Add("assistantOptinSkipButton",
+ IDS_VOICE_INTERACTION_VALUE_PROP_SKIP_BUTTON);
builder->Add("assistantOptinRetryButton",
IDS_VOICE_INTERACTION_VALUE_PROP_RETRY_BUTTON);
- builder->Add("assistantOptinMoreButton",
- IDS_VOICE_INTERACTION_VALUE_PROP_MORE_BUTTION);
+ builder->Add("assistantOptinOKButton", IDS_OOBE_OK_BUTTON_TEXT);
builder->Add("back", IDS_EULA_BACK_BUTTON);
builder->Add("next", IDS_EULA_NEXT_BUTTON);
}
void ValuePropScreenHandler::RegisterMessages() {
AddPrefixedCallback("userActed", &ValuePropScreenHandler::HandleUserAction);
+ AddPrefixedCallback("screenShown",
+ &ValuePropScreenHandler::HandleScreenShown);
}
void ValuePropScreenHandler::Initialize() {}
@@ -62,4 +65,8 @@ void ValuePropScreenHandler::HandleUserAction(const std::string& action) {
.Run(AssistantOptInScreenExitCode::VALUE_PROP_ACCEPTED);
}
+void ValuePropScreenHandler::HandleScreenShown() {
+ RecordAssistantOptInStatus(ACTIVITY_CONTROL_SHOWN);
+}
+
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.h
index ec8e0324871..65e13af43c6 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/assistant_optin/value_prop_screen_handler.h
@@ -9,7 +9,7 @@
#include <string>
#include "base/macros.h"
-#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
namespace chromeos {
@@ -27,6 +27,7 @@ class ValuePropScreenHandler : public BaseWebUIHandler {
private:
void HandleUserAction(const std::string& action);
+ void HandleScreenShown();
OnAssistantOptInScreenExitCallback exit_callback_;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
index 2a0a1b3bdf6..72498815027 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
@@ -13,6 +13,8 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
+#include "device/bluetooth/bluetooth_device.h"
#include "ui/base/l10n/l10n_util.h"
namespace chromeos {
@@ -41,8 +43,14 @@ BluetoothPairingDialog* BluetoothPairingDialog::ShowDialog(
const base::string16& name_for_display,
bool paired,
bool connected) {
- BluetoothPairingDialog* dialog =
- new BluetoothPairingDialog(address, name_for_display, paired, connected);
+ std::string cannonical_address =
+ device::BluetoothDevice::CanonicalizeAddress(address);
+ if (cannonical_address.empty()) {
+ LOG(ERROR) << "BluetoothPairingDialog: Invalid address: " << address;
+ return nullptr;
+ }
+ BluetoothPairingDialog* dialog = new BluetoothPairingDialog(
+ cannonical_address, name_for_display, paired, connected);
dialog->ShowSystemDialog();
return dialog;
}
@@ -86,7 +94,10 @@ BluetoothPairingDialogUI::BluetoothPairingDialogUI(content::WebUI* web_ui)
source->SetJsonPath("strings.js");
#if BUILDFLAG(OPTIMIZE_WEBUI)
source->UseGzip();
- source->SetDefaultResource(IDR_BLUETOOTH_PAIRING_DIALOG_VULCANIZED_HTML);
+ source->SetDefaultResource(
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2) ?
+ IDR_BLUETOOTH_PAIRING_DIALOG_VULCANIZED_P2_HTML :
+ IDR_BLUETOOTH_PAIRING_DIALOG_VULCANIZED_HTML);
source->AddResourcePath("crisper.js",
IDR_BLUETOOTH_PAIRING_DIALOG_CRISPER_JS);
#else
diff --git a/chromium/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc b/chromium/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
index af67afa5562..13c32f05652 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <fstream>
#include <memory>
#include <utility>
@@ -17,9 +18,11 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
+#include "base/strings/pattern.h"
+#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/chromeos/drive/debug_info_collector.h"
#include "chrome/browser/chromeos/drive/drive_integration_service.h"
#include "chrome/browser/chromeos/drive/file_system_util.h"
@@ -52,6 +55,32 @@ namespace chromeos {
namespace {
+constexpr char kKey[] = "key";
+constexpr char kValue[] = "value";
+constexpr char kClass[] = "class";
+
+constexpr const char* const kLogLevelName[] = {"info", "warning", "error"};
+
+size_t SeverityToLogLevelNameIndex(logging::LogSeverity severity) {
+ if (severity <= logging::LOG_INFO)
+ return 0;
+ if (severity == logging::LOG_WARNING)
+ return 1;
+ return 2;
+}
+
+size_t LogMarkToLogLevelNameIndex(char mark) {
+ switch (mark) {
+ case 'I':
+ case 'V':
+ return 0;
+ case 'W':
+ return 1;
+ default:
+ return 2;
+ }
+}
+
// Gets metadata of all files and directories in |root_path|
// recursively. Stores the result as a list of dictionaries like:
//
@@ -189,27 +218,73 @@ std::string FormatEntry(const base::FilePath& path,
return out;
}
-std::string SeverityToString(logging::LogSeverity severity) {
- switch (severity) {
- case logging::LOG_INFO:
- return "info";
- case logging::LOG_WARNING:
- return "warning";
- case logging::LOG_ERROR:
- return "error";
- default: // Treat all other higher severities as ERROR.
- return "error";
- }
-}
-
-// Appends {'key': key, 'value': value} dictionary to the |list|.
+// Appends {'key': key, 'value': value, 'class': clazz} dictionary to the
+// |list|.
void AppendKeyValue(base::ListValue* list,
- const std::string& key,
- const std::string& value) {
+ std::string key,
+ std::string value,
+ std::string clazz = std::string()) {
auto dict = std::make_unique<base::DictionaryValue>();
- dict->SetString("key", key);
- dict->SetString("value", value);
- list->Append(std::move(dict));
+ dict->SetPath({kKey}, base::Value(std::move(key)));
+ dict->SetPath({kValue}, base::Value(std::move(value)));
+ if (!clazz.empty())
+ dict->SetPath({kClass}, base::Value(std::move(clazz)));
+ list->GetList().push_back(std::move(*dict));
+}
+
+ino_t GetInodeValue(const base::FilePath& path) {
+ struct stat file_stats;
+ if (stat(path.value().c_str(), &file_stats) != 0)
+ return 0;
+ return file_stats.st_ino;
+}
+
+std::pair<ino_t, base::ListValue> GetServiceLogContents(
+ const base::FilePath& log_path,
+ ino_t inode,
+ int from_line_number) {
+ base::ListValue result;
+
+ std::ifstream log(log_path.value());
+ if (log.good()) {
+ ino_t new_inode = GetInodeValue(log_path);
+ if (new_inode != inode) {
+ // Apparently log was recreated. Re-read the log.
+ from_line_number = 0;
+ inode = new_inode;
+ }
+
+ base::Time time;
+ constexpr char kTimestampPattern[] = R"(????-??-??T??:??:??.???Z? )";
+ const size_t pattern_length = strlen(kTimestampPattern);
+
+ std::string line;
+ int line_number = 0;
+ while (log.good()) {
+ std::getline(log, line);
+ if (line.empty() || ++line_number <= from_line_number) {
+ continue;
+ }
+
+ base::StringPiece log_line = line;
+ size_t severity_index = 0;
+ if (base::MatchPattern(log_line.substr(0, pattern_length),
+ kTimestampPattern) &&
+ google_apis::util::GetTimeFromString(
+ log_line.substr(0, pattern_length - 2), &time)) {
+ severity_index = LogMarkToLogLevelNameIndex(line[pattern_length - 2]);
+ line = line.substr(pattern_length);
+ }
+ const char* const severity = kLogLevelName[severity_index];
+
+ AppendKeyValue(&result,
+ google_apis::util::FormatTimeAsStringLocaltime(time),
+ base::StrCat({"[", severity, "] ", line}),
+ base::StrCat({"log-", severity}));
+ }
+ }
+
+ return {inode, std::move(result)};
}
// Class to handle messages from chrome://drive-internals.
@@ -255,6 +330,7 @@ class DriveInternalsWebUIHandler : public content::WebUIMessageHandler {
void UpdateCacheContentsSection(
drive::DebugInfoCollector* debug_info_collector);
void UpdateEventLogSection();
+ void UpdateServiceLogSection();
void UpdatePathConfigurationsSection();
// Called when GetGCacheContents() is complete.
@@ -306,9 +382,21 @@ class DriveInternalsWebUIHandler : public content::WebUIMessageHandler {
// Called after file system reset for ResetDriveFileSystem is done.
void ResetFinished(bool success);
+ // Called when service logs are read.
+ void OnServiceLogRead(std::pair<ino_t, base::ListValue>);
+
// The last event sent to the JavaScript side.
int last_sent_event_id_;
+ // The last line of service log sent to the JS side.
+ int last_sent_line_number_;
+
+ // The inode of the log file.
+ ino_t service_log_file_inode_;
+
+ // Service log file is being parsed.
+ bool service_log_file_is_processing_ = false;
+
base::WeakPtrFactory<DriveInternalsWebUIHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DriveInternalsWebUIHandler);
};
@@ -461,6 +549,9 @@ void DriveInternalsWebUIHandler::OnPageLoaded(const base::ListValue* args) {
// and resent whole the logs to the page.
last_sent_event_id_ = -1;
UpdateEventLogSection();
+ last_sent_line_number_ = 0;
+ service_log_file_inode_ = 0;
+ UpdateServiceLogSection();
}
void DriveInternalsWebUIHandler::UpdateDriveRelatedPreferencesSection() {
@@ -680,7 +771,8 @@ void DriveInternalsWebUIHandler::UpdateGCacheContentsSection() {
// Start updating the GCache contents section.
Profile* profile = Profile::FromWebUI(web_ui());
- const base::FilePath root_path = drive::util::GetCacheRootPath(profile);
+ const base::FilePath root_path =
+ drive::util::GetCacheRootPath(profile).DirName();
base::ListValue* gcache_contents = new base::ListValue;
base::DictionaryValue* gcache_summary = new base::DictionaryValue;
base::PostTaskWithTraitsAndReply(
@@ -705,9 +797,8 @@ void DriveInternalsWebUIHandler::UpdateFileSystemContentsSection() {
debug_info_collector->GetResourceEntry(
root_path,
- base::Bind(&DriveInternalsWebUIHandler::OnGetResourceEntryByPath,
- weak_ptr_factory_.GetWeakPtr(),
- root_path));
+ base::BindOnce(&DriveInternalsWebUIHandler::OnGetResourceEntryByPath,
+ weak_ptr_factory_.GetWeakPtr(), root_path));
debug_info_collector->ReadDirectory(
root_path,
@@ -762,20 +853,54 @@ void DriveInternalsWebUIHandler::UpdateEventLogSection() {
if (log[i].id <= last_sent_event_id_)
continue;
- std::string severity = SeverityToString(log[i].severity);
-
- auto dict = std::make_unique<base::DictionaryValue>();
- dict->SetString("key",
- google_apis::util::FormatTimeAsStringLocaltime(log[i].when));
- dict->SetString("value", "[" + severity + "] " + log[i].what);
- dict->SetString("class", "log-" + severity);
- list.Append(std::move(dict));
+ const char* const severity =
+ kLogLevelName[SeverityToLogLevelNameIndex(log[i].severity)];
+ AppendKeyValue(&list,
+ google_apis::util::FormatTimeAsStringLocaltime(log[i].when),
+ base::StrCat({"[", severity, "] ", log[i].what}),
+ base::StrCat({"log-", severity}));
last_sent_event_id_ = log[i].id;
}
if (!list.empty())
web_ui()->CallJavascriptFunctionUnsafe("updateEventLog", list);
}
+void DriveInternalsWebUIHandler::UpdateServiceLogSection() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ if (service_log_file_is_processing_)
+ return;
+ service_log_file_is_processing_ = true;
+
+ drive::DriveIntegrationService* integration_service = GetIntegrationService();
+ if (!integration_service)
+ return;
+ base::FilePath log_path = integration_service->GetDriveFsLogPath();
+ if (log_path.empty())
+ return;
+
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE},
+ base::BindOnce(&GetServiceLogContents, log_path, service_log_file_inode_,
+ last_sent_line_number_),
+ base::BindOnce(&DriveInternalsWebUIHandler::OnServiceLogRead,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
+void DriveInternalsWebUIHandler::OnServiceLogRead(
+ std::pair<ino_t, base::ListValue> response) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (service_log_file_inode_ != response.first) {
+ service_log_file_inode_ = response.first;
+ last_sent_line_number_ = 0;
+ }
+ if (!response.second.empty()) {
+ web_ui()->CallJavascriptFunctionUnsafe("updateServiceLog", response.second);
+ last_sent_line_number_ += response.second.GetList().size();
+ }
+ service_log_file_is_processing_ = false;
+}
+
void DriveInternalsWebUIHandler::UpdatePathConfigurationsSection() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -786,9 +911,11 @@ void DriveInternalsWebUIHandler::UpdatePathConfigurationsSection() {
AppendKeyValue(
&paths, "Downloads",
file_manager::util::GetDownloadsFolderForProfile(profile).AsUTF8Unsafe());
- AppendKeyValue(
- &paths, "Drive",
- drive::util::GetDriveMountPointPath(profile).AsUTF8Unsafe());
+ const auto* integration_service = GetIntegrationService();
+ if (integration_service && integration_service->IsMounted()) {
+ AppendKeyValue(&paths, "Drive",
+ integration_service->GetMountPointPath().AsUTF8Unsafe());
+ }
const char* kPathPreferences[] = {
prefs::kSelectFileLastDirectory,
@@ -898,6 +1025,7 @@ void DriveInternalsWebUIHandler::OnPeriodicUpdate(const base::ListValue* args) {
return;
UpdateEventLogSection();
+ UpdateServiceLogSection();
drive::JobListInterface* job_list = integration_service->job_list();
if (job_list) {
diff --git a/chromium/chrome/browser/ui/webui/chromeos/emulator/DEPS b/chromium/chrome/browser/ui/webui/chromeos/emulator/DEPS
deleted file mode 100644
index e9d9de6def2..00000000000
--- a/chromium/chrome/browser/ui/webui/chromeos/emulator/DEPS
+++ /dev/null
@@ -1,7 +0,0 @@
-specific_include_rules = {
- "device_emulator_message_handler\.cc": [
- # TODO(mash): Remove. http://crbug.com/756094
- "+ash/shell.h",
- "+ash/system/bluetooth/tray_bluetooth_helper.h",
- ],
-}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
index 8aa100ecda3..c88d7153051 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc
@@ -7,18 +7,19 @@
#include <stdint.h>
#include <utility>
-#include "ash/shell.h"
-#include "ash/system/bluetooth/tray_bluetooth_helper.h"
#include "base/bind.h"
#include "base/macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/browser/chromeos/system/fake_input_device_settings.h"
#include "chrome/browser/chromeos/system/input_device_settings.h"
+#include "chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_cras_audio_client.h"
#include "chromeos/dbus/fake_power_manager_client.h"
#include "content/public/browser/web_ui.h"
+#include "device/bluetooth/bluetooth_adapter_factory.h"
+#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/dbus/bluez_dbus_manager.h"
#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h"
#include "device/bluetooth/dbus/fake_bluetooth_device_client.h"
@@ -119,8 +120,8 @@ void DeviceEmulatorMessageHandler::BluetoothObserver::DeviceAdded(
}
void DeviceEmulatorMessageHandler::BluetoothObserver::DevicePropertyChanged(
- const dbus::ObjectPath& object_path,
- const std::string& property_name) {
+ const dbus::ObjectPath& object_path,
+ const std::string& property_name) {
if (property_name == kPairedPropertyName) {
owner_->web_ui()->CallJavascriptFunctionUnsafe(
kDevicePairedFromTrayJSCallback, base::Value(object_path.value()));
@@ -161,8 +162,7 @@ void DeviceEmulatorMessageHandler::CrasAudioObserver::NodesChanged() {
class DeviceEmulatorMessageHandler::PowerObserver
: public PowerManagerClient::Observer {
public:
- explicit PowerObserver(DeviceEmulatorMessageHandler* owner)
- : owner_(owner) {
+ explicit PowerObserver(DeviceEmulatorMessageHandler* owner) : owner_(owner) {
owner_->fake_power_manager_client_->AddObserver(this);
}
@@ -170,13 +170,12 @@ class DeviceEmulatorMessageHandler::PowerObserver
owner_->fake_power_manager_client_->RemoveObserver(this);
}
- void PowerChanged(
- const power_manager::PowerSupplyProperties& proto) override;
+ void PowerChanged(const power_manager::PowerSupplyProperties& proto) override;
private:
- DeviceEmulatorMessageHandler* owner_;
+ DeviceEmulatorMessageHandler* owner_;
- DISALLOW_COPY_AND_ASSIGN(PowerObserver);
+ DISALLOW_COPY_AND_ASSIGN(PowerObserver);
};
void DeviceEmulatorMessageHandler::PowerObserver::PowerChanged(
@@ -200,23 +199,32 @@ void DeviceEmulatorMessageHandler::PowerObserver::PowerChanged(
DeviceEmulatorMessageHandler::DeviceEmulatorMessageHandler()
: fake_bluetooth_device_client_(
static_cast<bluez::FakeBluetoothDeviceClient*>(
- bluez::BluezDBusManager::Get()
- ->GetBluetoothDeviceClient())),
+ bluez::BluezDBusManager::Get()->GetBluetoothDeviceClient())),
fake_cras_audio_client_(static_cast<chromeos::FakeCrasAudioClient*>(
- chromeos::DBusThreadManager::Get()
- ->GetCrasAudioClient())),
+ chromeos::DBusThreadManager::Get()->GetCrasAudioClient())),
fake_power_manager_client_(static_cast<chromeos::FakePowerManagerClient*>(
- chromeos::DBusThreadManager::Get()
- ->GetPowerManagerClient())),
- weak_ptr_factory_(this) {}
-
-DeviceEmulatorMessageHandler::~DeviceEmulatorMessageHandler() {
+ chromeos::DBusThreadManager::Get()->GetPowerManagerClient())),
+ weak_ptr_factory_(this) {
+ device::BluetoothAdapterFactory::GetAdapter(
+ base::Bind(&DeviceEmulatorMessageHandler::BluetoothDeviceAdapterReady,
+ weak_ptr_factory_.GetWeakPtr()));
}
+DeviceEmulatorMessageHandler::~DeviceEmulatorMessageHandler() {}
+
void DeviceEmulatorMessageHandler::Init(const base::ListValue* args) {
AllowJavascript();
}
+void DeviceEmulatorMessageHandler::BluetoothDeviceAdapterReady(
+ scoped_refptr<device::BluetoothAdapter> adapter) {
+ if (!adapter) {
+ LOG(ERROR) << "Bluetooth adapter not available";
+ return;
+ }
+ bluetooth_adapter_ = adapter;
+}
+
void DeviceEmulatorMessageHandler::RequestPowerInfo(
const base::ListValue* args) {
fake_power_manager_client_->RequestStatusUpdate();
@@ -287,8 +295,7 @@ void DeviceEmulatorMessageHandler::HandleRequestBluetoothPair(
// Try to pair the device with the main adapter. The device is identified
// by its device ID, which, in this case is the same as its address.
- ash::Shell::Get()->tray_bluetooth_helper()->ConnectToBluetoothDevice(
- props->address.value());
+ ConnectToBluetoothDevice(props->address.value());
if (!props->paired.value()) {
web_ui()->CallJavascriptFunctionUnsafe(kPairFailedJSCallback,
base::Value(path));
@@ -445,8 +452,8 @@ void DeviceEmulatorMessageHandler::UpdatePowerSources(
port));
std::string power_level;
CHECK(dict->GetString("power", &power_level));
- source->set_max_power(
- power_level == "high" ? kPowerLevelHigh : kPowerLevelLow);
+ source->set_max_power(power_level == "high" ? kPowerLevelHigh
+ : kPowerLevelLow);
if (id == selected_id)
selected_source = source;
}
@@ -630,6 +637,29 @@ DeviceEmulatorMessageHandler::GetDeviceInfo(
return device;
}
+void DeviceEmulatorMessageHandler::ConnectToBluetoothDevice(
+ const std::string& address) {
+ if (!bluetooth_adapter_) {
+ LOG(ERROR) << "Bluetooth adapter not ready";
+ return;
+ }
+ device::BluetoothDevice* device = bluetooth_adapter_->GetDevice(address);
+ if (!device || device->IsConnecting() ||
+ (device->IsPaired() &&
+ (device->IsConnected() || !device->IsConnectable()))) {
+ return;
+ }
+ if (!device->IsPaired() && device->IsPairable()) {
+ // Show pairing dialog for the unpaired device.
+ chromeos::BluetoothPairingDialog::ShowDialog(
+ device->GetAddress(), device->GetNameForDisplay(), device->IsPaired(),
+ device->IsConnected());
+ } else {
+ // Attempt to connect to the device.
+ device->Connect(nullptr, base::DoNothing(), base::DoNothing());
+ }
+}
+
void DeviceEmulatorMessageHandler::TouchpadExists(bool exists) {
if (!IsJavascriptAllowed())
return;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h b/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
index 9b5099d0082..9c6690616ff 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.h
@@ -8,10 +8,12 @@
#include <memory>
#include "base/macros.h"
+#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/system/pointer_device_observer.h"
#include "chromeos/dbus/power_manager/power_supply_properties.pb.h"
#include "content/public/browser/web_ui_message_handler.h"
+#include "device/bluetooth/bluetooth_adapter.h"
namespace base {
class DictionaryValue;
@@ -107,6 +109,9 @@ class DeviceEmulatorMessageHandler :
class CrasAudioObserver;
class PowerObserver;
+ void BluetoothDeviceAdapterReady(
+ scoped_refptr<device::BluetoothAdapter> adapter);
+
// Creates a bluetooth device with the properties given in |args|. |args|
// should contain a dictionary so that each dictionary value can be mapped
// to its respective property upon creating the device. Returns the device
@@ -118,6 +123,8 @@ class DeviceEmulatorMessageHandler :
std::unique_ptr<base::DictionaryValue> GetDeviceInfo(
const dbus::ObjectPath& object_path);
+ void ConnectToBluetoothDevice(const std::string& address);
+
// system::PointerDeviceObserver::Observer:
void TouchpadExists(bool exists) override;
void MouseExists(bool exists) override;
@@ -131,6 +138,8 @@ class DeviceEmulatorMessageHandler :
FakePowerManagerClient* fake_power_manager_client_;
std::unique_ptr<PowerObserver> power_observer_;
+ scoped_refptr<device::BluetoothAdapter> bluetooth_adapter_;
+
base::WeakPtrFactory<DeviceEmulatorMessageHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DeviceEmulatorMessageHandler);
diff --git a/chromium/chrome/browser/ui/webui/chromeos/first_run/first_run_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/first_run/first_run_handler.cc
index 5b5c071700f..97562f89390 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/first_run/first_run_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/first_run/first_run_handler.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/chromeos/first_run/first_run_handler.h"
+#include "ash/public/cpp/ash_features.h"
#include "base/bind.h"
#include "base/values.h"
#include "chromeos/chromeos_switches.h"
@@ -50,6 +51,8 @@ void FirstRunHandler::ShowStepPositioned(const std::string& name,
step_params.SetKey(
"voiceInteractionEnabled",
base::Value(chromeos::switches::IsVoiceInteractionEnabled()));
+ step_params.SetKey("unifiedSystemTrayEnabled",
+ base::Value(ash::features::IsSystemTrayUnifiedEnabled()));
web_ui()->CallJavascriptFunctionUnsafe("cr.FirstRun.showStep", step_params);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/image_source.cc b/chromium/chrome/browser/ui/webui/chromeos/image_source.cc
index 67ea4411f91..9145713af6c 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/image_source.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/image_source.cc
@@ -15,8 +15,8 @@
#include "base/memory/ref_counted_memory.h"
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/task_scheduler/task_scheduler.h"
+#include "base/task/post_task.h"
+#include "base/task/task_scheduler/task_scheduler.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/chromeos/login/users/avatar/user_image_loader.h"
#include "chrome/common/url_constants.h"
diff --git a/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc
index 0591f3b24f6..514fa719425 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc
@@ -17,6 +17,7 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
namespace chromeos {
@@ -115,7 +116,10 @@ InternetConfigDialogUI::InternetConfigDialogUI(content::WebUI* web_ui)
source->SetJsonPath("strings.js");
#if BUILDFLAG(OPTIMIZE_WEBUI)
source->UseGzip();
- source->SetDefaultResource(IDR_INTERNET_CONFIG_DIALOG_VULCANIZED_HTML);
+ source->SetDefaultResource(
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2) ?
+ IDR_INTERNET_CONFIG_DIALOG_VULCANIZED_P2_HTML :
+ IDR_INTERNET_CONFIG_DIALOG_VULCANIZED_HTML);
source->AddResourcePath("crisper.js", IDR_INTERNET_CONFIG_DIALOG_CRISPER_JS);
#else
source->SetDefaultResource(IDR_INTERNET_CONFIG_DIALOG_HTML);
diff --git a/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc
index a05bb03c5dc..91daeef0759 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc
@@ -18,6 +18,7 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
#include "ui/base/l10n/l10n_util.h"
namespace chromeos {
@@ -131,7 +132,10 @@ InternetDetailDialogUI::InternetDetailDialogUI(content::WebUI* web_ui)
source->SetJsonPath("strings.js");
#if BUILDFLAG(OPTIMIZE_WEBUI)
source->UseGzip();
- source->SetDefaultResource(IDR_INTERNET_DETAIL_DIALOG_VULCANIZED_HTML);
+ source->SetDefaultResource(
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2) ?
+ IDR_INTERNET_DETAIL_DIALOG_VULCANIZED_P2_HTML :
+ IDR_INTERNET_DETAIL_DIALOG_VULCANIZED_HTML);
source->AddResourcePath("crisper.js", IDR_INTERNET_DETAIL_DIALOG_CRISPER_JS);
#else
source->SetDefaultResource(IDR_INTERNET_DETAIL_DIALOG_HTML);
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.cc
index bc31372f2a9..a20c7a94568 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.cc
@@ -5,13 +5,26 @@
#include "chrome/browser/ui/webui/chromeos/login/app_downloading_screen_handler.h"
#include "chrome/browser/chromeos/login/screens/app_downloading_screen.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/grit/generated_resources.h"
+#include "components/arc/arc_prefs.h"
#include "components/login/localized_values_builder.h"
+#include "components/prefs/pref_service.h"
+#include "ui/base/resource/resource_bundle.h"
namespace {
const char kJsScreenPath[] = "login.AppDownloadingScreen";
+int GetNumberOfUserSelectedApps() {
+ const Profile* profile = ProfileManager::GetActiveUserProfile();
+ const PrefService* pref_service = profile->GetPrefs();
+ return static_cast<int>(
+ pref_service->Get(arc::prefs::kArcFastAppReinstallPackages)
+ ->GetList()
+ .size());
+}
+
} // namespace
namespace chromeos {
@@ -25,8 +38,10 @@ AppDownloadingScreenHandler::~AppDownloadingScreenHandler() {}
void AppDownloadingScreenHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) {
- builder->Add("appDownloadingScreenTitle",
- IDS_LOGIN_APP_DOWNLOADING_SCREEN_TITLE);
+ builder->Add("appDownloadingScreenTitleSingular",
+ IDS_LOGIN_APP_DOWNLOADING_SCREEN_TITLE_SINGULAR);
+ builder->Add("appDownloadingScreenTitlePlural",
+ IDS_LOGIN_APP_DOWNLOADING_SCREEN_TITLE_PLURAL);
builder->Add("appDownloadingScreenDescription",
IDS_LOGIN_APP_DOWNLOADING_SCREEN_DESCRIPTION);
builder->Add("appDownloadingContinueSetup",
@@ -44,6 +59,8 @@ void AppDownloadingScreenHandler::Bind(AppDownloadingScreen* screen) {
void AppDownloadingScreenHandler::Show() {
ShowScreen(kScreenId);
+ CallJS("updateNumberOfSelectedApps",
+ base::Value(GetNumberOfUserSelectedApps()));
}
void AppDownloadingScreenHandler::Hide() {}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc
index 763a78625a8..8b3d420b688 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/i18n/timezone.h"
+#include "base/sha1.h"
#include "chrome/browser/chromeos/arc/arc_support_host.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.h"
@@ -32,6 +33,15 @@
#include "content/public/browser/web_ui.h"
#include "ui/base/l10n/l10n_util.h"
+using ArcBackupAndRestoreConsent =
+ sync_pb::UserConsentTypes::ArcBackupAndRestoreConsent;
+using ArcGoogleLocationServiceConsent =
+ sync_pb::UserConsentTypes::ArcGoogleLocationServiceConsent;
+using ArcPlayTermsOfServiceConsent =
+ sync_pb::UserConsentTypes::ArcPlayTermsOfServiceConsent;
+
+using sync_pb::UserConsentTypes;
+
namespace {
const char kJsScreenPath[] = "login.ArcTermsOfServiceScreen";
@@ -296,32 +306,44 @@ void ArcTermsOfServiceScreenHandler::RecordConsents(
DCHECK(signin_manager->IsAuthenticated());
const std::string account_id = signin_manager->GetAuthenticatedAccountId();
- // TODO(jhorwich): Replace this approach when passing |is_managed| boolean is
- // supported by the underlying consent protos.
- const std::vector<int> consent_ids = ArcSupportHost::ComputePlayToSConsentIds(
- record_tos_content ? tos_content : "");
-
- consent_auditor->RecordGaiaConsent(
- account_id, consent_auditor::Feature::PLAY_STORE, consent_ids,
- IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT,
- tos_accepted ? consent_auditor::ConsentStatus::GIVEN
- : consent_auditor::ConsentStatus::NOT_GIVEN);
+ ArcPlayTermsOfServiceConsent play_consent;
+ play_consent.set_status(tos_accepted ? UserConsentTypes::GIVEN
+ : UserConsentTypes::NOT_GIVEN);
+ play_consent.set_confirmation_grd_id(IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT);
+ play_consent.set_consent_flow(ArcPlayTermsOfServiceConsent::SETUP);
+ if (record_tos_content) {
+ play_consent.set_play_terms_of_service_text_length(tos_content.length());
+ play_consent.set_play_terms_of_service_hash(
+ base::SHA1HashString(tos_content));
+ }
+ consent_auditor->RecordArcPlayConsent(account_id, play_consent);
if (record_backup_consent) {
- consent_auditor->RecordGaiaConsent(
- account_id, consent_auditor::Feature::BACKUP_AND_RESTORE,
- {IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE},
- IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT,
- backup_accepted ? consent_auditor::ConsentStatus::GIVEN
- : consent_auditor::ConsentStatus::NOT_GIVEN);
+ ArcBackupAndRestoreConsent backup_and_restore_consent;
+ backup_and_restore_consent.set_confirmation_grd_id(
+ IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT);
+ backup_and_restore_consent.add_description_grd_ids(
+ IDS_ARC_OPT_IN_DIALOG_BACKUP_RESTORE);
+ backup_and_restore_consent.set_status(backup_accepted
+ ? UserConsentTypes::GIVEN
+ : UserConsentTypes::NOT_GIVEN);
+
+ consent_auditor->RecordArcBackupAndRestoreConsent(
+ account_id, backup_and_restore_consent);
}
if (record_location_consent) {
- consent_auditor->RecordGaiaConsent(
- account_id, consent_auditor::Feature::GOOGLE_LOCATION_SERVICE,
- {IDS_ARC_OPT_IN_LOCATION_SETTING}, IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT,
- location_accepted ? consent_auditor::ConsentStatus::GIVEN
- : consent_auditor::ConsentStatus::NOT_GIVEN);
+ ArcGoogleLocationServiceConsent location_service_consent;
+ location_service_consent.set_confirmation_grd_id(
+ IDS_ARC_OOBE_TERMS_BUTTON_ACCEPT);
+ location_service_consent.add_description_grd_ids(
+ IDS_ARC_OPT_IN_LOCATION_SETTING);
+ location_service_consent.set_status(location_accepted
+ ? UserConsentTypes::GIVEN
+ : UserConsentTypes::NOT_GIVEN);
+
+ consent_auditor->RecordArcGoogleLocationServiceConsent(
+ account_id, location_service_consent);
}
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h
index 5bc0eafabf8..e63def59f34 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h
@@ -101,7 +101,8 @@ class ArcTermsOfServiceScreenHandler
void OnBackupAndRestoreModeChanged(bool enabled, bool managed) override;
void OnLocationServicesModeChanged(bool enabled, bool managed) override;
- base::ObserverList<ArcTermsOfServiceScreenViewObserver, true> observer_list_;
+ base::ObserverList<ArcTermsOfServiceScreenViewObserver, true>::Unchecked
+ observer_list_;
// Whether the screen should be shown right after initialization.
bool show_on_init_ = false;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.cc
new file mode 100644
index 00000000000..50203401165
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.cc
@@ -0,0 +1,363 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h"
+
+#include "chrome/browser/chromeos/login/oobe_screen.h"
+#include "chrome/browser/chromeos/login/screens/assistant_optin_flow_screen.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_utils.h"
+#include "chrome/grit/browser_resources.h"
+#include "chrome/grit/generated_resources.h"
+#include "chromeos/services/assistant/public/mojom/constants.mojom.h"
+#include "chromeos/services/assistant/public/proto/settings_ui.pb.h"
+#include "components/arc/arc_prefs.h"
+#include "components/login/localized_values_builder.h"
+#include "components/prefs/pref_service.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace chromeos {
+
+namespace {
+
+constexpr char kJsScreenPath[] = "login.AssistantOptInFlowScreen";
+constexpr char kSkipPressed[] = "skip-pressed";
+constexpr char kNextPressed[] = "next-pressed";
+constexpr char kFlowFinished[] = "flow-finished";
+
+} // namespace
+
+AssistantOptInFlowScreenHandler::AssistantOptInFlowScreenHandler()
+ : BaseScreenHandler(kScreenId), weak_factory_(this) {
+ set_call_js_prefix(kJsScreenPath);
+}
+
+AssistantOptInFlowScreenHandler::~AssistantOptInFlowScreenHandler() {
+ if (arc::VoiceInteractionControllerClient::Get()) {
+ arc::VoiceInteractionControllerClient::Get()->RemoveObserver(this);
+ }
+ if (screen_) {
+ screen_->OnViewDestroyed(this);
+ }
+}
+
+void AssistantOptInFlowScreenHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {
+ builder->Add("assistantOptinLoading",
+ IDS_VOICE_INTERACTION_VALUE_PROP_LOADING);
+ builder->Add("assistantOptinLoadErrorTitle",
+ IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_TITLE);
+ builder->Add("assistantOptinLoadErrorMessage",
+ IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_MESSAGE);
+ builder->Add("assistantOptinSkipButton",
+ IDS_VOICE_INTERACTION_VALUE_PROP_SKIP_BUTTON);
+ builder->Add("assistantOptinRetryButton",
+ IDS_VOICE_INTERACTION_VALUE_PROP_RETRY_BUTTON);
+ builder->Add("assistantOptinOKButton", IDS_OOBE_OK_BUTTON_TEXT);
+ builder->Add("assistantReadyTitle", IDS_ASSISTANT_READY_SCREEN_TITLE);
+ builder->Add("assistantReadyMessage", IDS_ASSISTANT_READY_SCREEN_MESSAGE);
+ builder->Add("assistantReadyButton", IDS_ASSISTANT_DONE_BUTTON);
+}
+
+void AssistantOptInFlowScreenHandler::RegisterMessages() {
+ AddCallback(
+ "assistant.ValuePropScreen.userActed",
+ &AssistantOptInFlowScreenHandler::HandleValuePropScreenUserAction);
+ AddCallback(
+ "assistant.ThirdPartyScreen.userActed",
+ &AssistantOptInFlowScreenHandler::HandleThirdPartyScreenUserAction);
+ AddCallback("assistant.GetMoreScreen.userActed",
+ &AssistantOptInFlowScreenHandler::HandleGetMoreScreenUserAction);
+ AddCallback("assistant.ReadyScreen.userActed",
+ &AssistantOptInFlowScreenHandler::HandleReadyScreenUserAction);
+ AddCallback("assistant.ValuePropScreen.screenShown",
+ &AssistantOptInFlowScreenHandler::HandleValuePropScreenShown);
+ AddCallback("assistant.ThirdPartyScreen.screenShown",
+ &AssistantOptInFlowScreenHandler::HandleThirdPartyScreenShown);
+ AddCallback("assistant.GetMoreScreen.screenShown",
+ &AssistantOptInFlowScreenHandler::HandleGetMoreScreenShown);
+ AddCallback("assistant.ReadyScreen.screenShown",
+ &AssistantOptInFlowScreenHandler::HandleReadyScreenShown);
+ AddCallback("assistantOptInFlow.hotwordResult",
+ &AssistantOptInFlowScreenHandler::HandleHotwordResult);
+ AddCallback("assistantOptInFlow.flowFinished",
+ &AssistantOptInFlowScreenHandler::HandleFlowFinished);
+ AddCallback("assistantOptInFlow.initialized",
+ &AssistantOptInFlowScreenHandler::HandleFlowInitialized);
+}
+
+void AssistantOptInFlowScreenHandler::Bind(AssistantOptInFlowScreen* screen) {
+ BaseScreenHandler::SetBaseScreen(screen);
+ screen_ = screen;
+ if (page_is_ready())
+ Initialize();
+}
+
+void AssistantOptInFlowScreenHandler::Unbind() {
+ screen_ = nullptr;
+ BaseScreenHandler::SetBaseScreen(nullptr);
+}
+
+void AssistantOptInFlowScreenHandler::Show() {
+ // Make sure enable Assistant service since we need it during the flow.
+ PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionEnabled, true);
+
+ if (arc::VoiceInteractionControllerClient::Get()->voice_interaction_state() ==
+ ash::mojom::VoiceInteractionState::NOT_READY) {
+ arc::VoiceInteractionControllerClient::Get()->AddObserver(this);
+ } else {
+ BindAssistantSettingsManager();
+ }
+
+ if (!page_is_ready() || !screen_) {
+ show_on_init_ = true;
+ return;
+ }
+
+ ShowScreen(kScreenId);
+}
+
+void AssistantOptInFlowScreenHandler::Hide() {}
+
+void AssistantOptInFlowScreenHandler::Initialize() {
+ if (!screen_ || !show_on_init_)
+ return;
+
+ Show();
+ show_on_init_ = false;
+}
+
+void AssistantOptInFlowScreenHandler::ShowNextScreen() {
+ CallJS("showNextScreen");
+}
+
+void AssistantOptInFlowScreenHandler::OnActivityControlOptInResult(
+ bool opted_in) {
+ Profile* profile = ProfileManager::GetActiveUserProfile();
+ if (opted_in) {
+ RecordAssistantOptInStatus(ACTIVITY_CONTROL_ACCEPTED);
+ settings_manager_->UpdateSettings(
+ GetSettingsUiUpdate(consent_token_).SerializeAsString(),
+ base::BindOnce(
+ &AssistantOptInFlowScreenHandler::OnUpdateSettingsResponse,
+ weak_factory_.GetWeakPtr()));
+ } else {
+ RecordAssistantOptInStatus(ACTIVITY_CONTROL_SKIPPED);
+ profile->GetPrefs()->SetBoolean(
+ arc::prefs::kVoiceInteractionActivityControlAccepted, false);
+ screen_->OnUserAction(kFlowFinished);
+ }
+
+ RecordActivityControlConsent(profile, ui_audit_key_, opted_in);
+}
+
+void AssistantOptInFlowScreenHandler::OnEmailOptInResult(bool opted_in) {
+ if (!email_optin_needed_) {
+ DCHECK(!opted_in);
+ ShowNextScreen();
+ return;
+ }
+
+ RecordAssistantOptInStatus(opted_in ? EMAIL_OPTED_IN : EMAIL_OPTED_OUT);
+ settings_manager_->UpdateSettings(
+ GetEmailOptInUpdate(opted_in).SerializeAsString(),
+ base::BindOnce(&AssistantOptInFlowScreenHandler::OnUpdateSettingsResponse,
+ weak_factory_.GetWeakPtr()));
+}
+
+void AssistantOptInFlowScreenHandler::OnStateChanged(
+ ash::mojom::VoiceInteractionState state) {
+ if (state != ash::mojom::VoiceInteractionState::NOT_READY) {
+ BindAssistantSettingsManager();
+ arc::VoiceInteractionControllerClient::Get()->RemoveObserver(this);
+ }
+}
+
+void AssistantOptInFlowScreenHandler::BindAssistantSettingsManager() {
+ if (settings_manager_.is_bound())
+ return;
+
+ // Set up settings mojom.
+ service_manager::Connector* connector =
+ content::BrowserContext::GetConnectorFor(
+ ProfileManager::GetActiveUserProfile());
+ connector->BindInterface(assistant::mojom::kServiceName,
+ mojo::MakeRequest(&settings_manager_));
+
+ SendGetSettingsRequest();
+}
+
+void AssistantOptInFlowScreenHandler::SendGetSettingsRequest() {
+ assistant::SettingsUiSelector selector = GetSettingsUiSelector();
+ settings_manager_->GetSettings(
+ selector.SerializeAsString(),
+ base::BindOnce(&AssistantOptInFlowScreenHandler::OnGetSettingsResponse,
+ weak_factory_.GetWeakPtr()));
+}
+
+void AssistantOptInFlowScreenHandler::ReloadContent(const base::Value& dict) {
+ CallJS("reloadContent", dict);
+}
+
+void AssistantOptInFlowScreenHandler::AddSettingZippy(const std::string& type,
+ const base::Value& data) {
+ CallJS("addSettingZippy", type, data);
+}
+
+void AssistantOptInFlowScreenHandler::OnGetSettingsResponse(
+ const std::string& settings) {
+ assistant::SettingsUi settings_ui;
+ settings_ui.ParseFromString(settings);
+
+ DCHECK(settings_ui.has_consent_flow_ui());
+
+ RecordAssistantOptInStatus(FLOW_STARTED);
+ auto consent_ui = settings_ui.consent_flow_ui().consent_ui();
+ auto activity_control_ui = consent_ui.activity_control_ui();
+ auto third_party_disclosure_ui = consent_ui.third_party_disclosure_ui();
+
+ consent_token_ = activity_control_ui.consent_token();
+ ui_audit_key_ = activity_control_ui.ui_audit_key();
+
+ // Process activity control data.
+ if (!activity_control_ui.setting_zippy().size()) {
+ // No need to consent. Move to the next screen.
+ activity_control_needed_ = false;
+ PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionActivityControlAccepted,
+ true);
+ ShowNextScreen();
+ } else {
+ AddSettingZippy("settings",
+ CreateZippyData(activity_control_ui.setting_zippy()));
+ }
+
+ // Process third party disclosure data.
+ AddSettingZippy("disclosure", CreateDisclosureData(
+ third_party_disclosure_ui.disclosures()));
+
+ // Process get more data.
+ email_optin_needed_ = settings_ui.has_email_opt_in_ui() &&
+ settings_ui.email_opt_in_ui().has_title();
+ AddSettingZippy("get-more", CreateGetMoreData(email_optin_needed_,
+ settings_ui.email_opt_in_ui()));
+
+ // Pass string constants dictionary.
+ ReloadContent(GetSettingsUiStrings(settings_ui, activity_control_needed_));
+}
+
+void AssistantOptInFlowScreenHandler::OnUpdateSettingsResponse(
+ const std::string& result) {
+ assistant::SettingsUiUpdateResult ui_result;
+ ui_result.ParseFromString(result);
+
+ if (ui_result.has_consent_flow_update_result()) {
+ if (ui_result.consent_flow_update_result().update_status() !=
+ assistant::ConsentFlowUiUpdateResult::SUCCESS) {
+ // TODO(updowndta): Handle consent update failure.
+ LOG(ERROR) << "Consent udpate error.";
+ } else if (activity_control_needed_) {
+ activity_control_needed_ = false;
+ PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionActivityControlAccepted,
+ true);
+ }
+ }
+
+ if (ui_result.has_email_opt_in_update_result()) {
+ if (ui_result.email_opt_in_update_result().update_status() !=
+ assistant::EmailOptInUpdateResult::SUCCESS) {
+ // TODO(updowndta): Handle email optin update failure.
+ LOG(ERROR) << "Email OptIn udpate error.";
+ }
+ // Update hotword will cause Assistant restart. In order to make sure email
+ // optin request is successfully sent to server, update the hotword after
+ // email optin result has been received.
+ PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionHotwordEnabled,
+ enable_hotword_);
+ }
+
+ ShowNextScreen();
+}
+
+void AssistantOptInFlowScreenHandler::HandleHotwordResult(bool enable_hotword) {
+ enable_hotword_ = enable_hotword;
+
+ if (!email_optin_needed_) {
+ // No need to send email optin result. Safe to update hotword pref and
+ // restart Assistant here.
+ PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionHotwordEnabled,
+ enable_hotword);
+ }
+}
+
+void AssistantOptInFlowScreenHandler::HandleLoadingScreenUserAction(
+ const std::string& action) {
+ if (action == kSkipPressed) {
+ screen_->OnUserAction(kFlowFinished);
+ }
+}
+
+void AssistantOptInFlowScreenHandler::HandleValuePropScreenUserAction(
+ const std::string& action) {
+ if (action == kSkipPressed) {
+ OnActivityControlOptInResult(false);
+ } else if (action == kNextPressed) {
+ OnActivityControlOptInResult(true);
+ }
+}
+
+void AssistantOptInFlowScreenHandler::HandleThirdPartyScreenUserAction(
+ const std::string& action) {
+ if (action == kNextPressed) {
+ RecordAssistantOptInStatus(THIRD_PARTY_CONTINUED);
+ ShowNextScreen();
+ }
+}
+
+void AssistantOptInFlowScreenHandler::HandleGetMoreScreenUserAction(
+ const bool screen_context,
+ const bool email_opted_in) {
+ RecordAssistantOptInStatus(GET_MORE_CONTINUED);
+ PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
+ prefs->SetBoolean(arc::prefs::kVoiceInteractionContextEnabled,
+ screen_context);
+ OnEmailOptInResult(email_opted_in);
+}
+
+void AssistantOptInFlowScreenHandler::HandleReadyScreenUserAction(
+ const std::string& action) {
+ if (action == kNextPressed) {
+ RecordAssistantOptInStatus(READY_SCREEN_CONTINUED);
+ screen_->OnUserAction(kFlowFinished);
+ }
+}
+
+void AssistantOptInFlowScreenHandler::HandleValuePropScreenShown() {
+ RecordAssistantOptInStatus(ACTIVITY_CONTROL_SHOWN);
+}
+
+void AssistantOptInFlowScreenHandler::HandleThirdPartyScreenShown() {
+ RecordAssistantOptInStatus(THIRD_PARTY_SHOWN);
+}
+
+void AssistantOptInFlowScreenHandler::HandleGetMoreScreenShown() {
+ RecordAssistantOptInStatus(GET_MORE_SHOWN);
+}
+
+void AssistantOptInFlowScreenHandler::HandleReadyScreenShown() {
+ RecordAssistantOptInStatus(READY_SCREEN_SHOWN);
+}
+
+void AssistantOptInFlowScreenHandler::HandleFlowFinished() {
+ screen_->OnUserAction(kFlowFinished);
+}
+
+void AssistantOptInFlowScreenHandler::HandleFlowInitialized() {}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h
new file mode 100644
index 00000000000..bcd0ff69667
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h
@@ -0,0 +1,110 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ASSISTANT_OPTIN_FLOW_SCREEN_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ASSISTANT_OPTIN_FLOW_SCREEN_HANDLER_H_
+
+#include <memory>
+#include <string>
+
+#include "base/macros.h"
+#include "chrome/browser/chromeos/arc/voice_interaction/voice_interaction_controller_client.h"
+#include "chrome/browser/chromeos/login/screens/assistant_optin_flow_screen_view.h"
+#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
+#include "chromeos/services/assistant/public/mojom/settings.mojom.h"
+
+namespace chromeos {
+
+// TODO(updowndota): Refactor to reuse AssistantOptInHandler methods.
+class AssistantOptInFlowScreenHandler
+ : public BaseScreenHandler,
+ public AssistantOptInFlowScreenView,
+ public arc::VoiceInteractionControllerClient::Observer {
+ public:
+ AssistantOptInFlowScreenHandler();
+ ~AssistantOptInFlowScreenHandler() override;
+
+ // BaseScreenHandler:
+ void DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) override;
+ void RegisterMessages() override;
+
+ // AssistantOptInFlowScreenView:
+ void Bind(AssistantOptInFlowScreen* screen) override;
+ void Unbind() override;
+ void Show() override;
+ void Hide() override;
+
+ // Send messages to the page.
+ void ShowNextScreen();
+
+ // Handle user opt-in result.
+ void OnActivityControlOptInResult(bool opted_in);
+ void OnEmailOptInResult(bool opted_in);
+
+ private:
+ // BaseScreenHandler:
+ void Initialize() override;
+
+ // arc::VoiceInteractionControllerClient::Observer overrides
+ void OnStateChanged(ash::mojom::VoiceInteractionState state) override;
+
+ // Connect to assistant settings manager.
+ void BindAssistantSettingsManager();
+
+ // Send GetSettings request for the opt-in UI.
+ void SendGetSettingsRequest();
+
+ // Send message and consent data to the page.
+ void ReloadContent(const base::Value& dict);
+ void AddSettingZippy(const std::string& type, const base::Value& data);
+
+ // Handle response from the settings manager.
+ void OnGetSettingsResponse(const std::string& settings);
+ void OnUpdateSettingsResponse(const std::string& settings);
+
+ // Handler for JS WebUI message.
+ void HandleLoadingScreenUserAction(const std::string& action);
+ void HandleValuePropScreenUserAction(const std::string& action);
+ void HandleThirdPartyScreenUserAction(const std::string& action);
+ void HandleGetMoreScreenUserAction(const bool screen_context,
+ const bool email_opted_in);
+ void HandleReadyScreenUserAction(const std::string& action);
+ void HandleValuePropScreenShown();
+ void HandleThirdPartyScreenShown();
+ void HandleGetMoreScreenShown();
+ void HandleReadyScreenShown();
+ void HandleHotwordResult(bool enable_hotword);
+ void HandleFlowFinished();
+ void HandleFlowInitialized();
+
+ AssistantOptInFlowScreen* screen_ = nullptr;
+
+ // Whether the screen should be shown right after initialization.
+ bool show_on_init_ = false;
+
+ // Consent token used to complete the opt-in.
+ std::string consent_token_;
+
+ // An opaque token for audit record.
+ std::string ui_audit_key_;
+
+ // Whether activity control is needed for user.
+ bool activity_control_needed_ = true;
+
+ // Whether email optin is needed for user.
+ bool email_optin_needed_ = false;
+
+ // Whether user chose to enable hotword.
+ bool enable_hotword_ = true;
+
+ assistant::mojom::AssistantSettingsManagerPtr settings_manager_;
+ base::WeakPtrFactory<AssistantOptInFlowScreenHandler> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(AssistantOptInFlowScreenHandler);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ASSISTANT_OPTIN_FLOW_SCREEN_HANDLER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
index 919aa82003b..6137e9ad4e4 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
@@ -10,11 +10,13 @@
#include "ash/public/interfaces/event_rewriter_controller.mojom.h"
#include "ash/shell.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
+#include "chrome/browser/chromeos/login/demo_mode/demo_setup_controller.h"
#include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/lock/screen_locker.h"
@@ -92,15 +94,11 @@ CoreOobeHandler::CoreOobeHandler(OobeUI* oobe_ui,
weak_ptr_factory_(this) {
DCHECK(js_calls_container);
set_call_js_prefix(kJsScreenPath);
- if (features::IsAshInBrowserProcess()) {
- AccessibilityManager* accessibility_manager = AccessibilityManager::Get();
- CHECK(accessibility_manager);
- accessibility_subscription_ = accessibility_manager->RegisterCallback(
- base::Bind(&CoreOobeHandler::OnAccessibilityStatusChanged,
- base::Unretained(this)));
- } else {
- NOTIMPLEMENTED();
- }
+ AccessibilityManager* accessibility_manager = AccessibilityManager::Get();
+ CHECK(accessibility_manager);
+ accessibility_subscription_ = accessibility_manager->RegisterCallback(
+ base::Bind(&CoreOobeHandler::OnAccessibilityStatusChanged,
+ base::Unretained(this)));
TabletModeClient* tablet_mode_client = TabletModeClient::Get();
tablet_mode_client->AddObserver(this);
@@ -129,9 +127,11 @@ void CoreOobeHandler::DeclareLocalizedValues(
// OOBE accessibility options menu strings shown on each screen.
builder->Add("accessibilityLink", IDS_OOBE_ACCESSIBILITY_LINK);
builder->Add("spokenFeedbackOption", IDS_OOBE_SPOKEN_FEEDBACK_OPTION);
+ builder->Add("selectToSpeakOption", IDS_OOBE_SELECT_TO_SPEAK_OPTION);
builder->Add("largeCursorOption", IDS_OOBE_LARGE_CURSOR_OPTION);
builder->Add("highContrastOption", IDS_OOBE_HIGH_CONTRAST_MODE_OPTION);
builder->Add("screenMagnifierOption", IDS_OOBE_SCREEN_MAGNIFIER_OPTION);
+ builder->Add("dockedMagnifierOption", IDS_OOBE_DOCKED_MAGNIFIER_OPTION);
builder->Add("virtualKeyboardOption", IDS_OOBE_VIRTUAL_KEYBOARD_OPTION);
builder->Add("closeAccessibilityMenu", IDS_OOBE_CLOSE_ACCESSIBILITY_MENU);
@@ -183,6 +183,8 @@ void CoreOobeHandler::Initialize() {
void CoreOobeHandler::GetAdditionalParameters(base::DictionaryValue* dict) {
dict->SetKey("isInTabletMode",
base::Value(TabletModeClient::Get()->tablet_mode_enabled()));
+ dict->SetKey("isDemoModeEnabled",
+ base::Value(DemoSetupController::IsDemoModeAllowed()));
}
void CoreOobeHandler::RegisterMessages() {
@@ -199,6 +201,10 @@ void CoreOobeHandler::RegisterMessages() {
&CoreOobeHandler::HandleEnableScreenMagnifier);
AddCallback("enableSpokenFeedback",
&CoreOobeHandler::HandleEnableSpokenFeedback);
+ AddCallback("enableSelectToSpeak",
+ &CoreOobeHandler::HandleEnableSelectToSpeak);
+ AddCallback("enableDockedMagnifier",
+ &CoreOobeHandler::HandleEnableDockedMagnifier);
AddCallback("setDeviceRequisition",
&CoreOobeHandler::HandleSetDeviceRequisition);
AddCallback("screenAssetsLoaded", &CoreOobeHandler::HandleScreenAssetsLoaded);
@@ -348,7 +354,6 @@ void CoreOobeHandler::HandleEnableVirtualKeyboard(bool enabled) {
}
void CoreOobeHandler::HandleEnableScreenMagnifier(bool enabled) {
- // TODO(nkostylev): Add support for partial screen magnifier.
DCHECK(MagnificationManager::Get());
MagnificationManager::Get()->SetMagnifierEnabled(enabled);
}
@@ -356,8 +361,22 @@ void CoreOobeHandler::HandleEnableScreenMagnifier(bool enabled) {
void CoreOobeHandler::HandleEnableSpokenFeedback(bool /* enabled */) {
// Checkbox is initialized on page init and updates when spoken feedback
// setting is changed so just toggle spoken feedback here.
- AccessibilityManager* manager = AccessibilityManager::Get();
- manager->EnableSpokenFeedback(!manager->IsSpokenFeedbackEnabled());
+ AccessibilityManager::Get()->EnableSpokenFeedback(
+ !AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
+}
+
+void CoreOobeHandler::HandleEnableSelectToSpeak(bool /* enabled */) {
+ // Checkbox is initialized on page init and updates when Select to Speak
+ // setting is changed so just toggle Select to Speak here.
+ AccessibilityManager::Get()->SetSelectToSpeakEnabled(
+ !AccessibilityManager::Get()->IsSelectToSpeakEnabled());
+}
+
+void CoreOobeHandler::HandleEnableDockedMagnifier(bool enabled) {
+ // Checkbox is initialized on page init and updates when the docked magnifier
+ // setting is changed so just toggle Select to Speak here.
+ DCHECK(MagnificationManager::Get());
+ MagnificationManager::Get()->SetDockedMagnifierEnabled(enabled);
}
void CoreOobeHandler::HandleSetDeviceRequisition(
@@ -417,12 +436,17 @@ void CoreOobeHandler::HandleToggleResetScreen() {
// purpose of installing a TPM firmware update.
tpm_firmware_update::GetAvailableUpdateModes(
base::BindOnce([](const std::set<tpm_firmware_update::Mode>& modes) {
- if (modes.count(tpm_firmware_update::Mode::kPowerwash) > 0) {
+ using tpm_firmware_update::Mode;
+ for (Mode mode : {Mode::kPowerwash, Mode::kCleanup}) {
+ if (modes.count(mode) == 0)
+ continue;
+
// Force the TPM firmware update option to be enabled.
g_browser_process->local_state()->SetInteger(
prefs::kFactoryResetTPMFirmwareUpdateMode,
- static_cast<int>(tpm_firmware_update::Mode::kPowerwash));
+ static_cast<int>(mode));
LaunchResetScreen();
+ return;
}
}),
base::TimeDelta());
@@ -469,12 +493,6 @@ void CoreOobeHandler::ForwardAccelerator(std::string accelerator_name) {
}
void CoreOobeHandler::UpdateA11yState() {
- if (!features::IsAshInBrowserProcess()) {
- NOTIMPLEMENTED();
- return;
- }
- // TODO(dpolukhin): crbug.com/412891
- DCHECK(MagnificationManager::Get());
base::DictionaryValue a11y_info;
a11y_info.SetBoolean("highContrastEnabled",
AccessibilityManager::Get()->IsHighContrastEnabled());
@@ -482,8 +500,24 @@ void CoreOobeHandler::UpdateA11yState() {
AccessibilityManager::Get()->IsLargeCursorEnabled());
a11y_info.SetBoolean("spokenFeedbackEnabled",
AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
- a11y_info.SetBoolean("screenMagnifierEnabled",
- MagnificationManager::Get()->IsMagnifierEnabled());
+ a11y_info.SetBoolean("selectToSpeakEnabled",
+ AccessibilityManager::Get()->IsSelectToSpeakEnabled());
+ a11y_info.SetBoolean(
+ "enableExperimentalA11yFeatures",
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableExperimentalAccessibilityFeatures));
+ if (!features::IsMultiProcessMash()) {
+ DCHECK(MagnificationManager::Get());
+ a11y_info.SetBoolean("screenMagnifierEnabled",
+ MagnificationManager::Get()->IsMagnifierEnabled());
+ a11y_info.SetBoolean(
+ "dockedMagnifierEnabled",
+ MagnificationManager::Get()->IsDockedMagnifierEnabled());
+ } else {
+ // TODO: get MagnificationManager working with mash.
+ // https://crbug.com/817157
+ NOTIMPLEMENTED_LOG_ONCE();
+ }
a11y_info.SetBoolean("virtualKeyboardEnabled",
AccessibilityManager::Get()->IsVirtualKeyboardEnabled());
CallJSOrDefer("refreshA11yInfo", a11y_info);
@@ -545,9 +579,9 @@ void CoreOobeHandler::UpdateDeviceRequisition() {
}
void CoreOobeHandler::UpdateKeyboardState() {
- // TODO(mash): Support virtual keyboard under MASH. There is no
+ // TODO(crbug.com/646565): Support virtual keyboard under MASH. There is no
// KeyboardController in the browser process under MASH.
- if (features::IsAshInBrowserProcess()) {
+ if (!features::IsUsingWindowService()) {
auto* keyboard_controller = keyboard::KeyboardController::Get();
if (keyboard_controller->enabled()) {
const bool is_keyboard_shown = keyboard_controller->IsKeyboardVisible();
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
index 95ff28854a8..933dd72f91f 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
@@ -130,6 +130,8 @@ class CoreOobeHandler : public BaseWebUIHandler,
void HandleEnableVirtualKeyboard(bool enabled);
void HandleEnableScreenMagnifier(bool enabled);
void HandleEnableSpokenFeedback(bool /* enabled */);
+ void HandleEnableSelectToSpeak(bool /* enabled */);
+ void HandleEnableDockedMagnifier(bool /* enabled */);
void HandleInitialized();
void HandleSkipUpdateEnrollAfterEula();
void HandleUpdateCurrentScreen(const std::string& screen);
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc
index dfd1bba9c94..c5b5f83824d 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc
@@ -4,13 +4,9 @@
#include "chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h"
-#include "base/command_line.h"
-#include "base/values.h"
#include "chrome/browser/chromeos/login/oobe_screen.h"
#include "chrome/browser/chromeos/login/screens/demo_setup_screen.h"
-#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/grit/generated_resources.h"
-#include "chromeos/chromeos_switches.h"
#include "components/login/localized_values_builder.h"
namespace {
@@ -61,12 +57,4 @@ void DemoSetupScreenHandler::DeclareLocalizedValues(
IDS_OOBE_DEMO_SETUP_ERROR_SCREEN_RETRY_BUTTON_LABEL);
}
-void DemoSetupScreenHandler::GetAdditionalParameters(
- base::DictionaryValue* dict) {
- const bool is_offline_demo_mode_enabled =
- base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableOfflineDemoMode);
- dict->SetBoolean("offlineDemoModeEnabled", is_offline_demo_mode_enabled);
-}
-
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h
index 2acc8e02609..46c6c14e3f0 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h
@@ -30,7 +30,6 @@ class DemoSetupScreenHandler : public BaseScreenHandler,
void Initialize() override;
void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override;
- void GetAdditionalParameters(base::DictionaryValue* dict) override;
private:
DemoSetupScreen* screen_ = nullptr;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_manager.cc b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_manager.cc
index 966871e92e0..0a205aa2534 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_manager.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_manager.cc
@@ -8,6 +8,9 @@
#include "base/logging.h"
#include "chrome/browser/ui/webui/chromeos/login/discover/discover_handler.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.h"
#include "chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_welcome.h"
namespace chromeos {
@@ -27,6 +30,12 @@ bool DiscoverManager::IsCompleted() const {
}
void DiscoverManager::CreateModules() {
+ modules_[DiscoverModuleLaunchHelpApp::kModuleName] =
+ std::make_unique<DiscoverModuleLaunchHelpApp>();
+ modules_[DiscoverModuleRedeemOffers::kModuleName] =
+ std::make_unique<DiscoverModuleRedeemOffers>();
+ modules_[DiscoverModuleSyncFiles::kModuleName] =
+ std::make_unique<DiscoverModuleSyncFiles>();
modules_[DiscoverModuleWelcome::kModuleName] =
std::make_unique<DiscoverModuleWelcome>();
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.cc b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.cc
new file mode 100644
index 00000000000..8f8fcbf6a6b
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.cc
@@ -0,0 +1,104 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_navigator.h"
+#include "chrome/browser/ui/browser_navigator_params.h"
+#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager_observer.h"
+#include "chrome/common/webui_url_constants.h"
+#include "chrome/grit/generated_resources.h"
+#include "content/public/browser/web_contents.h"
+#include "ui/gfx/geometry/rect.h"
+#include "url/gurl.h"
+
+namespace chromeos {
+
+// static
+DiscoverWindowManager* DiscoverWindowManager::GetInstance() {
+ static base::NoDestructor<DiscoverWindowManager> window_manager;
+ return window_manager.get();
+}
+
+void DiscoverWindowManager::AddObserver(
+ DiscoverWindowManagerObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void DiscoverWindowManager::RemoveObserver(
+ const DiscoverWindowManagerObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
+void DiscoverWindowManager::ShowChromeDiscoverPageForProfile(Profile* profile) {
+ const GURL gurl(chrome::kChromeUIDiscoverURL);
+
+ // Use the original (non off-the-record) profile for discover unless
+ // this is a guest session.
+ if (!profile->IsGuestSession() && profile->IsOffTheRecord())
+ profile = profile->GetOriginalProfile();
+
+ // Look for an existing browser window.
+ Browser* browser = FindBrowserForProfile(profile);
+ if (browser) {
+ DCHECK(browser->profile() == profile);
+ const content::WebContents* web_contents =
+ browser->tab_strip_model()->GetWebContentsAt(0);
+ if (web_contents && web_contents->GetURL() == gurl) {
+ browser->window()->Show();
+ return;
+ }
+ NavigateParams params(browser, gurl, ui::PAGE_TRANSITION_AUTO_BOOKMARK);
+ params.window_action = NavigateParams::SHOW_WINDOW;
+ params.user_gesture = true;
+ Navigate(&params);
+ return;
+ }
+
+ // No existing browser window, create one.
+ NavigateParams params(profile, gurl, ui::PAGE_TRANSITION_AUTO_BOOKMARK);
+ params.disposition = WindowOpenDisposition::NEW_POPUP;
+ params.trusted_source = true;
+ params.window_action = NavigateParams::SHOW_WINDOW;
+ params.user_gesture = true;
+ params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE;
+ // Adjust window size by the title bar size.
+ // TODO(https://crbug.com/864686): remove this.
+ params.window_bounds = gfx::Rect(768, 640 + 32 /* FIXMEalemate) */);
+
+ Navigate(&params);
+
+ // operator[] not used because SessionID has no default constructor.
+ discover_session_map_.emplace(profile, SessionID::InvalidValue())
+ .first->second = params.browser->session_id();
+ DCHECK(params.browser->is_trusted_source());
+
+ for (DiscoverWindowManagerObserver& observer : observers_)
+ observer.OnNewDiscoverWindow(params.browser);
+}
+
+Browser* DiscoverWindowManager::FindBrowserForProfile(Profile* profile) {
+ ProfileSessionMap::iterator iter = discover_session_map_.find(profile);
+ if (iter != discover_session_map_.end())
+ return chrome::FindBrowserWithID(iter->second);
+ return nullptr;
+}
+
+bool DiscoverWindowManager::IsDiscoverBrowser(Browser* browser) const {
+ ProfileSessionMap::const_iterator iter =
+ discover_session_map_.find(browser->profile());
+ return (iter != discover_session_map_.end() &&
+ iter->second == browser->session_id());
+}
+
+DiscoverWindowManager::DiscoverWindowManager() = default;
+
+DiscoverWindowManager::~DiscoverWindowManager() = default;
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.h b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.h
new file mode 100644
index 00000000000..2d8958ffaa2
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager.h
@@ -0,0 +1,58 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_DISCOVER_WINDOW_MANAGER_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_DISCOVER_WINDOW_MANAGER_H_
+
+#include <map>
+
+#include "base/macros.h"
+#include "base/no_destructor.h"
+#include "base/observer_list.h"
+#include "components/sessions/core/session_id.h"
+
+class Browser;
+class Profile;
+
+namespace chromeos {
+
+class DiscoverWindowManagerObserver;
+
+// Manages Discover windows for CrOS. Each Profile is associated with a single
+// Browser window for Discover UI that will be created when the separate
+// Discover App is first opened.
+class DiscoverWindowManager {
+ public:
+ static DiscoverWindowManager* GetInstance();
+
+ void AddObserver(DiscoverWindowManagerObserver* observer);
+ void RemoveObserver(const DiscoverWindowManagerObserver* observer);
+
+ // Shows a chrome://oobe/discover/ page in an an existing system
+ // Browser window for |profile| or creates a new one.
+ void ShowChromeDiscoverPageForProfile(Profile* profile);
+
+ // If a Browser Discover app window for |profile| has already been created,
+ // returns it, otherwise returns NULL.
+ Browser* FindBrowserForProfile(Profile* profile);
+
+ // Returns true if |browser| is a Discover app window.
+ bool IsDiscoverBrowser(Browser* browser) const;
+
+ private:
+ friend class base::NoDestructor<DiscoverWindowManager>;
+ using ProfileSessionMap = std::map<Profile*, SessionID>;
+
+ DiscoverWindowManager();
+ ~DiscoverWindowManager();
+
+ base::ObserverList<DiscoverWindowManagerObserver> observers_;
+ ProfileSessionMap discover_session_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(DiscoverWindowManager);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_DISCOVER_WINDOW_MANAGER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager_observer.h b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager_observer.h
new file mode 100644
index 00000000000..30a9c062214
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/discover_window_manager_observer.h
@@ -0,0 +1,25 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_DISCOVER_WINDOW_MANAGER_OBSERVER_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_DISCOVER_WINDOW_MANAGER_OBSERVER_H_
+
+#include "base/observer_list_types.h"
+
+class Browser;
+
+namespace chromeos {
+
+class DiscoverWindowManagerObserver : public base::CheckedObserver {
+ public:
+ // Called when a new Discover App browser window is created.
+ virtual void OnNewDiscoverWindow(Browser* discover_browser) = 0;
+
+ protected:
+ ~DiscoverWindowManagerObserver() override = default;
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_DISCOVER_WINDOW_MANAGER_OBSERVER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.cc b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.cc
new file mode 100644
index 00000000000..cd3e89c41f8
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.cc
@@ -0,0 +1,77 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.h"
+
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_handler.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/login/localized_values_builder.h"
+#include "content/public/browser/web_ui.h"
+#include "ui/chromeos/devicetype_utils.h"
+
+namespace chromeos {
+
+namespace {
+
+class DiscoverModuleLaunchHelpAppHandler : public DiscoverHandler {
+ public:
+ DiscoverModuleLaunchHelpAppHandler();
+ ~DiscoverModuleLaunchHelpAppHandler() override = default;
+
+ private:
+ // BaseWebUIHandler: implementation
+ void DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) override;
+ void Initialize() override;
+ void RegisterMessages() override;
+
+ // Message handlers.
+ void HandleLaunchHelpApp();
+
+ DISALLOW_COPY_AND_ASSIGN(DiscoverModuleLaunchHelpAppHandler);
+};
+
+DiscoverModuleLaunchHelpAppHandler::DiscoverModuleLaunchHelpAppHandler()
+ : DiscoverHandler(DiscoverModuleLaunchHelpApp::kModuleName) {}
+
+void DiscoverModuleLaunchHelpAppHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {
+ builder->Add("discoverGetHelp", IDS_DISCOVER_GET_HELP);
+}
+
+void DiscoverModuleLaunchHelpAppHandler::Initialize() {}
+
+void DiscoverModuleLaunchHelpAppHandler::RegisterMessages() {
+ AddPrefixedCallback("handleLaunchHelpApp",
+ &DiscoverModuleLaunchHelpAppHandler::HandleLaunchHelpApp);
+}
+
+void DiscoverModuleLaunchHelpAppHandler::HandleLaunchHelpApp() {
+ chrome::ShowHelpForProfile(Profile::FromWebUI(web_ui()),
+ chrome::HelpSource::HELP_SOURCE_WEBUI);
+}
+
+} // anonymous namespace
+
+/* ***************************************************************** */
+/* Discover LaunchHelpApp module implementation below. */
+
+const char DiscoverModuleLaunchHelpApp::kModuleName[] = "launch-help-app";
+
+DiscoverModuleLaunchHelpApp::DiscoverModuleLaunchHelpApp() = default;
+
+DiscoverModuleLaunchHelpApp::~DiscoverModuleLaunchHelpApp() = default;
+
+bool DiscoverModuleLaunchHelpApp::IsCompleted() const {
+ return false;
+}
+
+std::unique_ptr<DiscoverHandler>
+DiscoverModuleLaunchHelpApp::CreateWebUIHandler() const {
+ return std::make_unique<DiscoverModuleLaunchHelpAppHandler>();
+}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.h b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.h
new file mode 100644
index 00000000000..7a386aba397
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_launch_help_app.h
@@ -0,0 +1,32 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_LAUNCH_HELP_APP_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_LAUNCH_HELP_APP_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_module.h"
+
+namespace chromeos {
+
+class DiscoverModuleLaunchHelpApp : public DiscoverModule {
+ public:
+ DiscoverModuleLaunchHelpApp();
+ ~DiscoverModuleLaunchHelpApp() override;
+
+ // DiscoverModule:
+ bool IsCompleted() const override;
+ std::unique_ptr<DiscoverHandler> CreateWebUIHandler() const override;
+
+ // Module name.
+ static const char kModuleName[];
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiscoverModuleLaunchHelpApp);
+};
+
+} // namespace chromeos
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_LAUNCH_HELP_APP_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.cc b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.cc
new file mode 100644
index 00000000000..300586ee25d
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.cc
@@ -0,0 +1,63 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.h"
+
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_handler.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/login/localized_values_builder.h"
+#include "ui/chromeos/devicetype_utils.h"
+
+namespace chromeos {
+
+namespace {
+
+class DiscoverModuleRedeemOffersHandler : public DiscoverHandler {
+ public:
+ DiscoverModuleRedeemOffersHandler();
+ ~DiscoverModuleRedeemOffersHandler() override = default;
+
+ private:
+ // BaseWebUIHandler: implementation
+ void DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) override;
+ void Initialize() override;
+ void RegisterMessages() override;
+
+ DISALLOW_COPY_AND_ASSIGN(DiscoverModuleRedeemOffersHandler);
+};
+
+DiscoverModuleRedeemOffersHandler::DiscoverModuleRedeemOffersHandler()
+ : DiscoverHandler(DiscoverModuleRedeemOffers::kModuleName) {}
+
+void DiscoverModuleRedeemOffersHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {
+ builder->Add("discoverRedeemYourOffers", IDS_DISCOVER_REDEEM_YOUR_OFFERS);
+}
+
+void DiscoverModuleRedeemOffersHandler::Initialize() {}
+
+void DiscoverModuleRedeemOffersHandler::RegisterMessages() {}
+
+} // anonymous namespace
+
+/* ***************************************************************** */
+/* Discover RedeemOffers module implementation below. */
+
+const char DiscoverModuleRedeemOffers::kModuleName[] = "redeem-offers";
+
+DiscoverModuleRedeemOffers::DiscoverModuleRedeemOffers() = default;
+
+DiscoverModuleRedeemOffers::~DiscoverModuleRedeemOffers() = default;
+
+bool DiscoverModuleRedeemOffers::IsCompleted() const {
+ return false;
+}
+
+std::unique_ptr<DiscoverHandler>
+DiscoverModuleRedeemOffers::CreateWebUIHandler() const {
+ return std::make_unique<DiscoverModuleRedeemOffersHandler>();
+}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.h b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.h
new file mode 100644
index 00000000000..ac4d91b82fb
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_redeem_offers.h
@@ -0,0 +1,32 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_REDEEM_OFFERS_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_REDEEM_OFFERS_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_module.h"
+
+namespace chromeos {
+
+class DiscoverModuleRedeemOffers : public DiscoverModule {
+ public:
+ DiscoverModuleRedeemOffers();
+ ~DiscoverModuleRedeemOffers() override;
+
+ // DiscoverModule:
+ bool IsCompleted() const override;
+ std::unique_ptr<DiscoverHandler> CreateWebUIHandler() const override;
+
+ // Module name.
+ static const char kModuleName[];
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiscoverModuleRedeemOffers);
+};
+
+} // namespace chromeos
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_REDEEM_OFFERS_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.cc b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.cc
new file mode 100644
index 00000000000..cb910b79fc2
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.cc
@@ -0,0 +1,63 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.h"
+
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_handler.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/login/localized_values_builder.h"
+#include "ui/chromeos/devicetype_utils.h"
+
+namespace chromeos {
+
+namespace {
+
+class DiscoverModuleSyncFilesHandler : public DiscoverHandler {
+ public:
+ DiscoverModuleSyncFilesHandler();
+ ~DiscoverModuleSyncFilesHandler() override = default;
+
+ private:
+ // BaseWebUIHandler: implementation
+ void DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) override;
+ void Initialize() override;
+ void RegisterMessages() override;
+
+ DISALLOW_COPY_AND_ASSIGN(DiscoverModuleSyncFilesHandler);
+};
+
+DiscoverModuleSyncFilesHandler::DiscoverModuleSyncFilesHandler()
+ : DiscoverHandler(DiscoverModuleSyncFiles::kModuleName) {}
+
+void DiscoverModuleSyncFilesHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {
+ builder->Add("discoverSyncMyFiles", IDS_DISCOVER_SYNC_MY_FILES);
+}
+
+void DiscoverModuleSyncFilesHandler::Initialize() {}
+
+void DiscoverModuleSyncFilesHandler::RegisterMessages() {}
+
+} // anonymous namespace
+
+/* ***************************************************************** */
+/* Discover SyncFiles module implementation below. */
+
+const char DiscoverModuleSyncFiles::kModuleName[] = "sync-files";
+
+DiscoverModuleSyncFiles::DiscoverModuleSyncFiles() = default;
+
+DiscoverModuleSyncFiles::~DiscoverModuleSyncFiles() = default;
+
+bool DiscoverModuleSyncFiles::IsCompleted() const {
+ return false;
+}
+
+std::unique_ptr<DiscoverHandler> DiscoverModuleSyncFiles::CreateWebUIHandler()
+ const {
+ return std::make_unique<DiscoverModuleSyncFilesHandler>();
+}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.h b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.h
new file mode 100644
index 00000000000..2eccb231799
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_sync_files.h
@@ -0,0 +1,32 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_SYNC_FILES_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_SYNC_FILES_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "chrome/browser/ui/webui/chromeos/login/discover/discover_module.h"
+
+namespace chromeos {
+
+class DiscoverModuleSyncFiles : public DiscoverModule {
+ public:
+ DiscoverModuleSyncFiles();
+ ~DiscoverModuleSyncFiles() override;
+
+ // DiscoverModule:
+ bool IsCompleted() const override;
+ std::unique_ptr<DiscoverHandler> CreateWebUIHandler() const override;
+
+ // Module name.
+ static const char kModuleName[];
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DiscoverModuleSyncFiles);
+};
+
+} // namespace chromeos
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DISCOVER_MODULES_DISCOVER_MODULE_SYNC_FILES_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_welcome.cc b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_welcome.cc
index ff9c37f20c6..c5c8cb6ec14 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_welcome.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/discover/modules/discover_module_welcome.cc
@@ -33,8 +33,6 @@ DiscoverModuleWelcomeHandler::DiscoverModuleWelcomeHandler()
void DiscoverModuleWelcomeHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) {
- builder->Add("discoverWelcomeGetStarted", IDS_DISCOVER_WELCOME_GET_STARTED);
- builder->Add("discoverWelcomeLater", IDS_DISCOVER_WELCOME_LATER);
builder->AddF("discoverWelcomeTitle", IDS_DISCOVER_WELCOME_TITLE,
ui::GetChromeOSDeviceName());
builder->AddF("discoverWelcomeSubTitle", IDS_DISCOVER_WELCOME_SUBTITLE,
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
index a03537115f1..f7de7178211 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -14,7 +14,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"
@@ -574,8 +574,9 @@ void EncryptionMigrationScreenHandler::StartMigration() {
auth_request = CreateAuthorizationRequest();
}
DBusThreadManager::Get()->GetCryptohomeClient()->MountEx(
- cryptohome::Identification(user_context_.GetAccountId()), auth_request,
- mount,
+ cryptohome::CreateAccountIdentifierFromAccountId(
+ user_context_.GetAccountId()),
+ auth_request, mount,
base::BindOnce(&EncryptionMigrationScreenHandler::OnMountExistingVault,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -601,7 +602,9 @@ void EncryptionMigrationScreenHandler::OnMountExistingVault(
request.set_minimal_migration(IsMinimalMigration());
DBusThreadManager::Get()->GetCryptohomeClient()->AddObserver(this);
DBusThreadManager::Get()->GetCryptohomeClient()->MigrateToDircrypto(
- cryptohome::Identification(user_context_.GetAccountId()), request,
+ cryptohome::CreateAccountIdentifierFromAccountId(
+ user_context_.GetAccountId()),
+ request,
base::Bind(&EncryptionMigrationScreenHandler::OnMigrationRequested,
weak_ptr_factory_.GetWeakPtr()));
}
@@ -639,23 +642,30 @@ void EncryptionMigrationScreenHandler::RemoveCryptohome() {
user_manager::UserManager::Get()->SaveUserOAuthStatus(
user_context_.GetAccountId(),
user_manager::User::OAUTH2_TOKEN_STATUS_INVALID);
- cryptohome::AsyncMethodCaller::GetInstance()->AsyncRemove(
- cryptohome::Identification(user_context_.GetAccountId()),
- base::Bind(&EncryptionMigrationScreenHandler::OnRemoveCryptohome,
- weak_ptr_factory_.GetWeakPtr()));
+
+ const cryptohome::Identification cryptohome_id(user_context_.GetAccountId());
+
+ cryptohome::AccountIdentifier account_id_proto;
+ account_id_proto.set_account_id(cryptohome_id.id());
+
+ DBusThreadManager::Get()->GetCryptohomeClient()->RemoveEx(
+ account_id_proto,
+ base::BindOnce(&EncryptionMigrationScreenHandler::OnRemoveCryptohome,
+ weak_ptr_factory_.GetWeakPtr()));
}
void EncryptionMigrationScreenHandler::OnRemoveCryptohome(
- bool success,
- cryptohome::MountError return_code) {
- LOG_IF(ERROR, !success) << "Removing cryptohome failed. return code: "
- << return_code;
- if (success)
+ base::Optional<cryptohome::BaseReply> reply) {
+ cryptohome::MountError error = BaseReplyToMountError(reply);
+ if (error == cryptohome::MOUNT_ERROR_NONE) {
RecordRemoveCryptohomeResultSuccess(IsResumingIncompleteMigration(),
IsArcKiosk());
- else
+ } else {
+ LOG(ERROR) << "Removing cryptohome failed. return code: "
+ << reply.value().error();
RecordRemoveCryptohomeResultFailure(IsResumingIncompleteMigration(),
IsArcKiosk());
+ }
UpdateUIState(UIState::MIGRATION_FAILED);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
index f13f58d641d..74affe81713 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
@@ -108,7 +108,7 @@ class EncryptionMigrationScreenHandler : public EncryptionMigrationScreenView,
void OnMountExistingVault(base::Optional<cryptohome::BaseReply> reply);
// Removes cryptohome and shows the error screen after the removal finishes.
void RemoveCryptohome();
- void OnRemoveCryptohome(bool success, cryptohome::MountError return_code);
+ void OnRemoveCryptohome(base::Optional<cryptohome::BaseReply> reply);
// Creates authorization request for MountEx method using |user_context_|.
cryptohome::AuthorizationRequest CreateAuthorizationRequest();
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc
index 567d7be991b..537629dca63 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc
@@ -19,6 +19,7 @@
#include "chromeos/dbus/fake_cryptohome_client.h"
#include "chromeos/dbus/fake_power_manager_client.h"
#include "chromeos/dbus/power_policy_controller.h"
+#include "chromeos/dbus/util/account_identifier_operators.h"
#include "chromeos/login/auth/key.h"
#include "chromeos/login/auth/user_context.h"
#include "components/account_id/account_id.h"
@@ -230,7 +231,8 @@ TEST_F(EncryptionMigrationScreenHandlerTest, MinimalMigration) {
encryption_migration_screen_handler_->fake_wake_lock()->HasWakeLock());
EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs());
EXPECT_TRUE(fake_cryptohome_client_->minimal_migration());
- EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()),
+ EXPECT_EQ(cryptohome::CreateAccountIdentifierFromAccountId(
+ user_context_.GetAccountId()),
fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto());
EXPECT_EQ(
user_context_.GetKey()->GetSecret(),
@@ -254,7 +256,8 @@ TEST_F(EncryptionMigrationScreenHandlerTest, ResumeMinimalMigration) {
EXPECT_TRUE(continue_login_callback_called_);
EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs());
EXPECT_TRUE(fake_cryptohome_client_->minimal_migration());
- EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()),
+ EXPECT_EQ(cryptohome::CreateAccountIdentifierFromAccountId(
+ user_context_.GetAccountId()),
fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto());
EXPECT_EQ(
user_context_.GetKey()->GetSecret(),
@@ -280,7 +283,8 @@ TEST_F(EncryptionMigrationScreenHandlerTest, MinimalMigrationSlow) {
EXPECT_TRUE(restart_login_callback_called_);
EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs());
EXPECT_TRUE(fake_cryptohome_client_->minimal_migration());
- EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()),
+ EXPECT_EQ(cryptohome::CreateAccountIdentifierFromAccountId(
+ user_context_.GetAccountId()),
fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto());
EXPECT_EQ(
user_context_.GetKey()->GetSecret(),
@@ -295,10 +299,6 @@ TEST_F(EncryptionMigrationScreenHandlerTest, MinimalMigrationFails) {
scoped_task_environment_.RunUntilIdle();
- EXPECT_CALL(
- *mock_async_method_caller_,
- AsyncRemove(cryptohome::Identification(user_context_.GetAccountId()),
- _ /* callback */));
encryption_migration_screen_handler_->testing_tick_clock()->Advance(
base::TimeDelta::FromMinutes(1));
fake_cryptohome_client_->NotifyDircryptoMigrationProgress(
@@ -308,7 +308,8 @@ TEST_F(EncryptionMigrationScreenHandlerTest, MinimalMigrationFails) {
Mock::VerifyAndClearExpectations(mock_async_method_caller_);
EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs());
EXPECT_TRUE(fake_cryptohome_client_->minimal_migration());
- EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()),
+ EXPECT_EQ(cryptohome::CreateAccountIdentifierFromAccountId(
+ user_context_.GetAccountId()),
fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto());
EXPECT_EQ(
user_context_.GetKey()->GetSecret(),
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
index 2f4c2f8318c..50ea95bae58 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -419,6 +419,11 @@ void EnrollmentScreenHandler::ShowEnrollmentStatus(
case policy::DM_STATUS_SERVICE_DOMAIN_MISMATCH:
ShowError(IDS_ENTERPRISE_ENROLLMENT_DOMAIN_MISMATCH_ERROR, true);
break;
+ case policy::DM_STATUS_SERVICE_CONSUMER_ACCOUNT_WITH_PACKAGED_LICENSE:
+ ShowError(
+ IDS_ENTERPRISE_ENROLLMENT_CONSUMER_ACCOUNT_WITH_PACKAGED_LICENSE,
+ true);
+ break;
default:
ShowErrorMessage(
l10n_util::GetStringFUTF8(
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/error_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/error_screen_handler.cc
index 22f1eba88cd..bac09e27de8 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/error_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/error_screen_handler.cc
@@ -103,10 +103,11 @@ void ErrorScreenHandler::DeclareLocalizedValues(
builder->Add("rebootButton", IDS_RELAUNCH_BUTTON);
builder->Add("diagnoseButton", IDS_DIAGNOSE_BUTTON);
builder->Add("configureCertsButton", IDS_MANAGE_CERTIFICATES);
- builder->Add("continueButton", IDS_NETWORK_SELECTION_CONTINUE_BUTTON);
+ builder->Add("continueButton", IDS_WELCOME_SELECTION_CONTINUE_BUTTON);
builder->Add("okButton", IDS_APP_OK);
- builder->Add("proxySettingsMenuName", IDS_PROXY_SETTINGS_MENU_NAME);
- builder->Add("addWiFiNetworkMenuName", IDS_ADD_WI_FI_NETWORK_MENU_NAME);
+ builder->Add("proxySettingsMenuName",
+ IDS_NETWORK_PROXY_SETTINGS_LIST_ITEM_NAME);
+ builder->Add("addWiFiNetworkMenuName", IDS_NETWORK_ADD_WI_FI_LIST_ITEM_NAME);
network_element::AddLocalizedValuesToBuilder(builder);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.cc
new file mode 100644
index 00000000000..6b1a1887c5e
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.cc
@@ -0,0 +1,179 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h"
+
+#include "base/strings/string_number_conversions.h"
+#include "chrome/browser/chromeos/login/screens/fingerprint_setup_screen.h"
+#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/login/localized_values_builder.h"
+#include "components/prefs/pref_service.h"
+#include "content/public/common/service_manager_connection.h"
+#include "services/device/public/mojom/constants.mojom.h"
+#include "services/service_manager/public/cpp/connector.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace {
+
+const char kJsScreenPath[] = "login.FingerprintSetupScreen";
+
+// The max number of fingerprints that can be stored.
+constexpr int kMaxAllowedFingerprints = 3;
+
+// Determines what the newly added fingerprint's name should be.
+std::string GetDefaultFingerprintName(int enrolled_finger_count) {
+ DCHECK(enrolled_finger_count < kMaxAllowedFingerprints);
+ switch (enrolled_finger_count) {
+ case 0:
+ return l10n_util::GetStringUTF8(
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_NEW_FINGERPRINT_DEFAULT_NAME_1);
+ case 1:
+ return l10n_util::GetStringUTF8(
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_NEW_FINGERPRINT_DEFAULT_NAME_2);
+ case 2:
+ return l10n_util::GetStringUTF8(
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_NEW_FINGERPRINT_DEFAULT_NAME_3);
+ default:
+ NOTREACHED();
+ }
+ return std::string();
+}
+
+} // namespace
+
+namespace chromeos {
+
+FingerprintSetupScreenHandler::FingerprintSetupScreenHandler()
+ : BaseScreenHandler(kScreenId) {
+ set_call_js_prefix(kJsScreenPath);
+
+ service_manager::Connector* connector =
+ content::ServiceManagerConnection::GetForProcess()->GetConnector();
+ connector->BindInterface(device::mojom::kServiceName, &fp_service_);
+ device::mojom::FingerprintObserverPtr observer;
+ binding_.Bind(mojo::MakeRequest(&observer));
+ fp_service_->AddFingerprintObserver(std::move(observer));
+}
+
+FingerprintSetupScreenHandler::~FingerprintSetupScreenHandler() = default;
+
+void FingerprintSetupScreenHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {
+ builder->Add("setupFingerprintScreenTitle",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_TITLE);
+ builder->Add("setupFingerprintScreenDescription",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_SENSOR_DESCRIPTION);
+ builder->Add("skipFingerprintSetup",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_BUTTON_SKIP);
+ builder->Add("fingerprintSetupLater",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_BUTTON_LATER);
+ builder->Add("fingerprintSetupNext",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_BUTTON_NEXT);
+ builder->Add("fingerprintSetupDone",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_BUTTON_DONE);
+ builder->Add("fingerprintSetupAddAnother",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_BUTTON_ADD_ANOTHER);
+ builder->Add("placeFingerScreenTitle",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_SENSOR_LOCATION_TITLE);
+ builder->Add("enrollmentProgressScreenTitle",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_ENROLLMENT_PROGRESS_TITLE);
+ builder->Add("fingerprintSetupAddFingerprint",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_BUTTON_ADD_FINGERPRINT);
+ builder->Add("setupFingerprintEnrollmentSuccessTitle",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_ENROLLMENT_SUCCESS_TITLE);
+ builder->Add("setupFingerprintEnrollmentSuccessDescription",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_ENROLLMENT_SUCCESS_DESCRIPTION);
+ builder->Add("setupFingerprintScanMoveFinger",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_INSTRUCTION_MOVE_FINGER);
+ builder->Add("setupFingerprintScanTryAgain",
+ IDS_OOBE_FINGERPINT_SETUP_SCREEN_INSTRUCTION_TRY_AGAIN);
+}
+
+void FingerprintSetupScreenHandler::RegisterMessages() {
+ BaseScreenHandler::RegisterMessages();
+ web_ui()->RegisterMessageCallback(
+ "startEnroll",
+ base::BindRepeating(&FingerprintSetupScreenHandler::HandleStartEnroll,
+ base::Unretained(this)));
+}
+
+void FingerprintSetupScreenHandler::Bind(FingerprintSetupScreen* screen) {
+ screen_ = screen;
+ BaseScreenHandler::SetBaseScreen(screen);
+}
+
+void FingerprintSetupScreenHandler::Show() {
+ ShowScreen(kScreenId);
+}
+
+void FingerprintSetupScreenHandler::Hide() {
+ // Clean up existing fingerprint enroll session.
+ if (enroll_session_started_) {
+ fp_service_->CancelCurrentEnrollSession(base::BindOnce(
+ &FingerprintSetupScreenHandler::OnCancelCurrentEnrollSession,
+ weak_ptr_factory_.GetWeakPtr()));
+ }
+}
+
+void FingerprintSetupScreenHandler::Initialize() {}
+
+void FingerprintSetupScreenHandler::OnRestarted() {
+ VLOG(1) << "Fingerprint session restarted.";
+}
+
+void FingerprintSetupScreenHandler::OnEnrollScanDone(
+ uint32_t scan_result,
+ bool enroll_session_complete,
+ int percent_complete) {
+ VLOG(1) << "Receive fingerprint enroll scan result. scan_result="
+ << scan_result
+ << ", enroll_session_complete=" << enroll_session_complete
+ << ", percent_complete=" << percent_complete;
+ CallJS("onEnrollScanDone", static_cast<int>(scan_result),
+ enroll_session_complete, percent_complete);
+
+ if (enroll_session_complete) {
+ enroll_session_started_ = false;
+
+ ++enrolled_finger_count_;
+ CallJS("enableAddAnotherFinger",
+ enrolled_finger_count_ < kMaxAllowedFingerprints);
+
+ // Update the number of registered fingers, it's fine to override because
+ // this is the first time user log in and have no finger registered.
+ ProfileManager::GetActiveUserProfile()->GetPrefs()->SetInteger(
+ prefs::kQuickUnlockFingerprintRecord, enrolled_finger_count_);
+ }
+}
+
+void FingerprintSetupScreenHandler::OnAuthScanDone(
+ uint32_t scan_result,
+ const base::flat_map<std::string, std::vector<std::string>>& matches) {}
+
+void FingerprintSetupScreenHandler::OnSessionFailed() {
+ // TODO(xiaoyinh): Add more user visible information when available.
+ LOG(ERROR) << "Fingerprint session failed.";
+}
+
+void FingerprintSetupScreenHandler::HandleStartEnroll(
+ const base::ListValue* args) {
+ DCHECK(enrolled_finger_count_ < kMaxAllowedFingerprints);
+
+ enroll_session_started_ = true;
+ fp_service_->StartEnrollSession(
+ ProfileHelper::Get()->GetUserIdHashFromProfile(
+ ProfileManager::GetActiveUserProfile()),
+ GetDefaultFingerprintName(enrolled_finger_count_));
+}
+
+void FingerprintSetupScreenHandler::OnCancelCurrentEnrollSession(bool success) {
+ if (!success)
+ LOG(ERROR) << "Failed to cancel current fingerprint enroll session.";
+}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h
new file mode 100644
index 00000000000..40def90688f
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h
@@ -0,0 +1,71 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_FINGERPRINT_SETUP_SCREEN_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_FINGERPRINT_SETUP_SCREEN_HANDLER_H_
+
+#include "base/macros.h"
+#include "chrome/browser/chromeos/login/screens/fingerprint_setup_screen_view.h"
+#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/device/public/mojom/fingerprint.mojom.h"
+
+namespace chromeos {
+
+class FingerprintSetupScreen;
+
+// The sole implementation of the FingerprintSetupScreenView, using WebUI.
+class FingerprintSetupScreenHandler
+ : public BaseScreenHandler,
+ public FingerprintSetupScreenView,
+ public device::mojom::FingerprintObserver {
+ public:
+ FingerprintSetupScreenHandler();
+ ~FingerprintSetupScreenHandler() override;
+
+ // BaseScreenHandler:
+ void DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) override;
+ void RegisterMessages() override;
+
+ // FingerprintSetupScreenView:
+ void Bind(FingerprintSetupScreen* screen) override;
+ void Show() override;
+ void Hide() override;
+
+ // BaseScreenHandler:
+ void Initialize() override;
+
+ // device::mojom::FingerprintObserver:
+ void OnRestarted() override;
+ void OnEnrollScanDone(uint32_t scan_result,
+ bool enroll_session_complete,
+ int percent_complete) override;
+ void OnAuthScanDone(
+ uint32_t scan_result,
+ const base::flat_map<std::string, std::vector<std::string>>& matches)
+ override;
+ void OnSessionFailed() override;
+
+ private:
+ // JS callbacks.
+ void HandleStartEnroll(const base::ListValue* args);
+
+ void OnCancelCurrentEnrollSession(bool success);
+
+ FingerprintSetupScreen* screen_ = nullptr;
+
+ device::mojom::FingerprintPtr fp_service_;
+ mojo::Binding<device::mojom::FingerprintObserver> binding_{this};
+ int enrolled_finger_count_ = 0;
+ bool enroll_session_started_ = false;
+
+ base::WeakPtrFactory<FingerprintSetupScreenHandler> weak_ptr_factory_{this};
+
+ DISALLOW_COPY_AND_ASSIGN(FingerprintSetupScreenHandler);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_FINGERPRINT_SETUP_SCREEN_HANDLER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
index 0d06906c4be..e3c2649b0a2 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
@@ -19,7 +19,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/sys_info.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/language_preferences.h"
@@ -34,12 +34,14 @@
#include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h"
#include "chrome/browser/chromeos/net/network_portal_detector_impl.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
+#include "chrome/browser/chromeos/policy/device_network_configuration_updater.h"
#include "chrome/browser/chromeos/policy/temp_certs_cache_nss.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/ash/login_screen_client.h"
#include "chrome/browser/ui/webui/chromeos/login/active_directory_password_change_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h"
@@ -579,6 +581,10 @@ void GaiaScreenHandler::RegisterMessages() {
AddCallback("updateOobeDialogSize",
&GaiaScreenHandler::HandleUpdateOobeDialogSize);
AddCallback("hideOobeDialog", &GaiaScreenHandler::HandleHideOobeDialog);
+ AddCallback("updateSigninUIState",
+ &GaiaScreenHandler::HandleUpdateSigninUIState);
+ AddCallback("showGuestForGaia",
+ &GaiaScreenHandler::HandleShowGuestForGaiaScreen);
// Allow UMA metrics collection from JS.
web_ui()->AddMessageHandler(std::make_unique<MetricsHandler>());
@@ -852,6 +858,22 @@ void GaiaScreenHandler::HandleGetIsSamlUserPasswordless(
base::Value(false) /* isSamlUserPasswordless */);
}
+void GaiaScreenHandler::HandleUpdateSigninUIState(int state) {
+ if (LoginDisplayHost::default_host()) {
+ auto dialog_state = static_cast<ash::mojom::OobeDialogState>(state);
+ DCHECK(ash::mojom::IsKnownEnumValue(dialog_state));
+ LoginDisplayHost::default_host()->UpdateOobeDialogState(dialog_state);
+ }
+}
+
+void GaiaScreenHandler::HandleShowGuestForGaiaScreen(bool allow_guest_login,
+ bool can_show_for_gaia) {
+ LoginScreenClient::Get()->login_screen()->SetAllowLoginAsGuest(
+ allow_guest_login);
+ LoginScreenClient::Get()->login_screen()->SetShowGuestButtonForGaiaScreen(
+ can_show_for_gaia);
+}
+
void GaiaScreenHandler::OnShowAddUser() {
signin_screen_handler_->is_account_picker_showing_first_time_ = false;
lock_screen_utils::EnforcePolicyInputMethods(std::string());
@@ -1107,8 +1129,10 @@ void GaiaScreenHandler::ShowGaiaScreenIfReady() {
// out of scope and the certificates will not be held in memory anymore.
untrusted_authority_certs_cache_ =
std::make_unique<policy::TempCertsCacheNSS>(
- policy::TempCertsCacheNSS::
- GetUntrustedAuthoritiesFromDeviceOncPolicy());
+ g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->GetDeviceNetworkConfigurationUpdater()
+ ->GetAllAuthorityCertificates());
}
LoadAuthExtension(!gaia_silent_load_ /* force */, false /* offline */);
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
index 84306fde47f..f2da30938a3 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
@@ -137,6 +137,10 @@ class GaiaScreenHandler : public BaseScreenHandler,
void HandleGetIsSamlUserPasswordless(const std::string& callback_id,
const std::string& typed_email,
const std::string& gaia_id);
+ void HandleUpdateSigninUIState(int state);
+ void HandleShowGuestForGaiaScreen(bool allow_guest_login,
+ bool can_show_for_gaia);
+
void OnShowAddUser();
// Really handles the complete login message.
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.cc
index 39ff5fe96d7..3d0d0be07c1 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.cc
@@ -168,6 +168,9 @@ std::string HostPairingScreenHandler::GetErrorStringFromEnrollmentError(
case policy::DM_STATUS_SERVICE_DOMAIN_MISMATCH:
return l10n_util::GetStringUTF8(
IDS_ENTERPRISE_ENROLLMENT_DOMAIN_MISMATCH_ERROR);
+ case policy::DM_STATUS_SERVICE_CONSUMER_ACCOUNT_WITH_PACKAGED_LICENSE:
+ return l10n_util::GetStringUTF8(
+ IDS_ENTERPRISE_ENROLLMENT_CONSUMER_ACCOUNT_WITH_PACKAGED_LICENSE);
default:
return l10n_util::GetStringFUTF8(
IDS_ENTERPRISE_ENROLLMENT_STATUS_REGISTRATION_FAILED,
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/l10n_util.cc b/chromium/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
index 6859c60e1f1..9761fa5a543 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/l10n_util.cc
@@ -22,8 +22,8 @@
#include "base/strings/string16.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/task/post_task.h"
#include "base/task_runner_util.h"
-#include "base/task_scheduler/post_task.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc
new file mode 100644
index 00000000000..4d1c61677e8
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.cc
@@ -0,0 +1,63 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h"
+
+#include "chrome/browser/chromeos/login/screens/marketing_opt_in_screen.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/login/localized_values_builder.h"
+
+namespace {
+
+const char kJsScreenPath[] = "login.MarketingOptInScreen";
+
+} // namespace
+
+namespace chromeos {
+
+MarketingOptInScreenHandler::MarketingOptInScreenHandler()
+ : BaseScreenHandler(kScreenId) {
+ set_call_js_prefix(kJsScreenPath);
+}
+
+MarketingOptInScreenHandler::~MarketingOptInScreenHandler() {}
+
+void MarketingOptInScreenHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {
+ builder->Add("marketingOptInScreenTitle",
+ IDS_LOGIN_MARKETING_OPT_IN_SCREEN_TITLE);
+ builder->Add("marketingOptInScreenSubtitle",
+ IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SUBTITLE);
+ builder->Add("marketingOptInGetPlayUpdates",
+ IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_PLAY_UPDATES);
+ builder->Add("marketingOptInGetChromebookUpdates",
+ IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_CHROMEBOOK_UPDATES);
+ builder->Add("marketingOptInScreenAllSet",
+ IDS_LOGIN_MARKETING_OPT_IN_SCREEN_ALL_SET);
+}
+
+void MarketingOptInScreenHandler::Bind(MarketingOptInScreen* screen) {
+ screen_ = screen;
+ BaseScreenHandler::SetBaseScreen(screen);
+}
+
+void MarketingOptInScreenHandler::Show() {
+ ShowScreen(kScreenId);
+}
+
+void MarketingOptInScreenHandler::Hide() {}
+
+void MarketingOptInScreenHandler::Initialize() {}
+
+void MarketingOptInScreenHandler::RegisterMessages() {
+ AddPrefixedCallback("allSet", &MarketingOptInScreenHandler::HandleAllSet);
+}
+
+void MarketingOptInScreenHandler::HandleAllSet(
+ bool play_communications_opt_in,
+ bool tips_communications_opt_in) {
+ screen_->OnAllSet(play_communications_opt_in, tips_communications_opt_in);
+}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h
new file mode 100644
index 00000000000..2225b7af041
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h
@@ -0,0 +1,48 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_
+
+#include "base/macros.h"
+#include "chrome/browser/chromeos/login/screens/marketing_opt_in_screen_view.h"
+#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
+
+namespace chromeos {
+
+class MarketingOptInScreen;
+
+// The sole implementation of the MarketingOptInScreenView, using WebUI.
+class MarketingOptInScreenHandler : public BaseScreenHandler,
+ public MarketingOptInScreenView {
+ public:
+ MarketingOptInScreenHandler();
+ ~MarketingOptInScreenHandler() override;
+
+ // BaseScreenHandler:
+ void DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) override;
+
+ // MarketingOptInScreenView:
+ void Bind(MarketingOptInScreen* screen) override;
+ void Show() override;
+ void Hide() override;
+
+ private:
+ // BaseScreenHandler:
+ void Initialize() override;
+ void RegisterMessages() override;
+
+ // WebUI event handler.
+ void HandleAllSet(bool play_communications_opt_in,
+ bool tips_communications_opt_in);
+
+ MarketingOptInScreen* screen_ = nullptr;
+
+ DISALLOW_COPY_AND_ASSIGN(MarketingOptInScreenHandler);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_MARKETING_OPT_IN_SCREEN_HANDLER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
new file mode 100644
index 00000000000..aadf70c5866
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc
@@ -0,0 +1,114 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h"
+
+#include <stddef.h>
+
+#include "base/values.h"
+#include "chrome/browser/chromeos/login/demo_mode/demo_setup_controller.h"
+#include "chrome/browser/chromeos/login/screens/core_oobe_view.h"
+#include "chrome/browser/chromeos/login/screens/network_screen.h"
+#include "chrome/browser/chromeos/login/startup_utils.h"
+#include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h"
+#include "chrome/grit/generated_resources.h"
+#include "chromeos/network/network_handler.h"
+#include "chromeos/network/network_state_handler.h"
+#include "components/login/localized_values_builder.h"
+
+namespace {
+
+const char kJsScreenPath[] = "login.NetworkScreen";
+
+} // namespace
+
+namespace chromeos {
+
+NetworkScreenHandler::NetworkScreenHandler(CoreOobeView* core_oobe_view)
+ : BaseScreenHandler(kScreenId), core_oobe_view_(core_oobe_view) {
+ set_call_js_prefix(kJsScreenPath);
+ DCHECK(core_oobe_view_);
+}
+
+NetworkScreenHandler::~NetworkScreenHandler() {
+ if (screen_)
+ screen_->OnViewDestroyed(this);
+}
+
+void NetworkScreenHandler::Show() {
+ if (!page_is_ready()) {
+ show_on_init_ = true;
+ return;
+ }
+
+ // In OOBE all physical network technologies should be enabled, so the user is
+ // able to select any of the available networks on the device. Enabled
+ // technologies should not be changed if network screen is shown outside of
+ // OOBE.
+ // If OOBE is not completed, we assume that the only instance of this object
+ // could be OOBE itself.
+ if (!StartupUtils::IsOobeCompleted()) {
+ NetworkStateHandler* handler =
+ NetworkHandler::Get()->network_state_handler();
+ handler->SetTechnologyEnabled(NetworkTypePattern::Physical(), true,
+ chromeos::network_handler::ErrorCallback());
+ }
+
+ base::DictionaryValue data;
+ data.SetBoolean("isDemoModeSetup",
+ DemoSetupController::IsOobeDemoSetupFlowInProgress());
+ ShowScreenWithData(kScreenId, &data);
+}
+
+void NetworkScreenHandler::Hide() {}
+
+void NetworkScreenHandler::Bind(NetworkScreen* screen) {
+ screen_ = screen;
+ BaseScreenHandler::SetBaseScreen(screen_);
+}
+
+void NetworkScreenHandler::Unbind() {
+ screen_ = nullptr;
+ BaseScreenHandler::SetBaseScreen(nullptr);
+}
+
+void NetworkScreenHandler::ShowError(const base::string16& message) {
+ CallJS("showError", message);
+}
+
+void NetworkScreenHandler::ClearErrors() {
+ if (page_is_ready())
+ core_oobe_view_->ClearErrors();
+}
+
+void NetworkScreenHandler::ShowConnectingStatus(
+ bool connecting,
+ const base::string16& network_id) {}
+
+void NetworkScreenHandler::DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) {
+ builder->Add("networkSectionTitle", IDS_NETWORK_SELECTION_TITLE);
+ builder->Add("networkSectionHint", IDS_NETWORK_SELECTION_HINT);
+ builder->Add("proxySettingsListItemName",
+ IDS_NETWORK_PROXY_SETTINGS_LIST_ITEM_NAME);
+ builder->Add("addWiFiListItemName", IDS_NETWORK_ADD_WI_FI_LIST_ITEM_NAME);
+ builder->Add("offlineDemoSetupListItemName",
+ IDS_NETWORK_OFFLINE_DEMO_SETUP_LIST_ITEM_NAME);
+ network_element::AddLocalizedValuesToBuilder(builder);
+}
+
+void NetworkScreenHandler::GetAdditionalParameters(
+ base::DictionaryValue* dict) {
+ dict->SetBoolean("offlineDemoModeEnabled",
+ DemoSetupController::IsOfflineDemoModeAllowed());
+}
+
+void NetworkScreenHandler::Initialize() {
+ if (show_on_init_) {
+ show_on_init_ = false;
+ Show();
+ }
+}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.h
new file mode 100644
index 00000000000..1c88cdda1a2
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/network_screen_handler.h
@@ -0,0 +1,53 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_
+
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "chrome/browser/chromeos/login/screens/network_screen_view.h"
+#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
+
+namespace chromeos {
+
+class CoreOobeView;
+
+// WebUI implementation of NetworkScreenView. It is used to interact with
+// the OOBE network selection screen.
+class NetworkScreenHandler : public NetworkScreenView,
+ public BaseScreenHandler {
+ public:
+ explicit NetworkScreenHandler(CoreOobeView* core_oobe_view);
+ ~NetworkScreenHandler() override;
+
+ private:
+ // NetworkScreenView:
+ void Show() override;
+ void Hide() override;
+ void Bind(NetworkScreen* screen) override;
+ void Unbind() override;
+ void ShowError(const base::string16& message) override;
+ void ClearErrors() override;
+ void ShowConnectingStatus(bool connecting,
+ const base::string16& network_id) override;
+
+ // BaseScreenHandler:
+ void DeclareLocalizedValues(
+ ::login::LocalizedValuesBuilder* builder) override;
+ void GetAdditionalParameters(base::DictionaryValue* dict) override;
+ void Initialize() override;
+
+ CoreOobeView* core_oobe_view_ = nullptr;
+ NetworkScreen* screen_ = nullptr;
+
+ // Keeps whether screen should be shown right after initialization.
+ bool show_on_init_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_NETWORK_SCREEN_HANDLER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc b/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc
index 476a23950bf..564cfbe0f74 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.cc
@@ -193,13 +193,13 @@ bool NetworkStateInformer::UpdateState() {
bool NetworkStateInformer::UpdateProxyConfig() {
const NetworkState* default_network =
NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
- if (!default_network)
+ if (!default_network || !default_network->proxy_config())
return false;
- if (proxy_config_ && *proxy_config_ == default_network->proxy_config())
+ if (proxy_config_ && *proxy_config_ == *default_network->proxy_config())
return false;
proxy_config_ =
- std::make_unique<base::Value>(default_network->proxy_config().Clone());
+ std::make_unique<base::Value>(default_network->proxy_config()->Clone());
return true;
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.h b/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.h
index 70816148b9a..df2306eb8ec 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/network_state_informer.h
@@ -101,7 +101,7 @@ class NetworkStateInformer
std::string network_path_;
std::unique_ptr<base::Value> proxy_config_;
- base::ObserverList<NetworkStateInformerObserver> observers_;
+ base::ObserverList<NetworkStateInformerObserver>::Unchecked observers_;
content::NotificationRegistrar registrar_;
base::WeakPtrFactory<NetworkStateInformer> weak_ptr_factory_;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc b/chromium/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc
index 641f57d2c23..eb08cdc2e10 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/oobe_display_chooser_unittest.cc
@@ -13,7 +13,7 @@
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "mojo/public/cpp/bindings/binding.h"
-#include "services/ui/public/cpp/input_devices/input_device_client_test_api.h"
+#include "services/ws/public/cpp/input_devices/input_device_client_test_api.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/display/display.h"
#include "ui/display/display_observer.h"
@@ -90,7 +90,7 @@ class OobeDisplayChooserTest : public ash::AshTestBase {
display_chooser_->set_cros_display_config_ptr_for_test(
cros_display_config_->CreateInterfacePtrAndBind());
- ui::InputDeviceClientTestApi().OnDeviceListsComplete();
+ ws::InputDeviceClientTestApi().OnDeviceListsComplete();
}
OobeDisplayChooser* display_chooser() { return display_chooser_.get(); }
@@ -124,7 +124,7 @@ TEST_F(OobeDisplayChooserTest, PreferTouchAsPrimary) {
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
"Touchscreen", gfx::Size(800, 600), 1);
touchscreen.vendor_id = kWhitelistedId;
- ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
+ ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
base::RunLoop().RunUntilIdle();
// Associate touchscreen device with display
@@ -137,10 +137,10 @@ TEST_F(OobeDisplayChooserTest, PreferTouchAsPrimary) {
// For mus we have to explicitly tell the InputDeviceClient the
// TouchscreenDevices. Normally InputDeviceClient is told of the
// TouchscreenDevices by way of implementing
- // ui::mojom::InputDeviceObserverMojo. In unit tests InputDeviceClient is not
+ // ws::mojom::InputDeviceObserverMojo. In unit tests InputDeviceClient is not
// wired to the window server (the window server isn't running).
touchscreen.target_display_id = display_info[1].id();
- ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen}, true);
+ ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen}, true);
EXPECT_EQ(1, GetPrimaryDisplay());
display_chooser()->TryToPlaceUiOnTouchDisplay();
@@ -167,7 +167,7 @@ TEST_F(OobeDisplayChooserTest, DontSwitchFromTouch) {
ui::TouchscreenDevice(1, ui::InputDeviceType::INPUT_DEVICE_EXTERNAL,
"Touchscreen", gfx::Size(800, 600), 1);
touchscreen.vendor_id = kWhitelistedId;
- ui::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
+ ws::InputDeviceClientTestApi().SetTouchscreenDevices({touchscreen});
base::RunLoop().RunUntilIdle();
// Associate touchscreen device with display
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
index 4a80138f5a7..b3a45be6728 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -13,6 +13,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -22,6 +23,7 @@
#include "chrome/browser/chromeos/login/screens/demo_preferences_screen_view.h"
#include "chrome/browser/chromeos/login/screens/demo_setup_screen_view.h"
#include "chrome/browser/chromeos/login/screens/error_screen.h"
+#include "chrome/browser/chromeos/login/screens/fingerprint_setup_screen_view.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
@@ -36,6 +38,7 @@
#include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/arc_kiosk_splash_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_handler.h"
+#include "chrome/browser/ui/webui/chromeos/login/assistant_optin_flow_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/controller_pairing_screen_handler.h"
@@ -48,13 +51,16 @@
#include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h"
+#include "chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/hid_detection_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/kiosk_app_menu_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/kiosk_autolaunch_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/kiosk_enable_screen_handler.h"
+#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h"
+#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_display_chooser.h"
#include "chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h"
@@ -99,89 +105,70 @@ namespace chromeos {
namespace {
-const char* kKnownDisplayTypes[] = {OobeUI::kOobeDisplay,
- OobeUI::kLoginDisplay,
- OobeUI::kLockDisplay,
- OobeUI::kUserAddingDisplay,
- OobeUI::kAppLaunchSplashDisplay,
+const char* kKnownDisplayTypes[] = {OobeUI::kAppLaunchSplashDisplay,
OobeUI::kArcKioskSplashDisplay,
- OobeUI::kGaiaSigninDisplay};
-
-const char kStringsJSPath[] = "strings.js";
-const char kLockJSPath[] = "lock.js";
-const char kLoginJSPath[] = "login.js";
-const char kOobeJSPath[] = "oobe.js";
-const char kKeyboardUtilsJSPath[] = "keyboard_utils.js";
-const char kCustomElementsHTMLPath[] = "custom_elements.html";
-const char kCustomElementsJSPath[] = "custom_elements.js";
-const char kCustomElementsUserPodHTMLPath[] = "custom_elements_user_pod.html";
-
-// Paths for deferred resource loading.
-const char kEnrollmentHTMLPath[] = "enrollment.html";
-const char kEnrollmentCSSPath[] = "enrollment.css";
-const char kEnrollmentJSPath[] = "enrollment.js";
-const char kArcAssistantLogoPath[] = "assistant_logo.png";
-const char kArcPlaystoreCSSPath[] = "playstore.css";
-const char kArcOverlayCSSPath[] = "overlay.css";
-const char kArcPlaystoreJSPath[] = "playstore.js";
-const char kArcPlaystoreLogoPath[] = "playstore.svg";
-const char kProductLogoPath[] = "product-logo.png";
-
-const char kRecommendAppListViewJSPath[] = "recommend_app_list_view.js";
-const char kRecommendAppListViewHTMLPath[] = "recommend_app_list_view.html";
+ OobeUI::kDiscoverDisplay,
+ OobeUI::kGaiaSigninDisplay,
+ OobeUI::kLockDisplay,
+ OobeUI::kLoginDisplay,
+ OobeUI::kOobeDisplay,
+ OobeUI::kUserAddingDisplay};
+
+// Sorted
+constexpr char kArcAssistantLogoPath[] = "assistant_logo.png";
+constexpr char kArcOverlayCSSPath[] = "overlay.css";
+constexpr char kArcPlaystoreCSSPath[] = "playstore.css";
+constexpr char kArcPlaystoreJSPath[] = "playstore.js";
+constexpr char kArcPlaystoreLogoPath[] = "playstore.svg";
+constexpr char kCustomElementsHTMLPath[] = "custom_elements.html";
+constexpr char kCustomElementsJSPath[] = "custom_elements.js";
+constexpr char kCustomElementsUserPodHTMLPath[] =
+ "custom_elements_user_pod.html";
+constexpr char kDiscoverJSPath[] = "discover_app.js";
+constexpr char kKeyboardUtilsJSPath[] = "keyboard_utils.js";
+constexpr char kLockJSPath[] = "lock.js";
+constexpr char kLoginJSPath[] = "login.js";
+constexpr char kOobeJSPath[] = "oobe.js";
+constexpr char kProductLogoPath[] = "product-logo.png";
+constexpr char kRecommendAppListViewHTMLPath[] = "recommend_app_list_view.html";
+constexpr char kRecommendAppListViewJSPath[] = "recommend_app_list_view.js";
+constexpr char kStringsJSPath[] = "strings.js";
#if defined(GOOGLE_CHROME_BUILD)
-const char kLogo24PX1XSvgPath[] = "logo_24px-1x.svg";
-const char kLogo24PX2XSvgPath[] = "logo_24px-2x.svg";
-const char kSyncConsentIcons[] = "sync-consent-icons.html";
+constexpr char kLogo24PX1XSvgPath[] = "logo_24px-1x.svg";
+constexpr char kLogo24PX2XSvgPath[] = "logo_24px-2x.svg";
+constexpr char kSyncConsentIcons[] = "sync-consent-icons.html";
#endif
-// Creates a WebUIDataSource for chrome://oobe
-content::WebUIDataSource* CreateOobeUIDataSource(
- const base::DictionaryValue& localized_strings,
- const std::string& display_type) {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+// Paths for deferred resource loading.
+constexpr char kEnrollmentCSSPath[] = "enrollment.css";
+constexpr char kEnrollmentHTMLPath[] = "enrollment.html";
+constexpr char kEnrollmentJSPath[] = "enrollment.js";
- content::WebUIDataSource* source =
- content::WebUIDataSource::Create(chrome::kChromeUIOobeHost);
- source->AddLocalizedStrings(localized_strings);
- source->SetJsonPath(kStringsJSPath);
+// Adds various product logo resources.
+void AddProductLogoResources(content::WebUIDataSource* source) {
+ // Required for Assistant OOBE.
+ source->AddResourcePath(kArcAssistantLogoPath, IDR_ASSISTANT_LOGO_PNG);
- if (display_type == OobeUI::kOobeDisplay) {
- source->SetDefaultResource(IDR_OOBE_HTML);
- source->AddResourcePath(kOobeJSPath, IDR_OOBE_JS);
- source->AddResourcePath(kCustomElementsHTMLPath,
- IDR_CUSTOM_ELEMENTS_OOBE_HTML);
- source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_OOBE_JS);
- } else if (display_type == OobeUI::kLockDisplay) {
- // TODO(crbug.com/810170): Remove the resource files associated with
- // kShowNonMdLogin switch (IDR_LOCK_HTML/JS and IDR_LOGIN_HTML/JS and the
- // files those use).
- source->SetDefaultResource(IDR_MD_LOCK_HTML);
- source->AddResourcePath(kLockJSPath, IDR_MD_LOCK_JS);
- source->AddResourcePath(kCustomElementsHTMLPath,
- IDR_CUSTOM_ELEMENTS_LOCK_HTML);
- source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_LOCK_JS);
- source->AddResourcePath(kCustomElementsUserPodHTMLPath,
- IDR_CUSTOM_ELEMENTS_USER_POD_HTML);
- } else {
- source->SetDefaultResource(IDR_MD_LOGIN_HTML);
- source->AddResourcePath(kLoginJSPath, IDR_MD_LOGIN_JS);
- source->AddResourcePath(kCustomElementsHTMLPath,
- IDR_CUSTOM_ELEMENTS_LOGIN_HTML);
- source->AddResourcePath(kCustomElementsJSPath,
- IDR_CUSTOM_ELEMENTS_LOGIN_JS);
- source->AddResourcePath(kCustomElementsUserPodHTMLPath,
- IDR_CUSTOM_ELEMENTS_USER_POD_HTML);
- }
#if defined(GOOGLE_CHROME_BUILD)
source->AddResourcePath(kLogo24PX1XSvgPath, IDR_PRODUCT_LOGO_24PX_1X);
source->AddResourcePath(kLogo24PX2XSvgPath, IDR_PRODUCT_LOGO_24PX_2X);
+#endif
+
+ // Required in encryption migration screen.
+ source->AddResourcePath(kProductLogoPath, IDR_PRODUCT_LOGO_64);
+}
+
+void AddSyncConsentResources(content::WebUIDataSource* source) {
+#if defined(GOOGLE_CHROME_BUILD)
source->AddResourcePath(kSyncConsentIcons,
IDR_PRODUCT_CHROMEOS_SYNC_CONSENT_SCREEN_ICONS);
// No #else section here as Sync Settings screen is Chrome-specific.
#endif
+}
+// Adds resources for ARC-dependent screens (PlayStore ToS, Assistant, etc...)
+void AddArcScreensResources(content::WebUIDataSource* source) {
// Required for postprocessing of Goolge PlayStore Terms and Overlay help.
source->AddResourcePath(kArcOverlayCSSPath, IDR_ARC_SUPPORT_OVERLAY_CSS);
source->AddResourcePath(kArcPlaystoreCSSPath, IDR_ARC_SUPPORT_PLAYSTORE_CSS);
@@ -193,12 +180,92 @@ content::WebUIDataSource* CreateOobeUIDataSource(
IDR_ARC_SUPPORT_RECOMMEND_APP_LIST_VIEW_JS);
source->AddResourcePath(kRecommendAppListViewHTMLPath,
IDR_ARC_SUPPORT_RECOMMEND_APP_LIST_VIEW_HTML);
+}
- // Required for Assistant OOBE.
- source->AddResourcePath(kArcAssistantLogoPath, IDR_ASSISTANT_LOGO_PNG);
+// Adds Enterprise Enrollment resources.
+void AddEnterpriseEnrollmentResources(content::WebUIDataSource* source) {
+ // Deferred resources.
+ source->AddResourcePath(kEnrollmentHTMLPath, IDR_OOBE_ENROLLMENT_HTML);
+ source->AddResourcePath(kEnrollmentCSSPath, IDR_OOBE_ENROLLMENT_CSS);
+ source->AddResourcePath(kEnrollmentJSPath, IDR_OOBE_ENROLLMENT_JS);
+}
- // Required in encryption migration screen.
- source->AddResourcePath(kProductLogoPath, IDR_PRODUCT_LOGO_64);
+// Default and non-shared resource definition for kOobeDisplay display type.
+// chrome://oobe/oobe
+void AddOobeDisplayTypeDefaultResources(content::WebUIDataSource* source) {
+ source->SetDefaultResource(IDR_OOBE_HTML);
+ source->AddResourcePath(kOobeJSPath, IDR_OOBE_JS);
+ source->AddResourcePath(kCustomElementsHTMLPath,
+ IDR_CUSTOM_ELEMENTS_OOBE_HTML);
+ source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_OOBE_JS);
+}
+
+// Default and non-shared resource definition for kLockDisplay display type.
+// chrome://oobe/lock
+void AddLockDisplayTypeDefaultResources(content::WebUIDataSource* source) {
+ // TODO(crbug.com/810170): Remove the resource files associated with
+ // kShowNonMdLogin switch (IDR_LOCK_HTML/JS and IDR_LOGIN_HTML/JS and the
+ // files those use).
+ source->SetDefaultResource(IDR_MD_LOCK_HTML);
+ source->AddResourcePath(kLockJSPath, IDR_MD_LOCK_JS);
+ source->AddResourcePath(kCustomElementsHTMLPath,
+ IDR_CUSTOM_ELEMENTS_LOCK_HTML);
+ source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_LOCK_JS);
+}
+
+// Default and non-shared resource definition for kDiscoverDisplay display type.
+// chrome://oobe/discover
+void AddDiscoverDisplayTypeDefaultResources(content::WebUIDataSource* source) {
+ source->SetDefaultResource(IDR_CHROMEOS_DISCOVER_APP_HTML);
+ source->AddResourcePath(kDiscoverJSPath, IDR_CHROMEOS_DISCOVER_APP_JS);
+}
+
+// Default and non-shared resource definition for kLoginDisplay display type.
+// chrome://oobe/login
+void AddLoginDisplayTypeDefaultResources(content::WebUIDataSource* source) {
+ source->SetDefaultResource(IDR_MD_LOGIN_HTML);
+ source->AddResourcePath(kLoginJSPath, IDR_MD_LOGIN_JS);
+ source->AddResourcePath(kCustomElementsHTMLPath,
+ IDR_CUSTOM_ELEMENTS_LOGIN_HTML);
+ source->AddResourcePath(kCustomElementsJSPath, IDR_CUSTOM_ELEMENTS_LOGIN_JS);
+}
+
+// Creates a WebUIDataSource for chrome://oobe
+content::WebUIDataSource* CreateOobeUIDataSource(
+ const base::DictionaryValue& localized_strings,
+ const std::string& display_type) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUIOobeHost);
+ source->AddLocalizedStrings(localized_strings);
+ source->SetJsonPath(kStringsJSPath);
+
+ // First, configure default and non-shared resources for the current display
+ // type.
+ if (display_type == OobeUI::kOobeDisplay) {
+ AddOobeDisplayTypeDefaultResources(source);
+ } else if (display_type == OobeUI::kLockDisplay) {
+ AddLockDisplayTypeDefaultResources(source);
+ } else if (display_type == OobeUI::kDiscoverDisplay) {
+ AddDiscoverDisplayTypeDefaultResources(source);
+ } else {
+ AddLoginDisplayTypeDefaultResources(source);
+ }
+
+ // Configure shared resources
+ AddProductLogoResources(source);
+
+ if (display_type != OobeUI::kLockDisplay) {
+ AddSyncConsentResources(source);
+ AddArcScreensResources(source);
+ AddEnterpriseEnrollmentResources(source);
+ }
+ if (display_type == OobeUI::kLockDisplay ||
+ display_type == OobeUI::kLoginDisplay) {
+ source->AddResourcePath(kCustomElementsUserPodHTMLPath,
+ IDR_CUSTOM_ELEMENTS_USER_POD_HTML);
+ }
source->AddResourcePath(kKeyboardUtilsJSPath, IDR_KEYBOARD_UTILS_JS);
source->OverrideContentSecurityPolicyChildSrc(base::StringPrintf(
@@ -206,11 +273,6 @@ content::WebUIDataSource* CreateOobeUIDataSource(
source->OverrideContentSecurityPolicyObjectSrc(
"object-src chrome:;");
- // Serve deferred resources.
- source->AddResourcePath(kEnrollmentHTMLPath, IDR_OOBE_ENROLLMENT_HTML);
- source->AddResourcePath(kEnrollmentCSSPath, IDR_OOBE_ENROLLMENT_CSS);
- source->AddResourcePath(kEnrollmentJSPath, IDR_OOBE_ENROLLMENT_JS);
-
// Only add a filter when runing as test.
const bool is_running_test = command_line->HasSwitch(::switches::kTestName) ||
command_line->HasSwitch(::switches::kTestType);
@@ -222,9 +284,8 @@ content::WebUIDataSource* CreateOobeUIDataSource(
std::string GetDisplayType(const GURL& url) {
std::string path = url.path().size() ? url.path().substr(1) : "";
- if (std::find(kKnownDisplayTypes,
- kKnownDisplayTypes + arraysize(kKnownDisplayTypes),
- path) == kKnownDisplayTypes + arraysize(kKnownDisplayTypes)) {
+
+ if (!base::ContainsValue(kKnownDisplayTypes, path)) {
LOG(ERROR) << "Unknown display type '" << path << "'. Setting default.";
return OobeUI::kLoginDisplay;
}
@@ -242,28 +303,19 @@ bool IsRemoraRequisitioned() {
} // namespace
// static
-const char OobeUI::kOobeDisplay[] = "oobe";
-const char OobeUI::kLoginDisplay[] = "login";
-const char OobeUI::kLockDisplay[] = "lock";
-const char OobeUI::kUserAddingDisplay[] = "user-adding";
const char OobeUI::kAppLaunchSplashDisplay[] = "app-launch-splash";
const char OobeUI::kArcKioskSplashDisplay[] = "arc-kiosk-splash";
+const char OobeUI::kDiscoverDisplay[] = "discover";
const char OobeUI::kGaiaSigninDisplay[] = "gaia-signin";
+const char OobeUI::kLockDisplay[] = "lock";
+const char OobeUI::kLoginDisplay[] = "login";
+const char OobeUI::kOobeDisplay[] = "oobe";
+const char OobeUI::kUserAddingDisplay[] = "user-adding";
-OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
- : WebUIController(web_ui) {
- display_type_ = GetDisplayType(url);
-
+void OobeUI::ConfigureOobeDisplay() {
network_state_informer_ = new NetworkStateInformer();
network_state_informer_->Init();
- js_calls_container = std::make_unique<JSCallsContainer>();
-
- auto core_handler =
- std::make_unique<CoreOobeHandler>(this, js_calls_container.get());
- core_handler_ = core_handler.get();
- AddWebUIHandler(std::move(core_handler));
-
AddWebUIHandler(std::make_unique<NetworkDropdownHandler>());
AddScreenHandler(std::make_unique<UpdateScreenHandler>());
@@ -271,6 +323,8 @@ OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
if (display_type_ == kOobeDisplay)
AddScreenHandler(std::make_unique<WelcomeScreenHandler>(core_handler_));
+ AddScreenHandler(std::make_unique<NetworkScreenHandler>(core_handler_));
+
AddScreenHandler(std::make_unique<EnableDebuggingScreenHandler>());
AddScreenHandler(std::make_unique<EulaScreenHandler>(core_handler_));
@@ -320,7 +374,9 @@ OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
AddScreenHandler(std::make_unique<DemoPreferencesScreenHandler>());
- AddScreenHandler(std::make_unique<DiscoverScreenHandler>());
+ AddScreenHandler(std::make_unique<FingerprintSetupScreenHandler>());
+
+ AddScreenHandler(std::make_unique<MarketingOptInScreenHandler>());
policy::BrowserPolicyConnectorChromeOS* connector =
g_browser_process->platform_part()->browser_policy_connector_chromeos();
@@ -368,16 +424,15 @@ OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
AddScreenHandler(std::make_unique<UpdateRequiredScreenHandler>());
+ AddScreenHandler(std::make_unique<AssistantOptInFlowScreenHandler>());
+
// Initialize KioskAppMenuHandler. Note that it is NOT a screen handler.
auto kiosk_app_menu_handler =
std::make_unique<KioskAppMenuHandler>(network_state_informer_);
kiosk_app_menu_handler_ = kiosk_app_menu_handler.get();
- web_ui->AddMessageHandler(std::move(kiosk_app_menu_handler));
+ web_ui()->AddMessageHandler(std::move(kiosk_app_menu_handler));
- base::DictionaryValue localized_strings;
- GetLocalizedStrings(&localized_strings);
-
- Profile* profile = Profile::FromWebUI(web_ui);
+ Profile* profile = Profile::FromWebUI(web_ui());
// Set up the chrome://theme/ source, for Chrome logo.
ThemeSource* theme = new ThemeSource(profile);
content::URLDataSource::Add(profile, theme);
@@ -387,23 +442,46 @@ OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
new AboutUIHTMLSource(chrome::kChromeUITermsHost, profile);
content::URLDataSource::Add(profile, about_source);
- // Set up the chrome://oobe/ source.
- content::WebUIDataSource* html_source =
- CreateOobeUIDataSource(localized_strings, display_type_);
- content::WebUIDataSource::Add(profile, html_source);
-
// Set up the chrome://userimage/ source.
UserImageSource* user_image_source = new UserImageSource();
content::URLDataSource::Add(profile, user_image_source);
// TabHelper is required for OOBE webui to make webview working on it.
- content::WebContents* contents = web_ui->GetWebContents();
+ content::WebContents* contents = web_ui()->GetWebContents();
extensions::TabHelper::CreateForWebContents(contents);
if (IsRemoraRequisitioned())
oobe_display_chooser_ = std::make_unique<OobeDisplayChooser>();
}
+OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url)
+ : WebUIController(web_ui) {
+ display_type_ = GetDisplayType(url);
+
+ js_calls_container = std::make_unique<JSCallsContainer>();
+
+ auto core_handler =
+ std::make_unique<CoreOobeHandler>(this, js_calls_container.get());
+ core_handler_ = core_handler.get();
+
+ AddWebUIHandler(std::move(core_handler));
+
+ if (display_type_ != OobeUI::kDiscoverDisplay)
+ ConfigureOobeDisplay();
+
+ if (display_type_ != OobeUI::kLockDisplay) {
+ AddScreenHandler(std::make_unique<DiscoverScreenHandler>());
+ }
+
+ base::DictionaryValue localized_strings;
+ GetLocalizedStrings(&localized_strings);
+
+ // Set up the chrome://oobe/ source.
+ content::WebUIDataSource* html_source =
+ CreateOobeUIDataSource(localized_strings, display_type_);
+ content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source);
+}
+
OobeUI::~OobeUI() {
}
@@ -443,6 +521,10 @@ DemoPreferencesScreenView* OobeUI::GetDemoPreferencesScreenView() {
return GetView<DemoPreferencesScreenHandler>();
}
+FingerprintSetupScreenView* OobeUI::GetFingerprintSetupScreenView() {
+ return GetView<FingerprintSetupScreenHandler>();
+}
+
KioskAutolaunchScreenView* OobeUI::GetKioskAutolaunchScreenView() {
return GetView<KioskAutolaunchScreenHandler>();
}
@@ -459,6 +541,10 @@ SyncConsentScreenView* OobeUI::GetSyncConsentScreenView() {
return GetView<SyncConsentScreenHandler>();
}
+MarketingOptInScreenView* OobeUI::GetMarketingOptInScreenView() {
+ return GetView<MarketingOptInScreenHandler>();
+}
+
ArcTermsOfServiceScreenView* OobeUI::GetArcTermsOfServiceScreenView() {
return GetView<ArcTermsOfServiceScreenHandler>();
}
@@ -512,6 +598,10 @@ UpdateRequiredView* OobeUI::GetUpdateRequiredScreenView() {
return GetView<UpdateRequiredScreenHandler>();
}
+AssistantOptInFlowScreenView* OobeUI::GetAssistantOptInFlowScreenView() {
+ return GetView<AssistantOptInFlowScreenHandler>();
+}
+
UserImageView* OobeUI::GetUserImageView() {
return GetView<UserImageScreenHandler>();
}
@@ -533,6 +623,10 @@ UserBoardView* OobeUI::GetUserBoardView() {
return GetView<UserBoardScreenHandler>();
}
+NetworkScreenView* OobeUI::GetNetworkScreenView() {
+ return GetView<NetworkScreenHandler>();
+}
+
void OobeUI::OnShutdownPolicyChanged(bool reboot_on_shutdown) {
core_handler_->UpdateShutdownAndRebootVisibility(reboot_on_shutdown);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.h b/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
index 65a907ecbf2..d40fbf186a4 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
@@ -29,10 +29,13 @@ class AppDownloadingScreenView;
class AppLaunchSplashScreenView;
class ArcKioskSplashScreenView;
class ArcTermsOfServiceScreenView;
+class AssistantOptInFlowScreenView;
class AutoEnrollmentCheckScreenView;
class BaseScreenHandler;
class ControllerPairingScreenView;
class CoreOobeView;
+class DemoPreferencesScreenView;
+class DemoSetupScreenView;
class DeviceDisabledScreenView;
class EnableDebuggingScreenView;
class EncryptionMigrationScreenView;
@@ -40,6 +43,7 @@ class EnrollmentScreenView;
class EulaView;
class ErrorScreen;
class DiscoverScreenView;
+class FingerprintSetupScreenView;
class GaiaView;
class HIDDetectionView;
class HostPairingScreenView;
@@ -47,17 +51,16 @@ class KioskAppMenuHandler;
class KioskAutolaunchScreenView;
class KioskEnableScreenView;
class LoginScreenContext;
+class MarketingOptInScreenView;
class NativeWindowDelegate;
+class NetworkScreenView;
class NetworkStateInformer;
-class WelcomeView;
class OobeDisplayChooser;
class RecommendAppsScreenView;
+class ResetView;
class SigninScreenHandler;
class SigninScreenHandlerDelegate;
class SupervisedUserCreationScreenHandler;
-class ResetView;
-class DemoSetupScreenView;
-class DemoPreferencesScreenView;
class SyncConsentScreenView;
class TermsOfServiceScreenView;
class UserBoardView;
@@ -66,6 +69,7 @@ class UpdateView;
class UpdateRequiredView;
class VoiceInteractionValuePropScreenView;
class WaitForContainerReadyScreenView;
+class WelcomeView;
class WrongHWIDScreenView;
// A custom WebUI that defines datasource for out-of-box-experience (OOBE) UI:
@@ -77,13 +81,14 @@ class OobeUI : public content::WebUIController,
public:
// List of known types of OobeUI. Type added as path in chrome://oobe url, for
// example chrome://oobe/user-adding.
- static const char kOobeDisplay[];
- static const char kLoginDisplay[];
- static const char kLockDisplay[];
- static const char kUserAddingDisplay[];
static const char kAppLaunchSplashDisplay[];
static const char kArcKioskSplashDisplay[];
+ static const char kDiscoverDisplay[];
static const char kGaiaSigninDisplay[];
+ static const char kLockDisplay[];
+ static const char kLoginDisplay[];
+ static const char kOobeDisplay[];
+ static const char kUserAddingDisplay[];
class Observer {
public:
@@ -110,6 +115,7 @@ class OobeUI : public content::WebUIController,
ResetView* GetResetView();
DemoSetupScreenView* GetDemoSetupScreenView();
DemoPreferencesScreenView* GetDemoPreferencesScreenView();
+ FingerprintSetupScreenView* GetFingerprintSetupScreenView();
KioskAutolaunchScreenView* GetKioskAutolaunchScreenView();
KioskEnableScreenView* GetKioskEnableScreenView();
TermsOfServiceScreenView* GetTermsOfServiceScreenView();
@@ -132,9 +138,12 @@ class OobeUI : public content::WebUIController,
VoiceInteractionValuePropScreenView* GetVoiceInteractionValuePropScreenView();
WaitForContainerReadyScreenView* GetWaitForContainerReadyScreenView();
UpdateRequiredView* GetUpdateRequiredScreenView();
+ AssistantOptInFlowScreenView* GetAssistantOptInFlowScreenView();
GaiaView* GetGaiaScreenView();
UserBoardView* GetUserBoardView();
DiscoverScreenView* GetDiscoverScreenView();
+ NetworkScreenView* GetNetworkScreenView();
+ MarketingOptInScreenView* GetMarketingOptInScreenView();
// ShutdownPolicyHandler::Delegate
void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;
@@ -215,6 +224,10 @@ class OobeUI : public content::WebUIController,
void AddWebUIHandler(std::unique_ptr<BaseWebUIHandler> handler);
void AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler);
+ // Configures all the relevant screen shandlers and resources for OOBE/Login
+ // display type.
+ void ConfigureOobeDisplay();
+
// Type of UI.
std::string display_type_;
@@ -254,7 +267,7 @@ class OobeUI : public content::WebUIController,
std::vector<base::Closure> ready_callbacks_;
// List of registered observers.
- base::ObserverList<Observer> observer_list_;
+ base::ObserverList<Observer>::Unchecked observer_list_;
// Observer of CrosSettings watching the kRebootOnShutdown policy.
std::unique_ptr<ShutdownPolicyHandler> shutdown_policy_handler_;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc
index b55e82564a8..75924f17d03 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.cc
@@ -105,6 +105,10 @@ void RecommendAppsScreenHandler::OnLoadSuccess(const base::Value& app_list) {
LoadAppListInUI(app_list);
}
+void RecommendAppsScreenHandler::OnParseResponseError() {
+ HandleSkip();
+}
+
void RecommendAppsScreenHandler::HandleSkip() {
for (auto& observer : observer_list_)
observer.OnSkip();
@@ -116,6 +120,13 @@ void RecommendAppsScreenHandler::HandleRetry() {
}
void RecommendAppsScreenHandler::HandleInstall(const base::ListValue* args) {
+ // If the user does not select any apps, we should skip the app downloading
+ // screen.
+ if (args->GetList().empty()) {
+ HandleSkip();
+ return;
+ }
+
pref_service_->Set(arc::prefs::kArcFastAppReinstallPackages, *args);
arc::ArcFastAppReinstallStarter* fast_app_reinstall_starter =
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h
index c813764aeb6..723c44bfc42 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/recommend_apps_screen_handler.h
@@ -41,6 +41,7 @@ class RecommendAppsScreenHandler : public BaseScreenHandler,
// RecommendAppsScreenView:
void OnLoadError() override;
void OnLoadSuccess(const base::Value& app_list) override;
+ void OnParseResponseError() override;
// Call the JS function to load the list of apps in the WebView.
void LoadAppListInUI(const base::Value& app_list);
@@ -53,7 +54,8 @@ class RecommendAppsScreenHandler : public BaseScreenHandler,
PrefService* pref_service_;
- base::ObserverList<RecommendAppsScreenViewObserver, true> observer_list_;
+ base::ObserverList<RecommendAppsScreenViewObserver, true>::Unchecked
+ observer_list_;
DISALLOW_COPY_AND_ASSIGN(RecommendAppsScreenHandler);
};
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index fe182a0e43d..3ba24b7fc48 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -39,6 +39,7 @@
#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
#include "chrome/browser/chromeos/language_preferences.h"
#include "chrome/browser/chromeos/lock_screen_apps/state_controller.h"
+#include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_service.h"
#include "chrome/browser/chromeos/login/error_screens_histogram_helper.h"
#include "chrome/browser/chromeos/login/help_app_launcher.h"
@@ -315,7 +316,7 @@ SigninScreenHandler::SigninScreenHandler(
WallpaperControllerClient::Get()->AddObserver(std::move(ptr_info));
// TODO(tbarzic): This is needed for login UI - remove it when login switches
// to views implementation (or otherwise, make it work under mash).
- if (features::IsAshInBrowserProcess())
+ if (!features::IsMultiProcessMash())
detachable_base_observer_.Add(ash::Shell::Get()->detachable_base_handler());
}
@@ -543,6 +544,7 @@ void SigninScreenHandler::RegisterMessages() {
&SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts);
AddCallback("getTabletModeState",
&SigninScreenHandler::HandleGetTabletModeState);
+ AddCallback("getDemoModeState", &SigninScreenHandler::HandleGetDemoModeState);
AddCallback("logRemoveUserWarningShown",
&SigninScreenHandler::HandleLogRemoveUserWarningShown);
AddCallback("firstIncorrectPasswordAttempt",
@@ -839,7 +841,7 @@ void SigninScreenHandler::SetupAndShowOfflineMessage(
// error screen (offline, proxy).
if (IsGaiaVisible() ||
(error_screen_->GetErrorState() != NetworkError::ERROR_STATE_PORTAL)) {
- error_screen_->FixCaptivePortal();
+ LoginDisplayHost::default_host()->HandleDisplayCaptivePortal();
}
const std::string network_name = GetNetworkName(network_path);
error_screen_->SetErrorState(NetworkError::ERROR_STATE_PORTAL,
@@ -1602,6 +1604,11 @@ void SigninScreenHandler::HandleGetTabletModeState() {
TabletModeClient::Get()->tablet_mode_enabled());
}
+void SigninScreenHandler::HandleGetDemoModeState() {
+ CallJS("login.AccountPickerScreen.setDemoModeState",
+ DemoSession::IsDeviceInDemoMode());
+}
+
void SigninScreenHandler::HandleLogRemoveUserWarningShown() {
ProfileMetrics::LogProfileDeleteUser(
ProfileMetrics::DELETE_PROFILE_USER_MANAGER_SHOW_WARNING);
@@ -1765,7 +1772,7 @@ void SigninScreenHandler::OnDetachableBaseRequiresUpdateChanged(
bool requires_update) {}
void SigninScreenHandler::UpdateDetachableBaseChangedError() {
- if (!features::IsAshInBrowserProcess())
+ if (features::IsMultiProcessMash())
return;
auto pairing_status =
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
index 847fbad247d..9c3a788ca45 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
@@ -401,6 +401,7 @@ class SigninScreenHandler
void HandleGetPublicSessionKeyboardLayouts(const AccountId& account_id,
const std::string& locale);
void HandleGetTabletModeState();
+ void HandleGetDemoModeState();
void HandleLogRemoveUserWarningShown();
void HandleFirstIncorrectPasswordAttempt(const AccountId& account_id);
void HandleMaxIncorrectPasswordAttempts(const AccountId& account_id);
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/signin_userlist_unittest.cc b/chromium/chrome/browser/ui/webui/chromeos/login/signin_userlist_unittest.cc
index 230adcacf7c..825a45b5fc8 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/signin_userlist_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/signin_userlist_unittest.cc
@@ -12,8 +12,7 @@
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h"
#include "chrome/browser/chromeos/login/users/multi_profile_user_controller_delegate.h"
-#include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/chromeos/settings/device_settings_service.h"
+#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "chromeos/components/proximity_auth/screenlock_bridge.h"
@@ -64,9 +63,6 @@ class SigninPrepareUserListTest : public ash::AshTestBase,
fake_user_manager_->AddUser(AccountId::FromUserEmail(kUsers[i]));
fake_user_manager_->set_owner_id(AccountId::FromUserEmail(kOwner));
-
- chromeos::DeviceSettingsService::Initialize();
- chromeos::CrosSettings::Initialize();
}
void TearDown() override {
@@ -78,6 +74,7 @@ class SigninPrepareUserListTest : public ash::AshTestBase,
// MultiProfileUserControllerDelegate overrides:
void OnUserNotAllowed(const std::string& user_email) override {}
+ ScopedCrosSettingsTestHelper cros_settings_test_helper_;
FakeChromeUserManager* fake_user_manager_;
user_manager::ScopedUserManager user_manager_enabler_;
std::unique_ptr<TestingProfileManager> profile_manager_;
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc
index 1b3047e9864..b5b0c3fa9fd 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.cc
@@ -11,38 +11,28 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
-#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task_runner_util.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
-#include "chrome/browser/chromeos/customization/customization_document.h"
-#include "chrome/browser/chromeos/idle_detector.h"
#include "chrome/browser/chromeos/login/screens/core_oobe_view.h"
#include "chrome/browser/chromeos/login/screens/welcome_screen.h"
#include "chrome/browser/chromeos/login/ui/input_events_blocker.h"
-#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
-#include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h"
#include "chrome/browser/chromeos/system/input_device_settings.h"
#include "chrome/browser/chromeos/system/timezone_util.h"
#include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
-#include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/chromeos_switches.h"
-#include "chromeos/network/network_handler.h"
-#include "chromeos/network/network_state_handler.h"
#include "components/login/localized_values_builder.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_thread.h"
+#include "ui/base/ime/chromeos/component_extension_ime_manager.h"
#include "ui/base/ime/chromeos/extension_ime_util.h"
-#include "ui/gfx/geometry/rect.h"
-#include "ui/views/layout/fill_layout.h"
-#include "ui/views/widget/widget.h"
+#include "ui/base/ime/chromeos/input_method_manager.h"
namespace {
@@ -86,12 +76,6 @@ void WelcomeScreenHandler::Show() {
return;
}
- // Make sure all physical network technologies are enabled. On OOBE, the user
- // should be able to select any of the available networks on the device.
- NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
- handler->SetTechnologyEnabled(NetworkTypePattern::Physical(), true,
- chromeos::network_handler::ErrorCallback());
-
base::DictionaryValue welcome_screen_params;
welcome_screen_params.SetBoolean(
"isDeveloperMode", base::CommandLine::ForCurrentProcess()->HasSwitch(
@@ -112,23 +96,10 @@ void WelcomeScreenHandler::Unbind() {
BaseScreenHandler::SetBaseScreen(nullptr);
}
-void WelcomeScreenHandler::ShowError(const base::string16& message) {
- CallJS("showError", message);
-}
-
-void WelcomeScreenHandler::ClearErrors() {
- if (page_is_ready())
- core_oobe_view_->ClearErrors();
-}
-
void WelcomeScreenHandler::StopDemoModeDetection() {
core_oobe_view_->StopDemoModeDetection();
}
-void WelcomeScreenHandler::ShowConnectingStatus(
- bool connecting,
- const base::string16& network_id) {}
-
void WelcomeScreenHandler::ReloadLocalizedContent() {
base::DictionaryValue localized_strings;
GetOobeUI()->GetLocalizedStrings(&localized_strings);
@@ -140,15 +111,14 @@ void WelcomeScreenHandler::ReloadLocalizedContent() {
void WelcomeScreenHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) {
if (system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation())
- builder->Add("networkScreenGreeting", IDS_REMORA_CONFIRM_MESSAGE);
+ builder->Add("welcomeScreenGreeting", IDS_REMORA_CONFIRM_MESSAGE);
else
- builder->Add("networkScreenGreeting", IDS_WELCOME_SCREEN_GREETING);
+ builder->Add("welcomeScreenGreeting", IDS_WELCOME_SCREEN_GREETING);
- builder->Add("networkScreenTitle", IDS_WELCOME_SCREEN_TITLE);
- builder->Add("continueButton", IDS_NETWORK_SELECTION_CONTINUE_BUTTON);
+ builder->Add("welcomeScreenTitle", IDS_WELCOME_SCREEN_TITLE);
// MD-OOBE (oobe-welcome-md)
- builder->Add("debuggingFeaturesLink", IDS_NETWORK_ENABLE_DEV_FEATURES_LINK);
+ builder->Add("debuggingFeaturesLink", IDS_WELCOME_ENABLE_DEV_FEATURES_LINK);
builder->Add("timezoneDropdownLabel", IDS_TIMEZONE_DROPDOWN_LABEL);
builder->Add("oobeOKButtonText", IDS_OOBE_OK_BUTTON_TEXT);
builder->Add("welcomeNextButtonText", IDS_OOBE_WELCOME_NEXT_BUTTON_TEXT);
@@ -157,8 +127,6 @@ void WelcomeScreenHandler::DeclareLocalizedValues(
builder->Add("accessibilitySectionTitle", IDS_ACCESSIBILITY_SECTION_TITLE);
builder->Add("accessibilitySectionHint", IDS_ACCESSIBILITY_SECTION_HINT);
builder->Add("timezoneSectionTitle", IDS_TIMEZONE_SECTION_TITLE);
- builder->Add("networkSectionTitle", IDS_NETWORK_SECTION_TITLE);
- builder->Add("networkSectionHint", IDS_NETWORK_SECTION_HINT);
builder->Add("advancedOptionsSectionTitle",
IDS_OOBE_ADVANCED_OPTIONS_SCREEN_TITLE);
builder->Add("advancedOptionsEEBootstrappingTitle",
@@ -178,8 +146,6 @@ void WelcomeScreenHandler::DeclareLocalizedValues(
builder->Add("languageDropdownLabel", IDS_LANGUAGE_DROPDOWN_LABEL);
builder->Add("keyboardDropdownTitle", IDS_KEYBOARD_DROPDOWN_TITLE);
builder->Add("keyboardDropdownLabel", IDS_KEYBOARD_DROPDOWN_LABEL);
- builder->Add("proxySettingsMenuName", IDS_PROXY_SETTINGS_MENU_NAME);
- builder->Add("addWiFiNetworkMenuName", IDS_ADD_WI_FI_NETWORK_MENU_NAME);
builder->Add("highContrastOptionOff", IDS_HIGH_CONTRAST_OPTION_OFF);
builder->Add("highContrastOptionOn", IDS_HIGH_CONTRAST_OPTION_ON);
@@ -189,12 +155,13 @@ void WelcomeScreenHandler::DeclareLocalizedValues(
builder->Add("screenMagnifierOptionOn", IDS_SCREEN_MAGNIFIER_OPTION_ON);
builder->Add("spokenFeedbackOptionOff", IDS_SPOKEN_FEEDBACK_OPTION_OFF);
builder->Add("spokenFeedbackOptionOn", IDS_SPOKEN_FEEDBACK_OPTION_ON);
+ builder->Add("selectToSpeakOptionOff", IDS_SELECT_TO_SPEAK_OPTION_OFF);
+ builder->Add("selectToSpeakOptionOn", IDS_SELECT_TO_SPEAK_OPTION_ON);
builder->Add("virtualKeyboardOptionOff", IDS_VIRTUAL_KEYBOARD_OPTION_OFF);
builder->Add("virtualKeyboardOptionOn", IDS_VIRTUAL_KEYBOARD_OPTION_ON);
builder->Add("timezoneDropdownTitle", IDS_TIMEZONE_DROPDOWN_TITLE);
builder->Add("timezoneButtonText", IDS_TIMEZONE_BUTTON_TEXT);
- network_element::AddLocalizedValuesToBuilder(builder);
}
void WelcomeScreenHandler::GetAdditionalParameters(
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h
index 73157f50225..61e87a538a4 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h
@@ -6,16 +6,10 @@
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_WELCOME_SCREEN_HANDLER_H_
#include <memory>
-#include <string>
-#include "base/compiler_specific.h"
#include "base/macros.h"
-#include "chrome/browser/chromeos/base/locale_util.h"
#include "chrome/browser/chromeos/login/screens/welcome_view.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
-#include "ui/base/ime/chromeos/component_extension_ime_manager.h"
-#include "ui/base/ime/chromeos/input_method_manager.h"
-#include "ui/gfx/geometry/point.h"
namespace base {
class ListValue;
@@ -38,11 +32,7 @@ class WelcomeScreenHandler : public WelcomeView, public BaseScreenHandler {
void Hide() override;
void Bind(WelcomeScreen* screen) override;
void Unbind() override;
- void ShowError(const base::string16& message) override;
- void ClearErrors() override;
void StopDemoModeDetection() override;
- void ShowConnectingStatus(bool connecting,
- const base::string16& network_id) override;
void ReloadLocalizedContent() override;
// BaseScreenHandler implementation:
@@ -60,9 +50,6 @@ class WelcomeScreenHandler : public WelcomeView, public BaseScreenHandler {
// Keeps whether screen should be shown right after initialization.
bool show_on_init_ = false;
- // Position of the network control.
- gfx::Point network_control_pos_;
-
DISALLOW_COPY_AND_ASSIGN(WelcomeScreenHandler);
};
diff --git a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
index b8ed44130df..76ff0738b50 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.cc
@@ -4,164 +4,94 @@
#include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
-#include "base/bind.h"
-#include "base/macros.h"
-#include "base/memory/singleton.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/chromeos/login/ui/login_display_host.h"
-#include "chrome/browser/chromeos/login/ui/webui_login_view.h"
#include "chrome/browser/chromeos/mobile/mobile_activator.h"
#include "chrome/browser/lifetime/browser_shutdown.h"
-#include "chrome/browser/platform_util.h"
-#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
-#include "content/public/browser/browser_thread.h"
+#include "components/device_event_log/device_event_log.h"
+#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/widget/widget.h"
#include "ui/web_dialogs/web_dialog_delegate.h"
-using chromeos::MobileActivator;
-using content::BrowserThread;
-using content::WebContents;
-using content::WebUIMessageHandler;
-using ui::WebDialogDelegate;
-
-class MobileSetupDialogDelegate : public WebDialogDelegate {
- public:
- static MobileSetupDialogDelegate* GetInstance();
- void ShowDialog(const std::string& service_path);
-
- protected:
- friend struct base::DefaultSingletonTraits<MobileSetupDialogDelegate>;
-
- MobileSetupDialogDelegate();
- ~MobileSetupDialogDelegate() override;
-
- void OnCloseDialog();
-
- // WebDialogDelegate overrides.
- ui::ModalType GetDialogModalType() const override;
- base::string16 GetDialogTitle() const override;
- GURL GetDialogContentURL() const override;
- void GetWebUIMessageHandlers(
- std::vector<WebUIMessageHandler*>* handlers) const override;
- void GetDialogSize(gfx::Size* size) const override;
- std::string GetDialogArgs() const override;
- void OnDialogClosed(const std::string& json_retval) override;
- void OnCloseContents(WebContents* source, bool* out_close_dialog) override;
- bool ShouldShowDialogTitle() const override;
- bool HandleContextMenu(const content::ContextMenuParams& params) override;
-
- private:
- gfx::NativeWindow dialog_window_;
- // Cellular network service path.
- std::string service_path_;
- DISALLOW_COPY_AND_ASSIGN(MobileSetupDialogDelegate);
-};
+namespace chromeos {
+
+namespace {
+
+constexpr int kMobileSetupDialogWidth = 850;
+constexpr int kMobileSetupDialogHeight = 650;
+
+GURL GetURL(const NetworkState& network) {
+ std::string url(chrome::kChromeUIMobileSetupURL);
+ // TODO(stevenjb): Use GUID instead.
+ url.append(network.path());
+ return GURL(url);
+}
+
+MobileSetupDialog* dialog_instance = nullptr;
+
+} // namespace
// static
void MobileSetupDialog::ShowByNetworkId(const std::string& network_id) {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (dialog_instance) {
+ NET_LOG(EVENT) << "Only one active MobileSetupDialog instance supported.";
+ dialog_instance->dialog_window()->Focus();
+ return;
+ }
const chromeos::NetworkState* network =
chromeos::NetworkHandler::Get()
->network_state_handler()
->GetNetworkStateFromGuid(network_id);
if (!network) {
- LOG(ERROR) << "MobileSetupDialog: Network ID not found: " << network_id;
+ NET_LOG(ERROR) << "MobileSetupDialog: Network ID not found: " << network_id;
return;
}
- MobileSetupDialogDelegate::GetInstance()->ShowDialog(network->path());
-}
-
-// static
-MobileSetupDialogDelegate* MobileSetupDialogDelegate::GetInstance() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- return base::Singleton<MobileSetupDialogDelegate>::get();
-}
-
-MobileSetupDialogDelegate::MobileSetupDialogDelegate()
- : dialog_window_(nullptr) {}
-
-MobileSetupDialogDelegate::~MobileSetupDialogDelegate() {
-}
-
-void MobileSetupDialogDelegate::ShowDialog(const std::string& service_path) {
- service_path_ = service_path;
-
- gfx::NativeWindow parent = nullptr;
- // If we're on the login screen.
- if (chromeos::LoginDisplayHost::default_host()) {
- chromeos::WebUILoginView* login_view =
- chromeos::LoginDisplayHost::default_host()->GetWebUILoginView();
- if (login_view)
- parent = login_view->GetNativeWindow();
- }
- // Only the primary user can change this.
- dialog_window_ = chrome::ShowWebDialog(
- parent,
- ProfileManager::GetPrimaryUserProfile(),
- this);
-}
-
-ui::ModalType MobileSetupDialogDelegate::GetDialogModalType() const {
- return ui::MODAL_TYPE_SYSTEM;
-}
-
-base::string16 MobileSetupDialogDelegate::GetDialogTitle() const {
- return l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE);
+ NET_LOG(EVENT) << "Opening MobileSetupDialog, ID: " << network_id;
+ dialog_instance = new MobileSetupDialog(*network);
+ dialog_instance->ShowSystemDialog();
}
-GURL MobileSetupDialogDelegate::GetDialogContentURL() const {
- std::string url(chrome::kChromeUIMobileSetupURL);
- url.append(service_path_);
- return GURL(url);
-}
+MobileSetupDialog::MobileSetupDialog(const NetworkState& network)
+ : SystemWebDialogDelegate(
+ GetURL(network),
+ l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE)) {}
-void MobileSetupDialogDelegate::GetWebUIMessageHandlers(
- std::vector<WebUIMessageHandler*>* handlers) const {
+MobileSetupDialog::~MobileSetupDialog() {
+ dialog_instance = nullptr;
}
-void MobileSetupDialogDelegate::GetDialogSize(gfx::Size* size) const {
- size->SetSize(850, 650);
+void MobileSetupDialog::GetDialogSize(gfx::Size* size) const {
+ size->SetSize(kMobileSetupDialogWidth, kMobileSetupDialogHeight);
}
-std::string MobileSetupDialogDelegate::GetDialogArgs() const {
+std::string MobileSetupDialog::GetDialogArgs() const {
return std::string();
}
-void MobileSetupDialogDelegate::OnDialogClosed(const std::string& json_retval) {
- dialog_window_ = nullptr;
-}
-
-void MobileSetupDialogDelegate::OnCloseContents(WebContents* source,
- bool* out_close_dialog) {
+void MobileSetupDialog::OnCloseContents(content::WebContents* source,
+ bool* out_close_dialog) {
// If we're exiting, popping up the confirmation dialog can cause a
// crash. Note: IsTryingToQuit can be cancelled on other platforms by the
// onbeforeunload handler, except on ChromeOS. So IsTryingToQuit is the
// appropriate check to use here.
- if (!dialog_window_ ||
- !MobileActivator::GetInstance()->RunningActivation() ||
+ bool running_activation = MobileActivator::GetInstance()->RunningActivation();
+ NET_LOG(EVENT) << "Closing MobileSetupDialog. Activation running = "
+ << running_activation;
+ if (!dialog_window() || !running_activation ||
browser_shutdown::IsTryingToQuit()) {
*out_close_dialog = true;
return;
}
*out_close_dialog = chrome::ShowQuestionMessageBox(
- dialog_window_, l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE),
+ dialog_window(), l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE),
l10n_util::GetStringUTF16(IDS_MOBILE_CANCEL_ACTIVATION));
}
-bool MobileSetupDialogDelegate::ShouldShowDialogTitle() const {
- return true;
-}
-
-bool MobileSetupDialogDelegate::HandleContextMenu(
- const content::ContextMenuParams& params) {
- return true;
-}
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h
index 14dcab048d7..e15ad870e3d 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h
@@ -5,18 +5,30 @@
#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_MOBILE_SETUP_DIALOG_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_MOBILE_SETUP_DIALOG_H_
-#include <vector>
-
#include "base/macros.h"
-#include "base/memory/singleton.h"
-#include "ui/web_dialogs/web_dialog_ui.h"
+#include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h"
+
+namespace chromeos {
+
+class NetworkState;
-class MobileSetupDialog {
+class MobileSetupDialog : public SystemWebDialogDelegate {
public:
static void ShowByNetworkId(const std::string& network_id);
- private:
+ protected:
+ explicit MobileSetupDialog(const NetworkState& network);
+ ~MobileSetupDialog() override;
+
+ // ui::WebDialogDelegate
+ void GetDialogSize(gfx::Size* size) const override;
+ std::string GetDialogArgs() const override;
+ void OnCloseContents(content::WebContents* source,
+ bool* out_close_dialog) override;
+
DISALLOW_COPY_AND_ASSIGN(MobileSetupDialog);
};
+} // namespace chromeos
+
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_MOBILE_SETUP_DIALOG_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
index 48df3c8a814..1307ed94223 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.cc
@@ -33,10 +33,10 @@
#include "chrome/grit/generated_resources.h"
#include "chromeos/network/device_state.h"
#include "chromeos/network/network_configuration_handler.h"
-#include "chromeos/network/network_event_log.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/network_state_handler_observer.h"
+#include "components/device_event_log/device_event_log.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
@@ -52,13 +52,7 @@
#include "ui/base/webui/web_ui_util.h"
#include "url/gurl.h"
-using chromeos::MobileActivator;
-using chromeos::NetworkHandler;
-using chromeos::NetworkState;
-using content::BrowserThread;
-using content::RenderViewHost;
-using content::WebContents;
-using content::WebUIMessageHandler;
+namespace chromeos {
namespace {
@@ -83,31 +77,54 @@ const char kJsConnectivityChangedCallback[] =
void DataRequestFailed(
const std::string& service_path,
const content::URLDataSource::GotDataCallback& callback) {
- NET_LOG_ERROR("Data Request Failed for Mobile Setup", service_path);
+ NET_LOG(ERROR) << "Data Request Failed for Mobile Setup: " << service_path;
scoped_refptr<base::RefCountedBytes> html_bytes(new base::RefCountedBytes);
callback.Run(html_bytes.get());
}
+bool HasStringProperty(const base::Value& properties,
+ const char* key,
+ std::string* result) {
+ const base::Value* value =
+ properties.FindKeyOfType(key, base::Value::Type::STRING);
+ if (!value) {
+ NET_LOG(ERROR) << "Missing Mobile Setup property: " << key;
+ return false;
+ }
+ *result = value->GetString();
+ return true;
+}
+
+bool HasDictionaryProperty(const base::Value& properties,
+ const char* key,
+ const base::Value** result) {
+ *result = properties.FindKeyOfType(key, base::Value::Type::DICTIONARY);
+ if (!result)
+ NET_LOG(ERROR) << "Missing Mobile Setup property: " << key;
+ return !!result;
+}
+
// Converts the network properties into a JS object.
void GetDeviceInfo(const base::DictionaryValue& properties,
base::DictionaryValue* value) {
std::string name;
properties.GetStringWithoutPathExpansion(shill::kNameProperty, &name);
std::string activation_type;
- properties.GetStringWithoutPathExpansion(
- shill::kActivationTypeProperty,
- &activation_type);
+ properties.GetStringWithoutPathExpansion(shill::kActivationTypeProperty,
+ &activation_type);
const base::DictionaryValue* payment_dict;
std::string payment_url, post_method, post_data;
if (properties.GetDictionaryWithoutPathExpansion(
shill::kPaymentPortalProperty, &payment_dict)) {
- payment_dict->GetStringWithoutPathExpansion(
- shill::kPaymentPortalURL, &payment_url);
- payment_dict->GetStringWithoutPathExpansion(
- shill::kPaymentPortalMethod, &post_method);
- payment_dict->GetStringWithoutPathExpansion(
- shill::kPaymentPortalPostData, &post_data);
+ payment_dict->GetStringWithoutPathExpansion(shill::kPaymentPortalURL,
+ &payment_url);
+ payment_dict->GetStringWithoutPathExpansion(shill::kPaymentPortalMethod,
+ &post_method);
+ payment_dict->GetStringWithoutPathExpansion(shill::kPaymentPortalPostData,
+ &post_data);
}
+ NET_LOG(EVENT) << "MobileSetupUI: Payment URL = " << payment_url
+ << " Post Data = " << post_data;
value->SetString("activation_type", activation_type);
value->SetString("carrier", name);
@@ -117,12 +134,12 @@ void GetDeviceInfo(const base::DictionaryValue& properties,
// Use the cached DeviceState properties.
std::string device_path;
- if (!properties.GetStringWithoutPathExpansion(
- shill::kDeviceProperty, &device_path) ||
+ if (!properties.GetStringWithoutPathExpansion(shill::kDeviceProperty,
+ &device_path) ||
device_path.empty()) {
return;
}
- const chromeos::DeviceState* device =
+ const DeviceState* device =
NetworkHandler::Get()->network_state_handler()->GetDeviceState(
device_path);
if (!device)
@@ -182,11 +199,9 @@ class MobileSetupUIHTMLSource : public content::URLDataSource {
};
// The handler for Javascript messages related to the "register" view.
-class MobileSetupHandler
- : public WebUIMessageHandler,
- public MobileActivator::Observer,
- public chromeos::NetworkStateHandlerObserver,
- public base::SupportsWeakPtr<MobileSetupHandler> {
+class MobileSetupHandler : public content::WebUIMessageHandler,
+ public MobileActivator::Observer,
+ public NetworkStateHandlerObserver {
public:
MobileSetupHandler();
~MobileSetupHandler() override;
@@ -262,9 +277,7 @@ class MobileSetupHandler
//
////////////////////////////////////////////////////////////////////////////////
-MobileSetupUIHTMLSource::MobileSetupUIHTMLSource()
- : weak_ptr_factory_(this) {
-}
+MobileSetupUIHTMLSource::MobileSetupUIHTMLSource() : weak_ptr_factory_(this) {}
std::string MobileSetupUIHTMLSource::GetSource() const {
return chrome::kChromeUIMobileSetupHost;
@@ -286,29 +299,26 @@ void MobileSetupUIHTMLSource::GetPropertiesAndStartDataRequest(
const content::URLDataSource::GotDataCallback& callback,
const std::string& service_path,
const base::DictionaryValue& properties) {
- const base::DictionaryValue* payment_dict;
- std::string name, usage_url, activation_state, payment_url;
- if (!properties.GetStringWithoutPathExpansion(
- shill::kNameProperty, &name) ||
- !properties.GetStringWithoutPathExpansion(
- shill::kUsageURLProperty, &usage_url) ||
- !properties.GetStringWithoutPathExpansion(
- shill::kActivationStateProperty, &activation_state) ||
- !properties.GetDictionaryWithoutPathExpansion(
- shill::kPaymentPortalProperty, &payment_dict) ||
- !payment_dict->GetStringWithoutPathExpansion(
- shill::kPaymentPortalURL, &payment_url)) {
+ const base::Value* payment_dict;
+ std::string name, activation_state, payment_url;
+ if (!HasStringProperty(properties, shill::kNameProperty, &name) ||
+ !HasStringProperty(properties, shill::kActivationStateProperty,
+ &activation_state) ||
+ !HasDictionaryProperty(properties, shill::kPaymentPortalProperty,
+ &payment_dict) ||
+ !HasStringProperty(*payment_dict, shill::kPaymentPortalURL,
+ &payment_url)) {
DataRequestFailed(service_path, callback);
return;
}
- if (payment_url.empty() && usage_url.empty() &&
+ if (payment_url.empty() &&
activation_state != shill::kActivationStateActivated) {
DataRequestFailed(service_path, callback);
return;
}
- NET_LOG_EVENT("Starting mobile setup", service_path);
+ NET_LOG(EVENT) << "Starting mobile setup: " << service_path;
base::DictionaryValue strings;
strings.SetString("connecting_header",
@@ -326,15 +336,13 @@ void MobileSetupUIHTMLSource::GetPropertiesAndStartDataRequest(
l10n_util::GetStringUTF16(IDS_MOBILE_COMPLETED_TEXT));
strings.SetString("portal_unreachable_header",
l10n_util::GetStringUTF16(IDS_MOBILE_NO_CONNECTION_HEADER));
- strings.SetString("invalid_device_info_header",
+ strings.SetString(
+ "invalid_device_info_header",
l10n_util::GetStringUTF16(IDS_MOBILE_INVALID_DEVICE_INFO_HEADER));
strings.SetString("title", l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE));
- strings.SetString("close_button",
- l10n_util::GetStringUTF16(IDS_CLOSE));
- strings.SetString("cancel_button",
- l10n_util::GetStringUTF16(IDS_CANCEL));
- strings.SetString("ok_button",
- l10n_util::GetStringUTF16(IDS_OK));
+ strings.SetString("close_button", l10n_util::GetStringUTF16(IDS_CLOSE));
+ strings.SetString("cancel_button", l10n_util::GetStringUTF16(IDS_CANCEL));
+ strings.SetString("ok_button", l10n_util::GetStringUTF16(IDS_OK));
const std::string& app_locale = g_browser_process->GetApplicationLocale();
webui::SetLoadTimeDataDefaults(app_locale, &strings);
@@ -374,8 +382,7 @@ void MobileSetupUIHTMLSource::GetPropertiesFailure(
MobileSetupHandler::MobileSetupHandler()
: type_(TYPE_UNDETERMINED),
lte_portal_reachable_(true),
- weak_ptr_factory_(this) {
-}
+ weak_ptr_factory_(this) {}
MobileSetupHandler::~MobileSetupHandler() {
if (type_ == TYPE_ACTIVATION) {
@@ -453,7 +460,7 @@ void MobileSetupHandler::HandleStartActivation(const base::ListValue* args) {
if (path.empty())
return;
- LOG(WARNING) << "Starting activation for service " << path;
+ NET_LOG(EVENT) << "Starting activation for service: " << path;
type_ = TYPE_ACTIVATION;
MobileActivator::GetInstance()->AddObserver(this);
@@ -504,8 +511,7 @@ void MobileSetupHandler::HandleGetDeviceInfo(const base::ListValue* args) {
if (path.empty())
return;
- chromeos::NetworkStateHandler* nsh =
- NetworkHandler::Get()->network_state_handler();
+ NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler();
// TODO: Figure out why the path has an extra '/' in the front. (e.g. It is
// '//service/5' instead of '/service/5'.
const NetworkState* network = nsh->GetNetworkState(path.substr(1));
@@ -524,8 +530,7 @@ void MobileSetupHandler::HandleGetDeviceInfo(const base::ListValue* args) {
nsh->AddObserver(this, FROM_HERE);
// Update the network status and notify the webui. This is the initial
// network state so the webui should be notified no matter what.
- UpdatePortalReachability(network,
- true /* force notification */);
+ UpdatePortalReachability(network, true /* force notification */);
} else {
type_ = TYPE_PORTAL;
// For non-LTE networks network state is ignored, so report the portal is
@@ -557,8 +562,7 @@ void MobileSetupHandler::GetPropertiesFailure(
const std::string& callback_name,
const std::string& error_name,
std::unique_ptr<base::DictionaryValue> error_data) {
- NET_LOG_ERROR("MobileActivator GetProperties Failed: " + error_name,
- service_path);
+ NET_LOG(ERROR) << "MobileActivator GetProperties Failed: " << error_name;
// Invoke |callback_name| with an empty dictionary.
base::DictionaryValue device_dict;
web_ui()->CallJavascriptFunctionUnsafe(callback_name, device_dict);
@@ -576,7 +580,7 @@ void MobileSetupHandler::DefaultNetworkChanged(
const NetworkState* network =
NetworkHandler::Get()->network_state_handler()->GetNetworkState(path);
if (!network) {
- LOG(ERROR) << "Service path lost";
+ NET_LOG(ERROR) << "Service for activation lost: " << path;
web_ui()->GetWebContents()->Close();
return;
}
@@ -596,15 +600,13 @@ void MobileSetupHandler::NetworkConnectionStateChanged(
UpdatePortalReachability(network, false /* do not force notification */);
}
-void MobileSetupHandler::UpdatePortalReachability(
- const NetworkState* network,
- bool force_notification) {
+void MobileSetupHandler::UpdatePortalReachability(const NetworkState* network,
+ bool force_notification) {
DCHECK(web_ui());
DCHECK_EQ(type_, TYPE_PORTAL_LTE);
- chromeos::NetworkStateHandler* nsh =
- NetworkHandler::Get()->network_state_handler();
+ NetworkStateHandler* nsh = NetworkHandler::Get()->network_state_handler();
bool portal_reachable =
(network->IsConnectedState() ||
(nsh->DefaultNetwork() &&
@@ -624,8 +626,7 @@ void MobileSetupHandler::UpdatePortalReachability(
//
////////////////////////////////////////////////////////////////////////////////
-MobileSetupUI::MobileSetupUI(content::WebUI* web_ui)
- : WebUIController(web_ui) {
+MobileSetupUI::MobileSetupUI(content::WebUI* web_ui) : ui::WebDialogUI(web_ui) {
web_ui->AddMessageHandler(std::make_unique<MobileSetupHandler>());
MobileSetupUIHTMLSource* html_source = new MobileSetupUIHTMLSource();
@@ -636,8 +637,13 @@ MobileSetupUI::MobileSetupUI(content::WebUI* web_ui)
content::WebContentsObserver::Observe(web_ui->GetWebContents());
}
+MobileSetupUI::~MobileSetupUI() = default;
+
void MobileSetupUI::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
+ NET_LOG(EVENT) << "MobileSetupUI: DidFinishNavigation. Committed: "
+ << navigation_handle->HasCommitted() << " Frame: "
+ << navigation_handle->GetRenderFrameHost()->GetFrameName();
if (!navigation_handle->HasCommitted() ||
navigation_handle->GetRenderFrameHost()->GetFrameName() !=
"paymentForm") {
@@ -645,6 +651,8 @@ void MobileSetupUI::DidFinishNavigation(
}
if (navigation_handle->IsErrorPage()) {
+ NET_LOG(ERROR) << "MobileSetupUI: Error: "
+ << navigation_handle->GetNetErrorCode();
base::Value result_value(-navigation_handle->GetNetErrorCode());
web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadFailedCallback,
result_value);
@@ -653,3 +661,5 @@ void MobileSetupUI::DidFinishNavigation(
web_ui()->CallJavascriptFunctionUnsafe(kJsPortalFrameLoadCompletedCallback);
}
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h
index 0fd9d74190e..a98f2935ff4 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/mobile_setup_ui.h
@@ -6,17 +6,17 @@
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_MOBILE_SETUP_UI_H_
#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_ui_controller.h"
+#include "ui/web_dialogs/web_dialog_ui.h"
+
+namespace chromeos {
// A custom WebUI that defines datasource for mobile setup registration page
// that is used in Chrome OS activate modem and perform plan subscription tasks.
-class MobileSetupUI : public content::WebUIController,
- public content::WebContentsObserver,
- public base::SupportsWeakPtr<MobileSetupUI> {
+class MobileSetupUI : public ui::WebDialogUI,
+ public content::WebContentsObserver {
public:
explicit MobileSetupUI(content::WebUI* web_ui);
+ ~MobileSetupUI() override;
private:
// content::WebContentsObserver overrides.
@@ -26,4 +26,6 @@ class MobileSetupUI : public content::WebUIController,
DISALLOW_COPY_AND_ASSIGN(MobileSetupUI);
};
+} // namespace chromeos
+
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_MOBILE_SETUP_UI_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.cc
index 5ed83ce27d5..3f43b8aa4c7 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.cc
@@ -4,14 +4,22 @@
#include "chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/sys_info.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.h"
+#include "chrome/common/url_constants.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/multidevice_setup_resources.h"
#include "chrome/grit/multidevice_setup_resources_map.h"
+#include "chromeos/grit/chromeos_resources.h"
+#include "chromeos/services/multidevice_setup/public/cpp/url_provider.h"
+#include "chromeos/services/multidevice_setup/public/mojom/constants.mojom.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "ui/base/l10n/l10n_util.h"
namespace chromeos {
@@ -20,23 +28,37 @@ namespace multidevice_setup {
namespace {
+// TODO(khorimoto): Localize footnote marker if necessary.
+const char kFootnoteMarker[] = "*";
+
constexpr int kDialogHeightPx = 640;
constexpr int kDialogWidthPx = 768;
void AddMultiDeviceSetupStrings(content::WebUIDataSource* html_source) {
- // TODO(jordynass): Translate the newly added strings from
- // //chrome/app/chromeos_strings.grdp.
static constexpr struct {
const char* name;
int id;
- } kLocalizedStrings[] = {
+ } kLocalizedStringsWithoutPlaceholders[] = {
{"accept", IDS_MULTIDEVICE_SETUP_ACCEPT_LABEL},
{"cancel", IDS_CANCEL},
{"done", IDS_DONE},
+ {"passwordPageHeader", IDS_MULTIDEVICE_SETUP_PASSWORD_PAGE_HEADER},
+ {"enterPassword",
+ IDS_MULTIDEVICE_SETUP_PASSWORD_PAGE_ENTER_PASSWORD_LABEL},
+ {"wrongPassword",
+ IDS_MULTIDEVICE_SETUP_PASSWORD_PAGE_WRONG_PASSWORD_LABEL},
{"startSetupPageMultipleDeviceHeader",
IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_MULTIPLE_DEVICE_HEADER},
{"startSetupPageSingleDeviceHeader",
IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_SINGLE_DEVICE_HEADER},
+ {"startSetupPageFeatureListHeader",
+ IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_FEATURE_LIST_HEADER},
+ {"startSetupPageFeatureListAwm",
+ IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_AWM_DESCRIPTION},
+ {"startSetupPageFeatureListInstallApps",
+ IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_INSTALL_APPS_DESCRIPTION},
+ {"startSetupPageFeatureListAddFeatures",
+ IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_ADD_FEATURES},
{"setupFailedPageHeader", IDS_MULTIDEVICE_SETUP_SETUP_FAILED_PAGE_HEADER},
{"setupFailedPageMessage",
IDS_MULTIDEVICE_SETUP_SETUP_FAILED_PAGE_MESSAGE},
@@ -45,16 +67,26 @@ void AddMultiDeviceSetupStrings(content::WebUIDataSource* html_source) {
{"setupSucceededPageMessage",
IDS_MULTIDEVICE_SETUP_SETUP_SUCCEEDED_PAGE_MESSAGE},
{"startSetupPageHeader", IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_HEADER},
- {"startSetupPageMessagePart1",
- IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_MESSAGE_PART_1},
- {"startSetupPageMessagePart2",
- IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_MESSAGE_PART_2},
{"title", IDS_MULTIDEVICE_SETUP_DIALOG_TITLE},
{"tryAgain", IDS_MULTIDEVICE_SETUP_TRY_AGAIN_LABEL},
};
- for (const auto& entry : kLocalizedStrings)
+ for (const auto& entry : kLocalizedStringsWithoutPlaceholders)
html_source->AddLocalizedString(entry.name, entry.id);
+
+ html_source->AddString(
+ "startSetupPageMessage",
+ l10n_util::GetStringFUTF16(
+ IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_MESSAGE,
+ base::ASCIIToUTF16(kFootnoteMarker),
+ base::UTF8ToUTF16(
+ chromeos::multidevice_setup::GetBoardSpecificLearnMoreUrl()
+ .spec())));
+ html_source->AddString(
+ "startSetupPageFootnote",
+ l10n_util::GetStringFUTF16(
+ IDS_MULTIDEVICE_SETUP_START_SETUP_PAGE_FOOTNOTE,
+ base::ASCIIToUTF16(kFootnoteMarker)));
}
} // namespace
@@ -93,7 +125,7 @@ void MultiDeviceSetupDialog::OnDialogClosed(const std::string& json_retval) {
}
MultiDeviceSetupDialogUI::MultiDeviceSetupDialogUI(content::WebUI* web_ui)
- : ui::WebDialogUI(web_ui) {
+ : ui::MojoWebDialogUI(web_ui) {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUIMultiDeviceSetupHost);
@@ -101,6 +133,19 @@ MultiDeviceSetupDialogUI::MultiDeviceSetupDialogUI(content::WebUI* web_ui)
source->SetJsonPath("strings.js");
source->SetDefaultResource(
IDR_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_DIALOG_HTML);
+ source->AddResourcePath("mojo/public/mojom/base/time.mojom.js",
+ IDR_TIME_MOJOM_JS);
+ source->AddResourcePath(
+ "chromeos/services/device_sync/public/mojom/device_sync.mojom.js",
+ IDR_DEVICE_SYNC_MOJOM_JS);
+ source->AddResourcePath(
+ "chromeos/services/multidevice_setup/public/mojom/"
+ "multidevice_setup.mojom.js",
+ IDR_MULTIDEVICE_SETUP_MOJOM_JS);
+ source->AddResourcePath(
+ "chromeos/services/multidevice_setup/public/mojom/"
+ "multidevice_setup_constants.mojom.js",
+ IDR_MULTIDEVICE_SETUP_CONSTANTS_MOJOM_JS);
// Note: The |kMultiDeviceSetupResourcesSize| and |kMultideviceSetupResources|
// fields are defined in the generated file
@@ -110,11 +155,27 @@ MultiDeviceSetupDialogUI::MultiDeviceSetupDialogUI(content::WebUI* web_ui)
kMultideviceSetupResources[i].value);
}
+ web_ui->AddMessageHandler(std::make_unique<MultideviceSetupHandler>());
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source);
+
+ // Add Mojo bindings to this WebUI so that Mojo calls can occur in JavaScript.
+ AddHandlerToRegistry(base::BindRepeating(
+ &MultiDeviceSetupDialogUI::BindMultiDeviceSetup, base::Unretained(this)));
}
MultiDeviceSetupDialogUI::~MultiDeviceSetupDialogUI() = default;
+void MultiDeviceSetupDialogUI::BindMultiDeviceSetup(
+ chromeos::multidevice_setup::mojom::MultiDeviceSetupRequest request) {
+ service_manager::Connector* connector =
+ content::BrowserContext::GetConnectorFor(
+ web_ui()->GetWebContents()->GetBrowserContext());
+ DCHECK(connector);
+
+ connector->BindInterface(chromeos::multidevice_setup::mojom::kServiceName,
+ std::move(request));
+}
+
} // namespace multidevice_setup
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h
index 66433f09942..cd79039b1f2 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h
@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h"
+#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
#include "ui/web_dialogs/web_dialog_ui.h"
namespace chromeos {
@@ -38,12 +39,15 @@ class MultiDeviceSetupDialog : public SystemWebDialogDelegate {
DISALLOW_COPY_AND_ASSIGN(MultiDeviceSetupDialog);
};
-class MultiDeviceSetupDialogUI : public ui::WebDialogUI {
+class MultiDeviceSetupDialogUI : public ui::MojoWebDialogUI {
public:
explicit MultiDeviceSetupDialogUI(content::WebUI* web_ui);
~MultiDeviceSetupDialogUI() override;
private:
+ void BindMultiDeviceSetup(
+ chromeos::multidevice_setup::mojom::MultiDeviceSetupRequest request);
+
DISALLOW_COPY_AND_ASSIGN(MultiDeviceSetupDialogUI);
};
diff --git a/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.cc
new file mode 100644
index 00000000000..29d6bbc74f8
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.cc
@@ -0,0 +1,69 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "chrome/browser/chromeos/profiles/profile_helper.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/chrome_pages.h"
+#include "chrome/browser/ui/webui/chromeos/user_image_source.h"
+#include "chrome/common/webui_url_constants.h"
+#include "components/user_manager/user.h"
+#include "ui/base/webui/web_ui_util.h"
+
+namespace chromeos {
+
+namespace multidevice_setup {
+
+MultideviceSetupHandler::MultideviceSetupHandler() = default;
+
+MultideviceSetupHandler::~MultideviceSetupHandler() = default;
+
+void MultideviceSetupHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ "getProfileInfo",
+ base::BindRepeating(&MultideviceSetupHandler::HandleGetProfileInfo,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "openMultiDeviceSettings",
+ base::BindRepeating(
+ &MultideviceSetupHandler::HandleOpenMultiDeviceSettings,
+ base::Unretained(this)));
+}
+
+void MultideviceSetupHandler::HandleGetProfileInfo(
+ const base::ListValue* args) {
+ AllowJavascript();
+
+ std::string callback_id;
+ bool result = args->GetString(0, &callback_id);
+ DCHECK(result);
+
+ const user_manager::User* user =
+ chromeos::ProfileHelper::Get()->GetUserByProfile(
+ Profile::FromWebUI(web_ui()));
+
+ base::DictionaryValue response;
+ response.SetString("email", user->GetDisplayEmail());
+
+ scoped_refptr<base::RefCountedMemory> image =
+ chromeos::UserImageSource::GetUserImage(user->GetAccountId());
+ response.SetString("profilePhotoUrl",
+ webui::GetPngDataUrl(image->front(), image->size()));
+
+ ResolveJavascriptCallback(base::Value(callback_id), response);
+}
+
+void MultideviceSetupHandler::HandleOpenMultiDeviceSettings(
+ const base::ListValue* args) {
+ DCHECK(args->empty());
+ chrome::ShowSettingsSubPageForProfile(Profile::FromWebUI(web_ui()),
+ chrome::kConnectedDevicesSubPage);
+}
+
+} // namespace multidevice_setup
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.h b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.h
new file mode 100644
index 00000000000..093d0fb03bc
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_handler.h
@@ -0,0 +1,35 @@
+// 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 CHROME_BROWSER_UI_WEBUI_CHROMEOS_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_HANDLER_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_ui_message_handler.h"
+
+namespace chromeos {
+
+namespace multidevice_setup {
+
+// Chrome MultiDevice setup flow WebUI handler.
+class MultideviceSetupHandler : public content::WebUIMessageHandler {
+ public:
+ MultideviceSetupHandler();
+ ~MultideviceSetupHandler() override;
+
+ private:
+ // content::WebUIMessageHandler:
+ void RegisterMessages() override;
+
+ void HandleGetProfileInfo(const base::ListValue* args);
+ void HandleOpenMultiDeviceSettings(const base::ListValue* args);
+
+ DISALLOW_COPY_AND_ASSIGN(MultideviceSetupHandler);
+};
+
+} // namespace multidevice_setup
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_MULTIDEVICE_SETUP_MULTIDEVICE_SETUP_HANDLER_H_
diff --git a/chromium/chrome/browser/ui/webui/chromeos/power_ui.cc b/chromium/chrome/browser/ui/webui/chromeos/power_ui.cc
index 21d6578d905..656de5b6d66 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/power_ui.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/power_ui.cc
@@ -7,7 +7,9 @@
#include <stddef.h>
#include <memory>
+#include <string>
#include <utility>
+#include <vector>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -17,6 +19,7 @@
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/chromeos/power/power_data_collector.h"
+#include "chrome/browser/chromeos/power/process_data_collector.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
@@ -43,6 +46,8 @@ const char kRequestCpuFreqDataCallback[] = "requestCpuFreqData";
const char kOnRequestCpuFreqDataFunction[] =
"powerUI.showCpuFreqData";
+const char kRequestProcessUsageDataCallback[] = "requestProcessUsageData";
+
class PowerMessageHandler : public content::WebUIMessageHandler {
public:
PowerMessageHandler();
@@ -55,6 +60,7 @@ class PowerMessageHandler : public content::WebUIMessageHandler {
void OnGetBatteryChargeData(const base::ListValue* value);
void OnGetCpuIdleData(const base::ListValue* value);
void OnGetCpuFreqData(const base::ListValue* value);
+ void OnGetProcessUsageData(const base::ListValue* value);
void GetJsStateOccupancyData(
const std::vector<CpuDataCollector::StateOccupancySampleDeque>& data,
const std::vector<std::string>& state_names,
@@ -81,6 +87,10 @@ void PowerMessageHandler::RegisterMessages() {
kRequestCpuFreqDataCallback,
base::BindRepeating(&PowerMessageHandler::OnGetCpuFreqData,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ kRequestProcessUsageDataCallback,
+ base::BindRepeating(&PowerMessageHandler::OnGetProcessUsageData,
+ base::Unretained(this)));
}
void PowerMessageHandler::OnGetBatteryChargeData(const base::ListValue* value) {
@@ -142,6 +152,32 @@ void PowerMessageHandler::OnGetCpuFreqData(const base::ListValue* value) {
js_freq_data, js_system_resumed_data);
}
+void PowerMessageHandler::OnGetProcessUsageData(const base::ListValue* args) {
+ AllowJavascript();
+ CHECK_EQ(1U, args->GetSize());
+
+ const base::Value* callback_id;
+ CHECK(args->Get(0, &callback_id));
+
+ const std::vector<ProcessDataCollector::ProcessUsageData>& process_list =
+ ProcessDataCollector::Get()->GetProcessUsages();
+
+ base::ListValue js_process_usages;
+ for (const auto& process_info : process_list) {
+ std::unique_ptr<base::DictionaryValue> element =
+ std::make_unique<base::DictionaryValue>();
+ element->SetInteger("pid", process_info.process_data.pid);
+ element->SetString("name", process_info.process_data.name);
+ element->SetString("cmdline", process_info.process_data.cmdline);
+ element->SetInteger("type",
+ static_cast<int>(process_info.process_data.type));
+ element->SetDouble("powerUsageFraction", process_info.power_usage_fraction);
+ js_process_usages.Append(std::move(element));
+ }
+
+ ResolveJavascriptCallback(*callback_id, js_process_usages);
+}
+
void PowerMessageHandler::GetJsSystemResumedData(base::ListValue *data) {
DCHECK(data);
diff --git a/chromium/chrome/browser/ui/webui/chromeos/set_time_ui.cc b/chromium/chrome/browser/ui/webui/chromeos/set_time_ui.cc
index 95008b5f536..7a48123bd79 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/set_time_ui.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/set_time_ui.cc
@@ -101,8 +101,7 @@ class SetTimeMessageHandler : public content::WebUIMessageHandler,
return;
}
- Profile* profile = Profile::FromBrowserContext(
- web_ui()->GetWebContents()->GetBrowserContext());
+ Profile* profile = Profile::FromWebUI(web_ui());
DCHECK(profile);
system::SetTimezoneFromUI(profile, timezone_id);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/sys_internals/sys_internals_message_handler.h b/chromium/chrome/browser/ui/webui/chromeos/sys_internals/sys_internals_message_handler.h
index f2d2bfedf91..4a21bbabe73 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/sys_internals/sys_internals_message_handler.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/sys_internals/sys_internals_message_handler.h
@@ -9,7 +9,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "content/public/browser/web_ui_message_handler.h"
diff --git a/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.cc b/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.cc
index aa7400cb37d..165ee5e13b2 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.cc
@@ -70,8 +70,8 @@ void SystemWebDialogDelegate::ShowSystemDialog(bool is_minimal_style) {
int container_id = GetDialogModalType() == ui::MODAL_TYPE_NONE
? ash::kShellWindowId_AlwaysOnTopContainer
: ash::kShellWindowId_LockSystemModalContainer;
- chrome::ShowWebDialogInContainer(container_id, browser_context, this,
- is_minimal_style);
+ dialog_window_ = chrome::ShowWebDialogInContainer(
+ container_id, browser_context, this, is_minimal_style);
}
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h b/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h
index 6c248bb8cce..7e50ee2b283 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h
+++ b/chromium/chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h
@@ -51,11 +51,15 @@ class SystemWebDialogDelegate : public ui::WebDialogDelegate {
static constexpr int kDialogWidth = 512;
static constexpr int kDialogHeight = 480;
+ protected:
+ gfx::NativeWindow dialog_window() const { return dialog_window_; }
+
private:
GURL gurl_;
base::string16 title_;
content::WebUI* webui_ = nullptr;
ui::ModalType modal_type_;
+ gfx::NativeWindow dialog_window_;
DISALLOW_COPY_AND_ASSIGN(SystemWebDialogDelegate);
};
diff --git a/chromium/chrome/browser/ui/webui/components_ui.cc b/chromium/chrome/browser/ui/webui/components_ui.cc
index a3a4fe9b9b3..be13e830fc0 100644
--- a/chromium/chrome/browser/ui/webui/components_ui.cc
+++ b/chromium/chrome/browser/ui/webui/components_ui.cc
@@ -183,12 +183,14 @@ std::unique_ptr<base::ListValue> ComponentsUI::LoadComponents() {
for (size_t j = 0; j < component_ids.size(); ++j) {
update_client::CrxUpdateItem item;
if (cus->GetComponentDetails(component_ids[j], &item)) {
- std::unique_ptr<base::DictionaryValue> component_entry(
- new base::DictionaryValue());
+ auto component_entry = std::make_unique<base::DictionaryValue>();
component_entry->SetString("id", component_ids[j]);
- component_entry->SetString("name", item.component.name);
- component_entry->SetString("version", item.component.version.GetString());
component_entry->SetString("status", ServiceStatusToString(item.state));
+ if (item.component) {
+ component_entry->SetString("name", item.component->name);
+ component_entry->SetString("version",
+ item.component->version.GetString());
+ }
component_list->Append(std::move(component_entry));
}
}
@@ -266,8 +268,8 @@ void ComponentsUI::OnEvent(Events event, const std::string& id) {
if (event == Events::COMPONENT_UPDATED) {
auto* component_updater = g_browser_process->component_updater();
update_client::CrxUpdateItem item;
- if (component_updater->GetComponentDetails(id, &item))
- parameters.SetString("version", item.component.version.GetString());
+ if (component_updater->GetComponentDetails(id, &item) && item.component)
+ parameters.SetString("version", item.component->version.GetString());
}
parameters.SetString("id", id);
}
diff --git a/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.cc b/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.cc
index ab34217d8cc..5d2afa81386 100644
--- a/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.cc
+++ b/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.cc
@@ -11,6 +11,7 @@
#include "base/feature_list.h"
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_piece.h"
#include "base/values.h"
#include "base/win/windows_version.h"
#include "chrome/browser/conflicts/module_database_win.h"
@@ -21,6 +22,7 @@
#include "ui/base/l10n/l10n_util.h"
#if defined(GOOGLE_CHROME_BUILD)
+#include "base/win/win_util.h"
#include "chrome/browser/conflicts/incompatible_applications_updater_win.h"
#include "chrome/browser/conflicts/module_blacklist_cache_updater_win.h"
#endif
@@ -28,93 +30,165 @@
namespace {
#if defined(GOOGLE_CHROME_BUILD)
+
+// Strings used twice.
+constexpr char kNotLoaded[] = "Not loaded";
+constexpr char kAllowedInputMethodEditor[] = "Allowed - Input method editor";
+constexpr char kAllowedMatchingCertificate[] = "Allowed - Matching certificate";
+constexpr char kAllowedMicrosoftModule[] = "Allowed - Microsoft module";
+constexpr char kAllowedWhitelisted[] = "Allowed - Whitelisted";
+constexpr char kAllowedSameDirectory[] =
+#if defined(OFFICIAL_BUILD)
+ // In official builds, modules in the Chrome directory are blocked but they
+ // won't cause a warning because the warning would blame Chrome itself.
+ "Tolerated - In executable directory";
+#else // !defined(OFFICIAL_BUILD)
+ // In developer builds, DLLs that are part of Chrome are not signed and thus
+ // the easy way to identify them is to check that they are in the same
+ // directory (or child folder) as the main exe.
+ "Allowed - In executable directory (dev builds only)";
+#endif
+
+void AppendString(base::StringPiece input, std::string* output) {
+ if (!output->empty())
+ *output += ", ";
+ input.AppendToString(output);
+}
+
+// Returns a string describing the current module blocking status: loaded or
+// not, blocked or not, was in blacklist cache or not, bypassed blocking or not.
+std::string GetBlockingStatusString(
+ const ModuleBlacklistCacheUpdater::ModuleBlockingState& blocking_state) {
+ std::string status;
+
+ // Output status regarding the blacklist cache, current blocking, and
+ // load status.
+ if (blocking_state.was_blocked)
+ status = "Blocked";
+ if (!blocking_state.was_loaded)
+ AppendString(kNotLoaded, &status);
+ else if (blocking_state.was_in_blacklist_cache)
+ AppendString("Bypassed blocking", &status);
+ if (blocking_state.was_in_blacklist_cache)
+ AppendString("In blacklist cache", &status);
+
+ return status;
+}
+
+// Returns a string describing the blocking decision related to a module. This
+// returns the empty string to indicate that the warning decision description
+// should be used instead.
+std::string GetBlockingDecisionString(
+ const ModuleBlacklistCacheUpdater::ModuleBlockingState& blocking_state,
+ IncompatibleApplicationsUpdater* incompatible_applications_updater) {
+ using BlockingDecision = ModuleBlacklistCacheUpdater::ModuleBlockingDecision;
+
+ // Append status regarding the logic that will be applied during the next
+ // startup.
+ switch (blocking_state.blocking_decision) {
+ case BlockingDecision::kUnknown:
+ NOTREACHED();
+ break;
+ case BlockingDecision::kAllowedIME:
+ return kAllowedInputMethodEditor;
+ case BlockingDecision::kAllowedSameCertificate:
+ return kAllowedMatchingCertificate;
+ case BlockingDecision::kAllowedSameDirectory:
+ return kAllowedSameDirectory;
+ case BlockingDecision::kAllowedMicrosoft:
+ return kAllowedMicrosoftModule;
+ case BlockingDecision::kAllowedWhitelisted:
+ return kAllowedWhitelisted;
+ case BlockingDecision::kTolerated:
+ // This is a module explicitly allowed to load by the Module List
+ // component. But it is still valid for a potential warning, and so the
+ // warning status is used instead.
+ if (incompatible_applications_updater)
+ break;
+ return "Tolerated - Will be blocked in the future";
+ case BlockingDecision::kDisallowedExplicit:
+ return "Disallowed - Explicitly blacklisted";
+ case BlockingDecision::kDisallowedImplicit:
+ return "Disallowed - Implicitly blacklisted";
+ }
+
+ // Returning an empty string indicates that the warning status should be used.
+ return std::string();
+}
+
+// Returns a string describing the warning decision that was made regarding a
+// module.
+std::string GetModuleWarningDecisionString(
+ const ModuleInfoKey& module_key,
+ IncompatibleApplicationsUpdater* incompatible_applications_updater) {
+ using WarningDecision =
+ IncompatibleApplicationsUpdater::ModuleWarningDecision;
+
+ WarningDecision warning_decision =
+ incompatible_applications_updater->GetModuleWarningDecision(module_key);
+
+ switch (warning_decision) {
+ case WarningDecision::kNotLoaded:
+ return kNotLoaded;
+ case WarningDecision::kAllowedIME:
+ return kAllowedInputMethodEditor;
+ case WarningDecision::kAllowedShellExtension:
+ return "Tolerated - Shell extension";
+ case WarningDecision::kAllowedSameCertificate:
+ return kAllowedMatchingCertificate;
+ case WarningDecision::kAllowedSameDirectory:
+ return kAllowedSameDirectory;
+ case WarningDecision::kAllowedMicrosoft:
+ return kAllowedMicrosoftModule;
+ case WarningDecision::kAllowedWhitelisted:
+ return kAllowedWhitelisted;
+ case WarningDecision::kNoTiedApplication:
+ return "Tolerated - Could not tie to an installed application";
+ case WarningDecision::kIncompatible:
+ return "Incompatible";
+ case WarningDecision::kAddedToBlacklist:
+ case WarningDecision::kUnknown:
+ NOTREACHED();
+ break;
+ }
+
+ return std::string();
+}
+
std::string GetModuleStatusString(
const ModuleInfoKey& module_key,
IncompatibleApplicationsUpdater* incompatible_applications_updater,
ModuleBlacklistCacheUpdater* module_blacklist_cache_updater) {
- DCHECK(incompatible_applications_updater || module_blacklist_cache_updater);
+ if (!incompatible_applications_updater && !module_blacklist_cache_updater)
+ return std::string();
- // Strings used twice.
- constexpr char kNotLoaded[] = "Not loaded";
- constexpr char kAllowedInputMethodEditor[] = "Allowed - Input method editor";
- constexpr char kAllowedMatchingCertificate[] =
- "Allowed - Matching certificate";
- constexpr char kAllowedSameDirectory[] = "Allowed - In executable directory";
- constexpr char kAllowedMicrosoftModule[] = "Allowed - Microsoft module";
- constexpr char kAllowedWhitelisted[] = "Allowed - Whitelisted";
+ std::string status;
// The blocking status is shown over the warning status.
if (module_blacklist_cache_updater) {
- using BlockingDecision =
- ModuleBlacklistCacheUpdater::ModuleBlockingDecision;
-
- BlockingDecision blocking_decision =
- module_blacklist_cache_updater->GetModuleBlockingDecision(module_key);
-
- switch (blocking_decision) {
- case BlockingDecision::kNotLoaded:
- return kNotLoaded;
- case BlockingDecision::kAllowedIME:
- return kAllowedInputMethodEditor;
- case BlockingDecision::kAllowedSameCertificate:
- return kAllowedMatchingCertificate;
- case BlockingDecision::kAllowedSameDirectory:
- return kAllowedSameDirectory;
- case BlockingDecision::kAllowedMicrosoft:
- return kAllowedMicrosoftModule;
- case BlockingDecision::kAllowedWhitelisted:
- return kAllowedWhitelisted;
- case BlockingDecision::kTolerated:
- // This is a module explicitely allowed to load by the Module List
- // component. But it is still valid for a potential warning, and so the
- // warning status is used instead.
- if (incompatible_applications_updater)
- break;
- return "Tolerated - Will be blocked in the future";
- case BlockingDecision::kBlacklisted:
- return "Disallowed - Added to the blacklist";
- case BlockingDecision::kBlocked:
- return "Disallowed - Blocked";
- case BlockingDecision::kUnknown:
- NOTREACHED();
- break;
+ const ModuleBlacklistCacheUpdater::ModuleBlockingState& blocking_state =
+ module_blacklist_cache_updater->GetModuleBlockingState(module_key);
+
+ status = GetBlockingStatusString(blocking_state);
+
+ std::string blocking_string = GetBlockingDecisionString(
+ blocking_state, incompatible_applications_updater);
+ if (!blocking_string.empty()) {
+ AppendString(blocking_string, &status);
+ return status;
}
+
+ // An empty |blocking_string| indicates that a warning decision string
+ // should be used instead.
}
if (incompatible_applications_updater) {
- using WarningDecision =
- IncompatibleApplicationsUpdater::ModuleWarningDecision;
-
- WarningDecision warning_decision =
- incompatible_applications_updater->GetModuleWarningDecision(module_key);
-
- switch (warning_decision) {
- case WarningDecision::kNotLoaded:
- return kNotLoaded;
- case WarningDecision::kAllowedIME:
- return kAllowedInputMethodEditor;
- case WarningDecision::kAllowedShellExtension:
- return "Tolerated - Shell extension";
- case WarningDecision::kAllowedSameCertificate:
- return kAllowedMatchingCertificate;
- case WarningDecision::kAllowedSameDirectory:
- return kAllowedSameDirectory;
- case WarningDecision::kAllowedMicrosoft:
- return kAllowedMicrosoftModule;
- case WarningDecision::kAllowedWhitelisted:
- return kAllowedWhitelisted;
- case WarningDecision::kNoTiedApplication:
- return "Tolerated - Could not tie to an installed application";
- case WarningDecision::kIncompatible:
- return "Incompatible";
- case WarningDecision::kAddedToBlacklist:
- case WarningDecision::kUnknown:
- NOTREACHED();
- break;
- }
+ AppendString(GetModuleWarningDecisionString(
+ module_key, incompatible_applications_updater),
+ &status);
}
- return std::string();
+ return status;
}
#endif // defined(GOOGLE_CHROME_BUILD)
@@ -162,11 +236,6 @@ void ConflictsHandler::OnNewModuleFound(const ModuleInfoKey& module_key,
std::string type_string;
if (module_data.module_properties & ModuleInfoData::kPropertyShellExtension)
type_string = "Shell extension";
- if (module_data.module_properties & ModuleInfoData::kPropertyBlocked) {
- if (!type_string.empty())
- type_string += ", ";
- type_string += "blocked";
- }
data->SetString("type_description", type_string);
const auto& inspection_result = *module_data.inspection_result;
@@ -234,7 +303,10 @@ void ConflictsHandler::HandleRequestModuleList(const base::ListValue* args) {
third_party_features_status_ = kFeatureDisabled;
}
- // The above 2 cases are the only possible reasons why the manager wouldn't
+ if (base::win::IsEnterpriseManaged())
+ third_party_features_status_ = kEnterpriseManaged;
+
+ // The above 3 cases are the only possible reasons why the manager wouldn't
// exist.
DCHECK(third_party_features_status_.has_value());
#else // defined(GOOGLE_CHROME_BUILD)
@@ -298,6 +370,9 @@ std::string ConflictsHandler::GetThirdPartyFeaturesStatusString(
case ThirdPartyFeaturesStatus::kNonGoogleChromeBuild:
return "The third-party features are not available in non-Google Chrome "
"builds.";
+ case ThirdPartyFeaturesStatus::kEnterpriseManaged:
+ return "The third-party features are temporarily disabled for clients on "
+ "domain-joined machines.";
case ThirdPartyFeaturesStatus::kPolicyDisabled:
return "The ThirdPartyBlockingEnabled group policy is disabled.";
case ThirdPartyFeaturesStatus::kFeatureDisabled:
diff --git a/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.h b/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.h
index 51f0630e035..99ff0e656e4 100644
--- a/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.h
+++ b/chromium/chrome/browser/ui/webui/conflicts/conflicts_handler.h
@@ -33,6 +33,12 @@ class ConflictsHandler : public content::WebUIMessageHandler,
enum ThirdPartyFeaturesStatus {
// The third-party features are not available in non-Google Chrome builds.
kNonGoogleChromeBuild,
+ // The third-party features are temporarily disabled on domain-joined
+ // machines because of a known issue with third-party blocking and the
+ // IAttachmentExecute::Save() API (https://crbug.com/870998).
+ // TODO(pmonette): Move IAttachmentExecute::Save() to a utility process and
+ // remove this.
+ kEnterpriseManaged,
// The ThirdPartyBlockingEnabled group policy is disabled.
kPolicyDisabled,
// Both the IncompatibleApplicationsWarning and the
diff --git a/chromium/chrome/browser/ui/webui/discards/discards.mojom b/chromium/chrome/browser/ui/webui/discards/discards.mojom
index 64f0d0eb1c4..b9c02585a7d 100644
--- a/chromium/chrome/browser/ui/webui/discards/discards.mojom
+++ b/chromium/chrome/browser/ui/webui/discards/discards.mojom
@@ -37,6 +37,8 @@ struct TabDiscardsInfo {
// The number of times this tab has been discarded in the current browser
// session.
int32 discard_count;
+ // If the tab is currently discarded, the discard reason.
+ LifecycleUnitDiscardReason discard_reason;
// The rank of the tab in the "importance to user" list. The tab with 1 is the
// most important, the tab with N is the least important.
int32 utility_rank;
@@ -56,6 +58,8 @@ struct TabDiscardsInfo {
double reactivation_score;
// Site engagement score.
double site_engagement_score;
+ // Whether or not the tab has input focus.
+ bool has_focus;
};
// Interface for providing information about discards. Lives in the browser
diff --git a/chromium/chrome/browser/ui/webui/discards/discards_ui.cc b/chromium/chrome/browser/ui/webui/discards/discards_ui.cc
index 5aaf01c15d1..8c321454cac 100644
--- a/chromium/chrome/browser/ui/webui/discards/discards_ui.cc
+++ b/chromium/chrome/browser/ui/webui/discards/discards_ui.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/resource_coordinator/discard_reason.h"
#include "chrome/browser/resource_coordinator/lifecycle_unit.h"
#include "chrome/browser/resource_coordinator/lifecycle_unit_state.mojom.h"
#include "chrome/browser/resource_coordinator/tab_activity_watcher.h"
@@ -34,9 +33,9 @@
namespace {
-resource_coordinator::DiscardReason GetDiscardReason(bool urgent) {
- return urgent ? resource_coordinator::DiscardReason::kUrgent
- : resource_coordinator::DiscardReason::kProactive;
+mojom::LifecycleUnitDiscardReason GetDiscardReason(bool urgent) {
+ return urgent ? mojom::LifecycleUnitDiscardReason::URGENT
+ : mojom::LifecycleUnitDiscardReason::PROACTIVE;
}
mojom::LifecycleUnitVisibility GetLifecycleUnitVisibility(
@@ -78,10 +77,7 @@ double GetSiteEngagementScore(content::WebContents* contents) {
auto* engagement_svc = SiteEngagementService::Get(
Profile::FromBrowserContext(contents->GetBrowserContext()));
- double engagement =
- engagement_svc->GetDetails(nav_entry->GetURL()).total_score;
-
- return engagement;
+ return engagement_svc->GetDetails(nav_entry->GetURL()).total_score;
}
class DiscardsDetailsProviderImpl : public mojom::DiscardsDetailsProvider {
@@ -127,9 +123,12 @@ class DiscardsDetailsProviderImpl : public mojom::DiscardsDetailsProvider {
info->cannot_freeze_reasons = freeze_details.GetFailureReasonStrings();
resource_coordinator::DecisionDetails discard_details;
info->can_discard = lifecycle_unit->CanDiscard(
- resource_coordinator::DiscardReason::kProactive, &discard_details);
+ mojom::LifecycleUnitDiscardReason::PROACTIVE, &discard_details);
info->cannot_discard_reasons = discard_details.GetFailureReasonStrings();
- info->discard_count = tab_lifecycle_unit_external->GetDiscardCount();
+ info->discard_count = lifecycle_unit->GetDiscardCount();
+ // This is only valid if the state is PENDING_DISCARD or DISCARD, but the
+ // javascript code takes care of that.
+ info->discard_reason = lifecycle_unit->GetDiscardReason();
info->utility_rank = rank++;
const base::TimeTicks last_focused_time =
lifecycle_unit->GetLastFocusedTime();
@@ -148,6 +147,11 @@ class DiscardsDetailsProviderImpl : public mojom::DiscardsDetailsProvider {
if (info->has_reactivation_score)
info->reactivation_score = reactivation_score.value();
info->site_engagement_score = GetSiteEngagementScore(contents);
+ // TODO(crbug.com/876340): The focus is used to compute the page lifecycle
+ // state. This should be replaced with the actual page lifecycle state
+ // information from Blink, but this depends on implementing the passive
+ // state and plumbing it to the browser.
+ info->has_focus = lifecycle_unit->GetLastFocusedTime().is_max();
infos.push_back(std::move(info));
}
diff --git a/chromium/chrome/browser/ui/webui/eoc_internals/eoc_internals_page_handler.cc b/chromium/chrome/browser/ui/webui/eoc_internals/eoc_internals_page_handler.cc
index 8d533f08310..771a37085e2 100644
--- a/chromium/chrome/browser/ui/webui/eoc_internals/eoc_internals_page_handler.cc
+++ b/chromium/chrome/browser/ui/webui/eoc_internals/eoc_internals_page_handler.cc
@@ -21,11 +21,10 @@ using contextual_suggestions::ContextualSuggestionsResult;
namespace {
bool AreChromeFlagsSetup() {
- return (base::FeatureList::IsEnabled(
- contextual_suggestions::kContextualSuggestionsBottomSheet) ||
- base::FeatureList::IsEnabled(
- contextual_suggestions::kContextualSuggestionsButton)) &&
- base::FeatureList::IsEnabled(chrome::android::kChromeModernDesign);
+ return base::FeatureList::IsEnabled(
+ contextual_suggestions::kContextualSuggestionsBottomSheet) ||
+ base::FeatureList::IsEnabled(
+ contextual_suggestions::kContextualSuggestionsButton);
}
std::string GetAreChromeFlagsSetupString() {
diff --git a/chromium/chrome/browser/ui/webui/extensions/extensions_internals_browsertest.cc b/chromium/chrome/browser/ui/webui/extensions/extensions_internals_browsertest.cc
new file mode 100644
index 00000000000..43bcec32608
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/extensions/extensions_internals_browsertest.cc
@@ -0,0 +1,53 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/files/file_path.h"
+#include "base/path_service.h"
+#include "base/strings/stringprintf.h"
+#include "chrome/browser/extensions/chrome_test_extension_loader.h"
+#include "chrome/browser/extensions/extension_browsertest.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/common/chrome_paths.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
+#include "url/gurl.h"
+
+using ExtensionsInternalsTest = extensions::ExtensionBrowserTest;
+
+IN_PROC_BROWSER_TEST_F(ExtensionsInternalsTest,
+ TestExtensionsInternalsAreServed) {
+ // Install an extension that we can check for.
+ base::FilePath test_data_dir;
+ ASSERT_TRUE(base::PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir));
+ test_data_dir = test_data_dir.AppendASCII("extensions");
+ extensions::ChromeTestExtensionLoader loader(browser()->profile());
+ const extensions::Extension* extension =
+ loader.LoadExtension(test_data_dir.AppendASCII("good.crx")).get();
+ ASSERT_TRUE(extension);
+
+ // First, check that navigation succeeds.
+ GURL navigation_url("chrome://extensions-internals");
+ ui_test_utils::NavigateToURL(browser(), navigation_url);
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ ASSERT_TRUE(web_contents);
+ EXPECT_EQ(navigation_url, web_contents->GetLastCommittedURL());
+ EXPECT_FALSE(web_contents->IsCrashed());
+ EXPECT_FALSE(web_contents->GetInterstitialPage());
+
+ // Look for a bit of JSON that has the extension's unique ID.
+ bool has_text = false;
+ ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
+ web_contents,
+ base::StringPrintf("window.domAutomationController.send("
+ "document.body.textContent && "
+ "document.body.textContent.indexOf("
+ "'\"id\": \"%s\"') >= 0);",
+ extension->id().c_str()),
+ &has_text));
+ EXPECT_TRUE(has_text);
+}
diff --git a/chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.cc b/chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.cc
new file mode 100644
index 00000000000..669c2553a84
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.cc
@@ -0,0 +1,156 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/extensions/extensions_internals_source.h"
+
+#include <string>
+#include <utility>
+
+#include "base/json/json_writer.h"
+#include "base/logging.h"
+#include "base/memory/ref_counted_memory.h"
+#include "base/values.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/webui_url_constants.h"
+#include "components/prefs/pref_service.h"
+#include "content/public/browser/browser_thread.h"
+#include "extensions/browser/activity.h"
+#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/process_manager.h"
+
+namespace {
+
+const char* TypeToString(extensions::Manifest::Type type) {
+ switch (type) {
+ case extensions::Manifest::TYPE_UNKNOWN:
+ return "TYPE_UNKNOWN";
+ case extensions::Manifest::TYPE_EXTENSION:
+ return "TYPE_EXTENSION";
+ case extensions::Manifest::TYPE_THEME:
+ return "TYPE_THEME";
+ case extensions::Manifest::TYPE_USER_SCRIPT:
+ return "TYPE_USER_SCRIPT";
+ case extensions::Manifest::TYPE_HOSTED_APP:
+ return "TYPE_HOSTED_APP";
+ case extensions::Manifest::TYPE_LEGACY_PACKAGED_APP:
+ return "TYPE_LEGACY_PACKAGED_APP";
+ case extensions::Manifest::TYPE_PLATFORM_APP:
+ return "TYPE_PLATFORM_APP";
+ case extensions::Manifest::TYPE_SHARED_MODULE:
+ return "TYPE_SHARED_MODULE";
+ case extensions::Manifest::NUM_LOAD_TYPES:
+ break;
+ }
+ NOTREACHED();
+ return "";
+}
+
+const char* LocationToString(extensions::Manifest::Location loc) {
+ switch (loc) {
+ case extensions::Manifest::INVALID_LOCATION:
+ return "INVALID_LOCATION";
+ case extensions::Manifest::INTERNAL:
+ return "INTERNAL";
+ case extensions::Manifest::EXTERNAL_PREF:
+ return "EXTERNAL_PREF";
+ case extensions::Manifest::EXTERNAL_REGISTRY:
+ return "EXTERNAL_REGISTRY";
+ case extensions::Manifest::UNPACKED:
+ return "UNPACKED";
+ case extensions::Manifest::COMPONENT:
+ return "COMPONENT";
+ case extensions::Manifest::EXTERNAL_PREF_DOWNLOAD:
+ return "EXTERNAL_PREF_DOWNLOAD";
+ case extensions::Manifest::EXTERNAL_POLICY_DOWNLOAD:
+ return "EXTERNAL_POLICY_DOWNLOAD";
+ case extensions::Manifest::COMMAND_LINE:
+ return "COMMAND_LINE";
+ case extensions::Manifest::EXTERNAL_POLICY:
+ return "EXTERNAL_POLICY";
+ case extensions::Manifest::EXTERNAL_COMPONENT:
+ return "EXTERNAL_COMPONENT";
+ case extensions::Manifest::NUM_LOCATIONS:
+ break;
+ }
+ NOTREACHED();
+ return "";
+}
+
+base::Value FormatKeepaliveData(extensions::ProcessManager* process_manager,
+ const extensions::Extension* extension) {
+ base::Value keepalive_data(base::Value::Type::DICTIONARY);
+ keepalive_data.SetKey(
+ "count", base::Value(process_manager->GetLazyKeepaliveCount(extension)));
+ const extensions::ProcessManager::ActivitiesMultiset activities =
+ process_manager->GetLazyKeepaliveActivities(extension);
+ base::Value activities_data(base::Value::Type::LIST);
+ activities_data.GetList().reserve(activities.size());
+ for (const auto& activity : activities) {
+ base::Value activities_entry(base::Value::Type::DICTIONARY);
+ activities_entry.SetKey(
+ "type", base::Value(extensions::Activity::ToString(activity.first)));
+ activities_entry.SetKey("extra_data", base::Value(activity.second));
+ activities_data.GetList().push_back(std::move(activities_entry));
+ }
+ keepalive_data.SetKey("activites", std::move(activities_data));
+ return keepalive_data;
+}
+
+} // namespace
+
+ExtensionsInternalsSource::ExtensionsInternalsSource(Profile* profile)
+ : profile_(profile) {}
+
+ExtensionsInternalsSource::~ExtensionsInternalsSource() = default;
+
+std::string ExtensionsInternalsSource::GetSource() const {
+ return chrome::kChromeUIExtensionsInternalsHost;
+}
+
+std::string ExtensionsInternalsSource::GetMimeType(
+ const std::string& path) const {
+ return "text/plain";
+}
+
+void ExtensionsInternalsSource::StartDataRequest(
+ const std::string& path,
+ const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
+ const content::URLDataSource::GotDataCallback& callback) {
+ std::string json = WriteToString();
+ callback.Run(base::RefCountedString::TakeString(&json));
+}
+
+std::string ExtensionsInternalsSource::WriteToString() const {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ std::unique_ptr<extensions::ExtensionSet> extensions =
+ extensions::ExtensionRegistry::Get(profile_)
+ ->GenerateInstalledExtensionsSet();
+ extensions::ProcessManager* process_manager =
+ extensions::ProcessManager::Get(profile_);
+ base::Value data(base::Value::Type::LIST);
+ for (const auto& extension : *extensions) {
+ base::Value extension_data(base::Value::Type::DICTIONARY);
+ extension_data.SetKey("id", base::Value(extension->id()));
+ extension_data.SetKey(
+ "keepalive", FormatKeepaliveData(process_manager, extension.get()));
+ extension_data.SetKey("location",
+ base::Value(LocationToString(extension->location())));
+ extension_data.SetKey("manifest_version",
+ base::Value(extension->manifest_version()));
+ extension_data.SetKey("name", base::Value(extension->name()));
+ extension_data.SetKey("path",
+ base::Value(extension->path().LossyDisplayName()));
+ extension_data.SetKey("type",
+ base::Value(TypeToString(extension->GetType())));
+ extension_data.SetKey("version",
+ base::Value(extension->GetVersionForDisplay()));
+ data.GetList().push_back(std::move(extension_data));
+ }
+
+ std::string json;
+ base::JSONWriter::WriteWithOptions(
+ data, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json);
+
+ return json;
+}
diff --git a/chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.h b/chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.h
new file mode 100644
index 00000000000..c848a0a5041
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/extensions/extensions_internals_source.h
@@ -0,0 +1,38 @@
+// 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 CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSIONS_INTERNALS_SOURCE_H_
+#define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSIONS_INTERNALS_SOURCE_H_
+
+#include "base/macros.h"
+#include "content/public/browser/url_data_source.h"
+
+class Profile;
+
+// A simple data source that returns information about installed
+// extensions for the associated profile.
+class ExtensionsInternalsSource : public content::URLDataSource {
+ public:
+ explicit ExtensionsInternalsSource(Profile* profile);
+ ~ExtensionsInternalsSource() override;
+
+ // content::URLDataSource:
+ std::string GetSource() const override;
+ std::string GetMimeType(const std::string& path) const override;
+ void StartDataRequest(
+ const std::string& path,
+ const content::ResourceRequestInfo::WebContentsGetter& wc_getter,
+ const content::URLDataSource::GotDataCallback& callback) override;
+
+ // Simpler interface to generate string output, without needing to
+ // call StartDataRequest.
+ std::string WriteToString() const;
+
+ private:
+ Profile* const profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionsInternalsSource);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSIONS_INTERNALS_SOURCE_H_
diff --git a/chromium/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chromium/chrome/browser/ui/webui/extensions/extensions_ui.cc
index 77af9957f7b..393653d6692 100644
--- a/chromium/chrome/browser/ui/webui/extensions/extensions_ui.cc
+++ b/chromium/chrome/browser/ui/webui/extensions/extensions_ui.cc
@@ -13,6 +13,7 @@
#include "base/timer/elapsed_timer.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/chrome_extension_browser_constants.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/common/pref_names.h"
@@ -23,7 +24,7 @@
#include "chrome/grit/extensions_resources_map.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
-#include "components/google/core/browser/google_util.h"
+#include "components/google/core/common/google_util.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
@@ -32,6 +33,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
#include "extensions/common/extension_urls.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -128,8 +130,12 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
{"learnMore", IDS_LEARN_MORE},
{"noSearchResults", IDS_SEARCH_NO_RESULTS},
{"ok", IDS_OK},
+ {"save", IDS_SAVE},
{"searchResults", IDS_SEARCH_RESULTS},
+ // Multi-use strings defined in md_extensions_strings.grdp.
+ {"remove", IDS_MD_EXTENSIONS_REMOVE},
+
// Add extension-specific strings.
{"title", IDS_MANAGE_EXTENSIONS_SETTING_WINDOWS_TITLE},
{"toolbarTitle", IDS_MD_EXTENSIONS_TOOLBAR_TITLE},
@@ -158,13 +164,13 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
{"openChromeWebStore", IDS_MD_EXTENSIONS_SIDEBAR_OPEN_CHROME_WEB_STORE},
{"keyboardShortcuts", IDS_MD_EXTENSIONS_SIDEBAR_KEYBOARD_SHORTCUTS},
{"incognitoInfoWarning", IDS_EXTENSIONS_INCOGNITO_WARNING},
- {"itemHostPermissionsHeading",
- IDS_MD_EXTENSIONS_ITEM_HOST_PERMISSIONS_HEADING},
- {"itemHostAccessOnClick", IDS_MD_EXTENSIONS_HOST_ACCESS_ON_CLICK},
- {"itemHostAccessOnSpecificSites",
+ {"hostPermissionsEdit", IDS_MD_EXTENSIONS_HOST_PERMISSIONS_EDIT},
+ {"hostPermissionsHeading", IDS_MD_EXTENSIONS_ITEM_HOST_PERMISSIONS_HEADING},
+ {"hostAccessOnClick", IDS_MD_EXTENSIONS_HOST_ACCESS_ON_CLICK},
+ {"hostAccessOnSpecificSites",
IDS_MD_EXTENSIONS_HOST_ACCESS_ON_SPECIFIC_SITES},
- {"itemHostAccessOnAllSites", IDS_MD_EXTENSIONS_HOST_ACCESS_ON_ALL_SITES},
- {"itemAllowedHosts", IDS_EXTENSIONS_ITEM_ALLOWED_HOSTS},
+ {"hostAccessOnAllSites", IDS_MD_EXTENSIONS_HOST_ACCESS_ON_ALL_SITES},
+ {"hostAllowedHosts", IDS_EXTENSIONS_ITEM_ALLOWED_HOSTS},
{"itemId", IDS_MD_EXTENSIONS_ITEM_ID},
{"itemInspectViews", IDS_MD_EXTENSIONS_ITEM_INSPECT_VIEWS},
// NOTE: This text reads "<n> more". It's possible that it should be using
@@ -195,7 +201,6 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
{"itemOptions", IDS_MD_EXTENSIONS_ITEM_OPTIONS},
{"itemPermissions", IDS_MD_EXTENSIONS_ITEM_PERMISSIONS},
{"itemPermissionsEmpty", IDS_MD_EXTENSIONS_ITEM_PERMISSIONS_EMPTY},
- {"itemRemove", IDS_MD_EXTENSIONS_ITEM_REMOVE},
{"itemRemoveExtension", IDS_MD_EXTENSIONS_ITEM_REMOVE_EXTENSION},
{"itemSource", IDS_MD_EXTENSIONS_ITEM_SOURCE},
{"itemSourcePolicy", IDS_MD_EXTENSIONS_ITEM_SOURCE_POLICY},
@@ -218,6 +223,11 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
{"loadErrorErrorLabel", IDS_MD_EXTENSIONS_LOAD_ERROR_ERROR_LABEL},
{"loadErrorRetry", IDS_MD_EXTENSIONS_LOAD_ERROR_RETRY},
{"noErrorsToShow", IDS_EXTENSIONS_ERROR_NO_ERRORS_CODE_MESSAGE},
+ {"runtimeHostsDialogInputError",
+ IDS_MD_EXTENSIONS_RUNTIME_HOSTS_DIALOG_INPUT_ERROR},
+ {"runtimeHostsDialogInputLabel",
+ IDS_MD_EXTENSIONS_RUNTIME_HOSTS_DIALOG_INPUT_LABEL},
+ {"runtimeHostsDialogTitle", IDS_MD_EXTENSIONS_RUNTIME_HOSTS_DIALOG_TITLE},
{"packDialogTitle", IDS_MD_EXTENSIONS_PACK_DIALOG_TITLE},
{"packDialogWarningTitle", IDS_MD_EXTENSIONS_PACK_DIALOG_WARNING_TITLE},
{"packDialogErrorTitle", IDS_MD_EXTENSIONS_PACK_DIALOG_ERROR_TITLE},
@@ -298,13 +308,22 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
GURL(extension_urls::GetWebstoreExtensionsCategoryURL()),
g_browser_process->GetApplicationLocale())
.spec()));
+ source->AddString(
+ "hostPermissionsLearnMoreLink",
+ l10n_util::GetStringFUTF16(
+ IDS_MD_EXTENSIONS_HOST_PERMISSIONS_LEARN_MORE,
+ base::ASCIIToUTF16(
+ chrome_extension_constants::kRuntimeHostPermissionsHelpURL)));
source->AddBoolean(kInDevModeKey, in_dev_mode);
source->AddString(kLoadTimeClassesKey, GetLoadTimeClasses(in_dev_mode));
#if BUILDFLAG(OPTIMIZE_WEBUI)
source->AddResourcePath("crisper.js", IDR_MD_EXTENSIONS_CRISPER_JS);
- source->SetDefaultResource(IDR_MD_EXTENSIONS_VULCANIZED_HTML);
+ source->SetDefaultResource(
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2) ?
+ IDR_MD_EXTENSIONS_VULCANIZED_P2_HTML :
+ IDR_MD_EXTENSIONS_VULCANIZED_HTML);
source->UseGzip();
#else
// Add all MD Extensions resources.
diff --git a/chromium/chrome/browser/ui/webui/help/version_updater_basic.cc b/chromium/chrome/browser/ui/webui/help/version_updater_basic.cc
index 796d0a5a9f4..93e3f41a76d 100644
--- a/chromium/chrome/browser/ui/webui/help/version_updater_basic.cc
+++ b/chromium/chrome/browser/ui/webui/help/version_updater_basic.cc
@@ -5,16 +5,15 @@
#include "chrome/browser/ui/webui/help/version_updater_basic.h"
#include "base/strings/string16.h"
-#include "chrome/browser/upgrade_detector.h"
+#include "chrome/browser/upgrade_detector/upgrade_detector.h"
void VersionUpdaterBasic::CheckForUpdate(
const StatusCallback& status_callback,
const PromoteCallback&) {
- if (UpgradeDetector::GetInstance()->notify_upgrade())
- status_callback.Run(NEARLY_UPDATED, 0, false, std::string(), 0,
- base::string16());
- else
- status_callback.Run(DISABLED, 0, false, std::string(), 0, base::string16());
+ const Status status = UpgradeDetector::GetInstance()->notify_upgrade()
+ ? NEARLY_UPDATED
+ : DISABLED;
+ status_callback.Run(status, 0, false, std::string(), 0, base::string16());
}
VersionUpdater* VersionUpdater::Create(content::WebContents* web_contents) {
diff --git a/chromium/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc b/chromium/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc
index 587ec32394c..4127290b805 100644
--- a/chromium/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/help/version_updater_chromeos_unittest.cc
@@ -12,8 +12,7 @@
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "chrome/browser/chromeos/login/users/mock_user_manager.h"
-#include "chrome/browser/chromeos/settings/cros_settings.h"
-#include "chrome/browser/chromeos/settings/device_settings_service.h"
+#include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_update_engine_client.h"
#include "chromeos/dbus/shill_service_client.h"
@@ -61,9 +60,6 @@ class VersionUpdaterCrosTest : public ::testing::Test {
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_user_manager_, Shutdown()).Times(AtLeast(0));
- DeviceSettingsService::Initialize();
- CrosSettings::Initialize();
-
NetworkHandler::Initialize();
base::RunLoop().RunUntilIdle();
}
@@ -92,9 +88,6 @@ class VersionUpdaterCrosTest : public ::testing::Test {
void TearDown() override {
NetworkHandler::Shutdown();
-
- CrosSettings::Shutdown();
- DeviceSettingsService::Shutdown();
}
content::TestBrowserThreadBundle thread_bundle_;
@@ -103,6 +96,7 @@ class VersionUpdaterCrosTest : public ::testing::Test {
MockUserManager* mock_user_manager_; // Not owned.
user_manager::ScopedUserManager user_manager_enabler_;
+ ScopedCrosSettingsTestHelper cros_settings_test_helper_;
DISALLOW_COPY_AND_ASSIGN(VersionUpdaterCrosTest);
};
diff --git a/chromium/chrome/browser/ui/webui/help/version_updater_win.cc b/chromium/chrome/browser/ui/webui/help/version_updater_win.cc
index a09e5751176..f094833c346 100644
--- a/chromium/chrome/browser/ui/webui/help/version_updater_win.cc
+++ b/chromium/chrome/browser/ui/webui/help/version_updater_win.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/webui/help/version_updater_win.h"
#include "base/memory/weak_ptr.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/win/win_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/first_run/upgrade_util.h"
diff --git a/chromium/chrome/browser/ui/webui/inspect_ui.cc b/chromium/chrome/browser/ui/webui/inspect_ui.cc
index e777221fc77..151d8f14559 100644
--- a/chromium/chrome/browser/ui/webui/inspect_ui.cc
+++ b/chromium/chrome/browser/ui/webui/inspect_ui.cc
@@ -67,7 +67,8 @@ const char kInspectUiNameField[] = "name";
const char kInspectUiUrlField[] = "url";
const char kInspectUiIsAdditionalField[] = "isAdditional";
-void GetUiDevToolsTargets(base::ListValue& targets) {
+base::ListValue GetUiDevToolsTargets() {
+ base::ListValue targets;
for (const auto& client_pair :
ui_devtools::UiDevToolsServer::GetClientNamesAndUrls()) {
auto target_data = std::make_unique<base::DictionaryValue>();
@@ -76,6 +77,7 @@ void GetUiDevToolsTargets(base::ListValue& targets) {
target_data->SetBoolean(kInspectUiIsAdditionalField, true);
targets.Append(std::move(target_data));
}
+ return targets;
}
// InspectMessageHandler --------------------------------------------
@@ -105,7 +107,7 @@ class InspectMessageHandler : public WebUIMessageHandler {
void HandleTCPDiscoveryConfigCommand(const base::ListValue* args);
void HandleOpenNodeFrontendCommand(const base::ListValue* args);
- InspectUI* inspect_ui_;
+ InspectUI* const inspect_ui_;
DISALLOW_COPY_AND_ASSIGN(InspectMessageHandler);
};
@@ -383,8 +385,7 @@ void InspectUI::Inspect(const std::string& source_id,
const std::string& target_id) {
scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
if (target) {
- Profile* profile = Profile::FromBrowserContext(
- web_ui()->GetWebContents()->GetBrowserContext());
+ Profile* profile = Profile::FromWebUI(web_ui());
DevToolsWindow::OpenDevToolsWindow(target, profile);
}
}
@@ -393,8 +394,7 @@ void InspectUI::InspectFallback(const std::string& source_id,
const std::string& target_id) {
scoped_refptr<DevToolsAgentHost> target = FindTarget(source_id, target_id);
if (target) {
- Profile* profile = Profile::FromBrowserContext(
- web_ui()->GetWebContents()->GetBrowserContext());
+ Profile* profile = Profile::FromWebUI(web_ui());
DevToolsWindow::OpenDevToolsWindowWithBundledFrontend(target, profile);
}
}
@@ -490,8 +490,7 @@ void InspectUI::StartListeningNotifications() {
DevToolsTargetsUIHandler::Callback callback =
base::Bind(&InspectUI::PopulateTargets, base::Unretained(this));
- base::ListValue additional_targets;
- GetUiDevToolsTargets(additional_targets);
+ base::ListValue additional_targets = GetUiDevToolsTargets();
PopulateAdditionalTargets(additional_targets);
AddTargetUIHandler(
diff --git a/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
index 5fbf984c00f..f539aa124a9 100644
--- a/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
+++ b/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui.cc
@@ -271,15 +271,18 @@ safe_browsing::SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage(
if (net::GetValueForKeyInQuery(web_contents->GetURL(),
"type",
&type_param)) {
- // TODO(mattm): add param for SB_THREAT_TYPE_URL_UNWANTED.
if (type_param == "malware") {
threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
} else if (type_param == "phishing") {
threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
+ } else if (type_param == "unwanted") {
+ threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED;
} else if (type_param == "clientside_malware") {
threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_MALWARE;
} else if (type_param == "clientside_phishing") {
threat_type = safe_browsing::SB_THREAT_TYPE_URL_CLIENT_SIDE_PHISHING;
+ } else if (type_param == "billing") {
+ threat_type = safe_browsing::SB_THREAT_TYPE_BILLING;
}
}
safe_browsing::SafeBrowsingBlockingPage::UnsafeResource resource;
@@ -325,6 +328,8 @@ TestSafeBrowsingBlockingPageQuiet* CreateSafeBrowsingQuietBlockingPage(
threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
} else if (type_param == "phishing") {
threat_type = safe_browsing::SB_THREAT_TYPE_URL_PHISHING;
+ } else if (type_param == "unwanted") {
+ threat_type = safe_browsing::SB_THREAT_TYPE_URL_UNWANTED;
} else if (type_param == "giant") {
threat_type = safe_browsing::SB_THREAT_TYPE_URL_MALWARE;
is_giant_webview = true;
@@ -403,7 +408,8 @@ CaptivePortalBlockingPage* CreateCaptivePortalBlockingPage(
InterstitialUI::InterstitialUI(content::WebUI* web_ui)
: WebUIController(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui);
- content::URLDataSource::Add(profile, new InterstitialHTMLSource());
+ content::URLDataSource::Add(profile,
+ std::make_unique<InterstitialHTMLSource>());
}
InterstitialUI::~InterstitialUI() {
diff --git a/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc b/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc
index cfda3105c3b..22fdd471443 100644
--- a/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc
+++ b/chromium/chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc
@@ -101,6 +101,11 @@ IN_PROC_BROWSER_TEST_F(InterstitialUITest, PhishingInterstitial) {
"Security error");
}
+IN_PROC_BROWSER_TEST_F(InterstitialUITest, UnwantedSoftwareInterstitial) {
+ TestInterstitial(GURL("chrome://interstitials/safebrowsing?type=unwanted"),
+ "Security error");
+}
+
IN_PROC_BROWSER_TEST_F(InterstitialUITest, MalwareInterstitialQuiet) {
TestInterstitial(
GURL("chrome://interstitials/quietsafebrowsing?type=malware"),
@@ -113,6 +118,12 @@ IN_PROC_BROWSER_TEST_F(InterstitialUITest, PhishingInterstitialQuiet) {
"Security error");
}
+IN_PROC_BROWSER_TEST_F(InterstitialUITest, UnwantedSoftwareInterstitialQuiet) {
+ TestInterstitial(
+ GURL("chrome://interstitials/quietsafebrowsing?type=unwanted"),
+ "Security error");
+}
+
IN_PROC_BROWSER_TEST_F(InterstitialUITest, ClientsideMalwareInterstitial) {
TestInterstitial(
GURL("chrome://interstitials/safebrowsing?type=clientside_malware"),
@@ -125,6 +136,11 @@ IN_PROC_BROWSER_TEST_F(InterstitialUITest, ClientsidePhishingInterstitial) {
"Security error");
}
+IN_PROC_BROWSER_TEST_F(InterstitialUITest, BillingInterstitial) {
+ TestInterstitial(GURL("chrome://interstitials/safebrowsing?type=billing"),
+ "Security error");
+}
+
IN_PROC_BROWSER_TEST_F(InterstitialUITest, CaptivePortalInterstitial) {
TestInterstitial(GURL("chrome://interstitials/captiveportal"),
"Connect to network");
diff --git a/chromium/chrome/browser/ui/webui/interventions_internals/OWNERS b/chromium/chrome/browser/ui/webui/interventions_internals/OWNERS
index 6340a5dc2a9..ecb8556d61d 100644
--- a/chromium/chrome/browser/ui/webui/interventions_internals/OWNERS
+++ b/chromium/chrome/browser/ui/webui/interventions_internals/OWNERS
@@ -4,4 +4,4 @@ tbansal@chromium.org
per-file *.mojom=set noparent
per-file *.mojom=file://ipc/SECURITY_OWNERS
-# COMPONENT: UI>Browser>Previews
+# COMPONENT: Blink>Previews
diff --git a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.cc b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.cc
index 7acc8d01890..ae7afceea0e 100644
--- a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.cc
+++ b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.cc
@@ -12,12 +12,13 @@
#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/flag_descriptions.h"
-#include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h"
#include "chrome/common/chrome_switches.h"
#include "components/previews/core/previews_experiments.h"
#include "components/previews/core/previews_switches.h"
#include "net/nqe/network_quality_estimator_params.h"
+#include "services/network/public/cpp/network_quality_tracker.h"
#include "services/network/public/cpp/network_switches.h"
namespace {
@@ -99,11 +100,9 @@ std::string GetEnabledStateForSwitch(const std::string& switch_name) {
InterventionsInternalsPageHandler::InterventionsInternalsPageHandler(
mojom::InterventionsInternalsPageHandlerRequest request,
- previews::PreviewsUIService* previews_ui_service,
- UINetworkQualityEstimatorService* ui_nqe_service)
+ previews::PreviewsUIService* previews_ui_service)
: binding_(this, std::move(request)),
previews_ui_service_(previews_ui_service),
- ui_nqe_service_(ui_nqe_service),
current_estimated_ect_(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {
logger_ = previews_ui_service_->previews_logger();
DCHECK(logger_);
@@ -112,7 +111,8 @@ InterventionsInternalsPageHandler::InterventionsInternalsPageHandler(
InterventionsInternalsPageHandler::~InterventionsInternalsPageHandler() {
DCHECK(logger_);
logger_->RemoveObserver(this);
- ui_nqe_service_->RemoveEffectiveConnectionTypeObserver(this);
+ g_browser_process->network_quality_tracker()
+ ->RemoveEffectiveConnectionTypeObserver(this);
}
void InterventionsInternalsPageHandler::SetClientPage(
@@ -120,7 +120,8 @@ void InterventionsInternalsPageHandler::SetClientPage(
page_ = std::move(page);
DCHECK(page_);
logger_->AddAndNotifyObserver(this);
- ui_nqe_service_->AddEffectiveConnectionTypeObserver(this);
+ g_browser_process->network_quality_tracker()
+ ->AddEffectiveConnectionTypeObserver(this);
}
void InterventionsInternalsPageHandler::OnEffectiveConnectionTypeChanged(
diff --git a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.h b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.h
index 55c20dcd9a1..49a50b659d5 100644
--- a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.h
+++ b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler.h
@@ -15,19 +15,16 @@
#include "components/previews/core/previews_logger_observer.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "net/nqe/effective_connection_type.h"
-#include "net/nqe/effective_connection_type_observer.h"
-
-class UINetworkQualityEstimatorService;
+#include "services/network/public/cpp/network_quality_tracker.h"
class InterventionsInternalsPageHandler
: public previews::PreviewsLoggerObserver,
- public net::EffectiveConnectionTypeObserver,
+ public network::NetworkQualityTracker::EffectiveConnectionTypeObserver,
public mojom::InterventionsInternalsPageHandler {
public:
InterventionsInternalsPageHandler(
mojom::InterventionsInternalsPageHandlerRequest request,
- previews::PreviewsUIService* previews_ui_service,
- UINetworkQualityEstimatorService* ui_nqe_service);
+ previews::PreviewsUIService* previews_ui_service);
~InterventionsInternalsPageHandler() override;
// mojom::InterventionsInternalsPageHandler:
@@ -47,7 +44,7 @@ class InterventionsInternalsPageHandler
void OnLastObserverRemove() override;
private:
- // net::EffectiveConnectionTypeObserver:
+ // network::NetworkQualityTracker::EffectiveConnectionTypeObserver:
void OnEffectiveConnectionTypeChanged(
net::EffectiveConnectionType type) override;
@@ -61,10 +58,6 @@ class InterventionsInternalsPageHandler
// guaranteed to outlive |this|.
previews::PreviewsUIService* previews_ui_service_;
- // A pointer to the UINetworkQualityEsitmatorService, guaranteed to outlive
- // |this|.
- UINetworkQualityEstimatorService* ui_nqe_service_;
-
// The current estimated effective connection type.
net::EffectiveConnectionType current_estimated_ect_;
diff --git a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler_unittest.cc b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler_unittest.cc
index a1312af72e2..46c92a66784 100644
--- a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_page_handler_unittest.cc
@@ -22,7 +22,6 @@
#include "base/time/default_clock.h"
#include "build/build_config.h"
#include "chrome/browser/flag_descriptions.h"
-#include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/interventions_internals/interventions_internals.mojom.h"
#include "chrome/common/chrome_constants.h"
@@ -191,27 +190,6 @@ class TestPreviewsLogger : public previews::PreviewsLogger {
bool remove_is_called_;
};
-// Mock class to test interaction between PageHandler and the
-// UINetworkQualityEstimatorService.
-class TestUINetworkQualityEstimatorService
- : public UINetworkQualityEstimatorService {
- public:
- explicit TestUINetworkQualityEstimatorService(Profile* profile)
- : UINetworkQualityEstimatorService(profile), remove_is_called_(false) {}
-
- // UINetworkQualityEstimatorService:
- void RemoveEffectiveConnectionTypeObserver(
- net::EffectiveConnectionTypeObserver* observer) override {
- remove_is_called_ = true;
- }
-
- bool RemovedObserverIsCalled() const { return remove_is_called_; }
-
- private:
- // Check if the observer removed itself from the observer list.
- bool remove_is_called_;
-};
-
// A dummy class to setup PreviewsUIService.
class TestPreviewsDeciderImpl : public previews::PreviewsDeciderImpl {
public:
@@ -276,16 +254,11 @@ class InterventionsInternalsPageHandlerTest : public testing::Test {
std::make_unique<TestPreviewsUIService>(&io_data, std::move(logger));
ASSERT_TRUE(profile_manager_.SetUp());
- TestingProfile* test_profile =
- profile_manager_.CreateTestingProfile(chrome::kInitialProfile);
- ui_nqe_service_ =
- std::make_unique<TestUINetworkQualityEstimatorService>(test_profile);
mojom::InterventionsInternalsPageHandlerPtr page_handler_ptr;
handler_request_ = mojo::MakeRequest(&page_handler_ptr);
page_handler_ = std::make_unique<InterventionsInternalsPageHandler>(
- std::move(handler_request_), previews_ui_service_.get(),
- ui_nqe_service_.get());
+ std::move(handler_request_), previews_ui_service_.get());
mojom::InterventionsInternalsPagePtr page_ptr;
page_request_ = mojo::MakeRequest(&page_ptr);
@@ -306,7 +279,6 @@ class InterventionsInternalsPageHandlerTest : public testing::Test {
TestPreviewsLogger* logger_;
std::unique_ptr<TestPreviewsUIService> previews_ui_service_;
- std::unique_ptr<TestUINetworkQualityEstimatorService> ui_nqe_service_;
// InterventionsInternalPageHandler's variables.
mojom::InterventionsInternalsPageHandlerRequest handler_request_;
@@ -650,6 +622,13 @@ TEST_F(InterventionsInternalsPageHandlerTest, OnNewMessageLogAddedPostToPage) {
base::RunLoop().RunUntilIdle();
mojom::MessageLogPtr* actual = page_->message();
+ // Discard any messages generated by network quality tracker.
+ while ((*actual)->type == "ECT Changed") {
+ page_handler_->OnNewMessageLogAdded(message);
+ base::RunLoop().RunUntilIdle();
+
+ actual = page_->message();
+ }
EXPECT_EQ(message.event_type, (*actual)->type);
EXPECT_EQ(message.event_description, (*actual)->description);
EXPECT_EQ(message.url, (*actual)->url);
@@ -661,10 +640,8 @@ TEST_F(InterventionsInternalsPageHandlerTest, OnNewMessageLogAddedPostToPage) {
TEST_F(InterventionsInternalsPageHandlerTest, ObserverIsRemovedWhenDestroyed) {
EXPECT_FALSE(logger_->RemovedObserverIsCalled());
- EXPECT_FALSE(ui_nqe_service_->RemovedObserverIsCalled());
page_handler_.reset();
EXPECT_TRUE(logger_->RemovedObserverIsCalled());
- EXPECT_TRUE(ui_nqe_service_->RemovedObserverIsCalled());
}
TEST_F(InterventionsInternalsPageHandlerTest, OnNewBlacklistedHostPostToPage) {
diff --git a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.cc b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.cc
index 434ebf833c3..70172891639 100644
--- a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.cc
+++ b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.cc
@@ -8,8 +8,6 @@
#include <utility>
#include <vector>
-#include "chrome/browser/net/nqe/ui_network_quality_estimator_service.h"
-#include "chrome/browser/net/nqe/ui_network_quality_estimator_service_factory.h"
#include "chrome/browser/previews/previews_service.h"
#include "chrome/browser/previews/previews_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -58,8 +56,6 @@ InterventionsInternalsUI::InterventionsInternalsUI(content::WebUI* web_ui)
}
content::WebUIDataSource::Add(profile, GetSource());
previews_ui_service_ = previews_service->previews_ui_service();
- ui_nqe_service_ =
- UINetworkQualityEstimatorServiceFactory::GetForProfile(profile);
AddHandlerToRegistry(base::BindRepeating(
&InterventionsInternalsUI::BindInterventionsInternalsPageHandler,
base::Unretained(this)));
@@ -70,7 +66,6 @@ InterventionsInternalsUI::~InterventionsInternalsUI() {}
void InterventionsInternalsUI::BindInterventionsInternalsPageHandler(
mojom::InterventionsInternalsPageHandlerRequest request) {
DCHECK(previews_ui_service_);
- DCHECK(ui_nqe_service_);
page_handler_.reset(new InterventionsInternalsPageHandler(
- std::move(request), previews_ui_service_, ui_nqe_service_));
+ std::move(request), previews_ui_service_));
}
diff --git a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.h b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.h
index 28a0150d12e..b284a9d8131 100644
--- a/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.h
+++ b/chromium/chrome/browser/ui/webui/interventions_internals/interventions_internals_ui.h
@@ -14,8 +14,6 @@ namespace previews {
class PreviewsUIService;
} // namespace previews
-class UINetworkQualityEstimatorService;
-
// The WebUI for chrome://interventions-internals.
class InterventionsInternalsUI : public ui::MojoWebUIController {
public:
@@ -29,10 +27,6 @@ class InterventionsInternalsUI : public ui::MojoWebUIController {
// The PreviewsUIService associated with this UI.
previews::PreviewsUIService* previews_ui_service_;
- // The network quality estimator service for getting the estimate effective
- // conntection type.
- UINetworkQualityEstimatorService* ui_nqe_service_;
-
std::unique_ptr<InterventionsInternalsPageHandler> page_handler_;
DISALLOW_COPY_AND_ASSIGN(InterventionsInternalsUI);
diff --git a/chromium/chrome/browser/ui/webui/invalidations_message_handler.cc b/chromium/chrome/browser/ui/webui/invalidations_message_handler.cc
index 388d20b037c..ef2380b3429 100644
--- a/chromium/chrome/browser/ui/webui/invalidations_message_handler.cc
+++ b/chromium/chrome/browser/ui/webui/invalidations_message_handler.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
+#include "chrome/browser/invalidation/deprecated_profile_invalidation_provider_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "components/invalidation/impl/invalidation_logger.h"
#include "components/invalidation/impl/profile_invalidation_provider.h"
@@ -44,7 +44,7 @@ void InvalidationsMessageHandler::RegisterMessages() {
void InvalidationsMessageHandler::UIReady(const base::ListValue* args) {
invalidation::ProfileInvalidationProvider* invalidation_provider =
- invalidation::ProfileInvalidationProviderFactory::GetForProfile(
+ invalidation::DeprecatedProfileInvalidationProviderFactory::GetForProfile(
Profile::FromWebUI(web_ui()));
if (invalidation_provider) {
logger_ = invalidation_provider->GetInvalidationService()->
@@ -58,7 +58,7 @@ void InvalidationsMessageHandler::UIReady(const base::ListValue* args) {
void InvalidationsMessageHandler::HandleRequestDetailedStatus(
const base::ListValue* args) {
invalidation::ProfileInvalidationProvider* invalidation_provider =
- invalidation::ProfileInvalidationProviderFactory::GetForProfile(
+ invalidation::DeprecatedProfileInvalidationProviderFactory::GetForProfile(
Profile::FromWebUI(web_ui()));
if (invalidation_provider) {
invalidation_provider->GetInvalidationService()->RequestDetailedStatus(
diff --git a/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc b/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc
index 2488a4195d1..5d79f75d4cb 100644
--- a/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc
+++ b/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_browsertest.cc
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/bind_test_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "chrome/browser/local_discovery/test_service_discovery_client.h"
@@ -35,9 +36,6 @@
#include "chrome/test/base/web_ui_browser_test.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/http/http_status_code.h"
-#include "net/url_request/test_url_fetcher_factory.h"
-#include "net/url_request/url_request_status.h"
-#include "net/url_request/url_request_test_util.h"
#include "services/identity/public/cpp/identity_test_utils.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
@@ -49,18 +47,14 @@
#include "components/prefs/pref_service.h"
#endif
-using testing::InvokeWithoutArgs;
-using testing::Return;
+using testing::AnyNumber;
using testing::AtLeast;
-using testing::DoDefault;
using testing::DoAll;
+using testing::DoDefault;
using testing::InSequence;
-using testing::StrictMock;
-using testing::AnyNumber;
-
using testing::InvokeWithoutArgs;
using testing::Return;
-using testing::AtLeast;
+using testing::StrictMock;
namespace local_discovery {
@@ -324,43 +318,15 @@ class TestMessageLoopCondition {
DISALLOW_COPY_AND_ASSIGN(TestMessageLoopCondition);
};
-class MockableFakeURLFetcherCreator {
- public:
- MockableFakeURLFetcherCreator() {
- }
-
- ~MockableFakeURLFetcherCreator() {
- }
-
- MOCK_METHOD1(OnCreateFakeURLFetcher, void(const std::string& url));
-
- std::unique_ptr<net::FakeURLFetcher> CreateFakeURLFetcher(
- const GURL& url,
- net::URLFetcherDelegate* delegate,
- const std::string& response_data,
- net::HttpStatusCode response_code,
- net::URLRequestStatus::Status status) {
- OnCreateFakeURLFetcher(url.spec());
- return std::unique_ptr<net::FakeURLFetcher>(new net::FakeURLFetcher(
- url, delegate, response_data, response_code, status));
- }
-
- net::FakeURLFetcherFactory::FakeURLFetcherCreator callback() {
- return base::Bind(&MockableFakeURLFetcherCreator::CreateFakeURLFetcher,
- base::Unretained(this));
- }
-};
-
class LocalDiscoveryUITest : public WebUIBrowserTest {
public:
LocalDiscoveryUITest()
: test_shared_loader_factory_(
base::MakeRefCounted<network::WeakWrapperSharedURLLoaderFactory>(
&test_url_loader_factory_)),
- fake_fetcher_factory_(&fetcher_impl_factory_,
- fake_url_fetcher_creator_.callback()) {}
- ~LocalDiscoveryUITest() override {
- }
+ set_url_loader_factory_(test_shared_loader_factory_) {}
+
+ ~LocalDiscoveryUITest() override { test_shared_loader_factory_->Detach(); }
void SetUp() override {
// We need to stub out DualMediaSinkService here, because the profile setup
@@ -389,56 +355,16 @@ class LocalDiscoveryUITest : public WebUIBrowserTest {
GaiaUrls::GetInstance()->oauth2_token_url().spec(), kResponseGaiaToken);
test_url_loader_factory_.AddResponse(
GaiaUrls::GetInstance()->oauth_user_info_url().spec(), kResponseGaiaId);
+ test_url_loader_factory_.AddResponse(kURLInfo, kResponseInfo);
+ test_url_loader_factory_.AddResponse(kURLRegisterStart,
+ kResponseRegisterStart);
+ test_url_loader_factory_.AddResponse(kURLRegisterClaimToken,
+ kResponseRegisterClaimTokenNoConfirm);
+ test_url_loader_factory_.AddResponse(kURLCloudPrintConfirm,
+ kResponseCloudPrintConfirm);
+ test_url_loader_factory_.AddResponse(kURLRegisterComplete,
+ kResponseRegisterComplete);
- fake_fetcher_factory().SetFakeResponse(
- GURL(kURLInfo),
- kResponseInfo,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- fake_fetcher_factory().SetFakeResponse(
- GURL(kURLRegisterStart),
- kResponseRegisterStart,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- fake_fetcher_factory().SetFakeResponse(
- GURL(kURLRegisterClaimToken),
- kResponseRegisterClaimTokenNoConfirm,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- fake_fetcher_factory().SetFakeResponse(
- GURL(kURLCloudPrintConfirm),
- kResponseCloudPrintConfirm,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- fake_fetcher_factory().SetFakeResponse(
- GURL(kURLRegisterComplete),
- kResponseRegisterComplete,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- fake_fetcher_factory().SetFakeResponse(
- GaiaUrls::GetInstance()->oauth2_token_url(),
- kResponseGaiaToken,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(
- GaiaUrls::GetInstance()->oauth2_token_url().spec()))
- .Times(AnyNumber());
-
- fake_fetcher_factory().SetFakeResponse(
- GaiaUrls::GetInstance()->oauth_user_info_url(),
- kResponseGaiaId,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(
- GaiaUrls::GetInstance()->oauth_user_info_url().spec()))
- .Times(AnyNumber());
identity::MakePrimaryAccountAvailable(
SigninManagerFactory::GetForProfile(browser()->profile()),
ProfileOAuth2TokenServiceFactory::GetForProfile(browser()->profile()),
@@ -490,25 +416,18 @@ class LocalDiscoveryUITest : public WebUIBrowserTest {
return condition_devices_listed_;
}
- net::FakeURLFetcherFactory& fake_fetcher_factory() {
- return fake_fetcher_factory_;
- }
-
- MockableFakeURLFetcherCreator& fake_url_fetcher_creator() {
- return fake_url_fetcher_creator_;
+ network::TestURLLoaderFactory* test_url_loader_factory() {
+ return &test_url_loader_factory_;
}
private:
scoped_refptr<TestServiceDiscoveryClient> test_service_discovery_client_;
TestMessageLoopCondition condition_devices_listed_;
-
network::TestURLLoaderFactory test_url_loader_factory_;
scoped_refptr<network::WeakWrapperSharedURLLoaderFactory>
test_shared_loader_factory_;
-
- net::URLFetcherImplFactory fetcher_impl_factory_;
- StrictMock<MockableFakeURLFetcherCreator> fake_url_fetcher_creator_;
- net::FakeURLFetcherFactory fake_fetcher_factory_;
+ local_discovery::LocalDiscoveryUIHandler::SetURLLoaderFactoryForTesting
+ set_url_loader_factory_;
DISALLOW_COPY_AND_ASSIGN(LocalDiscoveryUITest);
};
@@ -540,10 +459,7 @@ IN_PROC_BROWSER_TEST_F(LocalDiscoveryUITest, AddRowTest) {
EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("checkNoDevices"));
}
-// Flaky: http://crbug.com/660669.
IN_PROC_BROWSER_TEST_F(LocalDiscoveryUITest, RegisterTest) {
- TestMessageLoopCondition condition_token_claimed;
-
ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUIDevicesURL));
condition_devices_listed().Wait();
@@ -557,49 +473,45 @@ IN_PROC_BROWSER_TEST_F(LocalDiscoveryUITest, RegisterTest) {
EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("registerShowOverlay"));
{
- InSequence s;
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(kURLInfo));
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(
- kURLRegisterStart));
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(
- kURLRegisterClaimToken))
- .WillOnce(InvokeWithoutArgs(&condition_token_claimed,
- &TestMessageLoopCondition::Signal));
+ base::RunLoop run_loop;
+ std::set<GURL> served_urls;
+ test_url_loader_factory()->SetInterceptor(base::BindLambdaForTesting(
+ [&](const network::ResourceRequest& resource) {
+ served_urls.insert(resource.url);
+ if (resource.url == GURL(kURLRegisterClaimToken))
+ run_loop.Quit();
+ }));
+ EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("registerBegin"));
+ run_loop.Run();
+ EXPECT_TRUE(base::ContainsKey(served_urls, GURL(kURLInfo)));
+ EXPECT_TRUE(base::ContainsKey(served_urls, GURL(kURLRegisterStart)));
+ EXPECT_TRUE(base::ContainsKey(served_urls, GURL(kURLRegisterClaimToken)));
+ test_url_loader_factory()->SetInterceptor(base::NullCallback());
}
- EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("registerBegin"));
-
- condition_token_claimed.Wait();
-
EXPECT_TRUE(WebUIBrowserTest::RunJavascriptTest("expectPageAdding1"));
- fake_fetcher_factory().SetFakeResponse(
- GURL(kURLRegisterClaimToken),
- kResponseRegisterClaimTokenConfirm,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
-
- fake_fetcher_factory().SetFakeResponse(
- GURL(kURLInfo),
- kResponseInfoWithID,
- net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
+ test_url_loader_factory()->AddResponse(kURLRegisterClaimToken,
+ kResponseRegisterClaimTokenConfirm);
+ test_url_loader_factory()->AddResponse(kURLInfo, kResponseInfoWithID);
{
- InSequence s;
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(
- kURLRegisterClaimToken));
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(
- kURLCloudPrintConfirm));
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(
- kURLRegisterComplete));
- EXPECT_CALL(fake_url_fetcher_creator(), OnCreateFakeURLFetcher(kURLInfo))
- .WillOnce(InvokeWithoutArgs(&condition_token_claimed,
- &TestMessageLoopCondition::Signal));
+ base::RunLoop run_loop;
+ std::set<GURL> served_urls;
+ test_url_loader_factory()->SetInterceptor(base::BindLambdaForTesting(
+ [&](const network::ResourceRequest& resource) {
+ served_urls.insert(resource.url);
+ if (resource.url == GURL(kURLInfo))
+ run_loop.Quit();
+ }));
+ run_loop.Run();
+ EXPECT_TRUE(base::ContainsKey(served_urls, GURL(kURLRegisterClaimToken)));
+ EXPECT_TRUE(base::ContainsKey(served_urls, GURL(kURLCloudPrintConfirm)));
+ EXPECT_TRUE(base::ContainsKey(served_urls, GURL(kURLRegisterComplete)));
+ EXPECT_TRUE(base::ContainsKey(served_urls, GURL(kURLInfo)));
+ test_url_loader_factory()->SetInterceptor(base::NullCallback());
}
- condition_token_claimed.Wait();
-
test_service_discovery_client()->SimulateReceive(
kAnnouncePacketRegistered, sizeof(kAnnouncePacketRegistered));
diff --git a/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc b/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
index 1ad7ece153e..1fa7b8a58cb 100644
--- a/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
+++ b/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/metrics/user_metrics.h"
+#include "base/no_destructor.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@@ -30,6 +31,7 @@
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_ui.h"
#include "printing/buildflags/buildflags.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "ui/base/l10n/l10n_util.h"
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) && !defined(OS_CHROMEOS)
@@ -92,8 +94,27 @@ void ReadDevicesList(const CloudPrintPrinterList::DeviceList& devices,
}
}
+scoped_refptr<network::SharedURLLoaderFactory>&
+GetURLLoaderFactoryForTesting() {
+ static base::NoDestructor<scoped_refptr<network::SharedURLLoaderFactory>>
+ instance;
+ return *instance;
+}
+
} // namespace
+LocalDiscoveryUIHandler::SetURLLoaderFactoryForTesting::
+ SetURLLoaderFactoryForTesting(
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) {
+ DCHECK(!GetURLLoaderFactoryForTesting());
+ GetURLLoaderFactoryForTesting() = url_loader_factory;
+}
+
+LocalDiscoveryUIHandler::SetURLLoaderFactoryForTesting::
+ ~SetURLLoaderFactoryForTesting() {
+ GetURLLoaderFactoryForTesting() = nullptr;
+}
+
LocalDiscoveryUIHandler::LocalDiscoveryUIHandler()
: is_visible_(false),
failed_list_count_(0),
@@ -168,9 +189,15 @@ void LocalDiscoveryUIHandler::HandleStart(const base::ListValue* args) {
privet_lister_.reset(
new cloud_print::PrivetDeviceListerImpl(service_discovery_client_.get(),
this));
+
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory =
+ GetURLLoaderFactoryForTesting();
+ if (!url_loader_factory)
+ url_loader_factory = profile->GetURLLoaderFactory();
+
privet_http_factory_ =
cloud_print::PrivetHTTPAsynchronousFactory::CreateInstance(
- profile->GetRequestContext());
+ url_loader_factory);
identity::IdentityManager* identity_manager =
IdentityManagerFactory::GetForProfile(profile);
@@ -516,7 +543,12 @@ std::unique_ptr<GCDApiFlow> LocalDiscoveryUIHandler::CreateApiFlow() {
if (!(identity_manager && identity_manager->HasPrimaryAccount()))
return std::unique_ptr<GCDApiFlow>();
- return GCDApiFlow::Create(profile->GetRequestContext(), identity_manager);
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory =
+ GetURLLoaderFactoryForTesting();
+ if (!url_loader_factory)
+ url_loader_factory = profile->GetURLLoaderFactory();
+
+ return GCDApiFlow::Create(url_loader_factory, identity_manager);
}
bool LocalDiscoveryUIHandler::IsUserSupervisedOrOffTheRecord() {
diff --git a/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h b/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h
index cca4463919c..440c6465cce 100644
--- a/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h
+++ b/chromium/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_WEBUI_LOCAL_DISCOVERY_LOCAL_DISCOVERY_UI_HANDLER_H_
#include <map>
+#include <memory>
#include <string>
#include <vector>
@@ -45,6 +46,17 @@ class LocalDiscoveryUIHandler
public cloud_print::CloudPrintPrinterList::Delegate,
public identity::IdentityManager::Observer {
public:
+ // Class used to set a URLLoaderFactory that should be used when making
+ // network requests. Create one instance of this object with the
+ // URLLoaderFactory to use. It's automatically unregistered when the object is
+ // destroyed.
+ class SetURLLoaderFactoryForTesting final {
+ public:
+ explicit SetURLLoaderFactoryForTesting(
+ scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory);
+ ~SetURLLoaderFactoryForTesting();
+ };
+
LocalDiscoveryUIHandler();
~LocalDiscoveryUIHandler() override;
diff --git a/chromium/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc b/chromium/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
index 06195fc97ab..403a5f4ac3c 100644
--- a/chromium/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
+++ b/chromium/chrome/browser/ui/webui/md_bookmarks/md_bookmarks_ui.cc
@@ -22,6 +22,7 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -135,7 +136,10 @@ content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) {
IDR_MD_BOOKMARKS_IMAGES_FOLDER_SVG);
#if BUILDFLAG(OPTIMIZE_WEBUI)
source->AddResourcePath("crisper.js", IDR_MD_BOOKMARKS_CRISPER_JS);
- source->SetDefaultResource(IDR_MD_BOOKMARKS_VULCANIZED_HTML);
+ source->SetDefaultResource(
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2)
+ ? IDR_MD_BOOKMARKS_VULCANIZED_P2_HTML
+ : IDR_MD_BOOKMARKS_VULCANIZED_HTML);
source->UseGzip({"images/folder_open.svg", "images/folder.svg"});
#else
source->AddResourcePath("actions.html", IDR_MD_BOOKMARKS_ACTIONS_HTML);
diff --git a/chromium/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc b/chromium/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc
index f7464ef1f8b..7d7ddfca942 100644
--- a/chromium/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc
+++ b/chromium/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc
@@ -210,7 +210,7 @@ DownloadsListTracker::CreateDownloadItemValue(
file_value->SetString("id", base::NumberToString(download_item->GetId()));
base::FilePath download_path(download_item->GetTargetFilePath());
- file_value->Set("file_path", base::CreateFilePathValue(download_path));
+ file_value->SetKey("file_path", base::CreateFilePathValue(download_path));
file_value->SetString("file_url",
net::FilePathToFileURL(download_path).spec());
@@ -227,12 +227,12 @@ DownloadsListTracker::CreateDownloadItemValue(
// language. This won't work if the extension was uninstalled, so the name
// might be the wrong language.
bool include_disabled = true;
+ auto* profile = Profile::FromBrowserContext(
+ content::DownloadItemUtils::GetBrowserContext(download_item));
+ auto* service =
+ extensions::ExtensionSystem::Get(profile)->extension_service();
const extensions::Extension* extension =
- extensions::ExtensionSystem::Get(
- Profile::FromBrowserContext(
- content::DownloadItemUtils::GetBrowserContext(download_item)))
- ->extension_service()
- ->GetExtensionById(by_ext->id(), include_disabled);
+ service->GetExtensionById(by_ext->id(), include_disabled);
if (extension)
by_ext_name = extension->name();
}
diff --git a/chromium/chrome/browser/ui/webui/md_downloads/md_downloads_ui.cc b/chromium/chrome/browser/ui/webui/md_downloads/md_downloads_ui.cc
index e3938ed4ed6..878c3ca58db 100644
--- a/chromium/chrome/browser/ui/webui/md_downloads/md_downloads_ui.cc
+++ b/chromium/chrome/browser/ui/webui/md_downloads/md_downloads_ui.cc
@@ -30,6 +30,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
#include "ui/base/resource/resource_bundle.h"
using content::BrowserContext;
@@ -53,7 +54,6 @@ content::WebUIDataSource* CreateDownloadsUIHTMLSource(Profile* profile) {
source->AddLocalizedString("moreActions", IDS_DOWNLOAD_MORE_ACTIONS);
source->AddLocalizedString("search", IDS_MD_DOWNLOAD_SEARCH);
-
// No results message that shows instead of the downloads list.
source->AddLocalizedString("noDownloads", IDS_MD_DOWNLOAD_NO_DOWNLOADS);
source->AddLocalizedString("noSearchResults", IDS_SEARCH_NO_RESULTS);
@@ -81,16 +81,14 @@ content::WebUIDataSource* CreateDownloadsUIHTMLSource(Profile* profile) {
source->AddLocalizedString("controlShowInFolder", IDS_DOWNLOAD_LINK_SHOW);
source->AddLocalizedString("controlCancel", IDS_DOWNLOAD_LINK_CANCEL);
source->AddLocalizedString("controlResume", IDS_DOWNLOAD_LINK_RESUME);
- source->AddLocalizedString("controlRemoveFromList",
- IDS_DOWNLOAD_LINK_REMOVE);
+ source->AddLocalizedString("controlRemoveFromList", IDS_DOWNLOAD_LINK_REMOVE);
source->AddLocalizedString("controlRetry", IDS_MD_DOWNLOAD_LINK_RETRY);
- source->AddLocalizedString("controlledByUrl",
- IDS_DOWNLOAD_BY_EXTENSION_URL);
+ source->AddLocalizedString("controlledByUrl", IDS_DOWNLOAD_BY_EXTENSION_URL);
PrefService* prefs = profile->GetPrefs();
source->AddBoolean("allowDeletingHistory",
prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory) &&
- !profile->IsSupervised());
+ !profile->IsSupervised());
source->AddLocalizedString("inIncognito", IDS_DOWNLOAD_IN_INCOGNITO);
@@ -108,7 +106,10 @@ content::WebUIDataSource* CreateDownloadsUIHTMLSource(Profile* profile) {
"2x/incognito_marker.png", "2x/no_downloads.png"});
source->AddResourcePath("crisper.js", IDR_MD_DOWNLOADS_CRISPER_JS);
- source->SetDefaultResource(IDR_MD_DOWNLOADS_VULCANIZED_HTML);
+ source->SetDefaultResource(
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2)
+ ? IDR_MD_DOWNLOADS_VULCANIZED_P2_HTML
+ : IDR_MD_DOWNLOADS_VULCANIZED_HTML);
#else
source->AddResourcePath("browser_proxy.html",
IDR_MD_DOWNLOADS_BROWSER_PROXY_HTML);
@@ -156,8 +157,7 @@ MdDownloadsUI::MdDownloadsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
// Set up the chrome://downloads/ source.
content::WebUIDataSource* source = CreateDownloadsUIHTMLSource(profile);
content::WebUIDataSource::Add(profile, source);
- ThemeSource* theme = new ThemeSource(profile);
- content::URLDataSource::Add(profile, theme);
+ content::URLDataSource::Add(profile, std::make_unique<ThemeSource>(profile));
}
// static
diff --git a/chromium/chrome/browser/ui/webui/md_history_ui.cc b/chromium/chrome/browser/ui/webui/md_history_ui.cc
index de8af30aaad..46df9d42ef5 100644
--- a/chromium/chrome/browser/ui/webui/md_history_ui.cc
+++ b/chromium/chrome/browser/ui/webui/md_history_ui.cc
@@ -30,6 +30,7 @@
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "ui/base/l10n/l10n_util.h"
@@ -174,12 +175,16 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile,
source->UseGzip(exclude_from_gzip);
#if BUILDFLAG(OPTIMIZE_WEBUI)
+ const bool use_polymer_2 =
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2);
source->AddResourcePath("app.html",
- IDR_MD_HISTORY_APP_VULCANIZED_HTML);
- source->AddResourcePath("app.crisper.js",
- IDR_MD_HISTORY_APP_CRISPER_JS);
+ use_polymer_2 ? IDR_MD_HISTORY_APP_VULCANIZED_P2_HTML
+ : IDR_MD_HISTORY_APP_VULCANIZED_HTML);
+ source->AddResourcePath("app.crisper.js", IDR_MD_HISTORY_APP_CRISPER_JS);
source->AddResourcePath("lazy_load.html",
- IDR_MD_HISTORY_LAZY_LOAD_VULCANIZED_HTML);
+ use_polymer_2
+ ? IDR_MD_HISTORY_LAZY_LOAD_VULCANIZED_P2_HTML
+ : IDR_MD_HISTORY_LAZY_LOAD_VULCANIZED_HTML);
source->AddResourcePath("lazy_load.crisper.js",
IDR_MD_HISTORY_LAZY_LOAD_CRISPER_JS);
#endif
@@ -217,7 +222,8 @@ MdHistoryUI::~MdHistoryUI() {}
void MdHistoryUI::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
- registry->RegisterBooleanPref(prefs::kMdHistoryMenuPromoShown, false,
+ registry->RegisterBooleanPref(
+ prefs::kMdHistoryMenuPromoShown, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
}
diff --git a/chromium/chrome/browser/ui/webui/media/media_engagement_ui.cc b/chromium/chrome/browser/ui/webui/media/media_engagement_ui.cc
index 00d7e9860e0..16bf36021df 100644
--- a/chromium/chrome/browser/ui/webui/media/media_engagement_ui.cc
+++ b/chromium/chrome/browser/ui/webui/media/media_engagement_ui.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/macros.h"
+#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/media/media_engagement_score.h"
#include "chrome/browser/media/media_engagement_service.h"
@@ -16,12 +17,20 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "components/component_updater/component_updater_service.h"
+#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_controller.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/web_preferences.h"
#include "media/base/media_switches.h"
#include "mojo/public/cpp/bindings/binding.h"
+#if !defined(OS_ANDROID)
+#include "chrome/common/pref_names.h"
+#include "components/prefs/pref_service.h"
+#endif
+
namespace {
namespace {
@@ -37,10 +46,13 @@ class MediaEngagementScoreDetailsProviderImpl
: public media::mojom::MediaEngagementScoreDetailsProvider {
public:
MediaEngagementScoreDetailsProviderImpl(
- Profile* profile,
+ content::WebUI* web_ui,
mojo::InterfaceRequest<media::mojom::MediaEngagementScoreDetailsProvider>
request)
- : profile_(profile), binding_(this, std::move(request)) {
+ : web_ui_(web_ui),
+ profile_(Profile::FromWebUI(web_ui)),
+ binding_(this, std::move(request)) {
+ DCHECK(web_ui_);
DCHECK(profile_);
service_ = MediaEngagementService::Get(profile_);
}
@@ -65,12 +77,30 @@ class MediaEngagementScoreDetailsProviderImpl
base::FeatureList::IsEnabled(
media::kMediaEngagementBypassAutoplayPolicies),
base::FeatureList::IsEnabled(media::kPreloadMediaEngagementData),
- media::GetEffectiveAutoplayPolicy(
- *base::CommandLine::ForCurrentProcess()),
- GetPreloadVersion()));
+ base::FeatureList::IsEnabled(media::kAutoplaySoundSettings),
+ GetBlockAutoplayPref(),
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kAutoplayPolicy),
+ GetAppliedAutoplayPolicy(), GetPreloadVersion()));
}
private:
+ const std::string GetAppliedAutoplayPolicy() {
+ switch (web_ui_->GetWebContents()
+ ->GetRenderViewHost()
+ ->GetWebkitPreferences()
+ .autoplay_policy) {
+ case content::AutoplayPolicy::kNoUserGestureRequired:
+ return "no-user-gesture-required";
+ case content::AutoplayPolicy::kUserGestureRequired:
+ return "user-gesture-required";
+ case content::AutoplayPolicy::kUserGestureRequiredForCrossOrigin:
+ return "user-gesture-required-for-cross-origin";
+ case content::AutoplayPolicy::kDocumentUserActivationRequired:
+ return "document-user-activation-required";
+ }
+ }
+
const std::string GetPreloadVersion() {
component_updater::ComponentUpdateService* cus =
g_browser_process->component_updater();
@@ -84,6 +114,17 @@ class MediaEngagementScoreDetailsProviderImpl
return std::string();
}
+ // Pref is not available on Android.
+ bool GetBlockAutoplayPref() {
+#if defined(OS_ANDROID)
+ return false;
+#else
+ return profile_->GetPrefs()->GetBoolean(prefs::kBlockAutoplayEnabled);
+#endif
+ }
+
+ content::WebUI* web_ui_;
+
Profile* profile_;
MediaEngagementService* service_;
@@ -118,5 +159,5 @@ MediaEngagementUI::~MediaEngagementUI() = default;
void MediaEngagementUI::BindMediaEngagementScoreDetailsProvider(
media::mojom::MediaEngagementScoreDetailsProviderRequest request) {
ui_handler_ = std::make_unique<MediaEngagementScoreDetailsProviderImpl>(
- Profile::FromWebUI(web_ui()), std::move(request));
+ web_ui(), std::move(request));
}
diff --git a/chromium/chrome/browser/ui/webui/media/webrtc_logs_ui.cc b/chromium/chrome/browser/ui/webui/media/webrtc_logs_ui.cc
index 69df161dfeb..bea416db65b 100644
--- a/chromium/chrome/browser/ui/webui/media/webrtc_logs_ui.cc
+++ b/chromium/chrome/browser/ui/webui/media/webrtc_logs_ui.cc
@@ -20,6 +20,7 @@
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/media/webrtc/webrtc_event_log_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
@@ -27,7 +28,8 @@
#include "components/prefs/pref_service.h"
#include "components/upload_list/upload_list.h"
#include "components/version_info/version_info.h"
-#include "components/webrtc_logging/browser/log_list.h"
+#include "components/webrtc_logging/browser/text_log_list.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
@@ -47,8 +49,10 @@ content::WebUIDataSource* CreateWebRtcLogsUIHTMLSource() {
content::WebUIDataSource::Create(chrome::kChromeUIWebRtcLogsHost);
source->AddLocalizedString("webrtcLogsTitle", IDS_WEBRTC_LOGS_TITLE);
- source->AddLocalizedString("webrtcLogCountFormat",
- IDS_WEBRTC_LOGS_LOG_COUNT_BANNER_FORMAT);
+ source->AddLocalizedString("webrtcTextLogCountFormat",
+ IDS_WEBRTC_TEXT_LOGS_LOG_COUNT_BANNER_FORMAT);
+ source->AddLocalizedString("webrtcEventLogCountFormat",
+ IDS_WEBRTC_EVENT_LOGS_LOG_COUNT_BANNER_FORMAT);
source->AddLocalizedString("webrtcLogHeaderFormat",
IDS_WEBRTC_LOGS_LOG_HEADER_FORMAT);
source->AddLocalizedString("webrtcLogLocalFileLabelFormat",
@@ -57,13 +61,23 @@ content::WebUIDataSource* CreateWebRtcLogsUIHTMLSource() {
IDS_WEBRTC_LOGS_NO_LOCAL_LOG_FILE_MESSAGE);
source->AddLocalizedString("webrtcLogUploadTimeFormat",
IDS_WEBRTC_LOGS_LOG_UPLOAD_TIME_FORMAT);
+ source->AddLocalizedString("webrtcLogFailedUploadTimeFormat",
+ IDS_WEBRTC_LOGS_LOG_FAILED_UPLOAD_TIME_FORMAT);
source->AddLocalizedString("webrtcLogReportIdFormat",
IDS_WEBRTC_LOGS_LOG_REPORT_ID_FORMAT);
+ source->AddLocalizedString("webrtcEventLogLocalLogIdFormat",
+ IDS_WEBRTC_LOGS_EVENT_LOG_LOCAL_LOG_ID);
source->AddLocalizedString("bugLinkText", IDS_WEBRTC_LOGS_BUG_LINK_LABEL);
source->AddLocalizedString("webrtcLogNotUploadedMessage",
IDS_WEBRTC_LOGS_LOG_NOT_UPLOADED_MESSAGE);
- source->AddLocalizedString("noLogsMessage",
- IDS_WEBRTC_LOGS_NO_LOGS_MESSAGE);
+ source->AddLocalizedString("webrtcLogPendingMessage",
+ IDS_WEBRTC_LOGS_LOG_PENDING_MESSAGE);
+ source->AddLocalizedString("webrtcLogActivelyUploadedMessage",
+ IDS_WEBRTC_LOGS_LOG_ACTIVELY_UPLOADED_MESSAGE);
+ source->AddLocalizedString("noTextLogsMessage",
+ IDS_WEBRTC_LOGS_NO_TEXT_LOGS_MESSAGE);
+ source->AddLocalizedString("noEventLogsMessage",
+ IDS_WEBRTC_LOGS_NO_EVENT_LOGS_MESSAGE);
source->SetJsonPath("strings.js");
source->AddResourcePath("webrtc_logs.js", IDR_WEBRTC_LOGS_JS);
source->SetDefaultResource(IDR_WEBRTC_LOGS_HTML);
@@ -86,17 +100,67 @@ class WebRtcLogsDOMHandler final : public WebUIMessageHandler {
void RegisterMessages() override;
private:
+ using WebRtcEventLogManager = webrtc_event_logging::WebRtcEventLogManager;
+
// Asynchronously fetches the list of upload WebRTC logs. Called from JS.
void HandleRequestWebRtcLogs(const base::ListValue* args);
- // Sends the recently uploaded logs list JS.
- void UpdateUI();
+ // Asynchronously load WebRTC text logs.
+ void LoadWebRtcTextLogs();
+
+ // Callback for when WebRTC text logs have been asynchronously loaded.
+ void OnWebRtcTextLogsLoaded();
- // Loads, parses and stores the list of uploaded WebRTC logs.
- scoped_refptr<UploadList> upload_list_;
+ // Asynchronously load WebRTC event logs.
+ void LoadWebRtcEventLogs();
- // The directory where the logs are stored.
- base::FilePath log_dir_;
+ // Callback for when WebRTC event logs have been asynchronously loaded.
+ void OnWebRtcEventLogsLoaded(
+ const std::vector<UploadList::UploadInfo>& event_logs);
+
+ // Update the chrome://webrtc-logs/ page.
+ void UpdateUI();
+
+ // Update the text/event logs part of the forementioned page.
+ void UpdateUIWithTextLogs(base::ListValue* text_logs_list) const;
+ void UpdateUIWithEventLogs(base::ListValue* event_logs_list) const;
+
+ // Convert a history entry about a captured WebRTC event log into a
+ // DictionaryValue of the type expected by updateWebRtcLogsList().
+ std::unique_ptr<base::DictionaryValue> EventLogUploadInfoToDictionaryValue(
+ const UploadList::UploadInfo& info) const;
+
+ // Helpers for EventLogUploadInfoToDictionaryValue().
+ std::unique_ptr<base::DictionaryValue> FromPendingLog(
+ const UploadList::UploadInfo& info) const;
+ std::unique_ptr<base::DictionaryValue> FromActivelyUploadedLog(
+ const UploadList::UploadInfo& info) const;
+ std::unique_ptr<base::DictionaryValue> FromNotUploadedLog(
+ const UploadList::UploadInfo& info) const;
+ std::unique_ptr<base::DictionaryValue> FromUploadUnsuccessfulLog(
+ const UploadList::UploadInfo& info) const;
+ std::unique_ptr<base::DictionaryValue> FromUploadSuccessfulLog(
+ const UploadList::UploadInfo& info) const;
+
+ bool SanityCheckOnUploadInfo(const UploadList::UploadInfo& info) const;
+
+ // The directories where the (text/event) logs are stored.
+ const base::FilePath text_log_dir_;
+ const base::FilePath event_log_dir_;
+
+ // Identifies to WebRtcEventLogManager the profile with which |this| is
+ // associated. Technically, we should be able to just keep Profile*,
+ // but avoiding it makes less lifetime assumptions.
+ // Note that the profile->GetOriginalProfile() is used, to make sure that
+ // for incognito profiles, the parent profile's event logs are shown,
+ // as is the behavior for text logs.
+ const WebRtcEventLogManager::BrowserContextId original_browser_context_id_;
+
+ // Loads, parses and stores the list of uploaded text WebRTC logs.
+ scoped_refptr<UploadList> text_log_upload_list_;
+
+ // List of WebRTC logs captured and possibly uploaded to Crash.
+ std::vector<UploadList::UploadInfo> event_logs_;
// Factory for creating weak references to instances of this class.
base::WeakPtrFactory<WebRtcLogsDOMHandler> weak_ptr_factory_;
@@ -105,20 +169,26 @@ class WebRtcLogsDOMHandler final : public WebUIMessageHandler {
};
WebRtcLogsDOMHandler::WebRtcLogsDOMHandler(Profile* profile)
- : log_dir_(
- webrtc_logging::LogList::GetWebRtcLogDirectoryForBrowserContextPath(
- profile->GetPath())),
+ : text_log_dir_(
+ webrtc_logging::TextLogList::
+ GetWebRtcLogDirectoryForBrowserContextPath(profile->GetPath())),
+ event_log_dir_(
+ WebRtcEventLogManager::GetRemoteBoundWebRtcEventLogsDir(profile)),
+ original_browser_context_id_(webrtc_event_logging::GetBrowserContextId(
+ profile->GetOriginalProfile())),
+ text_log_upload_list_(
+ webrtc_logging::TextLogList::CreateWebRtcLogList(profile)),
weak_ptr_factory_(this) {
- upload_list_ = webrtc_logging::LogList::CreateWebRtcLogList(profile);
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
}
WebRtcLogsDOMHandler::~WebRtcLogsDOMHandler() {
- upload_list_->CancelCallback();
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ text_log_upload_list_->CancelCallback();
}
void WebRtcLogsDOMHandler::RegisterMessages() {
- upload_list_->Load(base::BindOnce(&WebRtcLogsDOMHandler::UpdateUI,
- weak_ptr_factory_.GetWeakPtr()));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
web_ui()->RegisterMessageCallback(
"requestWebRtcLogsList",
@@ -128,15 +198,67 @@ void WebRtcLogsDOMHandler::RegisterMessages() {
void WebRtcLogsDOMHandler::HandleRequestWebRtcLogs(
const base::ListValue* args) {
- upload_list_->Load(base::BindOnce(&WebRtcLogsDOMHandler::UpdateUI,
- weak_ptr_factory_.GetWeakPtr()));
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ LoadWebRtcTextLogs();
+}
+
+void WebRtcLogsDOMHandler::LoadWebRtcTextLogs() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ text_log_upload_list_->Load(
+ base::BindOnce(&WebRtcLogsDOMHandler::OnWebRtcTextLogsLoaded,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
+void WebRtcLogsDOMHandler::OnWebRtcTextLogsLoaded() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ LoadWebRtcEventLogs(); // Text logs loaded; on to the event logs.
+}
+
+void WebRtcLogsDOMHandler::LoadWebRtcEventLogs() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ WebRtcEventLogManager* manager = WebRtcEventLogManager::GetInstance();
+ if (manager) {
+ manager->GetHistory(
+ original_browser_context_id_,
+ base::BindOnce(&WebRtcLogsDOMHandler::OnWebRtcEventLogsLoaded,
+ weak_ptr_factory_.GetWeakPtr()));
+ } else {
+ OnWebRtcEventLogsLoaded(std::vector<UploadList::UploadInfo>());
+ }
+}
+
+void WebRtcLogsDOMHandler::OnWebRtcEventLogsLoaded(
+ const std::vector<UploadList::UploadInfo>& event_logs) {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ event_logs_ = event_logs;
+
+ UpdateUI(); // All log histories loaded asynchronously; time to display.
}
void WebRtcLogsDOMHandler::UpdateUI() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ base::ListValue text_logs_list;
+ UpdateUIWithTextLogs(&text_logs_list);
+
+ base::ListValue event_logs_list;
+ UpdateUIWithEventLogs(&event_logs_list);
+
+ base::Value version(version_info::GetVersionNumber());
+
+ web_ui()->CallJavascriptFunctionUnsafe("updateWebRtcLogsList", text_logs_list,
+ event_logs_list, version);
+}
+
+void WebRtcLogsDOMHandler::UpdateUIWithTextLogs(
+ base::ListValue* upload_list) const {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
std::vector<UploadList::UploadInfo> uploads;
- upload_list_->GetUploads(50, &uploads);
+ text_log_upload_list_->GetUploads(50, &uploads);
- base::ListValue upload_list;
for (std::vector<UploadList::UploadInfo>::iterator i = uploads.begin();
i != uploads.end();
++i) {
@@ -150,8 +272,9 @@ void WebRtcLogsDOMHandler::UpdateUI() {
base::FilePath::StringType value;
if (!i->local_id.empty())
- value = log_dir_.AppendASCII(i->local_id)
- .AddExtension(FILE_PATH_LITERAL(".gz")).value();
+ value = text_log_dir_.AppendASCII(i->local_id)
+ .AddExtension(FILE_PATH_LITERAL(".gz"))
+ .value();
upload->SetString("local_file", value);
// In october 2015, capture time was added to the log list, previously the
@@ -186,13 +309,158 @@ void WebRtcLogsDOMHandler::UpdateUI() {
value_w = base::string16(base::ASCIIToUTF16("(unknown time)"));
upload->SetString("capture_time", value_w);
- upload_list.Append(std::move(upload));
+ upload_list->Append(std::move(upload));
}
+}
- base::Value version(version_info::GetVersionNumber());
+void WebRtcLogsDOMHandler::UpdateUIWithEventLogs(
+ base::ListValue* event_logs_list) const {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ for (auto it = event_logs_.crbegin(); it != event_logs_.crend(); ++it) {
+ event_logs_list->Append(EventLogUploadInfoToDictionaryValue(*it));
+ }
+}
+
+std::unique_ptr<base::DictionaryValue>
+WebRtcLogsDOMHandler::EventLogUploadInfoToDictionaryValue(
+ const UploadList::UploadInfo& info) const {
+ switch (info.state) {
+ case UploadList::UploadInfo::State::Pending:
+ // TODO(crbug.com/775415): Display actively-written logs differently
+ // than fully captured pending logs.
+ return info.upload_time.is_null() ? FromPendingLog(info)
+ : FromActivelyUploadedLog(info);
+ case UploadList::UploadInfo::State::NotUploaded:
+ return info.upload_time.is_null() ? FromNotUploadedLog(info)
+ : FromUploadUnsuccessfulLog(info);
+ case UploadList::UploadInfo::State::Uploaded:
+ return FromUploadSuccessfulLog(info);
+ case UploadList::UploadInfo::State::Pending_UserRequested:
+ NOTREACHED();
+ }
+
+ LOG(ERROR) << "Unrecognized state (" << static_cast<int>(info.state) << ").";
+ return nullptr;
+}
+
+std::unique_ptr<base::DictionaryValue> WebRtcLogsDOMHandler::FromPendingLog(
+ const UploadList::UploadInfo& info) const {
+ DCHECK_EQ(info.state, UploadList::UploadInfo::State::Pending);
+ DCHECK(info.upload_time.is_null());
+
+ if (!SanityCheckOnUploadInfo(info)) {
+ return nullptr;
+ }
+
+ std::unique_ptr<base::DictionaryValue> log(new base::DictionaryValue());
+ log->SetString("state", "pending");
+ log->SetString("capture_time",
+ base::TimeFormatFriendlyDateAndTime(info.capture_time));
+ log->SetString("local_file",
+ event_log_dir_.AppendASCII(info.local_id).value());
+ return log;
+}
+
+std::unique_ptr<base::DictionaryValue>
+WebRtcLogsDOMHandler::FromActivelyUploadedLog(
+ const UploadList::UploadInfo& info) const {
+ DCHECK_EQ(info.state, UploadList::UploadInfo::State::Pending);
+ DCHECK(!info.upload_time.is_null());
+
+ if (!SanityCheckOnUploadInfo(info)) {
+ return nullptr;
+ }
+
+ std::unique_ptr<base::DictionaryValue> log(new base::DictionaryValue());
+ log->SetString("state", "actively_uploaded");
+ log->SetString("capture_time",
+ base::TimeFormatFriendlyDateAndTime(info.capture_time));
+ log->SetString("local_file",
+ event_log_dir_.AppendASCII(info.local_id).value());
+ return log;
+}
+
+std::unique_ptr<base::DictionaryValue> WebRtcLogsDOMHandler::FromNotUploadedLog(
+ const UploadList::UploadInfo& info) const {
+ DCHECK_EQ(info.state, UploadList::UploadInfo::State::NotUploaded);
+ DCHECK(info.upload_time.is_null());
+
+ if (!SanityCheckOnUploadInfo(info)) {
+ return nullptr;
+ }
+
+ std::unique_ptr<base::DictionaryValue> log(new base::DictionaryValue());
+ log->SetString("state", "not_uploaded");
+ log->SetString("capture_time",
+ base::TimeFormatFriendlyDateAndTime(info.capture_time));
+ log->SetString("local_id", info.local_id);
+ return log;
+}
+
+std::unique_ptr<base::DictionaryValue>
+WebRtcLogsDOMHandler::FromUploadUnsuccessfulLog(
+ const UploadList::UploadInfo& info) const {
+ DCHECK_EQ(info.state, UploadList::UploadInfo::State::NotUploaded);
+ DCHECK(!info.upload_time.is_null());
+
+ if (!SanityCheckOnUploadInfo(info)) {
+ return nullptr;
+ }
+
+ if (!info.upload_id.empty()) {
+ LOG(ERROR) << "Unexpected upload ID.";
+ return nullptr;
+ }
+
+ std::unique_ptr<base::DictionaryValue> log(new base::DictionaryValue());
+ log->SetString("state", "upload_unsuccessful");
+ log->SetString("capture_time",
+ base::TimeFormatFriendlyDateAndTime(info.capture_time));
+ log->SetString("local_id", info.local_id);
+ log->SetString("upload_time",
+ base::TimeFormatFriendlyDateAndTime(info.upload_time));
+ return log;
+}
+
+std::unique_ptr<base::DictionaryValue>
+WebRtcLogsDOMHandler::FromUploadSuccessfulLog(
+ const UploadList::UploadInfo& info) const {
+ DCHECK_EQ(info.state, UploadList::UploadInfo::State::Uploaded);
+ DCHECK(!info.upload_time.is_null());
+
+ if (!SanityCheckOnUploadInfo(info)) {
+ return nullptr;
+ }
+
+ if (info.upload_id.empty()) {
+ LOG(ERROR) << "Unknown upload ID.";
+ return nullptr;
+ }
+
+ std::unique_ptr<base::DictionaryValue> log(new base::DictionaryValue());
+ log->SetString("state", "upload_successful");
+ log->SetString("capture_time",
+ base::TimeFormatFriendlyDateAndTime(info.capture_time));
+ log->SetString("local_id", info.local_id);
+ log->SetString("upload_id", info.upload_id);
+ log->SetString("upload_time",
+ base::TimeFormatFriendlyDateAndTime(info.upload_time));
+ return log;
+}
+
+bool WebRtcLogsDOMHandler::SanityCheckOnUploadInfo(
+ const UploadList::UploadInfo& info) const {
+ if (info.capture_time.is_null()) {
+ LOG(ERROR) << "Unknown capture time.";
+ return false;
+ }
+
+ if (info.local_id.empty()) {
+ LOG(ERROR) << "Unknown local ID.";
+ return false;
+ }
- web_ui()->CallJavascriptFunctionUnsafe("updateWebRtcLogsList", upload_list,
- version);
+ return true;
}
} // namespace
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl.cc
index 438bde5b358..ff37610b926 100644
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl.cc
+++ b/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl.cc
@@ -31,9 +31,6 @@
#include "ui/web_dialogs/web_dialog_web_contents_delegate.h"
#include "url/gurl.h"
-DEFINE_WEB_CONTENTS_USER_DATA_KEY(
- media_router::MediaRouterDialogControllerWebUIImpl);
-
using content::LoadCommittedDetails;
using content::NavigationController;
using content::WebContents;
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl_unittest.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl_unittest.cc
index ea35a42225c..78c74cad0f1 100644
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl_unittest.cc
@@ -8,11 +8,11 @@
#include "chrome/browser/media/router/test/test_helper.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/media_router/media_router_ui_service.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/toolbar/mock_media_router_action_controller.h"
#include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_webui_impl.h"
#include "chrome/browser/ui/webui/media_router/media_router_ui.h"
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service.h"
#include "chrome/browser/ui/webui/media_router/media_router_web_ui_test.h"
#include "content/public/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -29,8 +29,10 @@ class MediaRouterDialogControllerWebUIImplTest : public MediaRouterWebUITest {
void OpenMediaRouterDialog();
- MOCK_METHOD2(PresentationSuccessCallback,
- void(const blink::mojom::PresentationInfo&, const MediaRoute&));
+ MOCK_METHOD3(PresentationSuccessCallback,
+ void(const blink::mojom::PresentationInfo&,
+ mojom::RoutePresentationConnectionPtr,
+ const MediaRoute&));
MOCK_METHOD1(PresentationErrorCallback,
void(const blink::mojom::PresentationError& error));
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_ui.cc
index d49923de6a1..4aba966ad9f 100644
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui.cc
+++ b/chromium/chrome/browser/ui/webui/media_router/media_router_ui.cc
@@ -115,8 +115,10 @@ bool MediaRouterUI::ConnectRoute(const MediaSink::Id& sink_id,
GetIssueManager()->ClearNonBlockingIssues();
GetMediaRouter()->ConnectRouteByRouteId(
params->source_id, route_id, params->origin, initiator(),
- std::move(params->route_response_callbacks), params->timeout,
- params->incognito);
+ base::BindOnce(&MediaRouterUIBase::RunRouteResponseCallbacks,
+ std::move(params->presentation_callback),
+ std::move(params->route_result_callbacks)),
+ params->timeout, params->incognito);
return true;
}
@@ -324,11 +326,6 @@ void MediaRouterUI::OnRouteResponseReceived(
SendIssueForRouteTimeout(cast_mode, presentation_request_source_name);
}
-void MediaRouterUI::HandleCreateSessionRequestRouteResponse(
- const RouteRequestResult&) {
- Close();
-}
-
void MediaRouterUI::OnSearchSinkResponseReceived(
MediaCastMode cast_mode,
const MediaSink::Id& found_sink_id) {
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui.h b/chromium/chrome/browser/ui/webui/media_router/media_router_ui.h
index acf5fe70e64..bc1b0bbf1e1 100644
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui.h
+++ b/chromium/chrome/browser/ui/webui/media_router/media_router_ui.h
@@ -27,8 +27,8 @@ class MediaRouterUI : public MediaRouterUIBase, public ConstrainedWebDialogUI {
explicit MediaRouterUI(content::WebUI* web_ui);
~MediaRouterUI() override;
- // Closes the media router UI.
- void Close();
+ // MediaRouterUIBase:
+ void Close() override;
// Notifies this instance that the UI has been initialized.
virtual void OnUIInitialized();
@@ -160,9 +160,6 @@ class MediaRouterUI : public MediaRouterUIBase, public ConstrainedWebDialogUI {
const base::string16& presentation_request_source_name,
const RouteRequestResult& result) override;
- void HandleCreateSessionRequestRouteResponse(
- const RouteRequestResult&) override;
-
// Callback passed to MediaRouter to receive the sink ID of the sink found by
// SearchSinksAndCreateRoute().
void OnSearchSinkResponseReceived(MediaCastMode cast_mode,
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.cc
deleted file mode 100644
index 1726d12f796..00000000000
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.cc
+++ /dev/null
@@ -1,71 +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.
-
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service.h"
-
-#include "chrome/browser/media/router/media_router_feature.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h"
-#include "chrome/common/pref_names.h"
-#include "components/prefs/pref_change_registrar.h"
-#include "components/user_prefs/user_prefs.h"
-
-namespace media_router {
-
-MediaRouterUIService::MediaRouterUIService(Profile* profile)
- : MediaRouterUIService(profile, nullptr) {}
-
-MediaRouterUIService::MediaRouterUIService(
- Profile* profile,
- std::unique_ptr<MediaRouterActionController> action_controller)
- : profile_(profile),
- action_controller_(std::move(action_controller)),
- profile_pref_registrar_(std::make_unique<PrefChangeRegistrar>()) {
- profile_pref_registrar_->Init(profile->GetPrefs());
- profile_pref_registrar_->Add(
- ::prefs::kEnableMediaRouter,
- base::BindRepeating(&MediaRouterUIService::ConfigureService,
- base::Unretained(this)));
- ConfigureService();
-}
-
-MediaRouterUIService::~MediaRouterUIService() {}
-
-void MediaRouterUIService::Shutdown() {
- DisableService();
-}
-
-// static
-MediaRouterUIService* MediaRouterUIService::Get(Profile* profile) {
- return MediaRouterUIServiceFactory::GetForBrowserContext(profile);
-}
-
-MediaRouterActionController* MediaRouterUIService::action_controller() {
- return action_controller_.get();
-}
-
-void MediaRouterUIService::AddObserver(Observer* observer) {
- observers_.AddObserver(observer);
-}
-
-void MediaRouterUIService::RemoveObserver(Observer* observer) {
- observers_.RemoveObserver(observer);
-}
-
-void MediaRouterUIService::ConfigureService() {
- if (!MediaRouterEnabled(profile_)) {
- DisableService();
- } else if (!action_controller_ && MediaRouterEnabled(profile_)) {
- action_controller_ =
- std::make_unique<MediaRouterActionController>(profile_);
- }
-}
-
-void MediaRouterUIService::DisableService() {
- for (auto& observer : observers_)
- observer.OnServiceDisabled();
- action_controller_.reset();
-}
-
-} // namespace media_router
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.h b/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.h
deleted file mode 100644
index 313be0e33f6..00000000000
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service.h
+++ /dev/null
@@ -1,61 +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 CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_SERVICE_H_
-#define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_SERVICE_H_
-
-#include <memory>
-
-#include "base/observer_list.h"
-#include "chrome/browser/ui/toolbar/media_router_action_controller.h"
-#include "components/keyed_service/core/keyed_service.h"
-
-class PrefChangeRegistrar;
-class Profile;
-
-namespace media_router {
-
-// Service that owns per-profile Media Router UI objects, such as the controller
-// for the Media Router toolbar action.
-class MediaRouterUIService : public KeyedService {
- public:
- class Observer {
- public:
- virtual void OnServiceDisabled() = 0;
- };
-
- explicit MediaRouterUIService(Profile* profile);
- // Used by tests to inject an action controller.
- MediaRouterUIService(
- Profile* profile,
- std::unique_ptr<MediaRouterActionController> action_controller);
- ~MediaRouterUIService() override;
-
- // KeyedService:
- void Shutdown() override;
-
- static MediaRouterUIService* Get(Profile* profile);
-
- virtual MediaRouterActionController* action_controller();
-
- void AddObserver(Observer* observer);
- void RemoveObserver(Observer* observer);
-
- private:
- friend class MediaRouterUIBrowserTest;
-
- void ConfigureService();
- void DisableService();
-
- Profile* profile_;
- std::unique_ptr<MediaRouterActionController> action_controller_;
- std::unique_ptr<PrefChangeRegistrar> profile_pref_registrar_;
-
- base::ObserverList<Observer> observers_;
-
- DISALLOW_COPY_AND_ASSIGN(MediaRouterUIService);
-};
-
-} // namespace media_router
-
-#endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_SERVICE_H_
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.cc
deleted file mode 100644
index 98c0f0eeb07..00000000000
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.cc
+++ /dev/null
@@ -1,64 +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.
-
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h"
-
-#include "chrome/browser/media/router/media_router_factory.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/toolbar/toolbar_actions_model_factory.h"
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service.h"
-#include "components/keyed_service/content/browser_context_dependency_manager.h"
-
-using content::BrowserContext;
-
-namespace media_router {
-
-// static
-MediaRouterUIService* MediaRouterUIServiceFactory::GetForBrowserContext(
- BrowserContext* context) {
- DCHECK(context);
- return static_cast<MediaRouterUIService*>(
- GetInstance()->GetServiceForBrowserContext(context, true));
-}
-
-// static
-MediaRouterUIServiceFactory* MediaRouterUIServiceFactory::GetInstance() {
- return base::Singleton<MediaRouterUIServiceFactory>::get();
-}
-
-MediaRouterUIServiceFactory::MediaRouterUIServiceFactory()
- : BrowserContextKeyedServiceFactory(
- "MediaRouterUIService",
- BrowserContextDependencyManager::GetInstance()) {
- DependsOn(MediaRouterFactory::GetInstance());
- // MediaRouterUIService owns a MediaRouterActionController that depends on
- // ToolbarActionsModel.
- DependsOn(ToolbarActionsModelFactory::GetInstance());
-}
-
-MediaRouterUIServiceFactory::~MediaRouterUIServiceFactory() {}
-
-BrowserContext* MediaRouterUIServiceFactory::GetBrowserContextToUse(
- BrowserContext* context) const {
- return context;
-}
-
-KeyedService* MediaRouterUIServiceFactory::BuildServiceInstanceFor(
- BrowserContext* context) const {
- return new MediaRouterUIService(Profile::FromBrowserContext(context));
-}
-
-bool MediaRouterUIServiceFactory::ServiceIsCreatedWithBrowserContext() const {
-#if !defined(OS_ANDROID)
- return true;
-#else
- return false;
-#endif
-}
-
-bool MediaRouterUIServiceFactory::ServiceIsNULLWhileTesting() const {
- return true;
-}
-
-} // namespace media_router
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h b/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h
deleted file mode 100644
index 10d57611301..00000000000
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h
+++ /dev/null
@@ -1,51 +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 CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_SERVICE_FACTORY_H_
-#define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_SERVICE_FACTORY_H_
-
-#include "base/gtest_prod_util.h"
-#include "base/memory/singleton.h"
-#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
-
-namespace content {
-class BrowserContext;
-}
-
-namespace media_router {
-
-class MediaRouterUIService;
-
-class MediaRouterUIServiceFactory : public BrowserContextKeyedServiceFactory {
- public:
- static MediaRouterUIService* GetForBrowserContext(
- content::BrowserContext* context);
-
- static MediaRouterUIServiceFactory* GetInstance();
-
- private:
- friend struct base::DefaultSingletonTraits<MediaRouterUIServiceFactory>;
- FRIEND_TEST_ALL_PREFIXES(MediaRouterUIServiceFactoryUnitTest, CreateService);
- FRIEND_TEST_ALL_PREFIXES(MediaRouterUIServiceFactoryUnitTest,
- DoNotCreateActionControllerWhenDisabled);
- FRIEND_TEST_ALL_PREFIXES(MediaRouterUIServiceFactoryUnitTest,
- DisablingMediaRouting);
-
- MediaRouterUIServiceFactory();
- ~MediaRouterUIServiceFactory() override;
-
- // BrowserContextKeyedServiceFactory interface.
- content::BrowserContext* GetBrowserContextToUse(
- content::BrowserContext* context) const override;
- KeyedService* BuildServiceInstanceFor(
- content::BrowserContext* context) const override;
- bool ServiceIsCreatedWithBrowserContext() const override;
- bool ServiceIsNULLWhileTesting() const override;
-
- DISALLOW_COPY_AND_ASSIGN(MediaRouterUIServiceFactory);
-};
-
-} // namespace media_router
-
-#endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_SERVICE_FACTORY_H_
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory_unittest.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory_unittest.cc
deleted file mode 100644
index 22005542e82..00000000000
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_service_factory_unittest.cc
+++ /dev/null
@@ -1,103 +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.
-
-#include <memory>
-
-#include "base/values.h"
-#include "chrome/browser/media/router/media_router_factory.h"
-#include "chrome/browser/media/router/test/mock_media_router.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
-#include "chrome/browser/ui/toolbar/toolbar_actions_model_factory.h"
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service.h"
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/test/base/testing_profile.h"
-#include "components/sync_preferences/testing_pref_service_syncable.h"
-#include "content/public/test/test_browser_thread_bundle.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class MockMediaRouterUIServiceObserver
- : public media_router::MediaRouterUIService::Observer {
- public:
- MOCK_METHOD0(OnServiceDisabled, void());
-};
-
-} // namespace
-
-namespace media_router {
-
-class MediaRouterUIServiceFactoryUnitTest : public testing::Test {
- public:
- MediaRouterUIServiceFactoryUnitTest() {}
- ~MediaRouterUIServiceFactoryUnitTest() override {}
-
- void SetUp() override {
- TestingProfile::Builder builder;
- // MediaRouterUIService instantiates MediaRouterActionController, which
- // requires ToolbarActionsModel.
- builder.AddTestingFactory(ToolbarActionsModelFactory::GetInstance(),
- BuildFakeToolBarActionsModel);
- builder.AddTestingFactory(MediaRouterFactory::GetInstance(),
- MockMediaRouter::Create);
- profile_ = builder.Build();
- }
-
- static std::unique_ptr<KeyedService> BuildFakeToolBarActionsModel(
- content::BrowserContext* context) {
- return std::unique_ptr<ToolbarActionsModel>(
- new ToolbarActionsModel(static_cast<Profile*>(context), nullptr));
- }
-
- protected:
- content::TestBrowserThreadBundle thread_bundle_;
- std::unique_ptr<TestingProfile> profile_;
-};
-
-TEST_F(MediaRouterUIServiceFactoryUnitTest, CreateService) {
- // We call BuildServiceInstanceFor() directly because
- // MediaRouterUIServiceFactory::GetForBrowserContext() is set to return a
- // nullptr for a test profile.
- std::unique_ptr<MediaRouterUIService> service(
- static_cast<MediaRouterUIService*>(
- MediaRouterUIServiceFactory::GetInstance()->BuildServiceInstanceFor(
- profile_.get())));
- ASSERT_TRUE(service);
- ASSERT_TRUE(service->action_controller());
-}
-
-TEST_F(MediaRouterUIServiceFactoryUnitTest,
- DoNotCreateActionControllerWhenDisabled) {
- profile_->GetTestingPrefService()->SetManagedPref(
- prefs::kEnableMediaRouter, std::make_unique<base::Value>(false));
- std::unique_ptr<MediaRouterUIService> service(
- static_cast<MediaRouterUIService*>(
- MediaRouterUIServiceFactory::GetInstance()->BuildServiceInstanceFor(
- profile_.get())));
- ASSERT_TRUE(service);
- EXPECT_EQ(nullptr, service->action_controller());
-}
-
-TEST_F(MediaRouterUIServiceFactoryUnitTest, DisablingMediaRouting) {
- std::unique_ptr<MediaRouterUIService> service(
- static_cast<MediaRouterUIService*>(
- MediaRouterUIServiceFactory::GetInstance()->BuildServiceInstanceFor(
- profile_.get())));
- ASSERT_TRUE(service);
- ASSERT_TRUE(service->action_controller());
-
- MockMediaRouterUIServiceObserver mock_observer;
- service->AddObserver(&mock_observer);
- EXPECT_CALL(mock_observer, OnServiceDisabled).Times(testing::Exactly(1));
-
- profile_->GetTestingPrefService()->SetManagedPref(
- prefs::kEnableMediaRouter, std::make_unique<base::Value>(false));
- EXPECT_EQ(nullptr, service->action_controller());
- service->RemoveObserver(&mock_observer);
-}
-
-} // namespace media_router
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc
index cc65de51976..6847cd75354 100644
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h"
#include "chrome/common/media_router/media_route.h"
#include "chrome/common/media_router/media_source_helper.h"
+#include "chrome/common/media_router/mojo/media_router.mojom.h"
#include "chrome/common/media_router/route_request_result.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
@@ -107,7 +108,9 @@ class PresentationRequestCallbacks {
const blink::mojom::PresentationError& expected_error)
: expected_error_(expected_error) {}
- void Success(const blink::mojom::PresentationInfo&, const MediaRoute&) {}
+ void Success(const blink::mojom::PresentationInfo&,
+ mojom::RoutePresentationConnectionPtr,
+ const MediaRoute&) {}
void Error(const blink::mojom::PresentationError& error) {
EXPECT_EQ(expected_error_.error_type, error.error_type);
@@ -244,11 +247,11 @@ class MediaRouterUIIncognitoTest : public MediaRouterUITest {
TEST_F(MediaRouterUITest, RouteCreationTimeoutForTab) {
CreateMediaRouterUI(profile());
- std::vector<MediaRouteResponseCallback> callbacks;
+ MediaRouteResponseCallback callback;
EXPECT_CALL(mock_router_,
CreateRouteInternal(_, _, _, _, _,
base::TimeDelta::FromSeconds(60), false))
- .WillOnce(SaveArgWithMove<4>(&callbacks));
+ .WillOnce(SaveArgWithMove<4>(&callback));
media_router_ui_->CreateRoute(CreateSinkCompatibleWithAllSources().id(),
MediaCastMode::TAB_MIRROR);
@@ -257,17 +260,16 @@ TEST_F(MediaRouterUITest, RouteCreationTimeoutForTab) {
EXPECT_CALL(*message_handler_, UpdateIssue(IssueTitleEquals(expected_title)));
std::unique_ptr<RouteRequestResult> result =
RouteRequestResult::FromError("Timed out", RouteRequestResult::TIMED_OUT);
- for (auto& callback : callbacks)
- std::move(callback).Run(*result);
+ std::move(callback).Run(nullptr, *result);
}
TEST_F(MediaRouterUITest, RouteCreationTimeoutForDesktop) {
CreateMediaRouterUI(profile());
- std::vector<MediaRouteResponseCallback> callbacks;
+ MediaRouteResponseCallback callback;
EXPECT_CALL(mock_router_,
CreateRouteInternal(_, _, _, _, _,
base::TimeDelta::FromSeconds(120), false))
- .WillOnce(SaveArgWithMove<4>(&callbacks));
+ .WillOnce(SaveArgWithMove<4>(&callback));
media_router_ui_->CreateRoute(CreateSinkCompatibleWithAllSources().id(),
MediaCastMode::DESKTOP_MIRROR);
@@ -276,8 +278,7 @@ TEST_F(MediaRouterUITest, RouteCreationTimeoutForDesktop) {
EXPECT_CALL(*message_handler_, UpdateIssue(IssueTitleEquals(expected_title)));
std::unique_ptr<RouteRequestResult> result =
RouteRequestResult::FromError("Timed out", RouteRequestResult::TIMED_OUT);
- for (auto& callback : callbacks)
- std::move(callback).Run(*result);
+ std::move(callback).Run(nullptr, *result);
}
TEST_F(MediaRouterUITest, RouteCreationTimeoutForPresentation) {
@@ -286,11 +287,11 @@ TEST_F(MediaRouterUITest, RouteCreationTimeoutForPresentation) {
{0, 0}, {GURL("https://presentationurl.com")},
url::Origin::Create(GURL("https://frameurl.fakeurl")));
media_router_ui_->OnDefaultPresentationChanged(presentation_request);
- std::vector<MediaRouteResponseCallback> callbacks;
+ MediaRouteResponseCallback callback;
EXPECT_CALL(mock_router_,
CreateRouteInternal(_, _, _, _, _,
base::TimeDelta::FromSeconds(20), false))
- .WillOnce(SaveArgWithMove<4>(&callbacks));
+ .WillOnce(SaveArgWithMove<4>(&callback));
media_router_ui_->CreateRoute(CreateSinkCompatibleWithAllSources().id(),
MediaCastMode::PRESENTATION);
@@ -300,8 +301,7 @@ TEST_F(MediaRouterUITest, RouteCreationTimeoutForPresentation) {
EXPECT_CALL(*message_handler_, UpdateIssue(IssueTitleEquals(expected_title)));
std::unique_ptr<RouteRequestResult> result =
RouteRequestResult::FromError("Timed out", RouteRequestResult::TIMED_OUT);
- for (auto& callback : callbacks)
- std::move(callback).Run(*result);
+ std::move(callback).Run(nullptr, *result);
}
// Tests that if a local file CreateRoute call is made from a new tab, the
diff --git a/chromium/chrome/browser/ui/webui/media_router/media_router_web_ui_test.cc b/chromium/chrome/browser/ui/webui/media_router/media_router_web_ui_test.cc
index 0b0a38ed222..b15b9927ece 100644
--- a/chromium/chrome/browser/ui/webui/media_router/media_router_web_ui_test.cc
+++ b/chromium/chrome/browser/ui/webui/media_router/media_router_web_ui_test.cc
@@ -6,11 +6,11 @@
#include "chrome/browser/media/router/media_router_factory.h"
#include "chrome/browser/media/router/test/mock_media_router.h"
+#include "chrome/browser/ui/media_router/media_router_ui_service.h"
+#include "chrome/browser/ui/media_router/media_router_ui_service_factory.h"
#include "chrome/browser/ui/toolbar/mock_media_router_action_controller.h"
#include "chrome/browser/ui/toolbar/toolbar_actions_model.h"
#include "chrome/browser/ui/toolbar/toolbar_actions_model_factory.h"
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service.h"
-#include "chrome/browser/ui/webui/media_router/media_router_ui_service_factory.h"
#include "chrome/test/base/dialog_test_browser_window.h"
class MockMediaRouterUIService : public media_router::MediaRouterUIService {
diff --git a/chromium/chrome/browser/ui/webui/memory_internals_ui.cc b/chromium/chrome/browser/ui/webui/memory_internals_ui.cc
index 2ab3d76daed..17636bd8c31 100644
--- a/chromium/chrome/browser/ui/webui/memory_internals_ui.cc
+++ b/chromium/chrome/browser/ui/webui/memory_internals_ui.cc
@@ -74,8 +74,14 @@ std::string GetMessageString() {
case Mode::kRendererSampling:
return std::string(
- "Memory logging is enabled for an automatic sample of renderer "
- "processes. This UI is disabled.");
+ "Memory logging is enabled for at most one renderer process. Each "
+ "renderer process has a fixed probability of being sampled at "
+ "startup.");
+
+ case Mode::kUtilitySampling:
+ return std::string(
+ "Each utility process has a fixed probability of being profiled at "
+ "startup.");
case Mode::kNone:
case Mode::kManual:
@@ -272,14 +278,15 @@ void MemoryInternalsDOMHandler::GetChildProcessesOnIOThread(
base::WeakPtr<MemoryInternalsDOMHandler> dom_handler) {
std::vector<base::Value> result;
- // The only non-renderer child process that currently supports out-of-process
- // heap profiling is GPU.
+ // The only non-renderer child processes that currently support out-of-process
+ // heap profiling are GPU and UTILITY.
for (content::BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) {
// Note that ChildProcessData.id is a child ID and not an OS PID.
const content::ChildProcessData& data = iter.GetData();
- if (data.process_type == content::PROCESS_TYPE_GPU) {
- result.push_back(MakeProcessInfo(base::GetProcId(data.handle),
+ if (data.process_type == content::PROCESS_TYPE_GPU ||
+ data.process_type == content::PROCESS_TYPE_UTILITY) {
+ result.push_back(MakeProcessInfo(base::GetProcId(data.GetHandle()),
GetChildDescription(data)));
}
}
diff --git a/chromium/chrome/browser/ui/webui/nacl_ui.cc b/chromium/chrome/browser/ui/webui/nacl_ui.cc
index 49b29dfe600..c4f9b9d6532 100644
--- a/chromium/chrome/browser/ui/webui/nacl_ui.cc
+++ b/chromium/chrome/browser/ui/webui/nacl_ui.cc
@@ -23,7 +23,7 @@
#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/plugins/plugin_prefs.h"
@@ -355,7 +355,7 @@ void NaClDomHandler::MaybeRespondToPage() {
if (!pnacl_path_validated_) {
std::string* version_string = new std::string;
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&CheckPathAndVersion, version_string),
base::Bind(&NaClDomHandler::DidCheckPathAndVersion,
weak_ptr_factory_.GetWeakPtr(),
diff --git a/chromium/chrome/browser/ui/webui/net_internals/DEPS b/chromium/chrome/browser/ui/webui/net_internals/DEPS
index 060df380685..12e5f1c9cbe 100644
--- a/chromium/chrome/browser/ui/webui/net_internals/DEPS
+++ b/chromium/chrome/browser/ui/webui/net_internals/DEPS
@@ -1,5 +1,3 @@
include_rules = [
- "+components/onc",
- "+components/user_manager",
"+services/network/expect_ct_reporter.h",
]
diff --git a/chromium/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chromium/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
index 34960e3e654..76652731b92 100644
--- a/chromium/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ b/chromium/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -211,10 +211,8 @@ class NetInternalsMessageHandler
// Called back by the CertificateImporter when a certificate import finished.
// |previous_error| contains earlier errors during this import.
- void OnCertificatesImported(
- const std::string& previous_error,
- bool success,
- net::ScopedCERTCertificateList onc_trusted_certificates);
+ void OnCertificatesImported(const std::string& previous_error,
+ bool cert_import_success);
#endif
private:
@@ -981,19 +979,21 @@ void NetInternalsMessageHandler::ImportONCFileToNSSDB(
chromeos::onc::CertificateImporterImpl cert_importer(
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), nssdb);
- cert_importer.ImportCertificates(
- std::make_unique<chromeos::onc::OncParsedCertificates>(certificates),
- onc_source,
+ auto certs =
+ std::make_unique<chromeos::onc::OncParsedCertificates>(certificates);
+ if (certs->has_error())
+ error += "Some certificates couldn't be parsed. ";
+ cert_importer.ImportAllCertificatesUserInitiated(
+ certs->server_or_authority_certificates(), certs->client_certificates(),
base::Bind(&NetInternalsMessageHandler::OnCertificatesImported,
- AsWeakPtr(), error));
+ AsWeakPtr(), error /* previous_error */));
}
void NetInternalsMessageHandler::OnCertificatesImported(
const std::string& previous_error,
- bool success,
- net::ScopedCERTCertificateList /* unused onc_trusted_certificates */) {
+ bool cert_import_success) {
std::string error = previous_error;
- if (!success)
+ if (!cert_import_success)
error += "Some certificates couldn't be imported. ";
SendJavascriptCommand("receivedONCFileParse",
diff --git a/chromium/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chromium/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index d9cac60b0b5..ff6cec6de2f 100644
--- a/chromium/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chromium/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -20,11 +20,13 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_ui_util.h"
+#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -41,6 +43,7 @@
#include "chrome/browser/ui/webui/extensions/extension_basic_info.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
+#include "chrome/browser/web_applications/extensions/bookmark_app_util.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -150,6 +153,22 @@ void AppLauncherHandler::CreateAppInfo(const Extension* extension,
service->profile())->management_policy()->UserMayModifySettings(
extension, NULL));
+ bool is_locally_installed =
+ !extension->is_hosted_app() ||
+ BookmarkAppIsLocallyInstalled(service->profile(), extension);
+ value->SetBoolean("mayChangeLaunchType",
+ !extension->is_platform_app() && is_locally_installed);
+
+#if defined(OS_MACOSX)
+ // On Mac, only packaged apps can have shortcuts created.
+ value->SetBoolean("mayCreateShortcuts", extension->is_platform_app());
+#else
+ // On other platforms, any locally installed app can have shortcuts created.
+ value->SetBoolean("mayCreateShortcuts", is_locally_installed);
+#endif
+
+ value->SetBoolean("isLocallyInstalled", is_locally_installed);
+
auto icon_size = extension_misc::EXTENSION_ICON_LARGE;
auto match_type = ExtensionIconSet::MATCH_BIGGER;
bool has_non_default_large_icon =
diff --git a/chromium/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chromium/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index d59de5f9b1b..e2881420a45 100644
--- a/chromium/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chromium/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -58,8 +58,8 @@ NewTabUI::NewTabUI(content::WebUI* web_ui) : content::WebUIController(web_ui) {
web_ui->AddMessageHandler(std::make_unique<ThemeHandler>());
// content::URLDataSource assumes the ownership of the html source.
- content::URLDataSource::Add(
- profile, new NewTabHTMLSource(profile->GetOriginalProfile()));
+ content::URLDataSource::Add(profile, std::make_unique<NewTabHTMLSource>(
+ profile->GetOriginalProfile()));
pref_change_registrar_.Init(profile->GetPrefs());
pref_change_registrar_.Add(bookmarks::prefs::kShowBookmarkBar,
diff --git a/chromium/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chromium/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index 3c2af7b1a72..fdc50989ef1 100644
--- a/chromium/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chromium/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -32,7 +32,7 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
-#include "components/google/core/browser/google_util.h"
+#include "components/google/core/common/google_util.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chromium/chrome/browser/ui/webui/policy_indicator_localized_strings_provider.cc b/chromium/chrome/browser/ui/webui/policy_indicator_localized_strings_provider.cc
index 29c17795b7b..62bced52475 100644
--- a/chromium/chrome/browser/ui/webui/policy_indicator_localized_strings_provider.cc
+++ b/chromium/chrome/browser/ui/webui/policy_indicator_localized_strings_provider.cc
@@ -8,6 +8,10 @@
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/web_ui_data_source.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
+#endif
+
namespace policy_indicator {
struct LocalizedString {
@@ -16,8 +20,13 @@ struct LocalizedString {
};
void AddLocalizedStrings(content::WebUIDataSource* html_source) {
+ int controlled_setting_policy_id = IDS_CONTROLLED_SETTING_POLICY;
+#if defined(OS_CHROMEOS)
+ if (chromeos::DemoSession::IsDeviceInDemoMode())
+ controlled_setting_policy_id = IDS_CONTROLLED_SETTING_DEMO_SESSION;
+#endif
LocalizedString localized_strings[] = {
- {"controlledSettingPolicy", IDS_CONTROLLED_SETTING_POLICY},
+ {"controlledSettingPolicy", controlled_setting_policy_id},
{"controlledSettingRecommendedMatches", IDS_CONTROLLED_SETTING_RECOMMENDED},
{"controlledSettingRecommendedDiffers",
IDS_CONTROLLED_SETTING_HAS_RECOMMENDATION},
diff --git a/chromium/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc b/chromium/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc
index 48ee22746b2..24cbd0bc9b0 100644
--- a/chromium/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc
+++ b/chromium/chrome/browser/ui/webui/policy_tool_ui_browsertest.cc
@@ -8,8 +8,8 @@
#include "base/path_service.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/task_scheduler/task_traits.h"
+#include "base/task/post_task.h"
+#include "base/task/task_traits.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
diff --git a/chromium/chrome/browser/ui/webui/policy_tool_ui_handler.cc b/chromium/chrome/browser/ui/webui/policy_tool_ui_handler.cc
index b7ee3b356cb..c1f1a36df59 100644
--- a/chromium/chrome/browser/ui/webui/policy_tool_ui_handler.cc
+++ b/chromium/chrome/browser/ui/webui/policy_tool_ui_handler.cc
@@ -9,7 +9,7 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "build/build_config.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/policy/schema_registry_service.h"
@@ -404,7 +404,7 @@ void PolicyToolUIHandler::HandleUpdateSession(const base::ListValue* args) {
std::string converted_values;
base::JSONWriter::Write(*policy_values, &converted_values);
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&PolicyToolUIHandler::DoUpdateSession,
base::Unretained(this), converted_values),
base::BindOnce(&PolicyToolUIHandler::OnSessionUpdated,
@@ -415,7 +415,7 @@ void PolicyToolUIHandler::HandleUpdateSession(const base::ListValue* args) {
void PolicyToolUIHandler::HandleResetSession(const base::ListValue* args) {
DCHECK_EQ(0U, args->GetSize());
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&PolicyToolUIHandler::DoUpdateSession,
base::Unretained(this), "{}"),
base::BindOnce(&PolicyToolUIHandler::OnSessionUpdated,
@@ -472,7 +472,7 @@ void PolicyToolUIHandler::WriteSessionPolicyToFile(
const std::string data = session_dict_for_exporting_;
base::PostTaskWithTraits(
FROM_HERE,
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN},
base::BindOnce(&DoWriteSessionPolicyToFile, path, data));
}
diff --git a/chromium/chrome/browser/ui/webui/policy_ui_handler.cc b/chromium/chrome/browser/ui/webui/policy_ui_handler.cc
index cd3a8df1cd2..db5f1afedda 100644
--- a/chromium/chrome/browser/ui/webui/policy_ui_handler.cc
+++ b/chromium/chrome/browser/ui/webui/policy_ui_handler.cc
@@ -18,8 +18,8 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/task_scheduler/task_traits.h"
+#include "base/task/post_task.h"
+#include "base/task/task_traits.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -811,7 +811,7 @@ void PolicyUIHandler::WritePoliciesToJSONFile(
base::PostTaskWithTraits(
FROM_HERE,
- {base::MayBlock(), base::TaskPriority::BACKGROUND,
+ {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN},
base::BindOnce(&DoWritePoliciesToJSONFile, path, json_policies));
}
diff --git a/chromium/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc b/chromium/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc
index 78b67d27f48..3cdb186891c 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc
@@ -13,7 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_split.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/printing/pwg_raster_converter.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_utils.h"
diff --git a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.cc b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.cc
index b753712af06..40f83cbaa42 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.cc
@@ -11,7 +11,7 @@
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "chrome/browser/chromeos/printing/cups_print_job_manager.h"
#include "chrome/browser/chromeos/printing/cups_print_job_manager_factory.h"
@@ -21,6 +21,7 @@
#include "chrome/browser/chromeos/printing/printer_configurer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_utils.h"
+#include "chrome/common/pref_names.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/debug_daemon_client.h"
#include "chromeos/printing/ppd_provider.h"
@@ -28,6 +29,7 @@
#include "components/printing/common/printer_capabilities.h"
#include "content/public/browser/browser_thread.h"
#include "printing/backend/print_backend_consts.h"
+#include "printing/backend/printing_restrictions.h"
namespace {
@@ -59,17 +61,26 @@ void AddPrintersToList(const std::vector<chromeos::Printer>& printers,
}
}
+void CapabilitiesFetched(base::DictionaryValue policies,
+ LocalPrinterHandlerChromeos::GetCapabilityCallback cb,
+ std::unique_ptr<base::DictionaryValue> printer_info) {
+ printer_info->FindKey(printing::kPrinter)
+ ->SetKey(printing::kSettingPolicies, std::move(policies));
+ std::move(cb).Run(std::move(printer_info));
+}
+
void FetchCapabilities(std::unique_ptr<chromeos::Printer> printer,
+ base::DictionaryValue policies,
LocalPrinterHandlerChromeos::GetCapabilityCallback cb) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
printing::PrinterBasicInfo basic_info = ToBasicInfo(*printer);
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&printing::GetSettingsOnBlockingPool, printer->id(),
basic_info, nullptr),
- std::move(cb));
+ base::BindOnce(&CapabilitiesFetched, std::move(policies), std::move(cb)));
}
} // namespace
@@ -77,7 +88,8 @@ void FetchCapabilities(std::unique_ptr<chromeos::Printer> printer,
LocalPrinterHandlerChromeos::LocalPrinterHandlerChromeos(
Profile* profile,
content::WebContents* preview_web_contents)
- : preview_web_contents_(preview_web_contents),
+ : profile_(profile),
+ preview_web_contents_(preview_web_contents),
printers_manager_(
CupsPrintersManagerFactory::GetForBrowserContext(profile)),
printer_configurer_(chromeos::PrinterConfigurer::Create(profile)),
@@ -153,7 +165,7 @@ void LocalPrinterHandlerChromeos::StartGetCapability(
printer_configurer_->SetUpPrinter(
printer_ref,
base::BindOnce(&LocalPrinterHandlerChromeos::HandlePrinterSetup,
- weak_factory_.GetWeakPtr(), base::Passed(&printer),
+ weak_factory_.GetWeakPtr(), std::move(printer),
std::move(cb)));
}
@@ -164,14 +176,20 @@ void LocalPrinterHandlerChromeos::HandlePrinterSetup(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
switch (result) {
- case chromeos::PrinterSetupResult::kSuccess:
+ case chromeos::PrinterSetupResult::kSuccess: {
VLOG(1) << "Printer setup successful for " << printer->id()
<< " fetching properties";
- printers_manager_->PrinterInstalled(*printer);
+ printers_manager_->PrinterInstalled(*printer, true /*is_automatic*/);
+ // populate |policies| with policies for native printers.
+ base::DictionaryValue policies;
+ policies.SetInteger(
+ printing::kAllowedColorModes,
+ profile_->GetPrefs()->GetInteger(prefs::kPrintingAllowedColorModes));
// fetch settings on the blocking pool and invoke callback.
- FetchCapabilities(std::move(printer), std::move(cb));
+ FetchCapabilities(std::move(printer), std::move(policies), std::move(cb));
return;
+ }
case chromeos::PrinterSetupResult::kPpdNotFound:
LOG(WARNING) << "Could not find PPD. Check printer configuration.";
// Prompt user to update configuration.
diff --git a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.h b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.h
index a846e6ffefd..07ec8698ccf 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.h
+++ b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_chromeos.h
@@ -49,6 +49,7 @@ class LocalPrinterHandlerChromeos : public PrinterHandler {
GetCapabilityCallback cb,
chromeos::PrinterSetupResult result);
+ Profile* const profile_;
content::WebContents* const preview_web_contents_;
chromeos::CupsPrintersManager* printers_manager_;
scoped_refptr<chromeos::PpdProvider> ppd_provider_;
diff --git a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc
index 794a8d53a6c..45be6a05e11 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/local_printer_handler_default.cc
@@ -9,8 +9,8 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/task/post_task.h"
+#include "base/threading/scoped_blocking_call.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_utils.h"
#include "components/printing/common/printer_capabilities.h"
#include "content/public/browser/browser_thread.h"
@@ -19,7 +19,7 @@
namespace {
printing::PrinterList EnumeratePrintersAsync() {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
scoped_refptr<printing::PrintBackend> print_backend(
printing::PrintBackend::CreateInstance(nullptr));
@@ -30,7 +30,7 @@ printing::PrinterList EnumeratePrintersAsync() {
std::unique_ptr<base::DictionaryValue> FetchCapabilitiesAsync(
const std::string& device_name) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
scoped_refptr<printing::PrintBackend> print_backend(
printing::PrintBackend::CreateInstance(nullptr));
@@ -51,7 +51,7 @@ std::unique_ptr<base::DictionaryValue> FetchCapabilitiesAsync(
}
std::string GetDefaultPrinterAsync() {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
scoped_refptr<printing::PrintBackend> print_backend(
printing::PrintBackend::CreateInstance(nullptr));
@@ -74,7 +74,7 @@ void LocalPrinterHandlerDefault::GetDefaultPrinter(DefaultPrinterCallback cb) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&GetDefaultPrinterAsync), std::move(cb));
}
@@ -85,7 +85,7 @@ void LocalPrinterHandlerDefault::StartGetPrinters(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&EnumeratePrintersAsync),
base::BindOnce(&printing::ConvertPrinterListForCallback, callback,
std::move(done_callback)));
@@ -97,7 +97,7 @@ void LocalPrinterHandlerDefault::StartGetCapability(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&FetchCapabilitiesAsync, device_name), std::move(cb));
}
diff --git a/chromium/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc b/chromium/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
index 97f9d542885..ba142e10ef0 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc
@@ -11,9 +11,10 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/i18n/file_util_icu.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
@@ -93,8 +94,7 @@ std::unique_ptr<base::DictionaryValue> GetPdfCapabilities(
Media default_media("", "", default_media_size.width(),
default_media_size.height());
if (!default_media.MatchBySize() ||
- std::find(kPdfMedia, kPdfMedia + arraysize(kPdfMedia),
- default_media.type) == kPdfMedia + arraysize(kPdfMedia)) {
+ !base::ContainsValue(kPdfMedia, default_media.type)) {
default_media = Media(locale == "en-US" ? NA_LETTER : ISO_A4);
}
MediaCapability media;
@@ -325,7 +325,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
// returns and eventually FileSelected() gets called.
if (!prompt_user) {
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&GetUniquePath, path.Append(default_filename)),
base::Bind(&PdfPrinterHandler::OnGotUniqueFileName,
weak_ptr_factory_.GetWeakPtr()));
@@ -343,7 +343,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
// save directory does not exist.
base::FilePath default_path = download_prefs->DownloadPath();
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&SelectSaveDirectory, path, default_path),
base::BindOnce(&PdfPrinterHandler::OnDirectorySelected,
weak_ptr_factory_.GetWeakPtr(), default_filename));
@@ -351,7 +351,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename,
void PdfPrinterHandler::PostPrintToPdfTask() {
base::PostTaskWithTraits(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&PrintToPdfCallback, print_data_, print_to_pdf_path_,
pdf_file_saved_closure_));
print_to_pdf_path_.clear();
diff --git a/chromium/chrome/browser/ui/webui/print_preview/policy_settings.cc b/chromium/chrome/browser/ui/webui/print_preview/policy_settings.cc
new file mode 100644
index 00000000000..5177d8d0ed2
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/print_preview/policy_settings.cc
@@ -0,0 +1,18 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/print_preview/policy_settings.h"
+
+#include "chrome/common/pref_names.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+
+namespace printing {
+
+// static
+void PolicySettings::RegisterProfilePrefs(
+ user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterBooleanPref(prefs::kPrintHeaderFooter, true);
+}
+
+} // namespace printing
diff --git a/chromium/chrome/browser/ui/webui/print_preview/policy_settings.h b/chromium/chrome/browser/ui/webui/print_preview/policy_settings.h
new file mode 100644
index 00000000000..a77d0782632
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/print_preview/policy_settings.h
@@ -0,0 +1,28 @@
+// 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 CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_POLICY_SETTINGS_H_
+#define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_POLICY_SETTINGS_H_
+
+#include "base/macros.h"
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+namespace printing {
+
+// Registers the enterprise policy prefs that should be enforced in print
+// preview. These settings override other settings, and cannot be controlled by
+// the user.
+class PolicySettings {
+ public:
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(PolicySettings);
+};
+
+} // namespace printing
+
+#endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_POLICY_SETTINGS_H_
diff --git a/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 7ce766e59dd..8e8a5ed48ba 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -45,6 +45,7 @@
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
#include "chrome/browser/ui/webui/print_preview/pdf_printer_handler.h"
+#include "chrome/browser/ui/webui/print_preview/policy_settings.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#include "chrome/browser/ui/webui/print_preview/printer_handler.h"
#include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
@@ -61,6 +62,7 @@
#include "components/prefs/pref_service.h"
#include "components/printing/common/cloud_print_cdd_conversion.h"
#include "components/printing/common/print_messages.h"
+#include "components/printing/common/printer_capabilities.h"
#include "components/signin/core/browser/gaia_cookie_manager_service.h"
#include "components/signin/core/browser/profile_management_switches.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
@@ -128,7 +130,7 @@ enum PrintSettingsBuckets {
HEADERS_AND_FOOTERS,
CSS_BACKGROUND,
SELECTION_ONLY,
- EXTERNAL_PDF_PREVIEW,
+ EXTERNAL_PDF_PREVIEW_UNUSED,
PAGE_RANGE,
DEFAULT_MEDIA,
NON_DEFAULT_MEDIA,
@@ -138,6 +140,9 @@ enum PrintSettingsBuckets {
SCALING,
PRINT_AS_IMAGE,
PAGES_PER_SHEET,
+ FIT_TO_PAGE,
+ DEFAULT_DPI,
+ NON_DEFAULT_DPI,
PRINT_SETTINGS_BUCKET_BOUNDARY
};
@@ -262,6 +267,12 @@ const char kAppState[] = "serializedAppStateStr";
// Name of a dictionary field holding the default destination selection rules.
const char kDefaultDestinationSelectionRules[] =
"serializedDefaultDestinationSelectionRulesStr";
+// Name of a dictionary pref holding the default value for the header/footer
+// checkbox. If set, takes priority over sticky settings.
+const char kHeaderFooter[] = "headerFooter";
+// Name of a dictionary field telling us whether the kPrintHeaderFooter pref is
+// managed by an enterprise policy.
+const char kIsHeaderFooterManaged[] = "isHeaderFooterManaged";
// Get the print job settings dictionary from |json_str|. Returns NULL on
// failure.
@@ -287,17 +298,30 @@ std::unique_ptr<base::DictionaryValue> GetSettingsDictionary(
}
// Track the popularity of print settings and report the stats.
-void ReportPrintSettingsStats(const base::DictionaryValue& settings) {
+void ReportPrintSettingsStats(const base::DictionaryValue& print_settings,
+ const base::DictionaryValue& preview_settings,
+ bool is_pdf) {
ReportPrintSettingHistogram(TOTAL);
+ // Print settings can be categorized into 2 groups: settings that are applied
+ // via preview generation (page range, selection, headers/footers, background
+ // graphics, scaling, layout, page size, pages per sheet, fit to page,
+ // margins, rasterize), and settings that are applied at the printer (color,
+ // duplex, copies, collate, dpi). The former should be captured from the most
+ // recent preview request, as some of them are set to dummy values in the
+ // print ticket. Similarly, settings applied at the printer should be pulled
+ // from the print ticket, as they may have dummy values in the preview
+ // request.
const base::ListValue* page_range_array = NULL;
- if (settings.GetList(printing::kSettingPageRange, &page_range_array) &&
+ if (preview_settings.GetList(printing::kSettingPageRange,
+ &page_range_array) &&
!page_range_array->empty()) {
ReportPrintSettingHistogram(PAGE_RANGE);
}
const base::DictionaryValue* media_size_value = NULL;
- if (settings.GetDictionary(printing::kSettingMediaSize, &media_size_value) &&
+ if (preview_settings.GetDictionary(printing::kSettingMediaSize,
+ &media_size_value) &&
!media_size_value->empty()) {
bool is_default = false;
if (media_size_value->GetBoolean(printing::kSettingMediaSizeIsDefault,
@@ -310,74 +334,94 @@ void ReportPrintSettingsStats(const base::DictionaryValue& settings) {
}
bool landscape = false;
- if (settings.GetBoolean(printing::kSettingLandscape, &landscape))
+ if (preview_settings.GetBoolean(printing::kSettingLandscape, &landscape))
ReportPrintSettingHistogram(landscape ? LANDSCAPE : PORTRAIT);
int copies = 1;
- if (settings.GetInteger(printing::kSettingCopies, &copies) && copies > 1)
+ if (print_settings.GetInteger(printing::kSettingCopies, &copies) &&
+ copies > 1) {
ReportPrintSettingHistogram(COPIES);
+ }
int scaling = 100;
- if (settings.GetInteger(printing::kSettingScaleFactor, &scaling) &&
+ if (preview_settings.GetInteger(printing::kSettingScaleFactor, &scaling) &&
scaling != 100) {
ReportPrintSettingHistogram(SCALING);
}
int pages_per_sheet = 1;
- if (settings.GetInteger(printing::kSettingPagesPerSheet, &pages_per_sheet) &&
+ if (preview_settings.GetInteger(printing::kSettingPagesPerSheet,
+ &pages_per_sheet) &&
pages_per_sheet != 1) {
ReportPrintSettingHistogram(PAGES_PER_SHEET);
}
bool collate = false;
- if (settings.GetBoolean(printing::kSettingCollate, &collate) && collate)
+ if (print_settings.GetBoolean(printing::kSettingCollate, &collate) && collate)
ReportPrintSettingHistogram(COLLATE);
int duplex_mode = 0;
- if (settings.GetInteger(printing::kSettingDuplexMode, &duplex_mode))
+ if (print_settings.GetInteger(printing::kSettingDuplexMode, &duplex_mode))
ReportPrintSettingHistogram(duplex_mode ? DUPLEX : SIMPLEX);
int color_mode = 0;
- if (settings.GetInteger(printing::kSettingColor, &color_mode)) {
+ if (print_settings.GetInteger(printing::kSettingColor, &color_mode)) {
ReportPrintSettingHistogram(
printing::IsColorModelSelected(color_mode) ? COLOR : BLACK_AND_WHITE);
}
int margins_type = 0;
- if (settings.GetInteger(printing::kSettingMarginsType, &margins_type) &&
+ if (preview_settings.GetInteger(printing::kSettingMarginsType,
+ &margins_type) &&
margins_type != 0) {
ReportPrintSettingHistogram(NON_DEFAULT_MARGINS);
}
bool headers = false;
- if (settings.GetBoolean(printing::kSettingHeaderFooterEnabled, &headers) &&
+ if (preview_settings.GetBoolean(printing::kSettingHeaderFooterEnabled,
+ &headers) &&
headers) {
ReportPrintSettingHistogram(HEADERS_AND_FOOTERS);
}
bool css_background = false;
- if (settings.GetBoolean(printing::kSettingShouldPrintBackgrounds,
- &css_background) && css_background) {
+ if (preview_settings.GetBoolean(printing::kSettingShouldPrintBackgrounds,
+ &css_background) &&
+ css_background) {
ReportPrintSettingHistogram(CSS_BACKGROUND);
}
bool selection_only = false;
- if (settings.GetBoolean(printing::kSettingShouldPrintSelectionOnly,
- &selection_only) && selection_only) {
+ if (preview_settings.GetBoolean(printing::kSettingShouldPrintSelectionOnly,
+ &selection_only) &&
+ selection_only) {
ReportPrintSettingHistogram(SELECTION_ONLY);
}
- bool external_preview = false;
- if (settings.GetBoolean(printing::kSettingOpenPDFInPreview,
- &external_preview) && external_preview) {
- ReportPrintSettingHistogram(EXTERNAL_PDF_PREVIEW);
- }
-
bool rasterize = false;
- if (settings.GetBoolean(printing::kSettingRasterizePdf,
- &rasterize) && rasterize) {
+ if (preview_settings.GetBoolean(printing::kSettingRasterizePdf, &rasterize) &&
+ rasterize) {
ReportPrintSettingHistogram(PRINT_AS_IMAGE);
}
+
+ bool fit_to_page = false;
+ if (is_pdf &&
+ preview_settings.GetBoolean(printing::kSettingFitToPageEnabled,
+ &fit_to_page) &&
+ fit_to_page) {
+ ReportPrintSettingHistogram(FIT_TO_PAGE);
+ }
+
+ int dpi_horizontal = 0;
+ int dpi_vertical = 0;
+ if (print_settings.GetInteger(printing::kSettingDpiHorizontal,
+ &dpi_horizontal) &&
+ print_settings.GetInteger(printing::kSettingDpiVertical, &dpi_vertical) &&
+ dpi_horizontal > 0 && dpi_vertical > 0) {
+ bool is_default = false;
+ if (print_settings.GetBoolean(printing::kSettingDpiDefault, &is_default))
+ ReportPrintSettingHistogram(is_default ? DEFAULT_DPI : NON_DEFAULT_DPI);
+ }
}
UserActionBuckets DetermineUserAction(const base::DictionaryValue& settings) {
@@ -461,10 +505,10 @@ class PrintPreviewHandler::AccessTokenService
requests_[type].callback_id = callback_id;
}
- void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
- const std::string& access_token,
- const base::Time& expiration_time) override {
- OnServiceResponse(request, access_token);
+ void OnGetTokenSuccess(
+ const OAuth2TokenService::Request* request,
+ const OAuth2AccessTokenConsumer::TokenResponse& token_response) override {
+ OnServiceResponse(request, token_response.access_token);
}
void OnGetTokenFailure(const OAuth2TokenService::Request* request,
@@ -592,6 +636,7 @@ void PrintPreviewHandler::OnJavascriptDisallowed() {
// this is necessary for refresh or navigation from the chrome://print page.
weak_factory_.InvalidateWeakPtrs();
preview_callbacks_.clear();
+ preview_failures_.clear();
UnregisterForGaiaCookieChanges();
}
@@ -599,6 +644,12 @@ WebContents* PrintPreviewHandler::preview_web_contents() const {
return web_ui()->GetWebContents();
}
+PrefService* PrintPreviewHandler::GetPrefs() const {
+ auto* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
+ DCHECK(prefs);
+ return prefs;
+}
+
PrintPreviewUI* PrintPreviewHandler::print_preview_ui() const {
return static_cast<PrintPreviewUI*>(web_ui()->GetController());
}
@@ -718,8 +769,7 @@ void PrintPreviewHandler::HandleGetPreview(const base::ListValue* args) {
preview_callbacks_[request_id] = callback_id;
print_preview_ui()->OnPrintPreviewRequest(request_id);
// Add an additional key in order to identify |print_preview_ui| later on
- // when calling PrintPreviewUI::GetCurrentPrintPreviewStatus() on the IO
- // thread.
+ // when calling PrintPreviewUI::ShouldCancelRequest() on the IO thread.
settings->SetInteger(printing::kPreviewUIID,
print_preview_ui()->GetIDForPrintPreviewUI());
@@ -758,6 +808,7 @@ void PrintPreviewHandler::HandleGetPreview(const base::ListValue* args) {
VLOG(1) << "Print preview request start";
rfh->Send(new PrintMsg_PrintPreview(rfh->GetRoutingID(), *settings));
+ last_preview_settings_ = std::move(settings);
}
void PrintPreviewHandler::HandlePrint(const base::ListValue* args) {
@@ -820,11 +871,11 @@ void PrintPreviewHandler::HandlePrint(const base::ListValue* args) {
}
// After validating |settings|, record metrics.
- ReportPrintSettingsStats(*settings);
+ bool is_pdf = !print_preview_ui()->source_is_modifiable();
+ if (last_preview_settings_)
+ ReportPrintSettingsStats(*settings, *last_preview_settings_, is_pdf);
{
- PrintDocumentTypeBuckets doc_type =
- print_preview_ui()->source_is_modifiable() ? HTML_DOCUMENT
- : PDF_DOCUMENT;
+ PrintDocumentTypeBuckets doc_type = is_pdf ? PDF_DOCUMENT : HTML_DOCUMENT;
size_t average_page_size_in_kb = data->size() / page_count;
average_page_size_in_kb /= 1024;
ReportPrintDocumentTypeAndSizeHistograms(doc_type, average_page_size_in_kb);
@@ -869,8 +920,7 @@ void PrintPreviewHandler::HandleSaveAppState(const base::ListValue* args) {
printing::StickySettings* sticky_settings = GetStickySettings();
if (args->GetString(0, &data_to_save) && !data_to_save.empty())
sticky_settings->StoreAppState(data_to_save);
- sticky_settings->SaveInPrefs(Profile::FromBrowserContext(
- preview_web_contents()->GetBrowserContext())->GetPrefs());
+ sticky_settings->SaveInPrefs(GetPrefs());
}
// |args| is expected to contain a string with representing the callback id
@@ -903,9 +953,7 @@ void PrintPreviewHandler::HandleSignin(const base::ListValue* args) {
CHECK(!callback_id.empty());
CHECK(args->GetBoolean(1, &add_account));
- Profile* profile = Profile::FromBrowserContext(
- preview_web_contents()->GetBrowserContext());
- chrome::ScopedTabbedBrowserDisplayer displayer(profile);
+ chrome::ScopedTabbedBrowserDisplayer displayer(Profile::FromWebUI(web_ui()));
print_dialog_cloud::CreateCloudPrintSigninTab(
displayer.browser(), add_account,
base::Bind(&PrintPreviewHandler::OnSigninComplete,
@@ -1025,8 +1073,7 @@ void PrintPreviewHandler::SendInitialSettings(
print_preview_ui()->source_has_selection());
initial_settings.SetBoolean(printing::kSettingShouldPrintSelectionOnly,
print_preview_ui()->print_selection_only());
- PrefService* prefs = Profile::FromBrowserContext(
- preview_web_contents()->GetBrowserContext())->GetPrefs();
+ PrefService* prefs = GetPrefs();
printing::StickySettings* sticky_settings = GetStickySettings();
sticky_settings->RestoreFromPrefs(prefs);
if (sticky_settings->printer_app_state()) {
@@ -1036,22 +1083,27 @@ void PrintPreviewHandler::SendInitialSettings(
initial_settings.SetKey(kAppState, base::Value());
}
+ if (prefs->HasPrefPath(prefs::kPrintHeaderFooter)) {
+ // Don't override sticky settings, unless kPrintHeaderFooter is actually
+ // customized.
+ initial_settings.SetBoolean(kHeaderFooter,
+ prefs->GetBoolean(prefs::kPrintHeaderFooter));
+ }
+ initial_settings.SetBoolean(
+ kIsHeaderFooterManaged,
+ prefs->IsManagedPreference(prefs::kPrintHeaderFooter));
+
base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
initial_settings.SetBoolean(kIsInKioskAutoPrintMode,
cmdline->HasSwitch(switches::kKioskModePrinting));
initial_settings.SetBoolean(kIsInAppKioskMode,
chrome::IsRunningInForcedAppMode());
- bool set_rules = false;
- if (prefs) {
- const std::string rules_str =
- prefs->GetString(prefs::kPrintPreviewDefaultDestinationSelectionRules);
- if (!rules_str.empty()) {
- initial_settings.SetString(kDefaultDestinationSelectionRules, rules_str);
- set_rules = true;
- }
- }
- if (!set_rules) {
+ const std::string rules_str =
+ prefs->GetString(prefs::kPrintPreviewDefaultDestinationSelectionRules);
+ if (rules_str.empty()) {
initial_settings.SetKey(kDefaultDestinationSelectionRules, base::Value());
+ } else {
+ initial_settings.SetString(kDefaultDestinationSelectionRules, rules_str);
}
GetNumberFormatAndMeasurementSystem(&initial_settings);
@@ -1097,6 +1149,14 @@ void PrintPreviewHandler::SendPrinterSetup(
destination_info->Remove(printing::kSettingCapabilities, &caps_value) &&
caps_value->is_dict()) {
caps = base::DictionaryValue::From(std::move(caps_value));
+ base::Value* printer = destination_info->FindKeyOfType(
+ printing::kPrinter, base::Value::Type::DICTIONARY);
+ if (printer) {
+ base::Value* policies_value = printer->FindKeyOfType(
+ printing::kSettingPolicies, base::Value::Type::DICTIONARY);
+ if (policies_value)
+ response->SetKey("policies", std::move(*policies_value));
+ }
} else {
LOG(WARNING) << "Printer setup failed";
success = false;
@@ -1110,9 +1170,7 @@ void PrintPreviewHandler::SendPrinterSetup(
}
void PrintPreviewHandler::SendCloudPrintEnabled() {
- Profile* profile = Profile::FromBrowserContext(
- preview_web_contents()->GetBrowserContext());
- PrefService* prefs = profile->GetPrefs();
+ PrefService* prefs = GetPrefs();
if (prefs->GetBoolean(prefs::kCloudPrintSubmitEnabled) &&
!base::FeatureList::IsEnabled(features::kCloudPrinterHandler)) {
FireWebUIListener(
@@ -1169,6 +1227,10 @@ void PrintPreviewHandler::OnPrintPreviewFailed(int request_id) {
reported_failed_preview_ = true;
ReportUserActionHistogram(PREVIEW_FAILED);
}
+
+ // Keep track of failures.
+ bool inserted = preview_failures_.insert(request_id).second;
+ DCHECK(inserted);
RejectJavascriptCallback(base::Value(callback_id),
base::Value("PREVIEW_FAILED"));
}
@@ -1194,8 +1256,8 @@ void PrintPreviewHandler::SendPrintPresetOptions(bool disable_scaling,
}
void PrintPreviewHandler::SendPageCountReady(int page_count,
- int request_id,
- int fit_to_page_scaling) {
+ int fit_to_page_scaling,
+ int request_id) {
if (!ShouldReceiveRendererMessage(request_id))
return;
@@ -1216,12 +1278,19 @@ void PrintPreviewHandler::SendPageLayoutReady(
void PrintPreviewHandler::SendPagePreviewReady(int page_index,
int preview_uid,
- int preview_response_id) {
- if (!ShouldReceiveRendererMessage(preview_response_id))
+ int preview_request_id) {
+ // With print compositing, by the time compositing finishes and this method
+ // gets called, the print preview may have failed. Since the failure message
+ // may have arrived first, check for this case and bail out instead of
+ // thinking this may be a bad IPC message.
+ if (base::ContainsKey(preview_failures_, preview_request_id))
+ return;
+
+ if (!ShouldReceiveRendererMessage(preview_request_id))
return;
FireWebUIListener("page-preview-ready", base::Value(page_index),
- base::Value(preview_uid), base::Value(preview_response_id));
+ base::Value(preview_uid), base::Value(preview_request_id));
}
void PrintPreviewHandler::OnPrintPreviewCancelled(int request_id) {
diff --git a/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.h b/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.h
index a6b34ca8b66..88a08b47aaf 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.h
+++ b/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler.h
@@ -7,6 +7,7 @@
#include <map>
#include <memory>
+#include <set>
#include <string>
#include "base/files/file_path.h"
@@ -92,8 +93,8 @@ class PrintPreviewHandler
// Send the print preview page count and fit to page scaling
void SendPageCountReady(int page_count,
- int request_id,
- int fit_to_page_scaling);
+ int fit_to_page_scaling,
+ int request_id);
// Send the default page layout
void SendPageLayoutReady(const base::DictionaryValue& layout,
@@ -103,7 +104,7 @@ class PrintPreviewHandler
// Notify the WebUI that the page preview is ready.
void SendPagePreviewReady(int page_index,
int preview_uid,
- int preview_response_id);
+ int preview_request_id);
int regenerate_preview_request_count() const {
return regenerate_preview_request_count_;
@@ -144,7 +145,11 @@ class PrintPreviewHandler
FRIEND_TEST_ALL_PREFIXES(PrintPreviewPdfGeneratedBrowserTest,
MANUAL_DummyTest);
friend class PrintPreviewHandlerTest;
- FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, InitialSettings);
+ FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, InitialSettingsSimple);
+ FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest,
+ InitialSettingsEnableHeaderFooter);
+ FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest,
+ InitialSettingsDisableHeaderFooter);
FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, GetPrinters);
FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, GetPrinterCapabilities);
FRIEND_TEST_ALL_PREFIXES(PrintPreviewHandlerTest, Print);
@@ -156,6 +161,8 @@ class PrintPreviewHandler
PrintPreviewUI* print_preview_ui() const;
+ PrefService* GetPrefs() const;
+
// Whether the the handler should be receiving messages from the renderer to
// forward to the Print Preview JS in response to preview request with id
// |request_id|. Kills the renderer if the handler should not be receiving
@@ -317,6 +324,9 @@ class PrintPreviewHandler
// Whether we have already logged the number of printers this session.
bool has_logged_printers_count_;
+ // The settings used for the most recent preview request.
+ std::unique_ptr<base::DictionaryValue> last_preview_settings_;
+
// Holds token service to get OAuth2 access tokens.
std::unique_ptr<AccessTokenService> token_service_;
@@ -347,6 +357,9 @@ class PrintPreviewHandler
// Maps preview request ids to callbacks.
std::map<int, std::string> preview_callbacks_;
+ // Set of preview request ids for failed previews.
+ std::set<int> preview_failures_;
+
base::WeakPtrFactory<PrintPreviewHandler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandler);
diff --git a/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc b/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc
index 7e4bffcd685..bc7888c8133 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/print_preview_handler_unittest.cc
@@ -10,18 +10,24 @@
#include "base/base64.h"
#include "base/containers/flat_set.h"
+#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/memory/ref_counted_memory.h"
+#include "base/optional.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/icu_test_util.h"
#include "base/values.h"
#include "chrome/browser/printing/print_test_utils.h"
#include "chrome/browser/printing/print_view_manager.h"
+#include "chrome/browser/ui/webui/print_preview/policy_settings.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#include "chrome/browser/ui/webui/print_preview/printer_handler.h"
+#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
+#include "components/prefs/pref_service.h"
#include "components/printing/common/print_messages.h"
+#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_controller.h"
@@ -318,14 +324,16 @@ class PrintPreviewHandlerTest : public testing::Test {
// Validates the initial settings structure in the response matches the
// print_preview.NativeInitialSettings type in
- // chrome/browser/resources/print_preview/native_layer.js. Checks that
- // |default_printer_name| is the printer name returned and that
- // |initiator_title| is the initiator title returned and validates that
- // delimeters are correct for "en" locale (set in Initialize()). Assumes
- // "test-callback-id-0" was used as the callback id.
+ // chrome/browser/resources/print_preview/native_layer.js. Checks that:
+ // - |default_printer_name| is the printer name returned
+ // - |initiator_title| is the initiator title returned
+ // - |expected_header_footer| is the header/footer state returned, if any
+ // Also validates that delimeters are correct for "en" locale (set in
+ // Initialize()). Assumes "test-callback-id-0" was used as the callback id.
void ValidateInitialSettings(const content::TestWebUI::CallData& data,
const std::string& default_printer_name,
- const std::string& initiator_title) {
+ const std::string& initiator_title,
+ base::Optional<bool> expected_header_footer) {
CheckWebUIResponse(data, "test-callback-id-0", true);
const base::Value* settings = data.arg3();
ASSERT_TRUE(settings->FindKeyOfType("isInKioskAutoPrintMode",
@@ -358,6 +366,12 @@ class PrintPreviewHandlerTest : public testing::Test {
settings->FindKeyOfType("printerName", base::Value::Type::STRING);
ASSERT_TRUE(printer);
EXPECT_EQ(default_printer_name, printer->GetString());
+
+ const base::Value* header_footer =
+ settings->FindKeyOfType("headerFooter", base::Value::Type::BOOLEAN);
+ EXPECT_EQ(bool(expected_header_footer), bool(header_footer));
+ if (expected_header_footer)
+ EXPECT_EQ(*expected_header_footer, header_footer->GetBool());
}
IPC::TestSink& initiator_sink() {
@@ -385,6 +399,7 @@ class PrintPreviewHandlerTest : public testing::Test {
}
const Profile* profile() { return profile_.get(); }
+ PrefService* prefs() { return profile_->GetPrefs(); }
content::TestWebUI* web_ui() { return web_ui_.get(); }
printing::TestPrintPreviewHandler* handler() { return handler_; }
printing::TestPrinterHandler* printer_handler() { return printer_handler_; }
@@ -404,18 +419,36 @@ class PrintPreviewHandlerTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(PrintPreviewHandlerTest);
};
-TEST_F(PrintPreviewHandlerTest, InitialSettings) {
+TEST_F(PrintPreviewHandlerTest, InitialSettingsSimple) {
Initialize();
// Verify initial settings were sent.
ValidateInitialSettings(*web_ui()->call_data().back(),
printing::kDummyPrinterName,
- printing::kDummyInitiatorName);
+ printing::kDummyInitiatorName, base::nullopt);
// Check that the use-cloud-print event got sent
AssertWebUIEventFired(*web_ui()->call_data().front(), "use-cloud-print");
}
+TEST_F(PrintPreviewHandlerTest, InitialSettingsEnableHeaderFooter) {
+ // Set a pref that should take priority over StickySettings.
+ prefs()->SetBoolean(prefs::kPrintHeaderFooter, true);
+ Initialize();
+ ValidateInitialSettings(
+ *web_ui()->call_data().back(), printing::kDummyPrinterName,
+ printing::kDummyInitiatorName, base::Optional<bool>(true));
+}
+
+TEST_F(PrintPreviewHandlerTest, InitialSettingsDisableHeaderFooter) {
+ // Set a pref that should take priority over StickySettings.
+ prefs()->SetBoolean(prefs::kPrintHeaderFooter, false);
+ Initialize();
+ ValidateInitialSettings(
+ *web_ui()->call_data().back(), printing::kDummyPrinterName,
+ printing::kDummyInitiatorName, base::Optional<bool>(false));
+}
+
TEST_F(PrintPreviewHandlerTest, GetPrinters) {
Initialize();
@@ -636,7 +669,7 @@ TEST_F(PrintPreviewHandlerTest, SendPreviewUpdates) {
AssertWebUIEventFired(*web_ui()->call_data().back(), "page-layout-ready");
// 1 page document. Modifiable so send default 100 scaling.
- handler()->SendPageCountReady(1, preview_request_id, 100);
+ handler()->SendPageCountReady(1, 100, preview_request_id);
AssertWebUIEventFired(*web_ui()->call_data().back(), "page-count-ready");
// Page at index 0 is ready.
@@ -656,7 +689,7 @@ TEST_F(PrintPreviewHandlerTest, SendPreviewUpdates) {
handler()->SendPageLayoutReady(base::DictionaryValue(), false,
preview_request_id);
EXPECT_EQ(message_count, web_ui()->call_data().size());
- handler()->SendPageCountReady(1, 0, -1);
+ handler()->SendPageCountReady(1, -1, 0);
EXPECT_EQ(message_count, web_ui()->call_data().size());
handler()->OnPrintPreviewReady(0, 0);
EXPECT_EQ(message_count, web_ui()->call_data().size());
diff --git a/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
index 4d571af9601..8ecdea6626f 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -46,8 +46,8 @@
#include "content/public/browser/url_data_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
+#include "content/public/common/content_features.h"
#include "extensions/common/constants.h"
-#include "printing/buildflags/buildflags.h"
#include "printing/page_size_margins.h"
#include "printing/print_job_constants.h"
#include "ui/base/l10n/l10n_util.h"
@@ -431,7 +431,7 @@ void SetupPrintPreviewPlugin(content::WebUIDataSource* source) {
source->AddResourcePath("pdf/index.html", IDR_PDF_INDEX_HTML);
source->AddResourcePath("pdf/index.css", IDR_PDF_INDEX_CSS);
source->AddResourcePath("pdf/main.js", IDR_PDF_MAIN_JS);
- source->AddResourcePath("pdf/pdf.js", IDR_PDF_PDF_JS);
+ source->AddResourcePath("pdf/pdf_viewer.js", IDR_PDF_PDF_VIEWER_JS);
source->AddResourcePath("pdf/toolbar_manager.js", IDR_PDF_UI_MANAGER_JS);
source->AddResourcePath("pdf/pdf_fitting_type.js",
IDR_PDF_PDF_FITTING_TYPE_JS);
@@ -528,6 +528,10 @@ content::WebUIDataSource* CreateNewPrintPreviewUISource(Profile* profile) {
#if BUILDFLAG(OPTIMIZE_WEBUI)
source->AddResourcePath("crisper.js", IDR_PRINT_PREVIEW_CRISPER_JS);
source->SetDefaultResource(IDR_PRINT_PREVIEW_VULCANIZED_HTML);
+ source->SetDefaultResource(
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2) ?
+ IDR_PRINT_PREVIEW_VULCANIZED_P2_HTML :
+ IDR_PRINT_PREVIEW_VULCANIZED_HTML);
#else
for (size_t i = 0; i < kPrintPreviewResourcesSize; ++i) {
source->AddResourcePath(kPrintPreviewResources[i].name,
@@ -553,6 +557,14 @@ content::WebUIDataSource* CreatePrintPreviewUISource(Profile* profile) {
return source;
}
+PrintPreviewHandler* CreatePrintPreviewHandlers(content::WebUI* web_ui) {
+ auto handler = std::make_unique<PrintPreviewHandler>();
+ PrintPreviewHandler* handler_ptr = handler.get();
+ web_ui->AddMessageHandler(std::move(handler));
+ web_ui->AddMessageHandler(std::make_unique<MetricsHandler>());
+ return handler_ptr;
+}
+
} // namespace
PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui,
@@ -560,12 +572,7 @@ PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui,
: ConstrainedWebDialogUI(web_ui),
initial_preview_start_time_(base::TimeTicks::Now()),
id_(g_print_preview_ui_id_map.Get().Add(this)),
- handler_(nullptr),
- source_is_modifiable_(true),
- source_has_selection_(false),
- print_selection_only_(false),
- dialog_closed_(false) {
- handler_ = handler.get();
+ handler_(handler.get()) {
web_ui->AddMessageHandler(std::move(handler));
g_print_preview_request_id_map.Get().Set(id_, -1);
@@ -575,11 +582,7 @@ PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui)
: ConstrainedWebDialogUI(web_ui),
initial_preview_start_time_(base::TimeTicks::Now()),
id_(g_print_preview_ui_id_map.Get().Add(this)),
- handler_(nullptr),
- source_is_modifiable_(true),
- source_has_selection_(false),
- print_selection_only_(false),
- dialog_closed_(false) {
+ handler_(CreatePrintPreviewHandlers(web_ui)) {
// Set up the chrome://print/ data source.
Profile* profile = Profile::FromWebUI(web_ui);
@@ -594,12 +597,7 @@ PrintPreviewUI::PrintPreviewUI(content::WebUI* web_ui)
}
// Set up the chrome://theme/ source.
- content::URLDataSource::Add(profile, new ThemeSource(profile));
-
- auto handler = std::make_unique<PrintPreviewHandler>();
- handler_ = handler.get();
- web_ui->AddMessageHandler(std::move(handler));
- web_ui->AddMessageHandler(std::make_unique<MetricsHandler>());
+ content::URLDataSource::Add(profile, std::make_unique<ThemeSource>(profile));
g_print_preview_request_id_map.Get().Set(id_, -1);
}
@@ -646,15 +644,11 @@ void PrintPreviewUI::SetInitialParams(
}
// static
-void PrintPreviewUI::GetCurrentPrintPreviewStatus(
- const PrintHostMsg_PreviewIds& ids,
- bool* cancel) {
+bool PrintPreviewUI::ShouldCancelRequest(const PrintHostMsg_PreviewIds& ids) {
int current_id = -1;
- if (!g_print_preview_request_id_map.Get().Get(ids.ui_id, &current_id)) {
- *cancel = true;
- return;
- }
- *cancel = (ids.request_id != current_id);
+ if (!g_print_preview_request_id_map.Get().Get(ids.ui_id, &current_id))
+ return true;
+ return ids.request_id != current_id;
}
int32_t PrintPreviewUI::GetIDForPrintPreviewUI() const {
@@ -699,14 +693,14 @@ void PrintPreviewUI::OnPrintPreviewRequest(int request_id) {
g_print_preview_request_id_map.Get().Set(id_, request_id);
}
-void PrintPreviewUI::OnDidGetPreviewPageCount(
- const PrintHostMsg_DidGetPreviewPageCount_Params& params,
+void PrintPreviewUI::OnDidStartPreview(
+ const PrintHostMsg_DidStartPreview_Params& params,
int request_id) {
DCHECK_GT(params.page_count, 0);
if (g_testing_delegate)
g_testing_delegate->DidGetPreviewPageCount(params.page_count);
- handler_->SendPageCountReady(params.page_count, request_id,
- params.fit_to_page_scaling);
+ handler_->SendPageCountReady(params.page_count, params.fit_to_page_scaling,
+ request_id);
}
void PrintPreviewUI::OnDidGetDefaultPageLayout(
@@ -818,7 +812,7 @@ void PrintPreviewUI::SetDelegateForTesting(TestingDelegate* delegate) {
}
void PrintPreviewUI::SetSelectedFileForTesting(const base::FilePath& path) {
- handler_->FileSelectedForTesting(path, 0, NULL);
+ handler_->FileSelectedForTesting(path, 0, nullptr);
}
void PrintPreviewUI::SetPdfSavedClosureForTesting(
diff --git a/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.h b/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.h
index 336b9b82b34..6fc3581f8a8 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.h
+++ b/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui.h
@@ -15,10 +15,9 @@
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
-#include "printing/buildflags/buildflags.h"
class PrintPreviewHandler;
-struct PrintHostMsg_DidGetPreviewPageCount_Params;
+struct PrintHostMsg_DidStartPreview_Params;
struct PrintHostMsg_PreviewIds;
struct PrintHostMsg_RequestPrintPreview_Params;
struct PrintHostMsg_SetOptionsFromDocument_Params;
@@ -76,10 +75,9 @@ class PrintPreviewUI : public ConstrainedWebDialogUI {
const PrintHostMsg_RequestPrintPreview_Params& params);
// Determines whether to cancel a print preview request based on the request
- // and ui ids in |ids|.
+ // and UI ids in |ids|.
// Can be called from any thread.
- static void GetCurrentPrintPreviewStatus(const PrintHostMsg_PreviewIds& ids,
- bool* cancel);
+ static bool ShouldCancelRequest(const PrintHostMsg_PreviewIds& ids);
// Returns an id to uniquely identify this PrintPreviewUI.
int32_t GetIDForPrintPreviewUI() const;
@@ -87,10 +85,9 @@ class PrintPreviewUI : public ConstrainedWebDialogUI {
// Notifies the Web UI of a print preview request with |request_id|.
virtual void OnPrintPreviewRequest(int request_id);
- // Notifies the Web UI about the page count of the request preview.
- void OnDidGetPreviewPageCount(
- const PrintHostMsg_DidGetPreviewPageCount_Params& params,
- int request_id);
+ // Notifies the Web UI about the properties of the request preview.
+ void OnDidStartPreview(const PrintHostMsg_DidStartPreview_Params& params,
+ int request_id);
// Notifies the Web UI of the default page layout according to the currently
// selected printer and page size.
@@ -184,24 +181,24 @@ class PrintPreviewUI : public ConstrainedWebDialogUI {
const int32_t id_;
// Weak pointer to the WebUI handler.
- PrintPreviewHandler* handler_;
+ PrintPreviewHandler* const handler_;
// Indicates whether the source document can be modified.
- bool source_is_modifiable_;
+ bool source_is_modifiable_ = true;
// Indicates whether the source document has selection.
- bool source_has_selection_;
+ bool source_has_selection_ = false;
// Indicates whether only the selection should be printed.
- bool print_selection_only_;
+ bool print_selection_only_ = false;
+
+ // Keeps track of whether OnClosePrintPreviewDialog() has been called or not.
+ bool dialog_closed_ = false;
// Store the initiator title, used for populating the print preview dialog
// title.
base::string16 initiator_title_;
- // Keeps track of whether OnClosePrintPreviewDialog() has been called or not.
- bool dialog_closed_;
-
DISALLOW_COPY_AND_ASSIGN(PrintPreviewUI);
};
diff --git a/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc b/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc
index 4f8c3977135..b06ab2b7aa0 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/print_preview_ui_unittest.cc
@@ -31,7 +31,7 @@ namespace {
scoped_refptr<base::RefCountedBytes> CreateTestData() {
const unsigned char blob1[] =
- "12346102356120394751634516591348710478123649165419234519234512349134";
+ "%PDF-1.4123461023561203947516345165913487104781236491654192345192345";
std::vector<unsigned char> preview_data(blob1, blob1 + sizeof(blob1));
return base::MakeRefCounted<base::RefCountedBytes>(preview_data);
}
@@ -105,11 +105,6 @@ TEST_F(PrintPreviewUIUnitTest, PrintPreviewData) {
EXPECT_EQ(dummy_data->size(), data->size());
EXPECT_EQ(dummy_data.get(), data.get());
- // This should not cause any memory leaks.
- dummy_data = base::MakeRefCounted<base::RefCountedBytes>();
- preview_ui->SetPrintPreviewDataForIndex(printing::FIRST_PAGE_INDEX,
- dummy_data.get());
-
// Clear the preview data.
preview_ui->ClearAllPreviewData();
@@ -180,7 +175,7 @@ TEST_F(PrintPreviewUIUnitTest, PrintPreviewDraftPages) {
}
// Test the browser-side print preview cancellation functionality.
-TEST_F(PrintPreviewUIUnitTest, GetCurrentPrintPreviewStatus) {
+TEST_F(PrintPreviewUIUnitTest, ShouldCancelRequest) {
WebContents* initiator = browser()->tab_strip_model()->GetActiveWebContents();
ASSERT_TRUE(initiator);
@@ -201,38 +196,21 @@ TEST_F(PrintPreviewUIUnitTest, GetCurrentPrintPreviewStatus) {
preview_dialog->GetWebUI()->GetController());
ASSERT_TRUE(preview_ui);
- // Test with invalid |preview_ui_addr|.
- bool cancel = false;
+ // Test with invalid UI ID.
const int32_t kInvalidId = -5;
- preview_ui->GetCurrentPrintPreviewStatus(
- PrintHostMsg_PreviewIds(0, kInvalidId), &cancel);
- EXPECT_TRUE(cancel);
+ EXPECT_TRUE(preview_ui->ShouldCancelRequest({0, kInvalidId}));
const int kFirstRequestId = 1000;
const int kSecondRequestId = 1001;
- const int32_t preview_ui_addr = preview_ui->GetIDForPrintPreviewUI();
+ const int32_t preview_id = preview_ui->GetIDForPrintPreviewUI();
// Test with kFirstRequestId.
preview_ui->OnPrintPreviewRequest(kFirstRequestId);
- cancel = true;
- preview_ui->GetCurrentPrintPreviewStatus(
- PrintHostMsg_PreviewIds(kFirstRequestId, preview_ui_addr), &cancel);
- EXPECT_FALSE(cancel);
-
- cancel = false;
- preview_ui->GetCurrentPrintPreviewStatus(
- PrintHostMsg_PreviewIds(kSecondRequestId, preview_ui_addr), &cancel);
- EXPECT_TRUE(cancel);
+ EXPECT_FALSE(preview_ui->ShouldCancelRequest({kFirstRequestId, preview_id}));
+ EXPECT_TRUE(preview_ui->ShouldCancelRequest({kSecondRequestId, preview_id}));
// Test with kSecondRequestId.
preview_ui->OnPrintPreviewRequest(kSecondRequestId);
- cancel = false;
- preview_ui->GetCurrentPrintPreviewStatus(
- PrintHostMsg_PreviewIds(kFirstRequestId, preview_ui_addr), &cancel);
- EXPECT_TRUE(cancel);
-
- cancel = true;
- preview_ui->GetCurrentPrintPreviewStatus(
- PrintHostMsg_PreviewIds(kSecondRequestId, preview_ui_addr), &cancel);
- EXPECT_FALSE(cancel);
+ EXPECT_TRUE(preview_ui->ShouldCancelRequest({kFirstRequestId, preview_id}));
+ EXPECT_FALSE(preview_ui->ShouldCancelRequest({kSecondRequestId, preview_id}));
}
diff --git a/chromium/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc b/chromium/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc
index 77e5b23a2f3..746d0370739 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/privet_printer_handler.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/ui/webui/print_preview/print_preview_utils.h"
#include "chrome/common/chrome_switches.h"
#include "services/identity/public/cpp/identity_manager.h"
+#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "ui/gfx/geometry/size.h"
namespace {
@@ -140,7 +141,7 @@ void PrivetPrinterHandler::StartLister(
service_discovery_client_.get() == client.get());
service_discovery_client_ = client;
printer_lister_ = std::make_unique<cloud_print::PrivetLocalPrinterLister>(
- service_discovery_client_.get(), profile_->GetRequestContext(), this);
+ service_discovery_client_.get(), profile_->GetURLLoaderFactory(), this);
privet_lister_timer_ = std::make_unique<base::OneShotTimer>();
privet_lister_timer_->Start(FROM_HERE,
base::TimeDelta::FromSeconds(kSearchTimeoutSec),
@@ -274,7 +275,7 @@ void PrivetPrinterHandler::CreateHTTP(
privet_http_factory_ =
cloud_print::PrivetHTTPAsynchronousFactory::CreateInstance(
- profile_->GetRequestContext());
+ profile_->GetURLLoaderFactory());
privet_http_resolution_ = privet_http_factory_->CreatePrivetHTTP(name);
privet_http_resolution_->Start(device_description->address, callback);
}
diff --git a/chromium/chrome/browser/ui/webui/print_preview/sticky_settings.cc b/chromium/chrome/browser/ui/webui/print_preview/sticky_settings.cc
index e69c53e94b9..1d303aa5549 100644
--- a/chromium/chrome/browser/ui/webui/print_preview/sticky_settings.cc
+++ b/chromium/chrome/browser/ui/webui/print_preview/sticky_settings.cc
@@ -4,10 +4,7 @@
#include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
-#include <memory>
-
#include "base/values.h"
-#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
@@ -33,18 +30,19 @@ void StickySettings::StoreAppState(const std::string& data) {
}
void StickySettings::SaveInPrefs(PrefService* prefs) const {
- auto value = std::make_unique<base::DictionaryValue>();
+ base::Value dict(base::Value::Type::DICTIONARY);
if (printer_app_state_)
- value->SetString(kSettingAppState, printer_app_state_.value());
- prefs->Set(prefs::kPrintPreviewStickySettings, *value);
+ dict.SetKey(kSettingAppState, base::Value(*printer_app_state_));
+ prefs->Set(prefs::kPrintPreviewStickySettings, dict);
}
void StickySettings::RestoreFromPrefs(PrefService* prefs) {
const base::DictionaryValue* value =
prefs->GetDictionary(prefs::kPrintPreviewStickySettings);
- std::string buffer;
- if (value->GetString(kSettingAppState, &buffer))
- StoreAppState(buffer);
+ const base::Value* app_state =
+ value->FindKeyOfType(kSettingAppState, base::Value::Type::STRING);
+ if (app_state)
+ StoreAppState(app_state->GetString());
}
// static
diff --git a/chromium/chrome/browser/ui/webui/profile_helper.cc b/chromium/chrome/browser/ui/webui/profile_helper.cc
index 45e7d87e804..c980bfa5740 100644
--- a/chromium/chrome/browser/ui/webui/profile_helper.cc
+++ b/chromium/chrome/browser/ui/webui/profile_helper.cc
@@ -35,7 +35,7 @@ void ShowUserManager(const ProfileManager::CreateCallback& callback) {
g_browser_process->profile_manager()->CreateProfileAsync(
ProfileManager::GetSystemProfilePath(), callback, base::string16(),
- std::string(), std::string());
+ std::string());
}
std::string GetProfileUserName(Profile* profile) {
diff --git a/chromium/chrome/browser/ui/webui/profile_helper_browsertest.cc b/chromium/chrome/browser/ui/webui/profile_helper_browsertest.cc
index 37f4e959945..5c56ff86b96 100644
--- a/chromium/chrome/browser/ui/webui/profile_helper_browsertest.cc
+++ b/chromium/chrome/browser/ui/webui/profile_helper_browsertest.cc
@@ -36,7 +36,7 @@ Profile* CreateProfile() {
base::RunLoop run_loop;
profile_manager->CreateProfileAsync(
new_path, base::Bind(&UnblockOnProfileCreation, &run_loop),
- base::string16(), std::string(), std::string());
+ base::string16(), std::string());
run_loop.Run();
return profile_manager->GetProfileByPath(new_path);
}
diff --git a/chromium/chrome/browser/ui/webui/quota_internals/OWNERS b/chromium/chrome/browser/ui/webui/quota_internals/OWNERS
index 6fb5954d8c9..af949556e32 100644
--- a/chromium/chrome/browser/ui/webui/quota_internals/OWNERS
+++ b/chromium/chrome/browser/ui/webui/quota_internals/OWNERS
@@ -1,5 +1,6 @@
tzik@chromium.org
jsbell@chromium.org
+pwnall@chromium.org
# TEAM: storage-dev@chromium.org
# COMPONENT: Blink>Storage>Quota
diff --git a/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.cc b/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.cc
index c13d5fb59d5..268c322613d 100644
--- a/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.cc
+++ b/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/ui/webui/reset_password/reset_password_ui.h"
-#include "base/metrics/histogram_functions.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
@@ -32,12 +32,12 @@ constexpr char kStringTypeUMAName[] = "PasswordProtection.InterstitialString";
// Used for UMA metric logging. Please don't reorder.
// Indicates which type of strings are shown on this page.
-enum StringType {
+enum class StringType {
GENERIC_NO_ORG_NAME = 0,
GENERIC_WITH_ORG_NAME = 1,
WARNING_NO_ORG_NAME = 2,
WARNING_WITH_ORG_NAME = 3,
- STRING_TYPE_COUNT,
+ kMaxValue = WARNING_WITH_ORG_NAME,
};
// Implementation of mojom::ResetPasswordHander.
@@ -62,10 +62,9 @@ class ResetPasswordHandlerImpl : public mojom::ResetPasswordHandler {
safe_browsing::ChromePasswordProtectionService* service = safe_browsing::
ChromePasswordProtectionService::GetPasswordProtectionService(profile);
if (service) {
- service->OnUserAction(
- web_contents_, password_type_,
- safe_browsing::PasswordProtectionService::INTERSTITIAL,
- safe_browsing::PasswordProtectionService::CHANGE_PASSWORD);
+ service->OnUserAction(web_contents_, password_type_,
+ safe_browsing::WarningUIType::INTERSTITIAL,
+ safe_browsing::WarningAction::CHANGE_PASSWORD);
}
}
@@ -106,17 +105,15 @@ base::string16 GetFormattedHostName(const std::string host_name) {
} // namespace
ResetPasswordUI::ResetPasswordUI(content::WebUI* web_ui)
- : ui::MojoWebUIController(web_ui) {
- base::DictionaryValue load_time_data;
- password_type_ = GetPasswordType(web_ui->GetWebContents());
- PopulateStrings(web_ui->GetWebContents(), &load_time_data);
+ : ui::MojoWebUIController(web_ui),
+ password_type_(GetPasswordType(web_ui->GetWebContents())) {
std::unique_ptr<content::WebUIDataSource> html_source(
content::WebUIDataSource::Create(chrome::kChromeUIResetPasswordHost));
html_source->AddResourcePath("reset_password.js", IDR_RESET_PASSWORD_JS);
html_source->AddResourcePath("reset_password.mojom.js",
IDR_RESET_PASSWORD_MOJO_JS);
html_source->SetDefaultResource(IDR_RESET_PASSWORD_HTML);
- html_source->AddLocalizedStrings(load_time_data);
+ html_source->AddLocalizedStrings(PopulateStrings());
html_source->UseGzip();
content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
@@ -134,21 +131,18 @@ void ResetPasswordUI::BindResetPasswordHandler(
web_ui()->GetWebContents(), password_type_, std::move(request));
}
-void ResetPasswordUI::PopulateStrings(content::WebContents* web_contents,
- base::DictionaryValue* load_time_data) {
+base::DictionaryValue ResetPasswordUI::PopulateStrings() const {
std::string org_name =
safe_browsing::ChromePasswordProtectionService::
- GetPasswordProtectionService(
- Profile::FromBrowserContext(web_contents->GetBrowserContext()))
+ GetPasswordProtectionService(Profile::FromWebUI(web_ui()))
->GetOrganizationName(password_type_);
bool known_password_type =
password_type_ !=
safe_browsing::PasswordReuseEvent::REUSED_PASSWORD_TYPE_UNKNOWN;
if (!known_password_type) {
- base::UmaHistogramEnumeration(
+ UMA_HISTOGRAM_ENUMERATION(
safe_browsing::kInterstitialActionByUserNavigationHistogram,
- safe_browsing::PasswordProtectionService::SHOWN,
- safe_browsing::PasswordProtectionService::MAX_ACTION);
+ safe_browsing::WarningAction::SHOWN);
}
int heading_string_id = known_password_type
? IDS_RESET_PASSWORD_WARNING_HEADING
@@ -158,10 +152,10 @@ void ResetPasswordUI::PopulateStrings(content::WebContents* web_contents,
explanation_paragraph_string = l10n_util::GetStringUTF16(
known_password_type ? IDS_RESET_PASSWORD_WARNING_EXPLANATION_PARAGRAPH
: IDS_RESET_PASSWORD_EXPLANATION_PARAGRAPH);
- base::UmaHistogramEnumeration(
- kStringTypeUMAName,
- known_password_type ? WARNING_NO_ORG_NAME : GENERIC_NO_ORG_NAME,
- STRING_TYPE_COUNT);
+ UMA_HISTOGRAM_ENUMERATION(kStringTypeUMAName,
+ known_password_type
+ ? StringType::WARNING_NO_ORG_NAME
+ : StringType::GENERIC_NO_ORG_NAME);
} else {
base::string16 formatted_org_name = GetFormattedHostName(org_name);
explanation_paragraph_string = l10n_util::GetStringFUTF16(
@@ -169,18 +163,19 @@ void ResetPasswordUI::PopulateStrings(content::WebContents* web_contents,
? IDS_RESET_PASSWORD_WARNING_EXPLANATION_PARAGRAPH_WITH_ORG_NAME
: IDS_RESET_PASSWORD_EXPLANATION_PARAGRAPH_WITH_ORG_NAME,
formatted_org_name);
- base::UmaHistogramEnumeration(
- kStringTypeUMAName,
- known_password_type ? WARNING_WITH_ORG_NAME : GENERIC_WITH_ORG_NAME,
- STRING_TYPE_COUNT);
+ UMA_HISTOGRAM_ENUMERATION(kStringTypeUMAName,
+ known_password_type
+ ? StringType::WARNING_WITH_ORG_NAME
+ : StringType::GENERIC_WITH_ORG_NAME);
}
- load_time_data->SetString(
- "title", l10n_util::GetStringUTF16(IDS_RESET_PASSWORD_TITLE));
- load_time_data->SetString("heading",
- l10n_util::GetStringUTF16(heading_string_id));
- load_time_data->SetString("primaryParagraph", explanation_paragraph_string);
- load_time_data->SetString(
- "primaryButtonText",
- l10n_util::GetStringUTF16(IDS_RESET_PASSWORD_BUTTON));
+ base::DictionaryValue load_time_data;
+ load_time_data.SetString("title",
+ l10n_util::GetStringUTF16(IDS_RESET_PASSWORD_TITLE));
+ load_time_data.SetString("heading",
+ l10n_util::GetStringUTF16(heading_string_id));
+ load_time_data.SetString("primaryParagraph", explanation_paragraph_string);
+ load_time_data.SetString("primaryButtonText", l10n_util::GetStringUTF16(
+ IDS_RESET_PASSWORD_BUTTON));
+ return load_time_data;
}
diff --git a/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.h b/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.h
index 3519b553200..3f299695d7d 100644
--- a/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.h
+++ b/chromium/chrome/browser/ui/webui/reset_password/reset_password_ui.h
@@ -14,10 +14,6 @@ namespace base {
class DictionaryValue;
}
-namespace content {
-class WebContents;
-}
-
// The WebUI for chrome://reset-password/.
class ResetPasswordUI : public ui::MojoWebUIController {
public:
@@ -27,11 +23,10 @@ class ResetPasswordUI : public ui::MojoWebUIController {
private:
void BindResetPasswordHandler(mojom::ResetPasswordHandlerRequest request);
- void PopulateStrings(content::WebContents* web_content,
- base::DictionaryValue* load_time_data);
+ base::DictionaryValue PopulateStrings() const;
std::unique_ptr<mojom::ResetPasswordHandler> ui_handler_;
- safe_browsing::ReusedPasswordType password_type_;
+ const safe_browsing::ReusedPasswordType password_type_;
DISALLOW_COPY_AND_ASSIGN(ResetPasswordUI);
};
diff --git a/chromium/chrome/browser/ui/webui/sandbox_internals_ui.cc b/chromium/chrome/browser/ui/webui/sandbox_internals_ui.cc
index ea2ef9b4a88..0bab7ef7139 100644
--- a/chromium/chrome/browser/ui/webui/sandbox_internals_ui.cc
+++ b/chromium/chrome/browser/ui/webui/sandbox_internals_ui.cc
@@ -41,7 +41,14 @@ static void SetSandboxStatusData(content::WebUIDataSource* source) {
status & service_manager::SandboxLinux::kSeccompBPF);
source->AddBoolean("seccompTsync",
status & service_manager::SandboxLinux::kSeccompTSYNC);
- source->AddBoolean("yama", status & service_manager::SandboxLinux::kYama);
+ source->AddBoolean("yamaBroker",
+ status & service_manager::SandboxLinux::kYama);
+
+ // Yama does not enforce in user namespaces.
+ bool enforcing_yama_nonbroker =
+ status & service_manager::SandboxLinux::kYama &&
+ !(status & service_manager::SandboxLinux::kUserNS);
+ source->AddBoolean("yamaNonbroker", enforcing_yama_nonbroker);
// Require either the setuid or namespace sandbox for our first-layer sandbox.
bool good_layer1 = (status & service_manager::SandboxLinux::kSUID ||
diff --git a/chromium/chrome/browser/ui/webui/settings/about_handler.cc b/chromium/chrome/browser/ui/webui/settings/about_handler.cc
index 6a343a20086..06c2c95e34e 100644
--- a/chromium/chrome/browser/ui/webui/settings/about_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/about_handler.cc
@@ -20,7 +20,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/time/time.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -30,14 +30,14 @@
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_pages.h"
-#include "chrome/browser/upgrade_detector.h"
+#include "chrome/browser/upgrade_detector/upgrade_detector.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_content_client.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
-#include "components/google/core/browser/google_util.h"
+#include "components/google/core/common/google_util.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/policy_constants.h"
#include "components/strings/grit/components_chromium_strings.h"
@@ -284,11 +284,9 @@ AboutHandler* AboutHandler::Create(content::WebUIDataSource* html_source,
? IDS_VERSION_UI_OFFICIAL
: IDS_VERSION_UI_UNOFFICIAL),
base::UTF8ToUTF16(chrome::GetChannelName()),
-#if defined(ARCH_CPU_64_BITS)
- l10n_util::GetStringUTF16(IDS_VERSION_UI_64BIT)));
-#else
- l10n_util::GetStringUTF16(IDS_VERSION_UI_32BIT)));
-#endif
+ l10n_util::GetStringUTF16(sizeof(void*) == 8
+ ? IDS_VERSION_UI_64BIT
+ : IDS_VERSION_UI_32BIT)));
html_source->AddString(
"aboutProductCopyright",
diff --git a/chromium/chrome/browser/ui/webui/settings/about_handler.h b/chromium/chrome/browser/ui/webui/settings/about_handler.h
index 4c8ae08a292..6395f3060ef 100644
--- a/chromium/chrome/browser/ui/webui/settings/about_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/about_handler.h
@@ -15,7 +15,7 @@
#include "build/build_config.h"
#include "chrome/browser/ui/webui/help/version_updater.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
-#include "chrome/browser/upgrade_observer.h"
+#include "chrome/browser/upgrade_detector/upgrade_observer.h"
#include "components/policy/core/common/policy_service.h"
#include "content/public/browser/web_ui_message_handler.h"
diff --git a/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc b/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc
index dd9e351b7e1..5d5acfd7aed 100644
--- a/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc
@@ -30,9 +30,8 @@ void TriggerTPMFirmwareUpdate(
using chromeos::tpm_firmware_update::Mode;
// Decide which update mode to use.
- // TODO(crbug.com/854576): Re-add Mode::kPreserveDeviceState after fixing
- // interrupted update flow issue described in the bug.
- for (Mode mode : {Mode::kPowerwash}) {
+ for (Mode mode :
+ {Mode::kPreserveDeviceState, Mode::kPowerwash, Mode::kCleanup}) {
if (available_modes.count(mode) == 0) {
continue;
}
diff --git a/chromium/chrome/browser/ui/webui/settings/change_password_handler.cc b/chromium/chrome/browser/ui/webui/settings/change_password_handler.cc
index 090962aebcf..01225cba2aa 100644
--- a/chromium/chrome/browser/ui/webui/settings/change_password_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/change_password_handler.cc
@@ -52,12 +52,11 @@ void ChangePasswordHandler::HandleInitialize(const base::ListValue* args) {
}
void ChangePasswordHandler::HandleChangePassword(const base::ListValue* args) {
- service_->OnUserAction(
- web_ui()->GetWebContents(),
- safe_browsing::LoginReputationClientRequest::PasswordReuseEvent::
- SIGN_IN_PASSWORD,
- safe_browsing::PasswordProtectionService::CHROME_SETTINGS,
- safe_browsing::PasswordProtectionService::CHANGE_PASSWORD);
+ service_->OnUserAction(web_ui()->GetWebContents(),
+ safe_browsing::LoginReputationClientRequest::
+ PasswordReuseEvent::SIGN_IN_PASSWORD,
+ safe_browsing::WarningUIType::CHROME_SETTINGS,
+ safe_browsing::WarningAction::CHANGE_PASSWORD);
}
void ChangePasswordHandler::UpdateChangePasswordCardVisibility() {
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc
index 44240697552..56f573121d0 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -37,6 +38,14 @@ void AccessibilityHandler::RegisterMessages() {
"showSwitchAccessSettings",
base::BindRepeating(&AccessibilityHandler::HandleShowSwitchAccessSettings,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "getStartupSoundEnabled",
+ base::BindRepeating(&AccessibilityHandler::HandleGetStartupSoundEnabled,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setStartupSoundEnabled",
+ base::BindRepeating(&AccessibilityHandler::HandleSetStartupSoundEnabled,
+ base::Unretained(this)));
}
void AccessibilityHandler::HandleShowChromeVoxSettings(
@@ -54,6 +63,22 @@ void AccessibilityHandler::HandleShowSwitchAccessSettings(
OpenExtensionOptionsPage(extension_misc::kSwitchAccessExtensionId);
}
+void AccessibilityHandler::HandleGetStartupSoundEnabled(
+ const base::ListValue* args) {
+ AllowJavascript();
+ FireWebUIListener(
+ "startup-sound-enabled-updated",
+ base::Value(AccessibilityManager::Get()->GetStartupSoundEnabled()));
+}
+
+void AccessibilityHandler::HandleSetStartupSoundEnabled(
+ const base::ListValue* args) {
+ DCHECK_EQ(1U, args->GetSize());
+ bool enabled;
+ args->GetBoolean(0, &enabled);
+ AccessibilityManager::Get()->SetStartupSoundEnabled(enabled);
+}
+
void AccessibilityHandler::OpenExtensionOptionsPage(const char extension_id[]) {
const extensions::Extension* extension =
extensions::ExtensionRegistry::Get(profile_)->GetExtensionById(
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h b/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h
index d03c83e2ea6..26f284ad260 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h
@@ -37,6 +37,8 @@ class AccessibilityHandler : public ::settings::SettingsPageUIHandler {
void HandleShowChromeVoxSettings(const base::ListValue* args);
void HandleShowSelectToSpeakSettings(const base::ListValue* args);
void HandleShowSwitchAccessSettings(const base::ListValue* args);
+ void HandleGetStartupSoundEnabled(const base::ListValue* args);
+ void HandleSetStartupSoundEnabled(const base::ListValue* args);
void OpenExtensionOptionsPage(const char extension_id[]);
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.cc
index 66d0c0748cd..125e1427992 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.cc
@@ -25,11 +25,36 @@
namespace chromeos {
namespace settings {
+namespace {
+
+AccountManager::AccountKey GetAccountKeyFromJsCallback(
+ const base::DictionaryValue* const dictionary) {
+ const base::Value* id_value = dictionary->FindKey("id");
+ DCHECK(id_value);
+ const std::string id = id_value->GetString();
+ DCHECK(!id.empty());
+
+ const base::Value* account_type_value = dictionary->FindKey("accountType");
+ DCHECK(account_type_value);
+ const int account_type_int = account_type_value->GetInt();
+ DCHECK((account_type_int >=
+ account_manager::AccountType::ACCOUNT_TYPE_UNSPECIFIED) &&
+ (account_type_int <=
+ account_manager::AccountType::ACCOUNT_TYPE_ACTIVE_DIRECTORY));
+ const account_manager::AccountType account_type =
+ static_cast<account_manager::AccountType>(account_type_int);
+
+ return AccountManager::AccountKey{id, account_type};
+}
+
+} // namespace
+
AccountManagerUIHandler::AccountManagerUIHandler(
AccountManager* account_manager,
AccountTrackerService* account_tracker_service)
: account_manager_(account_manager),
account_tracker_service_(account_tracker_service),
+ account_mapper_util_(account_tracker_service_),
weak_factory_(this) {
DCHECK(account_manager_);
DCHECK(account_tracker_service_);
@@ -52,6 +77,10 @@ void AccountManagerUIHandler::RegisterMessages() {
"addAccount",
base::BindRepeating(&AccountManagerUIHandler::HandleAddAccount,
weak_factory_.GetWeakPtr()));
+ web_ui()->RegisterMessageCallback(
+ "removeAccount",
+ base::BindRepeating(&AccountManagerUIHandler::HandleRemoveAccount,
+ weak_factory_.GetWeakPtr()));
}
void AccountManagerUIHandler::HandleGetAccounts(const base::ListValue* args) {
@@ -92,23 +121,25 @@ void AccountManagerUIHandler::GetAccountsCallbackHandler(
}
base::DictionaryValue account;
+ account.SetString("id", account_key.id);
+ account.SetInteger("accountType", account_key.account_type);
+ account.SetBoolean("isDeviceAccount", false);
account.SetString("fullName", account_info.full_name);
account.SetString("email", account_info.email);
gfx::Image icon =
account_tracker_service_->GetAccountImage(account_info.account_id);
account.SetString("pic", webui::GetBitmapDataUrl(icon.AsBitmap()));
- // |account_key| is a GAIA account and hence |id| is the obfuscated GAIA id
- // (see |AccountManager::AccountKey|)
- if (account_key.id != device_account_id.GetGaiaId()) {
- accounts.GetList().push_back(std::move(account));
- } else {
+ if (account_mapper_util_.IsEqual(account_key, device_account_id)) {
device_account = std::move(account);
+ } else {
+ accounts.GetList().push_back(std::move(account));
}
}
// Device account must show up at the top.
if (!device_account.empty()) {
+ device_account.SetBoolean("isDeviceAccount", true);
accounts.GetList().insert(accounts.GetList().begin(),
std::move(device_account));
}
@@ -121,6 +152,27 @@ void AccountManagerUIHandler::HandleAddAccount(const base::ListValue* args) {
InlineLoginHandlerDialogChromeOS::Show();
}
+void AccountManagerUIHandler::HandleRemoveAccount(const base::ListValue* args) {
+ AllowJavascript();
+
+ const base::DictionaryValue* dictionary = nullptr;
+ args->GetList()[0].GetAsDictionary(&dictionary);
+ DCHECK(dictionary);
+
+ const AccountId device_account_id =
+ ProfileHelper::Get()
+ ->GetUserByProfile(Profile::FromWebUI(web_ui()))
+ ->GetAccountId();
+ const AccountManager::AccountKey account_key =
+ GetAccountKeyFromJsCallback(dictionary);
+ if (account_mapper_util_.IsEqual(account_key, device_account_id)) {
+ // It should not be possible to remove a device account.
+ return;
+ }
+
+ account_manager_->RemoveAccount(account_key);
+}
+
void AccountManagerUIHandler::OnJavascriptAllowed() {}
void AccountManagerUIHandler::OnJavascriptDisallowed() {}
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h b/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h
index 078a51cb189..b1b0b4a6a00 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "chrome/browser/chromeos/account_mapper_util.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
#include "chromeos/account_manager/account_manager.h"
#include "components/signin/core/browser/account_tracker_service.h"
@@ -51,6 +52,9 @@ class AccountManagerUIHandler : public ::settings::SettingsPageUIHandler,
// WebUI "addAccount" message callback.
void HandleAddAccount(const base::ListValue* args);
+ // WebUI "removeAccount" message callback.
+ void HandleRemoveAccount(const base::ListValue* args);
+
// |AccountManager::GetAccounts| callback.
void GetAccountsCallbackHandler(
base::Value callback_id,
@@ -65,6 +69,8 @@ class AccountManagerUIHandler : public ::settings::SettingsPageUIHandler,
// A non-owning pointer to |AccountTrackerService|.
AccountTrackerService* const account_tracker_service_;
+ chromeos::AccountMapperUtil account_mapper_util_;
+
base::WeakPtrFactory<AccountManagerUIHandler> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(AccountManagerUIHandler);
};
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
index 3c61e3ba330..cb6f001014e 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
@@ -15,7 +15,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -322,7 +322,8 @@ void CupsPrintersHandler::HandleUpdateCupsPrinter(const base::ListValue* args) {
"kUserNativePrintersAllowed is set to false";
// Used to log UMA metrics.
OnAddedPrinterCommon(printer,
- PrinterSetupResult::kNativePrintersNotAllowed);
+ PrinterSetupResult::kNativePrintersNotAllowed,
+ false);
// Used to fire the web UI listener.
OnAddPrinterError(PrinterSetupResult::kNativePrintersNotAllowed);
return;
@@ -495,7 +496,8 @@ void CupsPrintersHandler::HandleAddCupsPrinter(const base::ListValue* args) {
"kUserNativePrintersAllowed is set to false";
// Used to log UMA metrics.
OnAddedPrinterCommon(*printer,
- PrinterSetupResult::kNativePrintersNotAllowed);
+ PrinterSetupResult::kNativePrintersNotAllowed,
+ false);
// Used to fire the web UI listener.
OnAddPrinterError(PrinterSetupResult::kNativePrintersNotAllowed);
return;
@@ -588,7 +590,8 @@ void CupsPrintersHandler::HandleAddCupsPrinter(const base::ListValue* args) {
}
void CupsPrintersHandler::OnAddedPrinterCommon(const Printer& printer,
- PrinterSetupResult result_code) {
+ PrinterSetupResult result_code,
+ bool is_automatic) {
UMA_HISTOGRAM_ENUMERATION("Printing.CUPS.PrinterSetupResult", result_code,
PrinterSetupResult::kMaxValue);
switch (result_code) {
@@ -596,7 +599,7 @@ void CupsPrintersHandler::OnAddedPrinterCommon(const Printer& printer,
UMA_HISTOGRAM_ENUMERATION("Printing.CUPS.PrinterAdded",
printer.GetProtocol(), Printer::kProtocolMax);
PRINTER_LOG(USER) << "Performing printer setup";
- printers_manager_->PrinterInstalled(printer);
+ printers_manager_->PrinterInstalled(printer, is_automatic);
printers_manager_->UpdateConfiguredPrinter(printer);
return;
case PrinterSetupResult::kPpdNotFound:
@@ -641,7 +644,7 @@ void CupsPrintersHandler::OnAddedPrinterCommon(const Printer& printer,
void CupsPrintersHandler::OnAddedDiscoveredPrinter(
const Printer& printer,
PrinterSetupResult result_code) {
- OnAddedPrinterCommon(printer, result_code);
+ OnAddedPrinterCommon(printer, result_code, true);
if (result_code == PrinterSetupResult::kSuccess) {
FireWebUIListener("on-add-cups-printer", base::Value(result_code),
base::Value(printer.display_name()));
@@ -657,7 +660,7 @@ void CupsPrintersHandler::OnAddedSpecifiedPrinter(
const Printer& printer,
PrinterSetupResult result_code) {
PRINTER_LOG(EVENT) << "Add manual printer: " << result_code;
- OnAddedPrinterCommon(printer, result_code);
+ OnAddedPrinterCommon(printer, result_code, false);
FireWebUIListener("on-add-cups-printer", base::Value(result_code),
base::Value(printer.display_name()));
}
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h b/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h
index 447eecb1d69..741b87e13db 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.h
@@ -138,7 +138,8 @@ class CupsPrintersHandler : public ::settings::SettingsPageUIHandler,
// Code common between the discovered and manual add printer code paths.
void OnAddedPrinterCommon(const Printer& printer,
- PrinterSetupResult result_code);
+ PrinterSetupResult result_code,
+ bool is_automatic);
// CupsPrintersManager::Observer override:
void OnPrintersChanged(CupsPrintersManager::PrinterClass printer_class,
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc
index a54f351b8b7..be85dd83362 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc
@@ -14,18 +14,32 @@
#include "content/public/browser/web_ui.h"
#include "content/public/common/service_manager_connection.h"
#include "services/service_manager/public/cpp/connector.h"
+#include "ui/chromeos/events/event_rewriter_chromeos.h"
#include "ui/events/devices/input_device_manager.h"
namespace {
-bool HasExternalKeyboard() {
+struct KeyboardsStateResult {
+ bool has_external_non_apple_keyboard = false;
+ bool has_apple_keyboard = false;
+};
+
+KeyboardsStateResult GetKeyboardsState() {
+ KeyboardsStateResult result;
for (const ui::InputDevice& keyboard :
ui::InputDeviceManager::GetInstance()->GetKeyboardDevices()) {
- if (keyboard.type == ui::InputDeviceType::INPUT_DEVICE_EXTERNAL)
- return true;
+ const ui::EventRewriterChromeOS::DeviceType type =
+ ui::EventRewriterChromeOS::GetDeviceType(keyboard);
+ if (type == ui::EventRewriterChromeOS::kDeviceAppleKeyboard) {
+ result.has_apple_keyboard = true;
+ } else if (type ==
+ ui::EventRewriterChromeOS::kDeviceExternalNonAppleKeyboard ||
+ type == ui::EventRewriterChromeOS::kDeviceExternalUnknown) {
+ result.has_external_non_apple_keyboard = true;
+ }
}
- return false;
+ return result;
}
} // namespace
@@ -115,14 +129,25 @@ void KeyboardHandler::UpdateKeyboards() {
void KeyboardHandler::UpdateShowKeys() {
// kHasChromeOSKeyboard will be unset on Chromebooks that have standalone Caps
// Lock keys.
- const base::Value has_caps_lock(
- HasExternalKeyboard() ||
- !base::CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kHasChromeOSKeyboard));
- const base::Value has_diamond_key(
+ const KeyboardsStateResult keyboards_state = GetKeyboardsState();
+ const bool has_caps_lock = keyboards_state.has_apple_keyboard ||
+ keyboards_state.has_external_non_apple_keyboard ||
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kHasChromeOSKeyboard);
+ const bool has_diamond_key =
base::CommandLine::ForCurrentProcess()->HasSwitch(
- chromeos::switches::kHasChromeOSDiamondKey));
- FireWebUIListener(kShowKeysChangedName, has_caps_lock, has_diamond_key);
+ chromeos::switches::kHasChromeOSDiamondKey);
+
+ base::Value keyboard_params(base::Value::Type::DICTIONARY);
+ keyboard_params.SetKey("showCapsLock", base::Value(has_caps_lock));
+ keyboard_params.SetKey("showDiamondKey", base::Value(has_diamond_key));
+ keyboard_params.SetKey(
+ "showExternalMetaKey",
+ base::Value(keyboards_state.has_external_non_apple_keyboard));
+ keyboard_params.SetKey("showAppleCommandKey",
+ base::Value(keyboards_state.has_apple_keyboard));
+
+ FireWebUIListener(kShowKeysChangedName, keyboard_params);
}
} // namespace settings
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc
index c875a4480ff..7fd0854ab0a 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler_unittest.cc
@@ -12,7 +12,7 @@
#include "base/observer_list.h"
#include "chromeos/chromeos_switches.h"
#include "content/public/test/test_web_ui.h"
-#include "services/ui/public/cpp/input_devices/input_device_client_test_api.h"
+#include "services/ws/public/cpp/input_devices/input_device_client_test_api.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/devices/input_device.h"
@@ -45,7 +45,9 @@ class KeyboardHandlerTest : public testing::Test {
// which keys should be shown. False is returned if the message was invalid or
// not found.
bool GetLastShowKeysChangedMessage(bool* has_caps_lock_out,
- bool* has_diamond_key_out)
+ bool* has_diamond_key_out,
+ bool* has_external_meta_key_out,
+ bool* has_apple_command_key_out)
WARN_UNUSED_RESULT {
for (auto it = web_ui_.call_data().rbegin();
it != web_ui_.call_data().rend(); ++it) {
@@ -56,8 +58,29 @@ class KeyboardHandlerTest : public testing::Test {
name != KeyboardHandler::kShowKeysChangedName) {
continue;
}
- return data->arg2()->GetAsBoolean(has_caps_lock_out) &&
- data->arg3()->GetAsBoolean(has_diamond_key_out);
+
+ if (!data->arg2() ||
+ data->arg2()->type() != base::Value::Type::DICTIONARY) {
+ return false;
+ }
+
+ const base::Value* keyboard_params = data->arg2();
+ const std::vector<std::pair<std::string, bool*>> path_to_out_param = {
+ {"showCapsLock", has_caps_lock_out},
+ {"showDiamondKey", has_diamond_key_out},
+ {"showExternalMetaKey", has_external_meta_key_out},
+ {"showAppleCommandKey", has_apple_command_key_out},
+ };
+
+ for (const auto& pair : path_to_out_param) {
+ auto* found = keyboard_params->FindKey(pair.first);
+ if (!found)
+ return false;
+
+ *(pair.second) = found->GetBool();
+ }
+
+ return true;
}
return false;
}
@@ -66,8 +89,10 @@ class KeyboardHandlerTest : public testing::Test {
// is present and false otherwise. A failure is added if a message wasn't
// found.
bool HasCapsLock() {
- bool has_caps_lock = false, has_diamond_key = false;
- if (!GetLastShowKeysChangedMessage(&has_caps_lock, &has_diamond_key)) {
+ bool has_caps_lock = false;
+ bool ignored = false;
+ if (!GetLastShowKeysChangedMessage(&has_caps_lock, &ignored, &ignored,
+ &ignored)) {
ADD_FAILURE() << "Didn't get " << KeyboardHandler::kShowKeysChangedName;
return false;
}
@@ -78,15 +103,45 @@ class KeyboardHandlerTest : public testing::Test {
// is present and false otherwise. A failure is added if a message wasn't
// found.
bool HasDiamondKey() {
- bool has_caps_lock = false, has_diamond_key = false;
- if (!GetLastShowKeysChangedMessage(&has_caps_lock, &has_diamond_key)) {
+ bool has_diamond_key = false;
+ bool ignored = false;
+ if (!GetLastShowKeysChangedMessage(&ignored, &has_diamond_key, &ignored,
+ &ignored)) {
ADD_FAILURE() << "Didn't get " << KeyboardHandler::kShowKeysChangedName;
return false;
}
return has_diamond_key;
}
- ui::InputDeviceClientTestApi input_device_client_test_api_;
+ // Returns true if the last keys-changed message reported that a Meta key on
+ // an external keyboard is present and false otherwise. A failure is added if
+ // a message wasn't found.
+ bool HasExternalMetaKey() {
+ bool has_external_meta = false;
+ bool ignored = false;
+ if (!GetLastShowKeysChangedMessage(&ignored, &ignored, &has_external_meta,
+ &ignored)) {
+ ADD_FAILURE() << "Didn't get " << KeyboardHandler::kShowKeysChangedName;
+ return false;
+ }
+ return has_external_meta;
+ }
+
+ // Returns true if the last keys-changed message reported that a Command key
+ // on an Apple keyboard is present and false otherwise. A failure is added if
+ // a message wasn't found.
+ bool HasAppleCommandKey() {
+ bool has_apple_command_key = false;
+ bool ignored = false;
+ if (!GetLastShowKeysChangedMessage(&ignored, &ignored, &ignored,
+ &has_apple_command_key)) {
+ ADD_FAILURE() << "Didn't get " << KeyboardHandler::kShowKeysChangedName;
+ return false;
+ }
+ return has_apple_command_key;
+ }
+
+ ws::InputDeviceClientTestApi input_device_client_test_api_;
content::TestWebUI web_ui_;
TestKeyboardHandler handler_;
KeyboardHandler::TestAPI handler_test_api_;
@@ -101,6 +156,8 @@ TEST_F(KeyboardHandlerTest, DefaultKeys) {
handler_test_api_.Initialize();
EXPECT_FALSE(HasCapsLock());
EXPECT_FALSE(HasDiamondKey());
+ EXPECT_FALSE(HasExternalMetaKey());
+ EXPECT_FALSE(HasAppleCommandKey());
}
TEST_F(KeyboardHandlerTest, NonChromeOSKeyboard) {
@@ -109,6 +166,8 @@ TEST_F(KeyboardHandlerTest, NonChromeOSKeyboard) {
handler_test_api_.Initialize();
EXPECT_TRUE(HasCapsLock());
EXPECT_FALSE(HasDiamondKey());
+ EXPECT_FALSE(HasExternalMetaKey());
+ EXPECT_FALSE(HasAppleCommandKey());
}
TEST_F(KeyboardHandlerTest, ExternalKeyboard) {
@@ -120,18 +179,54 @@ TEST_F(KeyboardHandlerTest, ExternalKeyboard) {
handler_test_api_.Initialize();
EXPECT_FALSE(HasCapsLock());
EXPECT_FALSE(HasDiamondKey());
+ EXPECT_FALSE(HasExternalMetaKey());
+ EXPECT_FALSE(HasAppleCommandKey());
// Simulate an external keyboard being connected. We should assume there's a
- // Caps Lock key now.
+ // Caps Lock and Meta keys now.
input_device_client_test_api_.SetKeyboardDevices(std::vector<ui::InputDevice>{
{2, ui::INPUT_DEVICE_EXTERNAL, "external keyboard"}});
EXPECT_TRUE(HasCapsLock());
EXPECT_FALSE(HasDiamondKey());
+ EXPECT_TRUE(HasExternalMetaKey());
+ EXPECT_FALSE(HasAppleCommandKey());
+
+ // Simulate an external Apple keyboard being connected. Now users can remap
+ // the command key.
+ input_device_client_test_api_.SetKeyboardDevices(std::vector<ui::InputDevice>{
+ {3, ui::INPUT_DEVICE_EXTERNAL, "Apple Inc. Apple Keyboard"}});
+ EXPECT_TRUE(HasCapsLock());
+ EXPECT_FALSE(HasDiamondKey());
+ EXPECT_FALSE(HasExternalMetaKey());
+ EXPECT_TRUE(HasAppleCommandKey());
+
+ // Simulate two external keyboards (Apple and non-Apple) are connected at the
+ // same time.
+ input_device_client_test_api_.SetKeyboardDevices(std::vector<ui::InputDevice>{
+ {2, ui::INPUT_DEVICE_EXTERNAL, "external keyboard"},
+ {3, ui::INPUT_DEVICE_EXTERNAL, "Apple Inc. Apple Keyboard"}});
+ EXPECT_TRUE(HasCapsLock());
+ EXPECT_FALSE(HasDiamondKey());
+ EXPECT_TRUE(HasExternalMetaKey());
+ EXPECT_TRUE(HasAppleCommandKey());
+
+ // Some keyboard devices don't report the string "keyboard" as part of their
+ // device names. Those should also be detcted as external keyboards, and
+ // should show the capslock and external meta remapping.
+ // https://crbug.com/834594.
+ input_device_client_test_api_.SetKeyboardDevices(std::vector<ui::InputDevice>{
+ {4, ui::INPUT_DEVICE_EXTERNAL, "Topre Corporation Realforce 87"}});
+ EXPECT_TRUE(HasCapsLock());
+ EXPECT_FALSE(HasDiamondKey());
+ EXPECT_TRUE(HasExternalMetaKey());
+ EXPECT_FALSE(HasAppleCommandKey());
// Disconnect the external keyboard and check that the key goes away.
input_device_client_test_api_.SetKeyboardDevices({});
EXPECT_FALSE(HasCapsLock());
EXPECT_FALSE(HasDiamondKey());
+ EXPECT_FALSE(HasExternalMetaKey());
+ EXPECT_FALSE(HasAppleCommandKey());
}
TEST_F(KeyboardHandlerTest, DiamondKey) {
@@ -142,6 +237,8 @@ TEST_F(KeyboardHandlerTest, DiamondKey) {
handler_test_api_.Initialize();
EXPECT_FALSE(HasCapsLock());
EXPECT_TRUE(HasDiamondKey());
+ EXPECT_FALSE(HasExternalMetaKey());
+ EXPECT_FALSE(HasAppleCommandKey());
}
} // namespace settings
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
index 9b221939c81..cf29c548765 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/device_storage_handler.cc
@@ -11,7 +11,7 @@
#include "base/files/file_util.h"
#include "base/sys_info.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/browsing_data_appcache_helper.h"
#include "chrome/browser/browsing_data/browsing_data_cache_storage_helper.h"
@@ -187,7 +187,7 @@ void StorageHandler::UpdateDownloadsSize() {
file_manager::util::GetDownloadsFolderForProfile(profile_);
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&base::ComputeDirectorySize, downloads_path),
base::Bind(&StorageHandler::OnGetDownloadsSize,
weak_ptr_factory_.GetWeakPtr()));
@@ -363,7 +363,7 @@ void StorageHandler::UpdateOtherUsersSize() {
continue;
other_users_.push_back(user);
DBusThreadManager::Get()->GetCryptohomeClient()->GetAccountDiskUsage(
- cryptohome::Identification(user->GetAccountId()),
+ cryptohome::CreateAccountIdentifierFromAccountId(user->GetAccountId()),
base::BindOnce(&StorageHandler::OnGetOtherUserSize,
weak_ptr_factory_.GetWeakPtr()));
}
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc
index 95fdc49d9a7..7058fb6c087 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.cc
@@ -55,13 +55,13 @@ std::unique_ptr<base::DictionaryValue> GetFingerprintsInfo(
} // namespace
FingerprintHandler::FingerprintHandler(Profile* profile)
- : profile_(profile), binding_(this), weak_ptr_factory_(this) {
+ : profile_(profile),
+ binding_(this),
+ session_observer_(this),
+ weak_ptr_factory_(this) {
service_manager::Connector* connector =
content::ServiceManagerConnection::GetForProcess()->GetConnector();
connector->BindInterface(device::mojom::kServiceName, &fp_service_);
- device::mojom::FingerprintObserverPtr observer;
- binding_.Bind(mojo::MakeRequest(&observer));
- fp_service_->AddFingerprintObserver(std::move(observer));
user_id_ = ProfileHelper::Get()->GetUserIdHashFromProfile(profile);
}
@@ -110,12 +110,16 @@ void FingerprintHandler::RegisterMessages() {
void FingerprintHandler::OnJavascriptAllowed() {
// SessionManager may not exist in some tests.
if (SessionManager::Get())
- SessionManager::Get()->AddObserver(this);
+ session_observer_.Add(SessionManager::Get());
+
+ device::mojom::FingerprintObserverPtr observer;
+ binding_.Bind(mojo::MakeRequest(&observer));
+ fp_service_->AddFingerprintObserver(std::move(observer));
}
void FingerprintHandler::OnJavascriptDisallowed() {
- if (SessionManager::Get())
- SessionManager::Get()->RemoveObserver(this);
+ session_observer_.RemoveAll();
+ binding_.Close();
}
void FingerprintHandler::OnRestarted() {}
@@ -123,6 +127,10 @@ void FingerprintHandler::OnRestarted() {}
void FingerprintHandler::OnEnrollScanDone(uint32_t scan_result,
bool enroll_session_complete,
int percent_complete) {
+ VLOG(1) << "Receive fingerprint enroll scan result. scan_result="
+ << scan_result
+ << ", enroll_session_complete=" << enroll_session_complete
+ << ", percent_complete=" << percent_complete;
auto scan_attempt = std::make_unique<base::DictionaryValue>();
scan_attempt->SetInteger("result", scan_result);
scan_attempt->SetBoolean("isComplete", enroll_session_complete);
@@ -134,6 +142,8 @@ void FingerprintHandler::OnEnrollScanDone(uint32_t scan_result,
void FingerprintHandler::OnAuthScanDone(
uint32_t scan_result,
const base::flat_map<std::string, std::vector<std::string>>& matches) {
+ VLOG(1) << "Receive fingerprint auth scan result. scan_result="
+ << scan_result;
if (SessionManager::Get()->session_state() == SessionState::LOCKED)
return;
@@ -160,7 +170,9 @@ void FingerprintHandler::OnAuthScanDone(
FireWebUIListener("on-fingerprint-attempt-received", *fingerprint_attempt);
}
-void FingerprintHandler::OnSessionFailed() {}
+void FingerprintHandler::OnSessionFailed() {
+ LOG(ERROR) << "Fingerprint session failed.";
+}
void FingerprintHandler::OnSessionStateChanged() {
SessionState state = SessionManager::Get()->session_state();
@@ -214,6 +226,8 @@ void FingerprintHandler::HandleGetNumFingerprints(const base::ListValue* args) {
}
void FingerprintHandler::HandleStartEnroll(const base::ListValue* args) {
+ AllowJavascript();
+
// Determines what the newly added fingerprint's name should be.
for (int i = 1; i <= kMaxAllowedFingerprints; ++i) {
std::string fingerprint_name = l10n_util::GetStringFUTF8(
@@ -228,6 +242,7 @@ void FingerprintHandler::HandleStartEnroll(const base::ListValue* args) {
void FingerprintHandler::HandleCancelCurrentEnroll(
const base::ListValue* args) {
+ AllowJavascript();
fp_service_->CancelCurrentEnrollSession(
base::Bind(&FingerprintHandler::OnCancelCurrentEnrollSession,
weak_ptr_factory_.GetWeakPtr()));
@@ -307,11 +322,13 @@ void FingerprintHandler::OnSetRecordLabel(const std::string& callback_id,
void FingerprintHandler::HandleStartAuthentication(
const base::ListValue* args) {
+ AllowJavascript();
fp_service_->StartAuthSession();
}
void FingerprintHandler::HandleEndCurrentAuthentication(
const base::ListValue* args) {
+ AllowJavascript();
fp_service_->EndCurrentAuthSession(
base::Bind(&FingerprintHandler::OnEndCurrentAuthSession,
weak_ptr_factory_.GetWeakPtr()));
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h b/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h
index d3518f18970..db0c60aec42 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_FINGERPRINT_HANDLER_H_
#include "base/containers/flat_map.h"
+#include "base/scoped_observer.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
#include "components/session_manager/core/session_manager_observer.h"
#include "mojo/public/cpp/bindings/binding.h"
@@ -17,6 +18,10 @@ namespace base {
class ListValue;
} // namespace base
+namespace session_manager {
+class SessionManager;
+} // namespace session_manager
+
namespace chromeos {
namespace settings {
@@ -76,6 +81,9 @@ class FingerprintHandler : public ::settings::SettingsPageUIHandler,
device::mojom::FingerprintPtr fp_service_;
mojo::Binding<device::mojom::FingerprintObserver> binding_;
+ ScopedObserver<session_manager::SessionManager,
+ session_manager::SessionManagerObserver>
+ session_observer_;
base::WeakPtrFactory<FingerprintHandler> weak_ptr_factory_;
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/google_assistant_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/google_assistant_handler.cc
index f9263067b4a..ee3fc39b648 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/google_assistant_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/google_assistant_handler.cc
@@ -6,11 +6,16 @@
#include <utility>
+#include "ash/public/interfaces/assistant_controller.mojom.h"
+#include "ash/public/interfaces/constants.mojom.h"
#include "base/bind.h"
#include "base/values.h"
#include "chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_framework_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chromeos/chromeos_switches.h"
#include "components/arc/arc_service_manager.h"
+#include "content/public/browser/browser_context.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "ui/gfx/geometry/rect.h"
namespace chromeos {
@@ -72,6 +77,16 @@ void GoogleAssistantHandler::HandleSetGoogleAssistantContextEnabled(
void GoogleAssistantHandler::HandleShowGoogleAssistantSettings(
const base::ListValue* args) {
+ if (chromeos::switches::IsAssistantEnabled()) {
+ // Opens Google Assistant settings.
+ service_manager::Connector* connector =
+ content::BrowserContext::GetConnectorFor(profile_);
+ ash::mojom::AssistantControllerPtr assistant_controller;
+ connector->BindInterface(ash::mojom::kServiceName, &assistant_controller);
+ assistant_controller->OpenAssistantSettings();
+ return;
+ }
+
auto* service =
arc::ArcVoiceInteractionFrameworkService::GetForBrowserContext(profile_);
if (service)
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc
index 8dc3a46c55f..7a4c8bed26e 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/internet_handler.cc
@@ -21,6 +21,7 @@
#include "components/arc/arc_service_manager.h"
#include "components/arc/common/net.mojom.h"
#include "components/arc/connection_holder.h"
+#include "components/arc/metrics/arc_metrics_constants.h"
#include "components/onc/onc_constants.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
@@ -186,16 +187,16 @@ void InternetHandler::ConfigureThirdPartyVpn(const base::ListValue* args) {
return;
}
- if (network->vpn_provider_type() == shill::kProviderThirdPartyVpn) {
+ if (network->GetVpnProviderType() == shill::kProviderThirdPartyVpn) {
// Request that the third-party VPN provider used by the |network| show a
// configuration dialog for it.
VpnServiceFactory::GetForBrowserContext(profile_)
- ->SendShowConfigureDialogToExtension(network->vpn_provider_id(),
+ ->SendShowConfigureDialogToExtension(network->vpn_provider()->id,
network->name());
return;
}
- if (network->vpn_provider_type() == shill::kProviderArcVpn) {
+ if (network->GetVpnProviderType() == shill::kProviderArcVpn) {
auto* net_instance = ARC_GET_INSTANCE_FOR_METHOD(
arc::ArcServiceManager::Get()->arc_bridge_service()->net(),
ConfigureAndroidVpn);
@@ -208,7 +209,7 @@ void InternetHandler::ConfigureThirdPartyVpn(const base::ListValue* args) {
}
NET_LOG(ERROR) << "ConfigureThirdPartyVpn: Unsupported VPN type: "
- << network->vpn_provider_type() << " For: " << guid;
+ << network->GetVpnProviderType() << " For: " << guid;
}
void InternetHandler::RequestArcVpnProviders(const base::ListValue* args) {
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.cc
index ca84973cd35..36ef94d7f31 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.cc
@@ -7,24 +7,101 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
+#include "chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl.h"
#include "chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_dialog.h"
+#include "chromeos/components/proximity_auth/logging/logging.h"
#include "content/public/browser/web_ui.h"
namespace chromeos {
namespace settings {
-MultideviceHandler::MultideviceHandler() = default;
-MultideviceHandler::~MultideviceHandler() = default;
+namespace {
-void MultideviceHandler::OnJavascriptAllowed() {}
-void MultideviceHandler::OnJavascriptDisallowed() {}
+const char kPageContentDataModeKey[] = "mode";
+const char kPageContentDataHostDeviceNameKey[] = "hostDeviceName";
+const char kPageContentDataBetterTogetherStateKey[] = "betterTogetherState";
+const char kPageContentDataInstantTetheringStateKey[] = "instantTetheringState";
+const char kPageContentDataMessagesStateKey[] = "messagesState";
+const char kPageContentDataSmartLockStateKey[] = "smartLockState";
+
+void OnRetrySetHostNowResult(bool success) {
+ if (success)
+ return;
+
+ PA_LOG(WARNING) << "OnRetrySetHostNowResult(): Attempt to retry setting the "
+ << "host device failed.";
+}
+
+} // namespace
+
+MultideviceHandler::MultideviceHandler(
+ multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
+ std::unique_ptr<multidevice_setup::AndroidSmsAppHelperDelegate>
+ android_sms_app_helper)
+ : multidevice_setup_client_(multidevice_setup_client),
+ android_sms_app_helper_(std::move(android_sms_app_helper)),
+ multidevice_setup_observer_(this),
+ callback_weak_ptr_factory_(this) {}
+
+MultideviceHandler::~MultideviceHandler() {}
void MultideviceHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
"showMultiDeviceSetupDialog",
base::BindRepeating(&MultideviceHandler::HandleShowMultiDeviceSetupDialog,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "getPageContentData",
+ base::BindRepeating(&MultideviceHandler::HandleGetPageContent,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setFeatureEnabledState",
+ base::BindRepeating(&MultideviceHandler::HandleSetFeatureEnabledState,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "removeHostDevice",
+ base::BindRepeating(&MultideviceHandler::HandleRemoveHostDevice,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "retryPendingHostSetup",
+ base::BindRepeating(&MultideviceHandler::HandleRetryPendingHostSetup,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setUpAndroidSms",
+ base::BindRepeating(&MultideviceHandler::HandleSetUpAndroidSms,
+ base::Unretained(this)));
+}
+
+void MultideviceHandler::OnJavascriptAllowed() {
+ multidevice_setup_observer_.Add(multidevice_setup_client_);
+}
+
+void MultideviceHandler::OnJavascriptDisallowed() {
+ multidevice_setup_observer_.Remove(multidevice_setup_client_);
+
+ // Ensure that pending callbacks do not complete and cause JS to be evaluated.
+ callback_weak_ptr_factory_.InvalidateWeakPtrs();
+}
+
+void MultideviceHandler::OnHostStatusChanged(
+ const multidevice_setup::MultiDeviceSetupClient::HostStatusWithDevice&
+ host_status_with_device) {
+ UpdatePageContent();
+}
+
+void MultideviceHandler::OnFeatureStatesChanged(
+ const multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap&
+ feature_states_map) {
+ UpdatePageContent();
+}
+
+void MultideviceHandler::UpdatePageContent() {
+ std::unique_ptr<base::DictionaryValue> page_content_dictionary =
+ GeneratePageContentDataDictionary();
+ DCHECK(page_content_dictionary);
+ FireWebUIListener("settings.updateMultidevicePageContentData",
+ *page_content_dictionary);
}
void MultideviceHandler::HandleShowMultiDeviceSetupDialog(
@@ -33,6 +110,113 @@ void MultideviceHandler::HandleShowMultiDeviceSetupDialog(
multidevice_setup::MultiDeviceSetupDialog::Show();
}
+void MultideviceHandler::HandleGetPageContent(const base::ListValue* args) {
+ // This callback is expected to be the first one executed when the page is
+ // loaded, so it should be the one to allow JS calls.
+ AllowJavascript();
+
+ std::string callback_id;
+ bool result = args->GetString(0, &callback_id);
+ DCHECK(result);
+
+ std::unique_ptr<base::DictionaryValue> page_content_dictionary =
+ GeneratePageContentDataDictionary();
+ DCHECK(page_content_dictionary);
+
+ ResolveJavascriptCallback(base::Value(callback_id), *page_content_dictionary);
+}
+
+void MultideviceHandler::HandleSetFeatureEnabledState(
+ const base::ListValue* args) {
+ std::string callback_id;
+ bool result = args->GetString(0, &callback_id);
+ DCHECK(result);
+
+ int feature_as_int;
+ result = args->GetInteger(1, &feature_as_int);
+ DCHECK(result);
+
+ auto feature = static_cast<multidevice_setup::mojom::Feature>(feature_as_int);
+ DCHECK(multidevice_setup::mojom::IsKnownEnumValue(feature));
+
+ bool enabled;
+ result = args->GetBoolean(2, &enabled);
+ DCHECK(result);
+
+ base::Optional<std::string> auth_token;
+ std::string possible_token_value;
+ if (args->GetString(3, &possible_token_value))
+ auth_token = possible_token_value;
+
+ multidevice_setup_client_->SetFeatureEnabledState(
+ feature, enabled, auth_token,
+ base::BindOnce(&MultideviceHandler::OnSetFeatureStateEnabledResult,
+ callback_weak_ptr_factory_.GetWeakPtr(), callback_id));
+}
+
+void MultideviceHandler::HandleRemoveHostDevice(const base::ListValue* args) {
+ DCHECK(args->empty());
+ multidevice_setup_client_->RemoveHostDevice();
+}
+
+void MultideviceHandler::HandleRetryPendingHostSetup(
+ const base::ListValue* args) {
+ DCHECK(args->empty());
+ multidevice_setup_client_->RetrySetHostNow(
+ base::BindOnce(&OnRetrySetHostNowResult));
+}
+
+void MultideviceHandler::HandleSetUpAndroidSms(const base::ListValue* args) {
+ PA_LOG(WARNING) << "HandlingSetupSms";
+ DCHECK(args->empty());
+ android_sms_app_helper_->LaunchAndroidSmsApp();
+}
+
+void MultideviceHandler::OnSetFeatureStateEnabledResult(
+ const std::string& js_callback_id,
+ bool success) {
+ ResolveJavascriptCallback(base::Value(js_callback_id), base::Value(success));
+}
+
+std::unique_ptr<base::DictionaryValue>
+MultideviceHandler::GeneratePageContentDataDictionary() {
+ auto page_content_dictionary = std::make_unique<base::DictionaryValue>();
+
+ multidevice_setup::MultiDeviceSetupClient::HostStatusWithDevice
+ host_status_with_device = multidevice_setup_client_->GetHostStatus();
+ multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap feature_states =
+ multidevice_setup_client_->GetFeatureStates();
+
+ page_content_dictionary->SetInteger(
+ kPageContentDataModeKey,
+ static_cast<int32_t>(host_status_with_device.first));
+ page_content_dictionary->SetInteger(
+ kPageContentDataBetterTogetherStateKey,
+ static_cast<int32_t>(
+ feature_states
+ [multidevice_setup::mojom::Feature::kBetterTogetherSuite]));
+ page_content_dictionary->SetInteger(
+ kPageContentDataInstantTetheringStateKey,
+ static_cast<int32_t>(
+ feature_states
+ [multidevice_setup::mojom::Feature::kInstantTethering]));
+ page_content_dictionary->SetInteger(
+ kPageContentDataMessagesStateKey,
+ static_cast<int32_t>(
+ feature_states[multidevice_setup::mojom::Feature::kMessages]));
+ page_content_dictionary->SetInteger(
+ kPageContentDataSmartLockStateKey,
+ static_cast<int32_t>(
+ feature_states[multidevice_setup::mojom::Feature::kSmartLock]));
+
+ if (host_status_with_device.second) {
+ page_content_dictionary->SetString(kPageContentDataHostDeviceNameKey,
+ host_status_with_device.second->name());
+ }
+
+ return page_content_dictionary;
+}
+
} // namespace settings
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.h b/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.h
index 3ab88522348..cc5e9037e95 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler.h
@@ -6,27 +6,78 @@
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_CHROMEOS_MULTIDEVICE_HANDLER_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
+#include "chromeos/services/multidevice_setup/public/cpp/multidevice_setup_client.h"
+#include "chromeos/services/multidevice_setup/public/mojom/multidevice_setup.mojom.h"
+#include "components/cryptauth/remote_device_ref.h"
namespace chromeos {
+namespace multidevice_setup {
+class AndroidSmsAppHelperDelegate;
+} // namespace multidevice_setup
+
namespace settings {
// Chrome "Multidevice" (a.k.a. "Connected Devices") settings page UI handler.
-class MultideviceHandler : public ::settings::SettingsPageUIHandler {
+class MultideviceHandler
+ : public ::settings::SettingsPageUIHandler,
+ public multidevice_setup::MultiDeviceSetupClient::Observer {
public:
- MultideviceHandler();
+ explicit MultideviceHandler(
+ multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
+ std::unique_ptr<multidevice_setup::AndroidSmsAppHelperDelegate>
+ android_sms_app_helper);
~MultideviceHandler() override;
+ protected:
// content::WebUIMessageHandler:
void RegisterMessages() override;
+ private:
// ::settings::SettingsPageUIHandler:
void OnJavascriptAllowed() override;
void OnJavascriptDisallowed() override;
- private:
+ // multidevice_setup::MultiDeviceSetupClient::Observer:
+ void OnHostStatusChanged(
+ const multidevice_setup::MultiDeviceSetupClient::HostStatusWithDevice&
+ host_status_with_device) override;
+ void OnFeatureStatesChanged(
+ const multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap&
+ feature_states_map) override;
+
+ // Sends the most recent PageContentData dictionary to the WebUI page as an
+ // update (e.g., not due to a getPageContent() request).
+ void UpdatePageContent();
+
void HandleShowMultiDeviceSetupDialog(const base::ListValue* args);
+ void HandleGetPageContent(const base::ListValue* args);
+ void HandleSetFeatureEnabledState(const base::ListValue* args);
+ void HandleRemoveHostDevice(const base::ListValue* args);
+ void HandleRetryPendingHostSetup(const base::ListValue* args);
+ void HandleSetUpAndroidSms(const base::ListValue* args);
+
+ void OnSetFeatureStateEnabledResult(const std::string& js_callback_id,
+ bool success);
+
+ // Returns null if requisite data has not yet been fetched (i.e., if one or
+ // both of |last_host_status_update_| and |last_feature_states_update_| is
+ // null).
+ std::unique_ptr<base::DictionaryValue> GeneratePageContentDataDictionary();
+
+ multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client_;
+ std::unique_ptr<multidevice_setup::AndroidSmsAppHelperDelegate>
+ android_sms_app_helper_;
+
+ ScopedObserver<multidevice_setup::MultiDeviceSetupClient,
+ multidevice_setup::MultiDeviceSetupClient::Observer>
+ multidevice_setup_observer_;
+
+ // Used to cancel callbacks when JavaScript becomes disallowed.
+ base::WeakPtrFactory<MultideviceHandler> callback_weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(MultideviceHandler);
};
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc
new file mode 100644
index 00000000000..658795d6c18
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/multidevice_handler_unittest.cc
@@ -0,0 +1,330 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/settings/chromeos/multidevice_handler.h"
+
+#include <memory>
+
+#include "base/macros.h"
+#include "chromeos/services/multidevice_setup/public/cpp/fake_android_sms_app_helper_delegate.h"
+#include "chromeos/services/multidevice_setup/public/cpp/fake_multidevice_setup_client.h"
+#include "components/cryptauth/remote_device_test_util.h"
+#include "content/public/test/test_web_ui.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromeos {
+
+namespace settings {
+
+namespace {
+
+class TestMultideviceHandler : public MultideviceHandler {
+ public:
+ TestMultideviceHandler(
+ multidevice_setup::MultiDeviceSetupClient* multidevice_setup_client,
+ std::unique_ptr<multidevice_setup::AndroidSmsAppHelperDelegate>
+ android_sms_app_helper)
+ : MultideviceHandler(multidevice_setup_client,
+ std::move(android_sms_app_helper)) {}
+ ~TestMultideviceHandler() override = default;
+
+ // Make public for testing.
+ using MultideviceHandler::AllowJavascript;
+ using MultideviceHandler::RegisterMessages;
+ using MultideviceHandler::set_web_ui;
+};
+
+multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap
+GenerateDefaultFeatureStatesMap() {
+ return multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap{
+ {multidevice_setup::mojom::Feature::kBetterTogetherSuite,
+ multidevice_setup::mojom::FeatureState::kUnavailableNoVerifiedHost},
+ {multidevice_setup::mojom::Feature::kInstantTethering,
+ multidevice_setup::mojom::FeatureState::kUnavailableNoVerifiedHost},
+ {multidevice_setup::mojom::Feature::kMessages,
+ multidevice_setup::mojom::FeatureState::kUnavailableNoVerifiedHost},
+ {multidevice_setup::mojom::Feature::kSmartLock,
+ multidevice_setup::mojom::FeatureState::kUnavailableNoVerifiedHost}};
+}
+
+void VerifyPageContentDict(
+ const base::Value* value,
+ multidevice_setup::mojom::HostStatus expected_host_status,
+ const base::Optional<cryptauth::RemoteDeviceRef>& expected_host_device,
+ const multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap&
+ feature_states_map) {
+ const base::DictionaryValue* page_content_dict;
+ EXPECT_TRUE(value->GetAsDictionary(&page_content_dict));
+
+ int mode;
+ EXPECT_TRUE(page_content_dict->GetInteger("mode", &mode));
+ EXPECT_EQ(static_cast<int>(expected_host_status), mode);
+
+ int better_together_state;
+ EXPECT_TRUE(page_content_dict->GetInteger("betterTogetherState",
+ &better_together_state));
+ auto it = feature_states_map.find(
+ multidevice_setup::mojom::Feature::kBetterTogetherSuite);
+ EXPECT_EQ(static_cast<int>(it->second), better_together_state);
+
+ int instant_tethering_state;
+ EXPECT_TRUE(page_content_dict->GetInteger("instantTetheringState",
+ &instant_tethering_state));
+ it = feature_states_map.find(
+ multidevice_setup::mojom::Feature::kInstantTethering);
+ EXPECT_EQ(static_cast<int>(it->second), instant_tethering_state);
+
+ int messages_state;
+ EXPECT_TRUE(page_content_dict->GetInteger("messagesState", &messages_state));
+ it = feature_states_map.find(multidevice_setup::mojom::Feature::kMessages);
+ EXPECT_EQ(static_cast<int>(it->second), messages_state);
+
+ int smart_lock_state;
+ EXPECT_TRUE(
+ page_content_dict->GetInteger("smartLockState", &smart_lock_state));
+ it = feature_states_map.find(multidevice_setup::mojom::Feature::kSmartLock);
+ EXPECT_EQ(static_cast<int>(it->second), smart_lock_state);
+
+ std::string host_device_name;
+ if (expected_host_device) {
+ EXPECT_TRUE(
+ page_content_dict->GetString("hostDeviceName", &host_device_name));
+ EXPECT_EQ(expected_host_device->name(), host_device_name);
+ } else {
+ EXPECT_FALSE(
+ page_content_dict->GetString("hostDeviceName", &host_device_name));
+ }
+}
+
+} // namespace
+
+class MultideviceHandlerTest : public testing::Test {
+ protected:
+ MultideviceHandlerTest()
+ : test_device_(cryptauth::CreateRemoteDeviceRefForTest()) {}
+ ~MultideviceHandlerTest() override = default;
+
+ // testing::Test:
+ void SetUp() override {
+ test_web_ui_ = std::make_unique<content::TestWebUI>();
+
+ fake_multidevice_setup_client_ =
+ std::make_unique<multidevice_setup::FakeMultiDeviceSetupClient>();
+ auto fake_android_sms_app_helper_delegate =
+ std::make_unique<multidevice_setup::FakeAndroidSmsAppHelperDelegate>();
+ fake_android_sms_app_helper_delegate_ =
+ fake_android_sms_app_helper_delegate.get();
+
+ handler_ = std::make_unique<TestMultideviceHandler>(
+ fake_multidevice_setup_client_.get(),
+ std::move(fake_android_sms_app_helper_delegate));
+ handler_->set_web_ui(test_web_ui_.get());
+ handler_->RegisterMessages();
+ handler_->AllowJavascript();
+ }
+
+ void CallGetPageContentData() {
+ size_t call_data_count_before_call = test_web_ui()->call_data().size();
+
+ base::ListValue args;
+ args.AppendString("handlerFunctionName");
+ test_web_ui()->HandleReceivedMessage("getPageContentData", &args);
+
+ EXPECT_EQ(call_data_count_before_call + 1u,
+ test_web_ui()->call_data().size());
+
+ const content::TestWebUI::CallData& call_data =
+ CallDataAtIndex(call_data_count_before_call);
+ EXPECT_EQ("cr.webUIResponse", call_data.function_name());
+ EXPECT_EQ("handlerFunctionName", call_data.arg1()->GetString());
+ EXPECT_TRUE(call_data.arg2()->GetBool());
+ VerifyPageContent(call_data.arg3());
+ }
+
+ void CallRemoveHostDevice() {
+ size_t num_remote_host_device_calls_before_call =
+ fake_multidevice_setup_client()->num_remove_host_device_called();
+ base::ListValue empty_args;
+ test_web_ui()->HandleReceivedMessage("removeHostDevice", &empty_args);
+ EXPECT_EQ(num_remote_host_device_calls_before_call + 1u,
+ fake_multidevice_setup_client()->num_remove_host_device_called());
+ }
+
+ void SimulateHostStatusUpdate(
+ multidevice_setup::mojom::HostStatus host_status,
+ const base::Optional<cryptauth::RemoteDeviceRef>& host_device) {
+ size_t call_data_count_before_call = test_web_ui()->call_data().size();
+
+ fake_multidevice_setup_client_->SetHostStatusWithDevice(
+ std::make_pair(host_status, host_device));
+ EXPECT_EQ(call_data_count_before_call + 1u,
+ test_web_ui()->call_data().size());
+
+ const content::TestWebUI::CallData& call_data =
+ CallDataAtIndex(call_data_count_before_call);
+ EXPECT_EQ("cr.webUIListenerCallback", call_data.function_name());
+ EXPECT_EQ("settings.updateMultidevicePageContentData",
+ call_data.arg1()->GetString());
+ VerifyPageContent(call_data.arg2());
+ }
+
+ void SimulateFeatureStatesUpdate(
+ const multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap&
+ feature_states_map) {
+ size_t call_data_count_before_call = test_web_ui()->call_data().size();
+
+ fake_multidevice_setup_client_->SetFeatureStates(feature_states_map);
+ EXPECT_EQ(call_data_count_before_call + 1u,
+ test_web_ui()->call_data().size());
+
+ const content::TestWebUI::CallData& call_data =
+ CallDataAtIndex(call_data_count_before_call);
+ EXPECT_EQ("cr.webUIListenerCallback", call_data.function_name());
+ EXPECT_EQ("settings.updateMultidevicePageContentData",
+ call_data.arg1()->GetString());
+ VerifyPageContent(call_data.arg2());
+ }
+
+ void CallRetryPendingHostSetup(bool success) {
+ base::ListValue empty_args;
+ test_web_ui()->HandleReceivedMessage("retryPendingHostSetup", &empty_args);
+ fake_multidevice_setup_client()->InvokePendingRetrySetHostNowCallback(
+ success);
+ }
+
+ void CallSetUpAndroidSms() {
+ base::ListValue empty_args;
+ test_web_ui()->HandleReceivedMessage("setUpAndroidSms", &empty_args);
+ }
+
+ void CallSetFeatureEnabledState(multidevice_setup::mojom::Feature feature,
+ bool enabled,
+ const base::Optional<std::string>& auth_token,
+ bool success) {
+ size_t call_data_count_before_call = test_web_ui()->call_data().size();
+
+ base::ListValue args;
+ args.AppendString("handlerFunctionName");
+ args.AppendInteger(static_cast<int>(feature));
+ args.AppendBoolean(enabled);
+ if (auth_token)
+ args.AppendString(*auth_token);
+
+ base::ListValue empty_args;
+ test_web_ui()->HandleReceivedMessage("setFeatureEnabledState", &args);
+ fake_multidevice_setup_client()
+ ->InvokePendingSetFeatureEnabledStateCallback(
+ feature /* expected_feature */, enabled /* expected_enabled */,
+ auth_token /* expected_auth_token */, success);
+
+ EXPECT_EQ(call_data_count_before_call + 1u,
+ test_web_ui()->call_data().size());
+ const content::TestWebUI::CallData& call_data =
+ CallDataAtIndex(call_data_count_before_call);
+ EXPECT_EQ("cr.webUIResponse", call_data.function_name());
+ EXPECT_EQ("handlerFunctionName", call_data.arg1()->GetString());
+ EXPECT_TRUE(call_data.arg2()->GetBool());
+ EXPECT_EQ(success, call_data.arg3()->GetBool());
+ }
+
+ const content::TestWebUI::CallData& CallDataAtIndex(size_t index) {
+ return *test_web_ui_->call_data()[index];
+ }
+
+ content::TestWebUI* test_web_ui() { return test_web_ui_.get(); }
+
+ multidevice_setup::FakeMultiDeviceSetupClient*
+ fake_multidevice_setup_client() {
+ return fake_multidevice_setup_client_.get();
+ }
+
+ multidevice_setup::FakeAndroidSmsAppHelperDelegate*
+ fake_android_sms_app_helper_delegate() {
+ return fake_android_sms_app_helper_delegate_;
+ }
+
+ const cryptauth::RemoteDeviceRef test_device_;
+
+ private:
+ void VerifyPageContent(const base::Value* value) {
+ VerifyPageContentDict(
+ value, fake_multidevice_setup_client_->GetHostStatus().first,
+ fake_multidevice_setup_client_->GetHostStatus().second,
+ fake_multidevice_setup_client_->GetFeatureStates());
+ }
+
+ std::unique_ptr<content::TestWebUI> test_web_ui_;
+ std::unique_ptr<multidevice_setup::FakeMultiDeviceSetupClient>
+ fake_multidevice_setup_client_;
+ std::unique_ptr<TestMultideviceHandler> handler_;
+
+ multidevice_setup::MultiDeviceSetupClient::HostStatusWithDevice
+ host_status_with_device_;
+ multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap
+ feature_states_map_;
+ multidevice_setup::FakeAndroidSmsAppHelperDelegate*
+ fake_android_sms_app_helper_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(MultideviceHandlerTest);
+};
+
+TEST_F(MultideviceHandlerTest, PageContentData) {
+ CallGetPageContentData();
+ CallGetPageContentData();
+
+ SimulateHostStatusUpdate(
+ multidevice_setup::mojom::HostStatus::kEligibleHostExistsButNoHostSet,
+ base::nullopt /* host_device */);
+ SimulateHostStatusUpdate(multidevice_setup::mojom::HostStatus::
+ kHostSetLocallyButWaitingForBackendConfirmation,
+ test_device_);
+ SimulateHostStatusUpdate(
+ multidevice_setup::mojom::HostStatus::kHostSetButNotYetVerified,
+ test_device_);
+ SimulateHostStatusUpdate(multidevice_setup::mojom::HostStatus::kHostVerified,
+ test_device_);
+
+ multidevice_setup::MultiDeviceSetupClient::FeatureStatesMap
+ feature_states_map = GenerateDefaultFeatureStatesMap();
+ feature_states_map[multidevice_setup::mojom::Feature::kBetterTogetherSuite] =
+ multidevice_setup::mojom::FeatureState::kEnabledByUser;
+ SimulateFeatureStatesUpdate(feature_states_map);
+
+ feature_states_map[multidevice_setup::mojom::Feature::kBetterTogetherSuite] =
+ multidevice_setup::mojom::FeatureState::kDisabledByUser;
+ SimulateFeatureStatesUpdate(feature_states_map);
+}
+
+TEST_F(MultideviceHandlerTest, RetryPendingHostSetup) {
+ CallRetryPendingHostSetup(true /* success */);
+ CallRetryPendingHostSetup(false /* success */);
+}
+
+TEST_F(MultideviceHandlerTest, SetUpAndroidSms) {
+ EXPECT_FALSE(fake_android_sms_app_helper_delegate()->HasLaunchedApp());
+ CallSetUpAndroidSms();
+ EXPECT_TRUE(fake_android_sms_app_helper_delegate()->HasLaunchedApp());
+}
+
+TEST_F(MultideviceHandlerTest, SetFeatureEnabledState) {
+ CallSetFeatureEnabledState(
+ multidevice_setup::mojom::Feature::kBetterTogetherSuite,
+ true /* enabled */, "authToken" /* auth_token */, true /* success */);
+ CallSetFeatureEnabledState(
+ multidevice_setup::mojom::Feature::kBetterTogetherSuite,
+ false /* enabled */, "authToken" /* auth_token */, false /* success */);
+ CallSetFeatureEnabledState(
+ multidevice_setup::mojom::Feature::kBetterTogetherSuite,
+ false /* enabled */, "authToken" /* auth_token */, true /* success */);
+}
+
+TEST_F(MultideviceHandlerTest, RemoveHostDevice) {
+ CallRemoveHostDevice();
+ CallRemoveHostDevice();
+ CallRemoveHostDevice();
+}
+
+} // namespace settings
+
+} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/settings/chromeos/smb_handler.cc b/chromium/chrome/browser/ui/webui/settings/chromeos/smb_handler.cc
index 8a5af4ee012..ff52076ee4e 100644
--- a/chromium/chrome/browser/ui/webui/settings/chromeos/smb_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/chromeos/smb_handler.cc
@@ -20,11 +20,17 @@ namespace {
smb_client::SmbService* GetSmbService(Profile* profile) {
smb_client::SmbService* const service = smb_client::SmbService::Get(profile);
- DCHECK(service);
-
return service;
}
+base::Value BuildShareList(const std::vector<smb_client::SmbUrl>& shares) {
+ base::Value shares_list(base::Value::Type::LIST);
+ for (const auto& share : shares) {
+ shares_list.GetList().push_back(base::Value(share.ToString()));
+ }
+ return shares_list;
+}
+
} // namespace
SmbHandler::SmbHandler(Profile* profile)
@@ -54,6 +60,9 @@ void SmbHandler::HandleSmbMount(const base::ListValue* args) {
CHECK(args->GetString(3, &password));
smb_client::SmbService* const service = GetSmbService(profile_);
+ if (!service) {
+ return;
+ }
chromeos::file_system_provider::MountOptions mo;
mo.display_name = mount_name.empty() ? mount_url : mount_name;
@@ -79,6 +88,9 @@ void SmbHandler::HandleSmbMountResponse(SmbMountResult result) {
void SmbHandler::HandleStartDiscovery(const base::ListValue* args) {
smb_client::SmbService* const service = GetSmbService(profile_);
+ if (!service) {
+ return;
+ }
service->GatherSharesInNetwork(base::BindRepeating(
&SmbHandler::HandleGatherSharesResponse, weak_ptr_factory_.GetWeakPtr()));
@@ -91,9 +103,10 @@ void SmbHandler::HandleGatherSharesResponse(
std::move(stored_mount_call_).Run();
}
- // TODO(zentaro): Pass the shares discovered back to the UI.
- // https://crbug.com/852199.
+ AllowJavascript();
+ FireWebUIListener("on-shares-found", BuildShareList(shares_gathered));
}
+
} // namespace settings
} // namespace chromeos
diff --git a/chromium/chrome/browser/ui/webui/settings/downloads_handler.cc b/chromium/chrome/browser/ui/webui/settings/downloads_handler.cc
index 4e45994d152..61d21286ab9 100644
--- a/chromium/chrome/browser/ui/webui/settings/downloads_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/downloads_handler.cc
@@ -18,6 +18,10 @@
#include "content/public/browser/web_ui.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/file_manager/path_util.h"
+#endif
+
using base::UserMetricsAction;
namespace settings {
@@ -44,6 +48,12 @@ void DownloadsHandler::RegisterMessages() {
"selectDownloadLocation",
base::BindRepeating(&DownloadsHandler::HandleSelectDownloadLocation,
base::Unretained(this)));
+#if defined(OS_CHROMEOS)
+ web_ui()->RegisterMessageCallback(
+ "getDownloadLocationText",
+ base::BindRepeating(&DownloadsHandler::HandleGetDownloadLocationText,
+ base::Unretained(this)));
+#endif
}
void DownloadsHandler::OnJavascriptAllowed() {
@@ -105,4 +115,20 @@ void DownloadsHandler::FileSelected(const base::FilePath& path,
pref_service->SetFilePath(prefs::kSaveFileDefaultDirectory, path);
}
+#if defined(OS_CHROMEOS)
+void DownloadsHandler::HandleGetDownloadLocationText(
+ const base::ListValue* args) {
+ AllowJavascript();
+ CHECK_EQ(2U, args->GetSize());
+ std::string callback_id;
+ std::string path;
+ CHECK(args->GetString(0, &callback_id));
+ CHECK(args->GetString(1, &path));
+
+ ResolveJavascriptCallback(
+ base::Value(callback_id),
+ base::Value(file_manager::util::GetDownloadLocationText(profile_, path)));
+}
+#endif
+
} // namespace settings
diff --git a/chromium/chrome/browser/ui/webui/settings/downloads_handler.h b/chromium/chrome/browser/ui/webui/settings/downloads_handler.h
index 289cf74ab82..503455691e0 100644
--- a/chromium/chrome/browser/ui/webui/settings/downloads_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/downloads_handler.h
@@ -51,6 +51,13 @@ class DownloadsHandler : public SettingsPageUIHandler,
int index,
void* params) override;
+#if defined(OS_CHROMEOS)
+ // Callback for the "getDownloadLocationText" message. Converts actual
+ // paths in chromeos to values suitable to display to users.
+ // E.g. /home/chronos/u-<hash>/Downloads => "Downloads".
+ void HandleGetDownloadLocationText(const base::ListValue* args);
+#endif
+
Profile* profile_;
PrefChangeRegistrar pref_registrar_;
diff --git a/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index 65230a3aea7..2c30e7fc48e 100644
--- a/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -13,13 +13,13 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/buildflag.h"
+#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/plugins/plugin_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_shortcut_manager.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
@@ -28,17 +28,21 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/locale_settings.h"
#include "components/autofill/core/browser/payments/payments_service_url.h"
+#include "components/autofill/core/browser/payments/payments_util.h"
#include "components/autofill/core/common/autofill_constants.h"
+#include "components/autofill/core/common/autofill_features.h"
#include "components/content_settings/core/common/features.h"
-#include "components/google/core/browser/google_util.h"
+#include "components/google/core/common/google_util.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/safe_browsing/common/safe_browsing_prefs.h"
#include "components/signin/core/browser/signin_buildflags.h"
#include "components/strings/grit/components_strings.h"
#include "components/subresource_filter/core/browser/subresource_filter_features.h"
+#include "components/unified_consent/feature.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/content_features.h"
+#include "media/base/media_switches.h"
#include "services/device/public/cpp/device_features.h"
#include "ui/base/l10n/l10n_util.h"
@@ -57,6 +61,7 @@
#include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h"
#include "chromeos/chromeos_features.h"
#include "chromeos/chromeos_switches.h"
+#include "chromeos/services/multidevice_setup/public/cpp/url_provider.h"
#include "components/arc/arc_util.h"
#include "components/user_manager/user_manager.h"
#include "ui/chromeos/devicetype_utils.h"
@@ -134,6 +139,9 @@ void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"moreActions", IDS_SETTINGS_MORE_ACTIONS},
{"ok", IDS_OK},
{"restart", IDS_SETTINGS_RESTART},
+#if !defined(OS_CHROMEOS)
+ {"restartToApplyChanges", IDS_SETTINGS_RESTART_TO_APPLY_CHANGES},
+#endif
{"retry", IDS_SETTINGS_RETRY},
{"save", IDS_SAVE},
{"settings", IDS_SETTINGS_SETTINGS},
@@ -203,6 +211,7 @@ void AddA11yStrings(content::WebUIDataSource* html_source) {
{"dictationLabel", IDS_SETTINGS_ACCESSIBILITY_DICTATION_LABEL},
{"onScreenKeyboardLabel", IDS_SETTINGS_ON_SCREEN_KEYBOARD_LABEL},
{"monoAudioLabel", IDS_SETTINGS_MONO_AUDIO_LABEL},
+ {"startupSoundLabel", IDS_SETTINGS_STARTUP_SOUND_LABEL},
{"a11yExplanation", IDS_SETTINGS_ACCESSIBILITY_EXPLANATION},
{"caretHighlightLabel",
IDS_SETTINGS_ACCESSIBILITY_CARET_HIGHLIGHT_DESCRIPTION},
@@ -492,6 +501,8 @@ void AddBluetoothStrings(content::WebUIDataSource* html_source) {
{"bluetoothPairDevicePageTitle",
IDS_SETTINGS_BLUETOOTH_PAIR_DEVICE_TITLE},
{"bluetoothRemove", IDS_SETTINGS_BLUETOOTH_REMOVE},
+ {"bluetoothPrimaryUserControlled",
+ IDS_SETTINGS_BLUETOOTH_PRIMARY_USER_CONTROLLED},
};
AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings));
@@ -513,9 +524,18 @@ void AddClearBrowsingDataStrings(content::WebUIDataSource* html_source,
Profile* profile) {
LocalizedString localized_strings[] = {
{"clearTimeRange", IDS_SETTINGS_CLEAR_PERIOD_TITLE},
+ {"clearBrowsingDataWithSync", IDS_SETTINGS_CLEAR_BROWSING_DATA_WITH_SYNC},
+ {"clearBrowsingDataWithSyncError",
+ IDS_SETTINGS_CLEAR_BROWSING_DATA_WITH_SYNC_ERROR},
+ {"clearBrowsingDataWithSyncPassphraseError",
+ IDS_SETTINGS_CLEAR_BROWSING_DATA_WITH_SYNC_PASSPHRASE_ERROR},
+ {"clearBrowsingDataWithSyncPaused",
+ IDS_SETTINGS_CLEAR_BROWSING_DATA_WITH_SYNC_PAUSED},
{"clearBrowsingHistory", IDS_SETTINGS_CLEAR_BROWSING_HISTORY},
{"clearBrowsingHistorySummary",
IDS_SETTINGS_CLEAR_BROWSING_HISTORY_SUMMARY},
+ {"clearBrowsingHistorySummarySignedIn",
+ IDS_SETTINGS_CLEAR_BROWSING_HISTORY_SUMMARY_SYNC_ERROR},
{"clearDownloadHistory", IDS_SETTINGS_CLEAR_DOWNLOAD_HISTORY},
{"clearCache", IDS_SETTINGS_CLEAR_CACHE},
{"clearCookies", IDS_SETTINGS_CLEAR_COOKIES},
@@ -541,11 +561,6 @@ void AddClearBrowsingDataStrings(content::WebUIDataSource* html_source,
};
html_source->AddString(
- "clearBrowsingHistorySummarySignedIn",
- l10n_util::GetStringFUTF16(
- IDS_SETTINGS_CLEAR_BROWSING_HISTORY_SUMMARY_SIGNED_IN,
- base::ASCIIToUTF16(chrome::kMyActivityUrlInClearBrowsingData)));
- html_source->AddString(
"clearBrowsingHistorySummarySynced",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_CLEAR_BROWSING_HISTORY_SUMMARY_SYNCED,
@@ -617,6 +632,9 @@ void AddDeviceStrings(content::WebUIDataSource* html_source) {
{"keyboardKeyEscape", IDS_SETTINGS_KEYBOARD_KEY_ESCAPE},
{"keyboardKeyBackspace", IDS_SETTINGS_KEYBOARD_KEY_BACKSPACE},
{"keyboardKeyDisabled", IDS_SETTINGS_KEYBOARD_KEY_DISABLED},
+ {"keyboardKeyExternalCommand",
+ IDS_SETTINGS_KEYBOARD_KEY_EXTERNAL_COMMAND},
+ {"keyboardKeyExternalMeta", IDS_SETTINGS_KEYBOARD_KEY_EXTERNAL_META},
{"keyboardSendFunctionKeys", IDS_SETTINGS_KEYBOARD_SEND_FUNCTION_KEYS},
{"keyboardSendFunctionKeysDescription",
ui::DeviceUsesKeyboardLayout2()
@@ -737,9 +755,6 @@ void AddDeviceStrings(content::WebUIDataSource* html_source) {
base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableTouchCalibrationSetting));
- html_source->AddBoolean("enableDisplayZoomSetting",
- features::IsDisplayZoomSettingEnabled());
-
html_source->AddBoolean("hasExternalTouchDevice",
display::HasExternalTouchscreenDevice());
@@ -832,6 +847,8 @@ void AddDownloadsStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_DOWNLOADS_SHARE_ADDED_UNSUPPORTED_DEVICE_MESSAGE},
{"smbShareAddedMountExistsMessage",
IDS_SETTINGS_DOWNLOADS_SHARE_ADDED_MOUNT_EXISTS_MESSAGE},
+ {"smbShareAddedInvalidURLMessage",
+ IDS_SETTINGS_DOWNLOADS_SHARE_ADDED_MOUNT_INVALID_URL_MESSAGE},
#endif
};
AddLocalizedStringsBulk(html_source, localized_strings,
@@ -840,6 +857,8 @@ void AddDownloadsStrings(content::WebUIDataSource* html_source) {
#if defined(OS_CHROMEOS)
html_source->AddBoolean("enableNativeSmbSetting",
base::FeatureList::IsEnabled(features::kNativeSmb));
+ html_source->AddString("smbSharesLearnMoreURL",
+ GetHelpUrlWithBoard(chrome::kSmbSharesLearnMoreURL));
#endif
}
@@ -1374,18 +1393,20 @@ void AddOnStartupStrings(content::WebUIDataSource* html_source) {
arraysize(localized_strings));
}
-void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
+void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source,
+ Profile* profile) {
LocalizedString localized_strings[] = {
{"passwordsAndAutofillPageTitle",
IDS_SETTINGS_PASSWORDS_AND_AUTOFILL_PAGE_TITLE},
{"googlePayments", IDS_SETTINGS_GOOGLE_PAYMENTS},
{"googlePaymentsCached", IDS_SETTINGS_GOOGLE_PAYMENTS_CACHED},
- {"autofillFormsLabel", IDS_SETTINGS_AUTOFILL_TOGGLE_LABEL},
- {"enableProfilesLabel",
- IDS_SETTINGS_AUTOFILL_ENABLE_PROFILES_TOGGLE_LABEL},
- {"enableCreditCardsLabel",
- IDS_SETTINGS_AUTOFILL_ENABLE_CREDIT_CARDS_TOGGLE_LABEL},
- {"addresses", IDS_SETTINGS_AUTOFILL_ADDRESSES_HEADING},
+ {"enableProfilesLabel", IDS_AUTOFILL_ENABLE_PROFILES_TOGGLE_LABEL},
+ {"enableProfilesSublabel", IDS_AUTOFILL_ENABLE_PROFILES_TOGGLE_SUBLABEL},
+ {"enableCreditCardsLabel", IDS_AUTOFILL_ENABLE_CREDIT_CARDS_TOGGLE_LABEL},
+ {"enableCreditCardsSublabel",
+ IDS_AUTOFILL_ENABLE_CREDIT_CARDS_TOGGLE_SUBLABEL},
+ {"addresses", IDS_AUTOFILL_ADDRESSES},
+ {"addressesTitle", IDS_AUTOFILL_ADDRESSES_SETTINGS_TITLE},
{"addAddressTitle", IDS_SETTINGS_AUTOFILL_ADDRESSES_ADD_TITLE},
{"editAddressTitle", IDS_SETTINGS_AUTOFILL_ADDRESSES_EDIT_TITLE},
{"addressCountry", IDS_SETTINGS_AUTOFILL_ADDRESSES_COUNTRY},
@@ -1394,6 +1415,7 @@ void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
{"removeAddress", IDS_SETTINGS_ADDRESS_REMOVE},
{"removeCreditCard", IDS_SETTINGS_CREDIT_CARD_REMOVE},
{"clearCreditCard", IDS_SETTINGS_CREDIT_CARD_CLEAR},
+ {"creditCardsDetail", IDS_SETTINGS_AUTOFILL_CREDIT_CARD_DETAIL},
{"creditCardType", IDS_SETTINGS_AUTOFILL_CREDIT_CARD_TYPE_COLUMN_LABEL},
{"creditCardExpiration", IDS_SETTINGS_CREDIT_CARD_EXPIRATION_DATE},
{"creditCardName", IDS_SETTINGS_NAME_ON_CREDIT_CARD},
@@ -1403,6 +1425,13 @@ void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
{"creditCardExpired", IDS_SETTINGS_CREDIT_CARD_EXPIRED},
{"editCreditCardTitle", IDS_SETTINGS_EDIT_CREDIT_CARD_TITLE},
{"addCreditCardTitle", IDS_SETTINGS_ADD_CREDIT_CARD_TITLE},
+ {"migrateCreditCardsLabelSingle",
+ IDS_SETTINGS_SINGLE_MIGRATABLE_CARD_LABEL},
+ {"migrateCreditCardsLabelMultiple",
+ IDS_SETTINGS_MULTIPLE_MIGRATABLE_CARDS_LABEL},
+ {"migratableCardsInfoSingle", IDS_SETTINGS_SINGLE_MIGRATABLE_CARD_INFO},
+ {"migratableCardsInfoMultiple",
+ IDS_SETTINGS_MULTIPLE_MIGRATABLE_CARDS_INFO},
{"canMakePaymentToggleLabel", IDS_SETTINGS_CAN_MAKE_PAYMENT_TOGGLE_LABEL},
{"autofillDetail", IDS_SETTINGS_AUTOFILL_DETAIL},
{"passwordsSavePasswordsLabel",
@@ -1452,11 +1481,11 @@ void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
// |localized_strings| array once Autofill Home is fully launched.
if (base::FeatureList::IsEnabled(password_manager::features::kAutofillHome)) {
html_source->AddLocalizedString("autofill",
- IDS_SETTINGS_AUTOFILL_AUTOFILL_HOME);
+ IDS_AUTOFILL_ADDRESSES_SETTINGS_TITLE);
html_source->AddLocalizedString("passwords",
IDS_SETTINGS_PASSWORDS_AUTOFILL_HOME);
html_source->AddLocalizedString("creditCards",
- IDS_SETTINGS_AUTOFILL_PAYMENT_METHODS);
+ IDS_AUTOFILL_PAYMENT_METHODS);
html_source->AddLocalizedString("noCreditCardsFound",
IDS_SETTINGS_PAYMENT_METHODS_NONE);
} else {
@@ -1479,9 +1508,25 @@ void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
autofill::payments::GetManageAddressesUrl(0).spec());
html_source->AddString("manageCreditCardsUrl",
autofill::payments::GetManageInstrumentsUrl(0).spec());
+ html_source->AddBoolean(
+ "migrationEnabled",
+ autofill::features::GetLocalCardMigrationExperimentalFlag() ==
+ autofill::features::LocalCardMigrationExperimentalFlag::
+ kMigrationIncludeSettingsPage);
+
+ autofill::PersonalDataManager* personal_data_manager_ =
+ autofill::PersonalDataManagerFactory::GetForProfile(profile);
+ html_source->AddBoolean(
+ "hasGooglePaymentsAccount",
+ autofill::payments::GetBillingCustomerId(personal_data_manager_,
+ profile->GetPrefs()) != 0);
AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings));
+
+ html_source->AddBoolean("EnableCompanyName",
+ base::FeatureList::IsEnabled(
+ autofill::features::kAutofillEnableCompanyName));
}
void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
@@ -1489,29 +1534,21 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"peoplePageTitle", IDS_SETTINGS_PEOPLE},
{"manageOtherPeople", IDS_SETTINGS_PEOPLE_MANAGE_OTHER_PEOPLE},
#if defined(OS_CHROMEOS)
- {"accountManagerPageTitle", IDS_SETTINGS_ACCOUNT_MANAGER_PAGE_TITLE},
{"accountManagerDescription", IDS_SETTINGS_ACCOUNT_MANAGER_DESCRIPTION},
+ {"accountManagerPageTitle", IDS_SETTINGS_ACCOUNT_MANAGER_PAGE_TITLE},
+ {"accountManagerSubMenuLabel", IDS_SETTINGS_ACCOUNT_MANAGER_SUBMENU_LABEL},
{"accountListHeader", IDS_SETTINGS_ACCOUNT_MANAGER_LIST_HEADER},
{"addAccountLabel", IDS_SETTINGS_ACCOUNT_MANAGER_ADD_ACCOUNT_LABEL},
+ {"removeAccountLabel", IDS_SETTINGS_ACCOUNT_MANAGER_REMOVE_ACCOUNT_LABEL},
{"configureFingerprintTitle", IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_TITLE},
{"configureFingerprintInstructionLocateScannerStep",
IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_INSTRUCTION_LOCATE_SCANNER},
- {"configureFingerprintInstructionMoveFingerStep",
- IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_INSTRUCTION_MOVE_FINGER},
{"configureFingerprintInstructionReadyStep",
IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_INSTRUCTION_READY},
{"configureFingerprintLiftFinger",
IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_LIFT_FINGER},
- {"configureFingerprintPartialData",
- IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_PARTIAL_DATA},
- {"configureFingerprintInsufficientData",
- IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_INSUFFICIENT_DATA},
- {"configureFingerprintSensorDirty",
- IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_SENSOR_DIRTY},
- {"configureFingerprintTooSlow",
- IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_FINGER_TOO_SLOW},
- {"configureFingerprintTooFast",
- IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_FINGER_TOO_FAST},
+ {"configureFingerprintTryAgain",
+ IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_TRY_AGAIN},
{"configureFingerprintImmobile",
IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_FINGER_IMMOBILE},
{"configureFingerprintAddAnotherButton",
@@ -1540,14 +1577,20 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"lockScreenNumberFingerprints",
IDS_SETTINGS_PEOPLE_LOCK_SCREEN_NUM_FINGERPRINTS},
{"lockScreenNone", IDS_SETTINGS_PEOPLE_LOCK_SCREEN_NONE},
- {"lockScreenFingerprintEnable",
- IDS_SETTINGS_PEOPLE_LOCK_SCREEN_ENABLE_FINGERPRINT_CHECKBOX_LABEL},
{"lockScreenFingerprintNewName",
IDS_SETTINGS_PEOPLE_LOCK_SCREEN_NEW_FINGERPRINT_DEFAULT_NAME},
{"lockScreenFingerprintTitle",
IDS_SETTINGS_PEOPLE_LOCK_SCREEN_FINGERPRINT_SUBPAGE_TITLE},
{"lockScreenFingerprintWarning",
IDS_SETTINGS_PEOPLE_LOCK_SCREEN_FINGERPRINT_LESS_SECURE},
+ {"lockScreenNotificationHide",
+ IDS_ASH_SETTINGS_LOCK_SCREEN_NOTIFICATION_HIDE},
+ {"lockScreenNotificationHideSensitive",
+ IDS_ASH_SETTINGS_LOCK_SCREEN_NOTIFICATION_HIDE_SENSITIVE},
+ {"lockScreenNotificationShow",
+ IDS_ASH_SETTINGS_LOCK_SCREEN_NOTIFICATION_SHOW},
+ {"lockScreenNotificationTitle",
+ IDS_ASH_SETTINGS_LOCK_SCREEN_NOTIFICATION_TITLE},
{"lockScreenOptionsLock", IDS_SETTINGS_PEOPLE_LOCK_SCREEN_OPTIONS_LOCK},
{"lockScreenOptionsLoginLock",
IDS_SETTINGS_PEOPLE_LOCK_SCREEN_OPTIONS_LOGIN_LOCK},
@@ -1601,15 +1644,14 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"cancelSync", IDS_SETTINGS_SYNC_SETTINGS_CANCEL_SYNC},
#endif // defined(OS_CHROMEOS)
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
- {"peopleSignIn", IDS_SETTINGS_PEOPLE_SIGN_IN},
+ {"peopleSignIn", IDS_PROFILES_DICE_SIGNIN_BUTTON},
{"peopleSignOut", IDS_SETTINGS_PEOPLE_SIGN_OUT},
{"peopleSignInPrompt", IDS_SETTINGS_PEOPLE_SIGN_IN_PROMPT},
{"peopleSignInPromptSecondaryWithNoAccount",
- IDS_SETTINGS_PEOPLE_SIGN_IN_PROMPT_SECONDARY_WITH_NO_ACCOUNT},
+ IDS_SETTINGS_PEOPLE_SIGN_IN_PROMPT_SECONDARY_WITH_ACCOUNT},
{"peopleSignInPromptSecondaryWithAccount",
IDS_SETTINGS_PEOPLE_SIGN_IN_PROMPT_SECONDARY_WITH_ACCOUNT},
{"useAnotherAccount", IDS_SETTINGS_PEOPLE_SYNC_ANOTHER_ACCOUNT},
- {"syncAsName", IDS_SETTINGS_PEOPLE_SYNC_AS_NAME},
{"syncingTo", IDS_SETTINGS_PEOPLE_SYNCING_TO_ACCOUNT},
{"turnOffSync", IDS_SETTINGS_PEOPLE_SYNC_TURN_OFF},
{"signInAgain", IDS_SYNC_ERROR_USER_MENU_SIGNIN_AGAIN_BUTTON},
@@ -1640,10 +1682,10 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"deleteProfileWarningWithoutCounts",
IDS_SETTINGS_SYNC_DISCONNECT_DELETE_PROFILE_WARNING_WITHOUT_COUNTS},
{"syncDisconnectConfirm", IDS_SETTINGS_SYNC_DISCONNECT_CONFIRM},
- {"sync", IsUnifiedConsentEnabled(profile)
+ {"sync", unified_consent::IsUnifiedConsentFeatureEnabled()
? IDS_SETTINGS_SYNC_UNIFIED_CONSENT
: IDS_SETTINGS_SYNC},
- {"syncDescription", IsUnifiedConsentEnabled(profile)
+ {"syncDescription", unified_consent::IsUnifiedConsentFeatureEnabled()
? IDS_SETTINGS_SYNC_DESCRIPTION_UNIFIED_CONSENT
: IDS_SETTINGS_SYNC_DESCRIPTION},
{"nonPersonalizedServicesSectionLabel",
@@ -1655,7 +1697,7 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"syncExpandA11yLabel", IDS_SETTINGS_SYNC_SECTION_ACCESSIBILITY_LABEL},
{"syncAndNonPersonalizedServices",
IDS_SETTINGS_SYNC_SYNC_AND_NON_PERSONALIZED_SERVICES},
- {"syncPageTitle", IsUnifiedConsentEnabled(profile)
+ {"syncPageTitle", unified_consent::IsUnifiedConsentFeatureEnabled()
? IDS_SETTINGS_SYNC_SYNC_AND_NON_PERSONALIZED_SERVICES
: IDS_SETTINGS_SYNC_PAGE_TITLE},
{"syncLoading", IDS_SETTINGS_SYNC_LOADING},
@@ -1696,12 +1738,12 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings));
- // TODO(https://crbug.com/854562): Integrate these strings into the
- // |localized_strings| array once Autofill Home is fully launched.
if (base::FeatureList::IsEnabled(password_manager::features::kAutofillHome)) {
+ // TODO(https://crbug.com/854562): Integrate this string into the
+ // |localized_strings| array once Autofill Home is fully launched.
html_source->AddLocalizedString(
"enablePaymentsIntegrationCheckboxLabel",
- IDS_SETTINGS_ENABLE_PAYMENTS_INTEGRATION_CHECKBOX_LABEL_AUTOFILL_HOME);
+ IDS_AUTOFILL_ENABLE_PAYMENTS_INTEGRATION_CHECKBOX_LABEL);
} else {
html_source->AddLocalizedString(
"enablePaymentsIntegrationCheckboxLabel",
@@ -1746,12 +1788,13 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT,
base::ASCIIToUTF16(sync_dashboard_url)));
html_source->AddString(
- "passphraseResetHint",
- l10n_util::GetStringFUTF8(
- IsUnifiedConsentEnabled(profile)
- ? IDS_SETTINGS_PASSPHRASE_RESET_HINT_UNIFIED_CONSENT
- : IDS_SETTINGS_PASSPHRASE_RESET_HINT,
- base::ASCIIToUTF16(sync_dashboard_url)));
+ "passphraseResetHintEncryption",
+ l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_RESET_HINT_ENCRYPTION,
+ base::ASCIIToUTF16(sync_dashboard_url)));
+ html_source->AddString(
+ "passphraseResetHintToggle",
+ l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_RESET_HINT_TOGGLE,
+ base::ASCIIToUTF16(sync_dashboard_url)));
html_source->AddString(
"passphraseRecover",
l10n_util::GetStringFUTF8(IDS_SETTINGS_PASSPHRASE_RECOVER,
@@ -1773,7 +1816,7 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
LocalizedString sync_disconnect_strings[] = {
{"syncDisconnect", IDS_SETTINGS_PEOPLE_SYNC_TURN_OFF},
{"syncDisconnectTitle",
- IsUnifiedConsentEnabled(profile)
+ unified_consent::IsUnifiedConsentFeatureEnabled()
? IDS_SETTINGS_TURN_OFF_SYNC_AND_SIGN_OUT_DIALOG_TITLE_UNIFIED_CONSENT
: IDS_SETTINGS_TURN_OFF_SYNC_AND_SIGN_OUT_DIALOG_TITLE},
{"syncDisconnectDeleteProfile",
@@ -1784,7 +1827,7 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
AddLocalizedStringsBulk(html_source, sync_disconnect_strings,
arraysize(sync_disconnect_strings));
- if (IsUnifiedConsentEnabled(profile)) {
+ if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
html_source->AddLocalizedString(
"syncDisconnectExplanation",
IDS_SETTINGS_SYNC_DISCONNECT_AND_SIGN_OUT_EXPLANATION_UNIFIED_CONSENT);
@@ -1813,6 +1856,13 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
html_source->AddBoolean(
"driveSuggestAvailable",
base::FeatureList::IsEnabled(omnibox::kDocumentProvider));
+
+#if defined(OS_CHROMEOS)
+ // Used to control the display of Chrome OS Account Manager submenu in the
+ // People section.
+ html_source->AddBoolean("isAccountManagerEnabled",
+ chromeos::switches::IsAccountManagerEnabled());
+#endif
}
void AddPrintingStrings(content::WebUIDataSource* html_source) {
@@ -1924,6 +1974,8 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
Profile* profile) {
LocalizedString localized_strings[] = {
{"privacyPageTitle", IDS_SETTINGS_PRIVACY},
+ {"signinAllowedTitle", IDS_SETTINGS_SIGNIN_ALLOWED},
+ {"signinAllowedDescription", IDS_SETTINGS_SIGNIN_ALLOWED_DESC},
{"doNotTrack", IDS_SETTINGS_ENABLE_DO_NOT_TRACK},
{"doNotTrackDialogTitle", IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TITLE},
{"enableContentProtectionAttestation",
@@ -1956,7 +2008,8 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
arraysize(localized_strings));
// Select strings depending on unified-consent enabledness.
- bool is_unified_consent_enabled = IsUnifiedConsentEnabled(profile);
+ bool is_unified_consent_enabled =
+ unified_consent::IsUnifiedConsentFeatureEnabled();
if (is_unified_consent_enabled) {
LocalizedString conditional_localized_strings[] = {
{"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF_UNIFIED_CONSENT},
@@ -2003,7 +2056,7 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
}
html_source->AddString("syncAndGoogleServicesLearnMoreURL",
- IsUnifiedConsentEnabled(profile)
+ unified_consent::IsUnifiedConsentFeatureEnabled()
? chrome::kSyncAndGoogleServicesLearnMoreURL
: "");
html_source->AddString(
@@ -2125,6 +2178,10 @@ void AddGoogleAssistantStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_GOOGLE_ASSISTANT_ENABLE_HOTWORD},
{"googleAssistantEnableHotwordDescription",
IDS_SETTINGS_GOOGLE_ASSISTANT_ENABLE_HOTWORD_DESCRIPTION},
+ {"googleAssistantEnableNotification",
+ IDS_SETTINGS_GOOGLE_ASSISTANT_ENABLE_NOTIFICATION},
+ {"googleAssistantEnableNotificationDescription",
+ IDS_SETTINGS_GOOGLE_ASSISTANT_ENABLE_NOTIFICATION_DESCRIPTION},
{"googleAssistantSettings", IDS_SETTINGS_GOOGLE_ASSISTANT_SETTINGS},
};
AddLocalizedStringsBulk(html_source, localized_strings,
@@ -2215,6 +2272,10 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source,
IDS_SETTINGS_SITE_SETTINGS_ALL_SITES_DESCRIPTION},
{"siteSettingsAllSitesSearch", IDS_SETTINGS_SITE_SETTINGS_ALL_SITES_SEARCH},
{"siteSettingsAllSitesSort", IDS_SETTINGS_SITE_SETTINGS_ALL_SITES_SORT},
+ {"siteSettingsAllSitesSortMethodMostVisited",
+ IDS_SETTINGS_SITE_SETTINGS_ALL_SITES_SORT_METHOD_MOST_VISITED},
+ {"siteSettingsAllSitesSortMethodStorage",
+ IDS_SETTINGS_SITE_SETTINGS_ALL_SITES_SORT_METHOD_STORAGE},
{"siteSettingsAllSitesSortMethodName",
IDS_SETTINGS_SITE_SETTINGS_ALL_SITES_SORT_METHOD_NAME},
{"siteSettingsSiteRepresentationSeparator",
@@ -2337,11 +2398,16 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source,
IDS_SETTINGS_SITE_SETTINGS_ASK_DEFAULT_MENU},
{"siteSettingsActionAllowDefault",
IDS_SETTINGS_SITE_SETTINGS_ALLOW_DEFAULT_MENU},
+ {"siteSettingsActionAutomaticDefault",
+ IDS_SETTINGS_SITE_SETTINGS_AUTOMATIC_DEFAULT_MENU},
{"siteSettingsActionBlockDefault",
IDS_SETTINGS_SITE_SETTINGS_BLOCK_DEFAULT_MENU},
+ {"siteSettingsActionMuteDefault",
+ IDS_SETTINGS_SITE_SETTINGS_MUTE_DEFAULT_MENU},
{"siteSettingsActionAllow", IDS_SETTINGS_SITE_SETTINGS_ALLOW_MENU},
{"siteSettingsActionBlock", IDS_SETTINGS_SITE_SETTINGS_BLOCK_MENU},
{"siteSettingsActionAsk", IDS_SETTINGS_SITE_SETTINGS_ASK_MENU},
+ {"siteSettingsActionMute", IDS_SETTINGS_SITE_SETTINGS_MUTE_MENU},
{"siteSettingsActionReset", IDS_SETTINGS_SITE_SETTINGS_RESET_MENU},
{"siteSettingsActionSessionOnly",
IDS_SETTINGS_SITE_SETTINGS_SESSION_ONLY_MENU},
@@ -2427,6 +2493,8 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source,
IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLER_ALLOW_RECOMMENDED},
{"siteSettingsPaymentHandlerBlock",
IDS_SETTINGS_SITE_SETTINGS_PAYMENT_HANDLER_BLOCK},
+ {"siteSettingsBlockAutoplaySetting",
+ IDS_SETTINGS_SITE_SETTINGS_BLOCK_AUTOPLAY},
};
AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings));
@@ -2443,6 +2511,10 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source,
base::FeatureList::IsEnabled(features::kSoundContentSetting));
html_source->AddBoolean(
+ "enableBlockAutoplayContentSetting",
+ base::FeatureList::IsEnabled(media::kAutoplaySoundSettings));
+
+ html_source->AddBoolean(
"enableClipboardContentSetting",
base::FeatureList::IsEnabled(features::kClipboardContentSetting));
@@ -2568,11 +2640,13 @@ void AddMultideviceStrings(content::WebUIDataSource* html_source) {
IDS_SETTINGS_MULTIDEVICE_INSTANT_TETHERING},
{"multideviceAndroidMessagesItemTitle",
IDS_SETTINGS_MULTIDEVICE_ANDROID_MESSAGES},
- {"multideviceAndroidMessagesItemSummary",
- IDS_SETTINGS_MULTIDEVICE_ANDROID_MESSAGES_SUMMARY},
{"multideviceForgetDevice", IDS_SETTINGS_MULTIDEVICE_FORGET_THIS_DEVICE},
{"multideviceForgetDeviceSummary",
IDS_SETTINGS_MULTIDEVICE_FORGET_THIS_DEVICE_EXPLANATION},
+ {"multideviceForgetDeviceDialogHeading",
+ IDS_SETTINGS_MULTIDEVICE_FORGET_DEVICE_DIALOG_HEADING},
+ {"multideviceForgetDeviceDialogMessage",
+ IDS_SETTINGS_MULTIDEVICE_FORGET_DEVICE_DIALOG_MESSAGE},
};
AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings));
@@ -2585,22 +2659,40 @@ void AddMultideviceStrings(content::WebUIDataSource* html_source) {
"multideviceVerificationText",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_VERIFICATION_TEXT,
- GetHelpUrlWithBoard(chrome::kMultiDeviceLearnMoreURL)));
+ base::UTF8ToUTF16(
+ chromeos::multidevice_setup::GetBoardSpecificLearnMoreUrl()
+ .spec())));
html_source->AddString(
"multideviceCouldNotConnect",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_COULD_NOT_CONNECT,
- GetHelpUrlWithBoard(chrome::kMultiDeviceLearnMoreURL)));
+ base::UTF8ToUTF16(
+ chromeos::multidevice_setup::GetBoardSpecificLearnMoreUrl()
+ .spec())));
html_source->AddString(
"multideviceSetupSummary",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_SETUP_SUMMARY,
- GetHelpUrlWithBoard(chrome::kMultiDeviceLearnMoreURL)));
+ base::UTF8ToUTF16(
+ chromeos::multidevice_setup::GetBoardSpecificLearnMoreUrl()
+ .spec())));
+ html_source->AddString(
+ "multideviceNoHostText",
+ l10n_util::GetStringFUTF16(
+ IDS_SETTINGS_MULTIDEVICE_NO_ELIGIBLE_HOSTS,
+ base::UTF8ToUTF16(
+ chromeos::multidevice_setup::GetBoardSpecificLearnMoreUrl()
+ .spec())));
html_source->AddString(
"multideviceSmartLockItemSummary",
l10n_util::GetStringFUTF16(
IDS_SETTINGS_MULTIDEVICE_SMART_LOCK_SUMMARY,
GetHelpUrlWithBoard(chrome::kEasyUnlockLearnMoreUrl)));
+ html_source->AddString(
+ "multideviceAndroidMessagesItemSummary",
+ l10n_util::GetStringFUTF16(
+ IDS_SETTINGS_MULTIDEVICE_ANDROID_MESSAGES_SUMMARY,
+ GetHelpUrlWithBoard(chrome::kAndroidMessagesLearnMoreURL)));
}
#endif
@@ -2628,7 +2720,7 @@ void AddLocalizedStrings(content::WebUIDataSource* html_source,
AddDownloadsStrings(html_source);
AddLanguagesStrings(html_source);
AddOnStartupStrings(html_source);
- AddPasswordsAndFormsStrings(html_source);
+ AddPasswordsAndFormsStrings(html_source, profile);
AddPeopleStrings(html_source, profile);
AddPrintingStrings(html_source);
AddPrivacyStrings(html_source, profile);
diff --git a/chromium/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chromium/chrome/browser/ui/webui/settings/md_settings_ui.cc
index e2feea6212e..fa6dd8d8b36 100644
--- a/chromium/chrome/browser/ui/webui/settings/md_settings_ui.cc
+++ b/chromium/chrome/browser/ui/webui/settings/md_settings_ui.cc
@@ -11,11 +11,11 @@
#include <utility>
#include <vector>
+#include "ash/public/cpp/ash_features.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/browser/ui/webui/settings/about_handler.h"
#include "chrome/browser/ui/webui/settings/appearance_handler.h"
@@ -45,10 +45,12 @@
#include "chrome/grit/settings_resources_map.h"
#include "components/password_manager/core/common/password_manager_features.h"
#include "components/pref_registry/pref_registry_syncable.h"
+#include "components/unified_consent/feature.h"
#include "content/public/browser/navigation_handle.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 "content/public/common/content_features.h"
#include "printing/buildflags/buildflags.h"
#if defined(OS_WIN)
@@ -73,7 +75,10 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h"
+#include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
#include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
+#include "chrome/browser/chromeos/multidevice_setup/android_sms_app_helper_delegate_impl.h"
+#include "chrome/browser/chromeos/multidevice_setup/multidevice_setup_client_factory.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/ui/webui/settings/chromeos/accessibility_handler.h"
#include "chrome/browser/ui/webui/settings/chromeos/account_manager_handler.h"
@@ -96,6 +101,7 @@
#include "chrome/common/chrome_switches.h"
#include "chromeos/account_manager/account_manager.h"
#include "chromeos/account_manager/account_manager_factory.h"
+#include "chromeos/chromeos_features.h"
#include "chromeos/chromeos_switches.h"
#include "components/arc/arc_util.h"
#include "ui/base/ui_base_features.h"
@@ -213,8 +219,19 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
}
AddSettingsPageUIHandler(
std::make_unique<chromeos::settings::KeyboardHandler>());
- AddSettingsPageUIHandler(
- std::make_unique<chromeos::settings::MultideviceHandler>());
+ if (base::FeatureList::IsEnabled(
+ chromeos::features::kEnableUnifiedMultiDeviceSetup) &&
+ base::FeatureList::IsEnabled(
+ chromeos::features::kEnableUnifiedMultiDeviceSettings) &&
+ base::FeatureList::IsEnabled(chromeos::features::kMultiDeviceApi)) {
+ AddSettingsPageUIHandler(
+ std::make_unique<chromeos::settings::MultideviceHandler>(
+ chromeos::multidevice_setup::MultiDeviceSetupClientFactory::
+ GetForProfile(profile),
+ std::make_unique<
+ chromeos::multidevice_setup::AndroidSmsAppHelperDelegateImpl>(
+ profile)));
+ }
AddSettingsPageUIHandler(
std::make_unique<chromeos::settings::PointerHandler>());
AddSettingsPageUIHandler(
@@ -297,12 +314,22 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
chromeos::quick_unlock::IsPinDisabledByPolicy(profile->GetPrefs()));
html_source->AddBoolean("fingerprintUnlockEnabled",
chromeos::quick_unlock::IsFingerprintEnabled());
+ html_source->AddBoolean("lockScreenNotificationsEnabled",
+ ash::features::IsLockScreenNotificationsEnabled());
+ html_source->AddBoolean(
+ "lockScreenHideSensitiveNotificationsSupported",
+ ash::features::IsLockScreenHideSensitiveNotificationsSupported());
html_source->AddBoolean("hasInternalStylus",
ash::stylus_utils::HasInternalStylus());
html_source->AddBoolean("showCrostini",
IsCrostiniUIAllowedForProfile(profile));
+ // TODO(crbug.com/868747): Show an explanatory message instead of hiding the
+ // storage management info.
+ html_source->AddBoolean("hideStorageInfo",
+ chromeos::DemoSession::IsDeviceInDemoMode());
+
// We have 2 variants of Android apps settings. Default case, when the Play
// Store app exists we show expandable section that allows as to
// enable/disable the Play Store and link to Android settings which is
@@ -315,8 +342,8 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
html_source->AddBoolean("androidAppsVisible", androidAppsVisible);
html_source->AddBoolean("havePlayStoreApp", arc::IsPlayStoreAvailable());
- // TODO(mash): Support Chrome power settings in Mash. crbug.com/644348
- bool enable_power_settings = features::IsAshInBrowserProcess();
+ // TODO(mash): Support Chrome power settings in Mash. https://crbug.com/644348
+ bool enable_power_settings = !features::IsMultiProcessMash();
html_source->AddBoolean("enablePowerSettings", enable_power_settings);
if (enable_power_settings) {
AddSettingsPageUIHandler(std::make_unique<chromeos::settings::PowerHandler>(
@@ -329,7 +356,7 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
#endif // defined(OS_CHROMEOS)
html_source->AddBoolean("unifiedConsentEnabled",
- IsUnifiedConsentEnabled(profile));
+ unified_consent::IsUnifiedConsentFeatureEnabled());
// TODO(jdoerrie): https://crbug.com/854562.
// Remove once Autofill Home is launched.
@@ -350,12 +377,18 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
web_ui->AddMessageHandler(std::make_unique<MetricsHandler>());
#if BUILDFLAG(OPTIMIZE_WEBUI)
+ const bool use_polymer_2 =
+ base::FeatureList::IsEnabled(features::kWebUIPolymer2);
html_source->AddResourcePath("crisper.js", IDR_MD_SETTINGS_CRISPER_JS);
html_source->AddResourcePath("lazy_load.crisper.js",
IDR_MD_SETTINGS_LAZY_LOAD_CRISPER_JS);
- html_source->AddResourcePath("lazy_load.html",
- IDR_MD_SETTINGS_LAZY_LOAD_VULCANIZED_HTML);
- html_source->SetDefaultResource(IDR_MD_SETTINGS_VULCANIZED_HTML);
+ html_source->AddResourcePath(
+ "lazy_load.html", use_polymer_2
+ ? IDR_MD_SETTINGS_LAZY_LOAD_VULCANIZED_P2_HTML
+ : IDR_MD_SETTINGS_LAZY_LOAD_VULCANIZED_HTML);
+ html_source->SetDefaultResource(use_polymer_2
+ ? IDR_MD_SETTINGS_VULCANIZED_P2_HTML
+ : IDR_MD_SETTINGS_VULCANIZED_HTML);
html_source->UseGzip(exclude_from_gzip);
#else
// Add all settings resources.
@@ -372,8 +405,7 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
html_source);
}
-MdSettingsUI::~MdSettingsUI() {
-}
+MdSettingsUI::~MdSettingsUI() {}
void MdSettingsUI::AddSettingsPageUIHandler(
std::unique_ptr<content::WebUIMessageHandler> handler) {
diff --git a/chromium/chrome/browser/ui/webui/settings/people_handler.cc b/chromium/chrome/browser/ui/webui/settings/people_handler.cc
index d33f651f224..57fe25578d1 100644
--- a/chromium/chrome/browser/ui/webui/settings/people_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/people_handler.cc
@@ -26,7 +26,6 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/signin/signin_ui_util.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -39,7 +38,7 @@
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/autofill/core/common/autofill_constants.h"
-#include "components/autofill/core/common/autofill_pref_names.h"
+#include "components/autofill/core/common/autofill_prefs.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/prefs/pref_service.h"
#include "components/signin/core/browser/profile_management_switches.h"
@@ -49,8 +48,10 @@
#include "components/signin/core/browser/signin_metrics.h"
#include "components/signin/core/browser/signin_pref_names.h"
#include "components/strings/grit/components_strings.h"
-#include "components/sync/base/passphrase_type.h"
+#include "components/sync/base/passphrase_enums.h"
#include "components/sync/base/sync_prefs.h"
+#include "components/unified_consent/feature.h"
+#include "components/unified_consent/unified_consent_metrics.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -70,6 +71,7 @@
#endif
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
+#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "components/signin/core/browser/account_tracker_service.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -182,6 +184,27 @@ std::string GetSyncErrorAction(sync_ui_util::ActionType action_type) {
}
}
+#if BUILDFLAG(ENABLE_DICE_SUPPORT)
+// Returns the base::Value associated with the account, to use in the stored
+// accounts list.
+base::Value GetAccountValue(const AccountInfo& account,
+ AccountTrackerService* account_tracker) {
+ DCHECK(!account.IsEmpty());
+ base::Value dictionary(base::Value::Type::DICTIONARY);
+ dictionary.SetKey("email", base::Value(account.email));
+ dictionary.SetKey("fullName", base::Value(account.full_name));
+ dictionary.SetKey("givenName", base::Value(account.given_name));
+ const gfx::Image& account_image =
+ account_tracker->GetAccountImage(account.account_id);
+ if (!account_image.IsEmpty()) {
+ dictionary.SetKey(
+ "avatarImage",
+ base::Value(webui::GetBitmapDataUrl(account_image.AsBitmap())));
+ }
+ return dictionary;
+}
+#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
+
} // namespace
namespace settings {
@@ -242,6 +265,10 @@ void PeopleHandler::RegisterMessages() {
"SyncSetupManageOtherPeople",
base::BindRepeating(&PeopleHandler::HandleManageOtherPeople,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "UnifiedConsentToggleChanged",
+ base::BindRepeating(&PeopleHandler::OnUnifiedConsentToggleChanged,
+ base::Unretained(this)));
#if defined(OS_CHROMEOS)
web_ui()->RegisterMessageCallback(
"AttemptUserExit",
@@ -256,6 +283,9 @@ void PeopleHandler::RegisterMessages() {
"SyncSetupSignout", base::BindRepeating(&PeopleHandler::HandleSignout,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
+ "SyncSetupPauseSync", base::BindRepeating(&PeopleHandler::HandlePauseSync,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
"SyncSetupStartSignIn",
base::BindRepeating(&PeopleHandler::HandleStartSignin,
base::Unretained(this)));
@@ -330,6 +360,15 @@ void PeopleHandler::DisplayGaiaLoginInNewTabOrWindow(
force_new_tab = true;
}
+ ProfileSyncService* service = GetSyncService();
+ if (service && service->HasUnrecoverableError()) {
+ // When the user has an unrecoverable error, they first have to sign out and
+ // then sign in again.
+ SigninManagerFactory::GetForProfile(browser->profile())
+ ->SignOut(signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS,
+ signin_metrics::SignoutDelete::IGNORE_METRIC);
+ }
+
// If the signin manager already has an authenticated username, this is a
// re-auth scenario, and we need to ensure that the user signs in with the
// same email address.
@@ -442,9 +481,8 @@ void PeopleHandler::HandleSetDatatypes(const base::ListValue* args) {
const base::Value* callback_id = nullptr;
ParseConfigurationArguments(args, &configuration, &callback_id);
- PrefService* pref_service = profile_->GetPrefs();
- pref_service->SetBoolean(autofill::prefs::kAutofillWalletImportEnabled,
- configuration.payments_integration_enabled);
+ autofill::prefs::SetPaymentsIntegrationEnabled(
+ profile_->GetPrefs(), configuration.payments_integration_enabled);
// Start configuring the ProfileSyncService using the configuration passed
// to us from the JS layer.
@@ -482,32 +520,45 @@ void PeopleHandler::OnAccountUpdated(const AccountInfo& info) {
FireWebUIListener("stored-accounts-updated", *GetStoredAccountsList());
}
+void PeopleHandler::OnAccountImageUpdated(const std::string& account_id,
+ const gfx::Image& image) {
+ FireWebUIListener("stored-accounts-updated", *GetStoredAccountsList());
+}
+
void PeopleHandler::OnAccountRemoved(const AccountInfo& info) {
FireWebUIListener("stored-accounts-updated", *GetStoredAccountsList());
}
std::unique_ptr<base::ListValue> PeopleHandler::GetStoredAccountsList() {
- std::vector<AccountInfo> accounts =
- signin_ui_util::GetAccountsForDicePromos(profile_);
+ std::unique_ptr<base::ListValue> accounts_list =
+ std::make_unique<base::ListValue>();
+ bool dice_enabled =
+ AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_);
+
+ // Dice and unified consent both disabled: do not show the list of accounts.
+ if (!dice_enabled && !unified_consent::IsUnifiedConsentFeatureEnabled())
+ return accounts_list;
AccountTrackerService* account_tracker =
AccountTrackerServiceFactory::GetForProfile(profile_);
- std::unique_ptr<base::ListValue> accounts_list(new base::ListValue);
- accounts_list->Reserve(accounts.size());
-
- for (auto const& account : accounts) {
- accounts_list->GetList().push_back(
- base::Value(base::Value::Type::DICTIONARY));
- base::Value& acc = accounts_list->GetList().back();
- acc.SetKey("email", base::Value(account.email));
- acc.SetKey("fullName", base::Value(account.full_name));
- acc.SetKey("givenName", base::Value(account.given_name));
- const gfx::Image& account_image =
- account_tracker->GetAccountImage(account.account_id);
- if (!account_image.IsEmpty()) {
- acc.SetKey(
- "avatarImage",
- base::Value(webui::GetBitmapDataUrl(account_image.AsBitmap())));
+
+ if (dice_enabled) {
+ // If dice is enabled, show all the accounts.
+ std::vector<AccountInfo> accounts =
+ signin_ui_util::GetAccountsForDicePromos(profile_);
+ accounts_list->Reserve(accounts.size());
+ for (auto const& account : accounts) {
+ accounts_list->GetList().push_back(
+ GetAccountValue(account, account_tracker));
+ }
+ } else {
+ // If dice is disabled (and unified consent enabled), show only the primary
+ // account.
+ std::string primary_account = SigninManagerFactory::GetForProfile(profile_)
+ ->GetAuthenticatedAccountId();
+ if (!primary_account.empty()) {
+ accounts_list->GetList().push_back(GetAccountValue(
+ account_tracker->GetAccountInfo(primary_account), account_tracker));
}
}
@@ -515,6 +566,7 @@ std::unique_ptr<base::ListValue> PeopleHandler::GetStoredAccountsList() {
}
void PeopleHandler::HandleStartSyncingWithEmail(const base::ListValue* args) {
+ DCHECK(AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_));
const base::Value* email;
const base::Value* is_default_promo_account;
CHECK(args->Get(0, &email));
@@ -615,19 +667,14 @@ void PeopleHandler::HandleShowSetupUI(const base::ListValue* args) {
ProfileSyncService* service = GetSyncService();
- // Just let the page open for now, even when the user's not signed in or sync
- // is disabled.
- // TODO(scottchen): finish the UI for signed-out users
- // (https://crbug.com/800972).
- if (IsUnifiedConsentEnabled(profile_) &&
- (IsProfileAuthNeededOrHasErrors() || !service)) {
+ if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
if (service && !sync_blocker_)
sync_blocker_ = service->GetSetupInProgressHandle();
- // Preemptively mark login UI as active, because the user could potentially
- // sign-in directly from this UI without triggering handleShowSetupUI again.
GetLoginUIService()->SetLoginUI(this);
- FireWebUIListener("sync-prefs-changed", base::DictionaryValue());
+
+ PushSyncPrefs();
+ // Always let the page open when unified consent is enabled.
return;
}
@@ -660,11 +707,25 @@ void PeopleHandler::HandleShowSetupUI(const base::ListValue* args) {
if (sync_startup_tracker_)
return;
- if (!service->IsEngineInitialized()) {
+ if (!service->IsEngineInitialized() ||
+ service->HasDisableReason(
+ syncer::SyncService::DISABLE_REASON_USER_CHOICE)) {
// Requesting the sync service to start may trigger call to PushSyncPrefs.
// Setting up the startup tracker beforehand correctly signals the
// re-entrant call to early exit.
- sync_startup_tracker_.reset(new SyncStartupTracker(profile_, this));
+ sync_startup_tracker_ =
+ std::make_unique<SyncStartupTracker>(profile_, this);
+ // RequestStart() does two things:
+ // 1) If DISABLE_REASON_USER_CHOICE is set (meaning that Sync was reset via
+ // the dashboard), clears it.
+ // 2) Pokes the sync service to start *immediately*, i.e. bypass deferred
+ // startup.
+ // It's possible that both of these are already the case, i.e. the engine is
+ // already in the process of initializing, in which case RequestStart() will
+ // effectively do nothing. It's also possible that the sync service is
+ // already running in standalone transport mode and so the engine is already
+ // initialized. In that case, this will trigger the service to switch to
+ // full Sync-the-feature mode.
service->RequestStart();
// See if it's even possible to bring up the sync engine - if not
@@ -704,9 +765,11 @@ void PeopleHandler::HandleRequestPinLoginState(const base::ListValue* args) {
void PeopleHandler::HandleStartSignin(const base::ListValue* args) {
AllowJavascript();
- // Should only be called if the user is not already signed in or has an auth
- // error.
- DCHECK(IsProfileAuthNeededOrHasErrors());
+ // Should only be called if the user is not already signed in, has a auth
+ // error, or a unrecoverable sync error requiring re-auth.
+ ProfileSyncService* service = GetSyncService();
+ DCHECK(IsProfileAuthNeededOrHasErrors() ||
+ (service && service->HasUnrecoverableError()));
DisplayGaiaLogin(signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS);
}
@@ -742,6 +805,15 @@ void PeopleHandler::HandleSignout(const base::ListValue* args) {
ProfileMetrics::DELETE_PROFILE_SETTINGS);
}
}
+
+void PeopleHandler::HandlePauseSync(const base::ListValue* args) {
+ DCHECK(AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_));
+ SigninManager* signin_manager = SigninManagerFactory::GetForProfile(profile_);
+ DCHECK(signin_manager->IsAuthenticated());
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)->UpdateCredentials(
+ signin_manager->GetAuthenticatedAccountId(),
+ OAuth2TokenServiceDelegate::kInvalidRefreshToken);
+}
#endif
void PeopleHandler::HandleGetSyncStatus(const base::ListValue* args) {
@@ -761,6 +833,15 @@ void PeopleHandler::HandleManageOtherPeople(const base::ListValue* /* args */) {
#endif // !defined(OS_CHROMEOS)
}
+void PeopleHandler::OnUnifiedConsentToggleChanged(const base::ListValue* args) {
+ bool is_toggle_checked = args->GetList()[0].GetBool();
+ if (!is_toggle_checked) {
+ unified_consent::metrics::RecordUnifiedConsentRevoked(
+ unified_consent::metrics::UnifiedConsentRevokeReason::
+ kUserDisabledSettingsToggle);
+ }
+}
+
void PeopleHandler::CloseSyncSetup() {
// Stop a timer to handle timeout in waiting for checking network connection.
engine_start_timer_.reset();
@@ -905,10 +986,9 @@ PeopleHandler::GetSyncStatusDictionary() {
base::string16 link_label;
sync_ui_util::ActionType action_type = sync_ui_util::NO_ACTION;
bool status_has_error =
- sync_ui_util::GetStatusLabels(profile_, service, *signin,
- sync_ui_util::PLAIN_TEXT, &status_label,
- &link_label, &action_type) ==
- sync_ui_util::SYNC_ERROR;
+ sync_ui_util::GetStatusLabels(profile_, service, *signin, &status_label,
+ &link_label,
+ &action_type) == sync_ui_util::SYNC_ERROR;
sync_status->SetString("statusText", status_label);
sync_status->SetBoolean("hasError", status_has_error);
sync_status->SetString("statusAction", GetSyncErrorAction(action_type));
@@ -976,9 +1056,8 @@ void PeopleHandler::PushSyncPrefs() {
PrefService* pref_service = profile_->GetPrefs();
syncer::SyncPrefs sync_prefs(pref_service);
args.SetBoolean("syncAllDataTypes", sync_prefs.HasKeepEverythingSynced());
- args.SetBoolean(
- "paymentsIntegrationEnabled",
- pref_service->GetBoolean(autofill::prefs::kAutofillWalletImportEnabled));
+ args.SetBoolean("paymentsIntegrationEnabled",
+ autofill::prefs::IsPaymentsIntegrationEnabled(pref_service));
args.SetBoolean("encryptAllData", service->IsEncryptEverythingEnabled());
args.SetBoolean("encryptAllDataAllowed",
service->IsEncryptEverythingAllowed());
diff --git a/chromium/chrome/browser/ui/webui/settings/people_handler.h b/chromium/chrome/browser/ui/webui/settings/people_handler.h
index bfedcdc900e..6652b50d0a1 100644
--- a/chromium/chrome/browser/ui/webui/settings/people_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/people_handler.h
@@ -88,7 +88,6 @@ class PeopleHandler : public SettingsPageUIHandler,
PeopleHandlerTest,
DisplayConfigureWithEngineDisabledAndSyncStartupCompleted);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, HandleSetupUIWhenSyncDisabled);
- FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SelectCustomEncryption);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest,
ShowSetupCustomPassphraseRequired);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSetupEncryptAll);
@@ -102,9 +101,7 @@ class PeopleHandler : public SettingsPageUIHandler,
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSigninOnAuthError);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSyncSetup);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSyncSetupWhenNotSignedIn);
- FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SuccessfullySetPassphrase);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncEverything);
- FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncNothing);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncAllManually);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestPassphraseStillRequired);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncIndividualTypes);
@@ -117,13 +114,15 @@ class PeopleHandler : public SettingsPageUIHandler,
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerNonCrosTest,
UnrecoverableErrorInitializingSync);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerNonCrosTest, GaiaErrorInitializingSync);
- FRIEND_TEST_ALL_PREFIXES(PeopleHandlerNonCrosTest, HandleCaptcha);
- FRIEND_TEST_ALL_PREFIXES(PeopleHandlerNonCrosTest, HandleGaiaAuthFailure);
- FRIEND_TEST_ALL_PREFIXES(PeopleHandlerNonCrosTest,
- SubmitAuthWithInvalidUsername);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerFirstSigninTest, DisplayBasicLogin);
FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest,
AcquireSyncBlockerWhenLoadingSyncSettingsSubpage);
+ FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, RestartSyncAfterDashboardClear);
+ FRIEND_TEST_ALL_PREFIXES(
+ PeopleHandlerTest,
+ RestartSyncAfterDashboardClearWithStandaloneTransport);
+ FRIEND_TEST_ALL_PREFIXES(PeopleHandlerDiceUnifiedConsentTest,
+ StoredAccountsList);
// SettingsPageUIHandler implementation.
void RegisterMessages() override;
@@ -149,6 +148,8 @@ class PeopleHandler : public SettingsPageUIHandler,
#if BUILDFLAG(ENABLE_DICE_SUPPORT)
// AccountTrackerService::Observer implementation.
void OnAccountUpdated(const AccountInfo& info) override;
+ void OnAccountImageUpdated(const std::string& account_id,
+ const gfx::Image& image) override;
void OnAccountRemoved(const AccountInfo& info) override;
#endif
@@ -173,10 +174,14 @@ class PeopleHandler : public SettingsPageUIHandler,
#if defined(OS_CHROMEOS)
void HandleRequestPinLoginState(const base::ListValue* args);
#endif
+#if !defined(OS_CHROMEOS)
void HandleStartSignin(const base::ListValue* args);
void HandleSignout(const base::ListValue* args);
+ void HandlePauseSync(const base::ListValue* args);
+#endif
void HandleGetSyncStatus(const base::ListValue* args);
void HandleManageOtherPeople(const base::ListValue* args);
+ void OnUnifiedConsentToggleChanged(const base::ListValue* args);
#if !defined(OS_CHROMEOS)
// Displays the GAIA login form.
diff --git a/chromium/chrome/browser/ui/webui/settings/people_handler_unittest.cc b/chromium/chrome/browser/ui/webui/settings/people_handler_unittest.cc
index 58a9f2b000a..d2f47257478 100644
--- a/chromium/chrome/browser/ui/webui/settings/people_handler_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/settings/people_handler_unittest.cc
@@ -14,7 +14,10 @@
#include "base/stl_util.h"
#include "base/values.h"
#include "build/build_config.h"
+#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/fake_signin_manager_builder.h"
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chrome/browser/signin/scoped_account_consistency.h"
#include "chrome/browser/signin/signin_error_controller_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
@@ -31,10 +34,13 @@
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
+#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/fake_auth_status_provider.h"
+#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
#include "components/sync/base/sync_prefs.h"
#include "components/sync_preferences/pref_service_syncable.h"
+#include "components/unified_consent/scoped_unified_consent.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_controller.h"
@@ -182,10 +188,9 @@ class TestingPeopleHandler : public PeopleHandler {
class TestWebUIProvider
: public TestChromeWebUIControllerFactory::WebUIProvider {
public:
- content::WebUIController* NewWebUI(content::WebUI* web_ui,
- const GURL& url) override {
- content::WebUIController* controller = new content::WebUIController(web_ui);
- return controller;
+ std::unique_ptr<content::WebUIController> NewWebUI(content::WebUI* web_ui,
+ const GURL& url) override {
+ return std::make_unique<content::WebUIController>(web_ui);
}
};
@@ -208,7 +213,7 @@ class PeopleHandlerTest : public ChromeRenderViewHostTestHarness {
mock_pss_ = static_cast<ProfileSyncServiceMock*>(
ProfileSyncServiceFactory::GetInstance()->SetTestingFactoryAndUse(
profile(), BuildMockProfileSyncService));
- EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
+ ON_CALL(*mock_pss_, GetAuthError()).WillByDefault(ReturnRef(error_));
ON_CALL(*mock_pss_, GetPassphraseType())
.WillByDefault(Return(syncer::PassphraseType::IMPLICIT_PASSPHRASE));
ON_CALL(*mock_pss_, GetExplicitPassphraseTime()).WillByDefault(
@@ -235,25 +240,26 @@ class PeopleHandlerTest : public ChromeRenderViewHostTestHarness {
// Setup the expectations for calls made when displaying the config page.
void SetDefaultExpectationsForConfigPage() {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_NONE));
- EXPECT_CALL(*mock_pss_, GetRegisteredDataTypes())
- .WillRepeatedly(Return(GetAllTypes()));
- EXPECT_CALL(*mock_pss_, GetPreferredDataTypes())
- .WillRepeatedly(Return(GetAllTypes()));
- EXPECT_CALL(*mock_pss_, GetActiveDataTypes())
- .WillRepeatedly(Return(GetAllTypes()));
- EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsEncryptEverythingEnabled())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, GetRegisteredDataTypes())
+ .WillByDefault(Return(GetAllTypes()));
+ ON_CALL(*mock_pss_, GetPreferredDataTypes())
+ .WillByDefault(Return(GetAllTypes()));
+ ON_CALL(*mock_pss_, GetActiveDataTypes())
+ .WillByDefault(Return(GetAllTypes()));
+ ON_CALL(*mock_pss_, IsEncryptEverythingAllowed())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, IsEncryptEverythingEnabled())
+ .WillByDefault(Return(false));
}
void SetupInitializedProfileSyncService() {
// An initialized ProfileSyncService will have already completed sync setup
// and will have an initialized sync engine.
ASSERT_TRUE(mock_signin_->IsInitialized());
- EXPECT_CALL(*mock_pss_, IsEngineInitialized()).WillRepeatedly(Return(true));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::ACTIVE));
}
void ExpectPageStatusResponse(const std::string& expected_status) {
@@ -336,10 +342,9 @@ TEST_F(PeopleHandlerFirstSigninTest, DisplayBasicLogin) {
// Test that the HandleStartSignin call enables JavaScript.
handler_->DisallowJavascript();
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(
- Return(syncer::SyncService::DISABLE_REASON_NOT_SIGNED_IN));
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NOT_SIGNED_IN));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
// Ensure that the user is not signed in before calling |HandleStartSignin()|.
SigninManager* manager = SigninManager::FromSigninManagerBase(mock_signin_);
manager->SignOut(signin_metrics::SIGNOUT_TEST,
@@ -361,10 +366,9 @@ TEST_F(PeopleHandlerFirstSigninTest, DisplayBasicLogin) {
}
TEST_F(PeopleHandlerTest, ShowSyncSetupWhenNotSignedIn) {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(
- Return(syncer::SyncService::DISABLE_REASON_NOT_SIGNED_IN));
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NOT_SIGNED_IN));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
handler_->HandleShowSetupUI(nullptr);
ExpectPageStatusChanged(PeopleHandler::kDonePageStatus);
@@ -379,8 +383,8 @@ TEST_F(PeopleHandlerTest, ShowSyncSetupWhenNotSignedIn) {
// Verifies that the sync setup is terminated correctly when the
// sync is disabled.
TEST_F(PeopleHandlerTest, HandleSetupUIWhenSyncDisabled) {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(
Return(syncer::SyncService::DISABLE_REASON_ENTERPRISE_POLICY));
handler_->HandleShowSetupUI(nullptr);
@@ -394,11 +398,12 @@ TEST_F(PeopleHandlerTest, HandleSetupUIWhenSyncDisabled) {
// Verifies that the handler correctly handles a cancellation when
// it is displaying the spinner to the user.
TEST_F(PeopleHandlerTest, DisplayConfigureWithEngineDisabledAndCancel) {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_NONE));
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
error_ = GoogleServiceAuthError::AuthErrorNone();
- EXPECT_CALL(*mock_pss_, IsEngineInitialized()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::INITIALIZING));
EXPECT_CALL(*mock_pss_, RequestStart());
// We're simulating a user setting up sync, which would cause the engine to
@@ -419,12 +424,14 @@ TEST_F(PeopleHandlerTest, DisplayConfigureWithEngineDisabledAndCancel) {
// to showing a configuration page when sync setup completes successfully.
TEST_F(PeopleHandlerTest,
DisplayConfigureWithEngineDisabledAndSyncStartupCompleted) {
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
error_ = GoogleServiceAuthError::AuthErrorNone();
// Sync engine is stopped initially, and will start up.
- EXPECT_CALL(*mock_pss_, IsEngineInitialized()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(
+ syncer::SyncService::TransportState::WAITING_FOR_START_REQUEST));
EXPECT_CALL(*mock_pss_, RequestStart());
SetDefaultExpectationsForConfigPage();
@@ -436,9 +443,10 @@ TEST_F(PeopleHandlerTest,
Mock::VerifyAndClearExpectations(mock_pss_);
// Now, act as if the ProfileSyncService has started up.
SetDefaultExpectationsForConfigPage();
- EXPECT_CALL(*mock_pss_, IsEngineInitialized()).WillRepeatedly(Return(true));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::ACTIVE));
error_ = GoogleServiceAuthError::AuthErrorNone();
- EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
+ ON_CALL(*mock_pss_, GetAuthError()).WillByDefault(ReturnRef(error_));
handler_->SyncStartupCompleted();
EXPECT_EQ(2U, web_ui_.call_data().size());
@@ -457,13 +465,13 @@ TEST_F(PeopleHandlerTest,
// user has continued on.
TEST_F(PeopleHandlerTest,
DisplayConfigureWithEngineDisabledAndCancelAfterSigninSuccess) {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_NONE));
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
error_ = GoogleServiceAuthError::AuthErrorNone();
- EXPECT_CALL(*mock_pss_, IsEngineInitialized())
- .WillOnce(Return(false))
- .WillRepeatedly(Return(true));
+ EXPECT_CALL(*mock_pss_, GetTransportState())
+ .WillOnce(Return(syncer::SyncService::TransportState::INITIALIZING))
+ .WillRepeatedly(Return(syncer::SyncService::TransportState::ACTIVE));
EXPECT_CALL(*mock_pss_, RequestStart());
SetDefaultExpectationsForConfigPage();
handler_->HandleShowSetupUI(nullptr);
@@ -481,11 +489,12 @@ TEST_F(PeopleHandlerTest,
}
TEST_F(PeopleHandlerTest, DisplayConfigureWithEngineDisabledAndSigninFailed) {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_NONE));
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
error_ = GoogleServiceAuthError::AuthErrorNone();
- EXPECT_CALL(*mock_pss_, IsEngineInitialized()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::INITIALIZING));
EXPECT_CALL(*mock_pss_, RequestStart());
handler_->HandleShowSetupUI(nullptr);
@@ -493,7 +502,7 @@ TEST_F(PeopleHandlerTest, DisplayConfigureWithEngineDisabledAndSigninFailed) {
Mock::VerifyAndClearExpectations(mock_pss_);
error_ = GoogleServiceAuthError(
GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
- EXPECT_CALL(*mock_pss_, GetAuthError()).WillRepeatedly(ReturnRef(error_));
+ ON_CALL(*mock_pss_, GetAuthError()).WillByDefault(ReturnRef(error_));
NotifySyncListeners();
// On failure, the dialog will be closed.
@@ -502,10 +511,61 @@ TEST_F(PeopleHandlerTest, DisplayConfigureWithEngineDisabledAndSigninFailed) {
LoginUIServiceFactory::GetForProfile(profile())->current_login_ui());
}
+TEST_F(PeopleHandlerTest, RestartSyncAfterDashboardClear) {
+ // Clearing sync from the dashboard results in DISABLE_REASON_USER_CHOICE
+ // being set.
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_USER_CHOICE));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::DISABLED));
+
+ // Attempting to open the setup UI should restart sync.
+ EXPECT_CALL(*mock_pss_, RequestStart()).WillOnce([&]() {
+ // RequestStart() clears DISABLE_REASON_USER_CHOICE, and immediately starts
+ // initialzing the engine.
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(
+ Return(syncer::SyncService::TransportState::INITIALIZING));
+ });
+
+ handler_->HandleShowSetupUI(nullptr);
+ ExpectPageStatusChanged(PeopleHandler::kSpinnerPageStatus);
+}
+
+TEST_F(PeopleHandlerTest,
+ RestartSyncAfterDashboardClearWithStandaloneTransport) {
+ // Clearing sync from the dashboard results in DISABLE_REASON_USER_CHOICE
+ // being set. However, the sync engine has restarted in standalone transport
+ // mode.
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_USER_CHOICE));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::ACTIVE));
+
+ // Attempting to open the setup UI should re-enable sync-the-feature.
+ EXPECT_CALL(*mock_pss_, RequestStart()).WillOnce([&]() {
+ // RequestStart() clears DISABLE_REASON_USER_CHOICE. Since the engine is
+ // already running, it just gets reconfigured.
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(
+ Return(syncer::SyncService::TransportState::CONFIGURING));
+ });
+
+ handler_->HandleShowSetupUI(nullptr);
+ ExpectPageStatusChanged(PeopleHandler::kSpinnerPageStatus);
+}
+
// Tests that signals not related to user intention to configure sync don't
// trigger sync engine start.
TEST_F(PeopleHandlerTest, OnlyStartEngineWhenConfiguringSync) {
- EXPECT_CALL(*mock_pss_, IsEngineInitialized()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::INITIALIZING));
EXPECT_CALL(*mock_pss_, RequestStart()).Times(0);
NotifySyncStateChanged();
}
@@ -541,10 +601,10 @@ class PeopleHandlerNonCrosTest : public PeopleHandlerTest {
// TODO(kochi): We need equivalent tests for ChromeOS.
TEST_F(PeopleHandlerNonCrosTest, UnrecoverableErrorInitializingSync) {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(
Return(syncer::SyncService::DISABLE_REASON_UNRECOVERABLE_ERROR));
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
// Open the web UI.
handler_->HandleShowSetupUI(nullptr);
@@ -552,10 +612,9 @@ TEST_F(PeopleHandlerNonCrosTest, UnrecoverableErrorInitializingSync) {
}
TEST_F(PeopleHandlerNonCrosTest, GaiaErrorInitializingSync) {
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(
- Return(syncer::SyncService::DISABLE_REASON_NOT_SIGNED_IN));
- EXPECT_CALL(*mock_pss_, IsFirstSetupComplete()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NOT_SIGNED_IN));
+ ON_CALL(*mock_pss_, IsFirstSetupComplete()).WillByDefault(Return(false));
// Open the web UI.
handler_->HandleShowSetupUI(nullptr);
@@ -570,10 +629,9 @@ TEST_F(PeopleHandlerTest, TestSyncEverything) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
SetupInitializedProfileSyncService();
EXPECT_CALL(*mock_pss_, OnUserChoseDatatypes(true, _));
handler_->HandleSetDatatypes(&list_args);
@@ -587,12 +645,11 @@ TEST_F(PeopleHandlerTest, TestPassphraseStillRequired) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
SetDefaultExpectationsForConfigPage();
@@ -612,10 +669,10 @@ TEST_F(PeopleHandlerTest, EnterExistingFrozenImplicitPassword) {
// Act as if an encryption passphrase is required the first time, then never
// again after that.
EXPECT_CALL(*mock_pss_, IsPassphraseRequired()).WillOnce(Return(true));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
EXPECT_CALL(*mock_pss_, SetDecryptionPassphrase("oldGaiaPassphrase"))
.WillOnce(Return(true));
@@ -632,12 +689,11 @@ TEST_F(PeopleHandlerTest, SetNewCustomPassphrase) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
EXPECT_CALL(*mock_pss_,
SetEncryptionPassphrase("custom_passphrase",
@@ -655,12 +711,11 @@ TEST_F(PeopleHandlerTest, EnterWrongExistingPassphrase) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
EXPECT_CALL(*mock_pss_, SetDecryptionPassphrase("invalid_passphrase")).
WillOnce(Return(false));
@@ -683,12 +738,11 @@ TEST_F(PeopleHandlerTest, EnterBlankExistingPassphrase) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
SetDefaultExpectationsForConfigPage();
@@ -702,10 +756,9 @@ TEST_F(PeopleHandlerTest, EnterBlankExistingPassphrase) {
// data type.
TEST_F(PeopleHandlerTest, TestSyncIndividualTypes) {
syncer::ModelTypeSet user_selectable_types = GetAllTypes();
- syncer::ModelTypeSet::Iterator it;
- for (it = user_selectable_types.First(); it.Good(); it.Inc()) {
+ for (syncer::ModelType type : user_selectable_types) {
syncer::ModelTypeSet type_to_set;
- type_to_set.Put(it.Get());
+ type_to_set.Put(type);
std::string args = GetConfiguration(NULL,
CHOOSE_WHAT_TO_SYNC,
type_to_set,
@@ -714,10 +767,9 @@ TEST_F(PeopleHandlerTest, TestSyncIndividualTypes) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
SetupInitializedProfileSyncService();
EXPECT_CALL(*mock_pss_,
OnUserChoseDatatypes(false, ModelTypeSetMatches(type_to_set)));
@@ -737,10 +789,9 @@ TEST_F(PeopleHandlerTest, TestSyncAllManually) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
SetupInitializedProfileSyncService();
EXPECT_CALL(*mock_pss_,
OnUserChoseDatatypes(false, ModelTypeSetMatches(GetAllTypes())));
@@ -750,10 +801,9 @@ TEST_F(PeopleHandlerTest, TestSyncAllManually) {
}
TEST_F(PeopleHandlerTest, ShowSyncSetup) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
// This should display the sync setup dialog (not login).
SetDefaultExpectationsForConfigPage();
@@ -773,13 +823,13 @@ TEST_F(PeopleHandlerTest, ShowSigninOnAuthError) {
FakeAuthStatusProvider provider(
SigninErrorControllerFactory::GetForProfile(profile()));
provider.SetAuthError(kTestUser, error_);
- EXPECT_CALL(*mock_pss_, GetDisableReasons())
- .WillRepeatedly(Return(syncer::SyncService::DISABLE_REASON_NONE));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsEngineInitialized()).WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, GetDisableReasons())
+ .WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::INITIALIZING));
#if defined(OS_CHROMEOS)
// On ChromeOS, auth errors are ignored - instead we just try to start the
@@ -806,10 +856,9 @@ TEST_F(PeopleHandlerTest, ShowSigninOnAuthError) {
}
TEST_F(PeopleHandlerTest, ShowSetupSyncEverything) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
SetDefaultExpectationsForConfigPage();
// This should display the sync setup dialog (not login).
@@ -835,10 +884,9 @@ TEST_F(PeopleHandlerTest, ShowSetupSyncEverything) {
}
TEST_F(PeopleHandlerTest, ShowSetupManuallySyncAll) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
syncer::SyncPrefs sync_prefs(profile()->GetPrefs());
sync_prefs.SetKeepEverythingSynced(false);
@@ -852,20 +900,17 @@ TEST_F(PeopleHandlerTest, ShowSetupManuallySyncAll) {
TEST_F(PeopleHandlerTest, ShowSetupSyncForAllTypesIndividually) {
syncer::ModelTypeSet user_selectable_types = GetAllTypes();
- syncer::ModelTypeSet::Iterator it;
- for (it = user_selectable_types.First(); it.Good(); it.Inc()) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ for (syncer::ModelType type : user_selectable_types) {
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
syncer::SyncPrefs sync_prefs(profile()->GetPrefs());
sync_prefs.SetKeepEverythingSynced(false);
SetDefaultExpectationsForConfigPage();
syncer::ModelTypeSet types;
- types.Put(it.Get());
- EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()).
- WillRepeatedly(Return(types));
+ types.Put(type);
+ ON_CALL(*mock_pss_, GetPreferredDataTypes()).WillByDefault(Return(types));
// This should display the sync setup dialog (not login).
handler_->HandleShowSetupUI(nullptr);
@@ -883,10 +928,9 @@ TEST_F(PeopleHandlerTest, ShowSetupSyncForAllTypesIndividually) {
}
TEST_F(PeopleHandlerTest, ShowSetupOldGaiaPassphraseRequired) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, GetPassphraseType())
- .WillRepeatedly(
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, GetPassphraseType())
+ .WillByDefault(
Return(syncer::PassphraseType::FROZEN_IMPLICIT_PASSPHRASE));
SetupInitializedProfileSyncService();
SetDefaultExpectationsForConfigPage();
@@ -900,10 +944,9 @@ TEST_F(PeopleHandlerTest, ShowSetupOldGaiaPassphraseRequired) {
}
TEST_F(PeopleHandlerTest, ShowSetupCustomPassphraseRequired) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*mock_pss_, GetPassphraseType())
- .WillRepeatedly(Return(syncer::PassphraseType::CUSTOM_PASSPHRASE));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(true));
+ ON_CALL(*mock_pss_, GetPassphraseType())
+ .WillByDefault(Return(syncer::PassphraseType::CUSTOM_PASSPHRASE));
SetupInitializedProfileSyncService();
SetDefaultExpectationsForConfigPage();
@@ -916,14 +959,12 @@ TEST_F(PeopleHandlerTest, ShowSetupCustomPassphraseRequired) {
}
TEST_F(PeopleHandlerTest, ShowSetupEncryptAll) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
SetDefaultExpectationsForConfigPage();
- EXPECT_CALL(*mock_pss_, IsEncryptEverythingEnabled())
- .WillRepeatedly(Return(true));
+ ON_CALL(*mock_pss_, IsEncryptEverythingEnabled()).WillByDefault(Return(true));
// This should display the sync setup dialog (not login).
handler_->HandleShowSetupUI(nullptr);
@@ -933,14 +974,13 @@ TEST_F(PeopleHandlerTest, ShowSetupEncryptAll) {
}
TEST_F(PeopleHandlerTest, ShowSetupEncryptAllDisallowed) {
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsUsingSecondaryPassphrase())
+ .WillByDefault(Return(false));
SetupInitializedProfileSyncService();
SetDefaultExpectationsForConfigPage();
- EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsEncryptEverythingAllowed())
+ .WillByDefault(Return(false));
// This should display the sync setup dialog (not login).
handler_->HandleShowSetupUI(nullptr);
@@ -956,17 +996,75 @@ TEST_F(PeopleHandlerTest, TurnOnEncryptAllDisallowed) {
base::ListValue list_args;
list_args.AppendString(kTestCallbackId);
list_args.AppendString(args);
- EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
- .WillRepeatedly(Return(false));
- EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
+ .WillByDefault(Return(false));
+ ON_CALL(*mock_pss_, IsPassphraseRequired()).WillByDefault(Return(false));
SetupInitializedProfileSyncService();
- EXPECT_CALL(*mock_pss_, IsEncryptEverythingAllowed())
- .WillRepeatedly(Return(false));
+ ON_CALL(*mock_pss_, IsEncryptEverythingAllowed())
+ .WillByDefault(Return(false));
EXPECT_CALL(*mock_pss_, EnableEncryptEverything()).Times(0);
handler_->HandleSetEncryption(&list_args);
ExpectPageStatusResponse(PeopleHandler::kConfigurePageStatus);
}
+#if BUILDFLAG(ENABLE_DICE_SUPPORT)
+class PeopleHandlerDiceUnifiedConsentTest
+ : public ::testing::TestWithParam<std::tuple<bool, bool>> {};
+
+TEST_P(PeopleHandlerDiceUnifiedConsentTest, StoredAccountsList) {
+ content::TestBrowserThreadBundle test_browser_thread_bundle;
+
+ // Decode test parameters.
+ bool dice_enabled;
+ bool unified_consent_enabled;
+ std::tie(dice_enabled, unified_consent_enabled) = GetParam();
+ unified_consent::ScopedUnifiedConsent unified_consent(
+ unified_consent_enabled
+ ? unified_consent::UnifiedConsentFeatureState::kEnabledWithBump
+ : unified_consent::UnifiedConsentFeatureState::kDisabled);
+ ScopedAccountConsistency dice(
+ dice_enabled ? signin::AccountConsistencyMethod::kDice
+ : signin::AccountConsistencyMethod::kDiceFixAuthErrors);
+
+ // Setup the profile.
+ TestingProfile profile;
+ AccountTrackerService* account_tracker =
+ AccountTrackerServiceFactory::GetForProfile(&profile);
+ SigninManager* signin_manager = SigninManagerFactory::GetForProfile(&profile);
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(&profile);
+ std::string account_1 =
+ account_tracker->SeedAccountInfo("1234", "a@gmail.com");
+ std::string account_2 =
+ account_tracker->SeedAccountInfo("5678", "b@gmail.com");
+ token_service->UpdateCredentials(account_1, "token");
+ token_service->UpdateCredentials(account_2, "token");
+ signin_manager->SetAuthenticatedAccountInfo("1234", "a@gmail.com");
+
+ PeopleHandler handler(&profile);
+ std::unique_ptr<base::ListValue> accounts_list =
+ handler.GetStoredAccountsList();
+
+ if (dice_enabled) {
+ EXPECT_EQ(2u, accounts_list->GetSize());
+ EXPECT_EQ("a@gmail.com",
+ accounts_list->GetList()[0].FindKey("email")->GetString());
+ EXPECT_EQ("b@gmail.com",
+ accounts_list->GetList()[1].FindKey("email")->GetString());
+ } else if (unified_consent_enabled) {
+ EXPECT_EQ(1u, accounts_list->GetSize());
+ EXPECT_EQ("a@gmail.com",
+ accounts_list->GetList()[0].FindKey("email")->GetString());
+ } else {
+ EXPECT_EQ(0u, accounts_list->GetSize());
+ }
+}
+
+INSTANTIATE_TEST_CASE_P(Test,
+ PeopleHandlerDiceUnifiedConsentTest,
+ ::testing::Combine(::testing::Bool(),
+ ::testing::Bool()));
+#endif // BUILDFLAG(ENABLE_DICE_SUPPORT)
+
} // namespace settings
diff --git a/chromium/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc b/chromium/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
index 1f486d9b882..e91b7de825c 100644
--- a/chromium/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
-#include "components/google/core/browser/google_util.h"
+#include "components/google/core/common/google_util.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_ui.h"
diff --git a/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc b/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
index 871a956100d..908a8d324a7 100644
--- a/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.cc
@@ -18,8 +18,11 @@
#include "chrome/browser/browsing_data/counters/browsing_data_counter_factory.h"
#include "chrome/browser/browsing_data/counters/browsing_data_counter_utils.h"
#include "chrome/browser/history/web_history_service_factory.h"
+#include "chrome/browser/signin/account_reconcilor_factory.h"
+#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
@@ -28,11 +31,11 @@
#include "components/feature_engagement/buildflags.h"
#include "components/prefs/pref_member.h"
#include "components/prefs/pref_service.h"
-#include "components/signin/core/browser/signin_manager.h"
#include "content/public/browser/browsing_data_filter_builder.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
+#include "services/identity/public/cpp/identity_manager.h"
#include "ui/base/text/bytes_formatting.h"
#if BUILDFLAG(ENABLE_DESKTOP_IN_PRODUCT_HELP)
@@ -248,15 +251,27 @@ void ClearBrowsingDataHandler::HandleClearBrowsingData(
checked_other_types);
}
+ // If Sync is running, prevent it from being paused during the operation.
+ // However, if Sync is in error, clearing cookies should pause it.
+ std::unique_ptr<AccountReconcilor::ScopedSyncedDataDeletion>
+ scoped_data_deletion;
+ sync_ui_util::MessageType sync_status = sync_ui_util::GetStatus(
+ profile_, sync_service_, *SigninManagerFactory::GetForProfile(profile_));
+ if (sync_status == sync_ui_util::SYNCED) {
+ scoped_data_deletion = AccountReconcilorFactory::GetForProfile(profile_)
+ ->GetScopedSyncDataDeletion();
+ }
+
int period_selected;
CHECK(args->GetInteger(2, &period_selected));
content::BrowsingDataRemover* remover =
content::BrowserContext::GetBrowsingDataRemover(profile_);
- base::OnceClosure callback = base::BindOnce(
- &ClearBrowsingDataHandler::OnClearingTaskFinished,
- weak_ptr_factory_.GetWeakPtr(), webui_callback_id, std::move(data_types));
+ base::OnceClosure callback =
+ base::BindOnce(&ClearBrowsingDataHandler::OnClearingTaskFinished,
+ weak_ptr_factory_.GetWeakPtr(), webui_callback_id,
+ std::move(data_types), std::move(scoped_data_deletion));
browsing_data::TimePeriod time_period =
static_cast<browsing_data::TimePeriod>(period_selected);
@@ -275,7 +290,8 @@ void ClearBrowsingDataHandler::HandleClearBrowsingData(
void ClearBrowsingDataHandler::OnClearingTaskFinished(
const std::string& webui_callback_id,
- const base::flat_set<BrowsingDataType>& data_types) {
+ const base::flat_set<BrowsingDataType>& data_types,
+ std::unique_ptr<AccountReconcilor::ScopedSyncedDataDeletion> deletion) {
PrefService* prefs = profile_->GetPrefs();
int notice_shown_times = prefs->GetInteger(
browsing_data::prefs::kClearBrowsingDataHistoryNoticeShownTimes);
@@ -327,10 +343,11 @@ void ClearBrowsingDataHandler::OnStateChanged(syncer::SyncService* sync) {
}
void ClearBrowsingDataHandler::UpdateSyncState() {
- auto* signin_manager = SigninManagerFactory::GetForProfile(profile_);
+ identity::IdentityManager* identity_manager =
+ IdentityManagerFactory::GetForProfile(profile_);
CallJavascriptFunction(
"cr.webUIListenerCallback", base::Value("update-sync-state"),
- base::Value(signin_manager && signin_manager->IsAuthenticated()),
+ base::Value(identity_manager && identity_manager->HasPrimaryAccount()),
base::Value(sync_service_ && sync_service_->IsSyncActive() &&
sync_service_->GetActiveDataTypes().Has(
syncer::HISTORY_DELETE_DIRECTIVES)),
diff --git a/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h b/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
index 40fcfa0b06f..96e239934ac 100644
--- a/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
@@ -17,6 +17,7 @@
#include "components/browser_sync/profile_sync_service.h"
#include "components/browsing_data/core/browsing_data_utils.h"
#include "components/browsing_data/core/counters/browsing_data_counter.h"
+#include "components/signin/core/browser/account_reconcilor.h"
namespace base {
class ListValue;
@@ -47,12 +48,14 @@ class ClearBrowsingDataHandler : public SettingsPageUIHandler,
// Clears browsing data, called by Javascript.
void HandleClearBrowsingData(const base::ListValue* value);
-
// Called when a clearing task finished. |webui_callback_id| is provided
// by the WebUI action that initiated it.
+ // The ScopedSyncedDataDeletion is passed here to ensure that the Sync token
+ // is not invalidated before this function is run.
void OnClearingTaskFinished(
const std::string& webui_callback_id,
- const base::flat_set<browsing_data::BrowsingDataType>& data_types);
+ const base::flat_set<browsing_data::BrowsingDataType>& data_types,
+ std::unique_ptr<AccountReconcilor::ScopedSyncedDataDeletion> deletion);
// Initializes the dialog UI. Called by JavaScript when the DOM is ready.
void HandleInitialize(const base::ListValue* args);
diff --git a/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc b/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc
index 9150748cdba..12b0a2a44ee 100644
--- a/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.cc
@@ -45,6 +45,9 @@ class FileSystemContext;
namespace {
+constexpr char kEffectiveTopLevelDomainPlus1Name[] = "etldPlus1";
+constexpr char kNumCookies[] = "numCookies";
+
int GetCategoryLabelID(CookieTreeNode::DetailedInfo::NodeType node_type) {
constexpr struct {
CookieTreeNode::DetailedInfo::NodeType node_type;
@@ -174,6 +177,10 @@ void CookiesViewHandler::RegisterMessages() {
base::BindRepeating(&CookiesViewHandler::HandleGetCookieDetails,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
+ "localData.getNumCookiesList",
+ base::BindRepeating(&CookiesViewHandler::HandleGetNumCookiesList,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
"localData.getNumCookiesString",
base::BindRepeating(&CookiesViewHandler::HandleGetNumCookiesString,
base::Unretained(this)));
@@ -309,53 +316,73 @@ void CookiesViewHandler::HandleGetCookieDetails(const base::ListValue* args) {
SendCookieDetails(node);
}
-void CookiesViewHandler::HandleGetNumCookiesString(
- const base::ListValue* args) {
+void CookiesViewHandler::HandleGetNumCookiesList(const base::ListValue* args) {
CHECK_EQ(2U, args->GetSize());
std::string callback_id;
CHECK(args->GetString(0, &callback_id));
- base::string16 etld_plus1;
- CHECK(args->GetString(1, &etld_plus1));
+ const base::ListValue* etld_plus1_list;
+ CHECK(args->GetList(1, &etld_plus1_list));
AllowJavascript();
CHECK(cookies_tree_model_.get());
- // This method is only interested in the number of cookies, so don't save the
- // filter and keep the existing |sorted_sites_| list.
- if (etld_plus1 != filter_)
- cookies_tree_model_->UpdateSearchResults(etld_plus1);
- int num_cookies = 0;
- const CookieTreeNode* root = cookies_tree_model_->GetRoot();
- for (int i = 0; i < root->child_count(); ++i) {
- const CookieTreeNode* site = root->GetChild(i);
- const base::string16& title = site->GetTitle();
- if (!base::EndsWith(title, etld_plus1,
- base::CompareCase::INSENSITIVE_ASCII)) {
- continue;
- }
+ base::string16 etld_plus1;
+ base::Value result(base::Value::Type::LIST);
+ for (size_t i = 0; i < etld_plus1_list->GetSize(); ++i) {
+ etld_plus1_list->GetString(i, &etld_plus1);
+ // This method is only interested in the number of cookies, so don't save
+ // |etld_plus1| as a new filter and keep the existing |sorted_sites_| list.
+ cookies_tree_model_->UpdateSearchResults(etld_plus1);
- for (int j = 0; j < site->child_count(); ++j) {
- const CookieTreeNode* category = site->GetChild(j);
- if (category->GetDetailedInfo().node_type !=
- CookieTreeNode::DetailedInfo::TYPE_COOKIES) {
+ int num_cookies = 0;
+ const CookieTreeNode* root = cookies_tree_model_->GetRoot();
+ for (int i = 0; i < root->child_count(); ++i) {
+ const CookieTreeNode* site = root->GetChild(i);
+ const base::string16& title = site->GetTitle();
+ if (!base::EndsWith(title, etld_plus1,
+ base::CompareCase::INSENSITIVE_ASCII)) {
continue;
}
- for (int k = 0; k < category->child_count(); ++k) {
- if (category->GetChild(k)->GetDetailedInfo().node_type !=
- CookieTreeNode::DetailedInfo::TYPE_COOKIE) {
+ for (int j = 0; j < site->child_count(); ++j) {
+ const CookieTreeNode* category = site->GetChild(j);
+ if (category->GetDetailedInfo().node_type !=
+ CookieTreeNode::DetailedInfo::TYPE_COOKIES) {
continue;
}
- ++num_cookies;
+ for (int k = 0; k < category->child_count(); ++k) {
+ if (category->GetChild(k)->GetDetailedInfo().node_type !=
+ CookieTreeNode::DetailedInfo::TYPE_COOKIE) {
+ continue;
+ }
+
+ ++num_cookies;
+ }
}
}
- }
- if (etld_plus1 != filter_) {
- // Restore the original |filter_|.
- cookies_tree_model_->UpdateSearchResults(filter_);
+ base::Value cookies_per_etld_plus1(base::Value::Type::DICTIONARY);
+ cookies_per_etld_plus1.SetKey(kEffectiveTopLevelDomainPlus1Name,
+ base::Value(etld_plus1));
+ cookies_per_etld_plus1.SetKey(kNumCookies, base::Value(num_cookies));
+ result.GetList().emplace_back(std::move(cookies_per_etld_plus1));
}
+ ResolveJavascriptCallback(base::Value(callback_id), result);
+
+ // Restore the original |filter_|.
+ cookies_tree_model_->UpdateSearchResults(filter_);
+}
+
+void CookiesViewHandler::HandleGetNumCookiesString(
+ const base::ListValue* args) {
+ CHECK_EQ(2U, args->GetSize());
+ std::string callback_id;
+ CHECK(args->GetString(0, &callback_id));
+ int num_cookies;
+ CHECK(args->GetInteger(1, &num_cookies));
+
+ AllowJavascript();
const base::string16 string =
num_cookies > 0 ? l10n_util::GetPluralStringFUTF16(
IDS_SETTINGS_SITE_SETTINGS_NUM_COOKIES, num_cookies)
diff --git a/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.h b/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.h
index 0b742577c16..bba06ea179a 100644
--- a/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/settings_cookies_view_handler.h
@@ -61,7 +61,12 @@ class CookiesViewHandler : public SettingsPageUIHandler,
// Retrieve cookie details for a specific site.
void HandleGetCookieDetails(const base::ListValue* args);
- // Gets the number of cookies formatted in a plural string, given a site.
+ // Gets a list containing the number of cookies for each domain (eTLD+1 names)
+ // given in |siteList|. This will always return a result array the same length
+ // and in the same order as |siteList|.
+ void HandleGetNumCookiesList(const base::ListValue* args);
+
+ // Gets a plural string for the given number of cookies.
void HandleGetNumCookiesString(const base::ListValue* args);
// Remove all sites data.
diff --git a/chromium/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc b/chromium/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc
index 721518a1f17..1ea37913233 100644
--- a/chromium/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc
@@ -192,6 +192,7 @@ void ManageProfileHandler::HandleSetProfileIconToDefaultAvatar(
PrefService* pref_service = profile_->GetPrefs();
pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index);
+ pref_service->SetInteger(prefs::kProfileLocalAvatarIndex, new_icon_index);
pref_service->SetBoolean(prefs::kProfileUsingDefaultAvatar, false);
pref_service->SetBoolean(prefs::kProfileUsingGAIAAvatar, false);
diff --git a/chromium/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chromium/chrome/browser/ui/webui/settings/site_settings_handler.cc
index fa89523712c..04422c787f8 100644
--- a/chromium/chrome/browser/ui/webui/settings/site_settings_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -17,11 +17,12 @@
#include "base/macros.h"
#include "base/metrics/user_metrics.h"
#include "base/values.h"
-#include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/content_settings/web_site_settings_uma_util.h"
+#include "chrome/browser/engagement/site_engagement_service.h"
#include "chrome/browser/infobars/infobar_service.h"
+#include "chrome/browser/media/unified_autoplay_config.h"
#include "chrome/browser/permissions/chooser_context_base.h"
#include "chrome/browser/permissions/permission_decision_auto_blocker.h"
#include "chrome/browser/permissions/permission_manager.h"
@@ -34,11 +35,14 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/site_settings_helper.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
+#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/crx_file/id_util.h"
+#include "components/prefs/pref_change_registrar.h"
+#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_contents.h"
@@ -54,9 +58,6 @@
#include "ui/base/text/bytes_formatting.h"
#if defined(OS_CHROMEOS)
-#include "chrome/common/pref_names.h"
-#include "components/prefs/pref_change_registrar.h"
-#include "components/prefs/pref_service.h"
#include "components/user_manager/user_manager.h"
#endif
@@ -66,6 +67,7 @@ namespace {
constexpr char kEffectiveTopLevelDomainPlus1Name[] = "etldPlus1";
constexpr char kOriginList[] = "origins";
+constexpr char kNumCookies[] = "numCookies";
constexpr char kZoom[] = "zoom";
// Return an appropriate API Permission ID for the given string name.
@@ -149,12 +151,44 @@ void CreateOrAppendSiteGroupEntry(
}
}
-} // namespace
+// Converts a given |site_group_map| to a list of base::DictionaryValues, adding
+// the site engagement score for each origin.
+void ConvertSiteGroupMapToListValue(
+ const std::map<std::string, std::set<std::string>>& site_group_map,
+ base::Value* list_value,
+ Profile* profile) {
+ DCHECK_EQ(base::Value::Type::LIST, list_value->type());
+ DCHECK(profile);
+ SiteEngagementService* engagement_service =
+ SiteEngagementService::Get(profile);
+ for (const auto& entry : site_group_map) {
+ // eTLD+1 is the effective top level domain + 1.
+ base::Value site_group(base::Value::Type::DICTIONARY);
+ site_group.SetKey(kEffectiveTopLevelDomainPlus1Name,
+ base::Value(entry.first));
+ base::Value origin_list(base::Value::Type::LIST);
+ for (const std::string& origin : entry.second) {
+ base::Value origin_object(base::Value::Type::DICTIONARY);
+ origin_object.SetKey("origin", base::Value(origin));
+ origin_object.SetKey(
+ "engagement",
+ base::Value(engagement_service->GetScore(GURL(origin))));
+ origin_object.SetKey("usage", base::Value(0));
+ origin_list.GetList().emplace_back(std::move(origin_object));
+ }
+ site_group.SetKey(kNumCookies, base::Value(0));
+ site_group.SetKey(kOriginList, std::move(origin_list));
+ list_value->GetList().push_back(std::move(site_group));
+ }
+}
+} // namespace
SiteSettingsHandler::SiteSettingsHandler(Profile* profile)
- : profile_(profile), observer_(this) {
-}
+ : profile_(profile),
+ observer_(this),
+ pref_change_registrar_(nullptr),
+ local_storage_helper_(nullptr) {}
SiteSettingsHandler::~SiteSettingsHandler() {
}
@@ -190,6 +224,10 @@ void SiteSettingsHandler::RegisterMessages() {
base::BindRepeating(&SiteSettingsHandler::HandleGetAllSites,
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
+ "getFormattedBytes",
+ base::BindRepeating(&SiteSettingsHandler::HandleGetFormattedBytes,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
"getExceptionList",
base::BindRepeating(&SiteSettingsHandler::HandleGetExceptionList,
base::Unretained(this)));
@@ -235,6 +273,14 @@ void SiteSettingsHandler::RegisterMessages() {
"removeZoomLevel",
base::BindRepeating(&SiteSettingsHandler::HandleRemoveZoomLevel,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "setBlockAutoplayEnabled",
+ base::BindRepeating(&SiteSettingsHandler::HandleSetBlockAutoplayEnabled,
+ base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "fetchBlockAutoplayStatus",
+ base::BindRepeating(&SiteSettingsHandler::HandleFetchBlockAutoplayStatus,
+ base::Unretained(this)));
}
void SiteSettingsHandler::OnJavascriptAllowed() {
@@ -263,9 +309,16 @@ void SiteSettingsHandler::OnJavascriptAllowed() {
base::Bind(&SiteSettingsHandler::OnZoomLevelChanged,
base::Unretained(this)));
-#if defined(OS_CHROMEOS)
pref_change_registrar_ = std::make_unique<PrefChangeRegistrar>();
pref_change_registrar_->Init(profile_->GetPrefs());
+
+ // If the block autoplay pref changes send the new status.
+ pref_change_registrar_->Add(
+ prefs::kBlockAutoplayEnabled,
+ base::Bind(&SiteSettingsHandler::SendBlockAutoplayStatus,
+ base::Unretained(this)));
+
+#if defined(OS_CHROMEOS)
pref_change_registrar_->Add(
prefs::kEnableDRM,
base::Bind(&SiteSettingsHandler::OnPrefEnableDrmChanged,
@@ -277,6 +330,7 @@ void SiteSettingsHandler::OnJavascriptDisallowed() {
observer_.RemoveAll();
notification_registrar_.RemoveAll();
host_zoom_map_subscription_.reset();
+ pref_change_registrar_->Remove(prefs::kBlockAutoplayEnabled);
#if defined(OS_CHROMEOS)
pref_change_registrar_->Remove(prefs::kEnableDRM);
#endif
@@ -342,6 +396,14 @@ void SiteSettingsHandler::OnContentSettingChanged(
? ""
: secondary_pattern.ToString()));
}
+
+ // If the default sound content setting changed then we should send block
+ // autoplay status.
+ if (primary_pattern == ContentSettingsPattern() &&
+ secondary_pattern == ContentSettingsPattern() &&
+ content_type == CONTENT_SETTINGS_TYPE_SOUND) {
+ SendBlockAutoplayStatus();
+ }
}
void SiteSettingsHandler::Observe(
@@ -425,9 +487,7 @@ void SiteSettingsHandler::HandleClearUsage(
base::Unretained(this), barrier));
// Also clear the *local* storage data.
- scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper =
- new BrowsingDataLocalStorageHelper(profile_);
- local_storage_helper->DeleteOrigin(url, barrier);
+ GetLocalStorageHelper()->DeleteOrigin(url, barrier);
}
}
@@ -560,6 +620,10 @@ void SiteSettingsHandler::HandleGetAllSites(const base::ListValue* args) {
// TODO(https://crbug.com/835712): Assess performance of this method for
// unusually large numbers of stored content settings.
+ // Add sites that are using any local storage to the list.
+ GetLocalStorageHelper()->StartFetching(base::BindRepeating(
+ &SiteSettingsHandler::OnLocalStorageFetched, base::Unretained(this)));
+
// Retrieve a list of embargoed settings to check separately. This ensures
// that only settings included in |content_types| will be listed in all sites.
ContentSettingsForOneType embargo_settings;
@@ -584,9 +648,6 @@ void SiteSettingsHandler::HandleGetAllSites(const base::ListValue* args) {
// Convert |types| to a list of ContentSettingsTypes.
for (ContentSettingsType content_type : content_types) {
- // TODO(https://crbug.com/835712): Add extension content settings, plus
- // sites that use any non-zero amount of storage.
-
ContentSettingsForOneType entries;
map->GetSettingsForOneType(content_type, std::string(), &entries);
for (const ContentSettingPatternSource& e : entries) {
@@ -596,21 +657,51 @@ void SiteSettingsHandler::HandleGetAllSites(const base::ListValue* args) {
}
}
- // Convert |all_sites_map| to a list of base::DictionaryValues.
base::Value result(base::Value::Type::LIST);
- for (const auto& entry : all_sites_map) {
- // eTLD+1 is the effective top level domain + 1.
- base::Value site_group(base::Value::Type::DICTIONARY);
- site_group.SetKey(kEffectiveTopLevelDomainPlus1Name,
- base::Value(entry.first));
- base::Value origin_list(base::Value::Type::LIST);
- for (const std::string& origin : entry.second) {
- origin_list.GetList().emplace_back(origin);
+ ConvertSiteGroupMapToListValue(all_sites_map, &result, profile);
+ ResolveJavascriptCallback(*callback_id, result);
+}
+
+void SiteSettingsHandler::OnLocalStorageFetched(
+ const std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo>&
+ local_storage_info) {
+ std::map<std::string, int> origin_size_map;
+ std::map<std::string, std::set<std::string>> all_sites_map;
+ for (const BrowsingDataLocalStorageHelper::LocalStorageInfo& info :
+ local_storage_info) {
+ origin_size_map.emplace(info.origin_url.spec(), info.size);
+ CreateOrAppendSiteGroupEntry(&all_sites_map, info.origin_url);
+ }
+ base::Value result(base::Value::Type::LIST);
+ ConvertSiteGroupMapToListValue(all_sites_map, &result, profile_);
+
+ // Merge the origin usage number into |result|.
+ for (size_t i = 0; i < result.GetList().size(); ++i) {
+ base::Value* site_group = &result.GetList()[i];
+ base::Value* origin_list = site_group->FindKey(kOriginList);
+
+ for (size_t i = 0; i < origin_list->GetList().size(); ++i) {
+ base::Value* origin_info = &origin_list->GetList()[i];
+ const std::string& origin = origin_info->FindKey("origin")->GetString();
+ const auto& size_info = origin_size_map.find(origin);
+ if (size_info != origin_size_map.end())
+ origin_info->SetKey("usage", base::Value(size_info->second));
}
- site_group.SetKey(kOriginList, std::move(origin_list));
- result.GetList().push_back(std::move(site_group));
}
- ResolveJavascriptCallback(*callback_id, result);
+ FireWebUIListener("onLocalStorageListFetched", result);
+}
+
+void SiteSettingsHandler::HandleGetFormattedBytes(const base::ListValue* args) {
+ AllowJavascript();
+
+ CHECK_EQ(2U, args->GetSize());
+ const base::Value* callback_id;
+ CHECK(args->Get(0, &callback_id));
+ int num_bytes;
+ CHECK(args->GetInteger(1, &num_bytes));
+
+ const base::string16 string = ui::FormatBytes(num_bytes);
+ ResolveJavascriptCallback(*callback_id, base::Value(string));
}
void SiteSettingsHandler::HandleGetExceptionList(const base::ListValue* args) {
@@ -1053,4 +1144,59 @@ void SiteSettingsHandler::HandleRemoveZoomLevel(const base::ListValue* args) {
host_zoom_map->SetZoomLevelForHost(origin, default_level);
}
+void SiteSettingsHandler::HandleFetchBlockAutoplayStatus(
+ const base::ListValue* args) {
+ AllowJavascript();
+ SendBlockAutoplayStatus();
+}
+
+void SiteSettingsHandler::SendBlockAutoplayStatus() {
+ if (!IsJavascriptAllowed())
+ return;
+
+ base::DictionaryValue status;
+
+ // Whether the block autoplay toggle should be checked.
+ base::DictionaryValue pref;
+ pref.SetKey(
+ "value",
+ base::Value(
+ UnifiedAutoplayConfig::ShouldBlockAutoplay(profile_) &&
+ UnifiedAutoplayConfig::IsBlockAutoplayUserModifiable(profile_)));
+ status.SetKey("pref", std::move(pref));
+
+ // Whether the block autoplay toggle should be enabled.
+ status.SetKey("enabled",
+ base::Value(UnifiedAutoplayConfig::IsBlockAutoplayUserModifiable(
+ profile_)));
+
+ FireWebUIListener("onBlockAutoplayStatusChanged", status);
+}
+
+void SiteSettingsHandler::HandleSetBlockAutoplayEnabled(
+ const base::ListValue* args) {
+ AllowJavascript();
+
+ if (!UnifiedAutoplayConfig::IsBlockAutoplayUserModifiable(profile_))
+ return;
+
+ CHECK_EQ(1U, args->GetSize());
+ bool value;
+ CHECK(args->GetBoolean(0, &value));
+
+ profile_->GetPrefs()->SetBoolean(prefs::kBlockAutoplayEnabled, value);
+}
+
+void SiteSettingsHandler::SetBrowsingDataLocalStorageHelperForTesting(
+ scoped_refptr<BrowsingDataLocalStorageHelper> helper) {
+ DCHECK(!local_storage_helper_);
+ local_storage_helper_ = helper;
+}
+
+BrowsingDataLocalStorageHelper* SiteSettingsHandler::GetLocalStorageHelper() {
+ if (!local_storage_helper_)
+ local_storage_helper_ = new BrowsingDataLocalStorageHelper(profile_);
+ return local_storage_helper_.get();
+}
+
} // namespace settings
diff --git a/chromium/chrome/browser/ui/webui/settings/site_settings_handler.h b/chromium/chrome/browser/ui/webui/settings/site_settings_handler.h
index 3f5b4a470ad..7a5f9c9b787 100644
--- a/chromium/chrome/browser/ui/webui/settings/site_settings_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/site_settings_handler.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/scoped_observer.h"
+#include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
#include "chrome/browser/storage/storage_info_fetcher.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
#include "components/content_settings/core/browser/content_settings_observer.h"
@@ -22,9 +23,7 @@
class HostContentSettingsMap;
class Profile;
-#if defined(OS_CHROMEOS)
class PrefChangeRegistrar;
-#endif
namespace base {
class ListValue;
@@ -85,12 +84,16 @@ class SiteSettingsHandler : public SettingsPageUIHandler,
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAndSetForInvalidURLs);
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Incognito);
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAllSites);
+ FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, GetAllSitesLocalStorage);
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Origins);
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, Patterns);
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, ZoomLevels);
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerInfobarTest,
SettingPermissionsTriggersInfobar);
FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, SessionOnlyException);
+ FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest,
+ BlockAutoplay_SendOnRequest);
+ FRIEND_TEST_ALL_PREFIXES(SiteSettingsHandlerTest, BlockAutoplay_Update);
// Asynchronously fetches the usage for a given origin. Replies back with
// OnGetUsageInfo above.
@@ -113,6 +116,16 @@ class SiteSettingsHandler : public SettingsPageUIHandler,
// 1, affected by any of the content settings specified in |args|.
void HandleGetAllSites(const base::ListValue* args);
+ // Called when the list of origins using local storage has been fetched, and
+ // sends this list back to the front end.
+ void OnLocalStorageFetched(
+ const std::list<BrowsingDataLocalStorageHelper::LocalStorageInfo>&
+ local_storage_info);
+
+ // Converts a given number of bytes into a human-readable format, with data
+ // units.
+ void HandleGetFormattedBytes(const base::ListValue* args);
+
// Returns the list of site exceptions for a given content settings type.
void HandleGetExceptionList(const base::ListValue* args);
@@ -151,6 +164,20 @@ class SiteSettingsHandler : public SettingsPageUIHandler,
// Removes a particular zoom level for a given host.
void HandleRemoveZoomLevel(const base::ListValue* args);
+ // Handles the request to send block autoplay state.
+ void HandleFetchBlockAutoplayStatus(const base::ListValue* args);
+
+ // Notifies the JS side about the state of the block autoplay toggle.
+ void SendBlockAutoplayStatus();
+
+ // Updates the block autoplay enabled pref when the UI is toggled.
+ void HandleSetBlockAutoplayEnabled(const base::ListValue* args);
+
+ void SetBrowsingDataLocalStorageHelperForTesting(
+ scoped_refptr<BrowsingDataLocalStorageHelper> helper);
+
+ BrowsingDataLocalStorageHelper* GetLocalStorageHelper();
+
Profile* profile_;
content::NotificationRegistrar notification_registrar_;
@@ -168,10 +195,10 @@ class SiteSettingsHandler : public SettingsPageUIHandler,
// Change observer for content settings.
ScopedObserver<HostContentSettingsMap, content_settings::Observer> observer_;
-#if defined(OS_CHROMEOS)
// Change observer for prefs.
std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_;
-#endif
+
+ scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper_;
DISALLOW_COPY_AND_ASSIGN(SiteSettingsHandler);
};
diff --git a/chromium/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc b/chromium/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
index 2b1e3700934..301b05f54d6 100644
--- a/chromium/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/settings/site_settings_handler_unittest.cc
@@ -9,6 +9,7 @@
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_clock.h"
+#include "chrome/browser/browsing_data/mock_browsing_data_local_storage_helper.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -18,6 +19,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/site_settings_helper.h"
+#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -151,6 +153,36 @@ class SiteSettingsHandlerTest : public testing::Test {
content::TestWebUI* web_ui() { return &web_ui_; }
SiteSettingsHandler* handler() { return &handler_; }
+ void ValidateBlockAutoplay(bool expected_value, bool expected_enabled) {
+ const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
+ EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
+
+ std::string event_name;
+ ASSERT_TRUE(data.arg1()->GetAsString(&event_name));
+ EXPECT_EQ("onBlockAutoplayStatusChanged", event_name);
+
+ const base::DictionaryValue* event_data = nullptr;
+ ASSERT_TRUE(data.arg2()->GetAsDictionary(&event_data));
+
+ bool enabled;
+ ASSERT_TRUE(event_data->GetBoolean("enabled", &enabled));
+ EXPECT_EQ(expected_enabled, enabled);
+
+ const base::DictionaryValue* pref_data = nullptr;
+ ASSERT_TRUE(event_data->GetDictionary("pref", &pref_data));
+
+ bool value;
+ ASSERT_TRUE(pref_data->GetBoolean("value", &value));
+ EXPECT_EQ(expected_value, value);
+ }
+
+ void SetSoundContentSettingDefault(ContentSetting value) {
+ HostContentSettingsMap* content_settings =
+ HostContentSettingsMapFactory::GetForProfile(profile());
+ content_settings->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_SOUND,
+ value);
+ }
+
void ValidateDefault(const ContentSetting expected_setting,
const site_settings::SiteSettingSource expected_source,
size_t expected_total_calls) {
@@ -407,8 +439,10 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
site_group.FindKey("origins")->GetList();
EXPECT_EQ("example.com", etld_plus1_string);
EXPECT_EQ(2UL, origin_list.size());
- EXPECT_EQ(url1.spec(), origin_list[0].GetString());
- EXPECT_EQ(url2.spec(), origin_list[1].GetString());
+ EXPECT_EQ(url1.spec(), origin_list[0].FindKey("origin")->GetString());
+ EXPECT_EQ(0, origin_list[0].FindKey("engagement")->GetDouble());
+ EXPECT_EQ(url2.spec(), origin_list[1].FindKey("origin")->GetString());
+ EXPECT_EQ(0, origin_list[1].FindKey("engagement")->GetDouble());
}
}
@@ -434,7 +468,7 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
site_group.FindKey("origins")->GetList();
if (etld_plus1_string == "example2.net") {
EXPECT_EQ(1UL, origin_list.size());
- EXPECT_EQ(url3.spec(), origin_list[0].GetString());
+ EXPECT_EQ(url3.spec(), origin_list[0].FindKey("origin")->GetString());
} else {
EXPECT_EQ("example.com", etld_plus1_string);
}
@@ -444,6 +478,9 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
// Test embargoed settings also appear.
PermissionDecisionAutoBlocker* auto_blocker =
PermissionDecisionAutoBlocker::GetForProfile(profile());
+ base::SimpleTestClock clock;
+ clock.SetNow(base::Time::Now());
+ auto_blocker->SetClockForTesting(&clock);
const GURL url4("https://example2.co.uk");
for (int i = 0; i < 3; ++i) {
auto_blocker->RecordDismissAndEmbargo(url4,
@@ -465,11 +502,24 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
EXPECT_EQ(3UL, site_groups.size());
}
- // Add an expired embargo setting to a) an existing eTLD+1 group and b) a new
- // eTLD+1 group.
- base::SimpleTestClock clock;
- clock.SetNow(base::Time::Now());
- auto_blocker->SetClockForTesting(&clock);
+ // Check |url4| disappears from the list when its embargo expires.
+ clock.Advance(base::TimeDelta::FromDays(8));
+ handler()->HandleGetAllSites(&get_all_sites_args);
+
+ {
+ const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
+ EXPECT_EQ("cr.webUIResponse", data.function_name());
+ EXPECT_EQ(kCallbackId, data.arg1()->GetString());
+ ASSERT_TRUE(data.arg2()->GetBool());
+
+ const base::Value::ListStorage& site_groups = data.arg3()->GetList();
+ EXPECT_EQ(2UL, site_groups.size());
+ EXPECT_EQ("example.com", site_groups[0].FindKey("etldPlus1")->GetString());
+ EXPECT_EQ("example2.net", site_groups[1].FindKey("etldPlus1")->GetString());
+ }
+
+ // Add an expired embargo setting to an existing eTLD+1 group and make sure it
+ // still appears.
for (int i = 0; i < 3; ++i) {
auto_blocker->RecordDismissAndEmbargo(url3,
CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
@@ -484,6 +534,7 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
auto_blocker->GetEmbargoResult(url3, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)
.content_setting);
+ handler()->HandleGetAllSites(&get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
@@ -491,10 +542,12 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::ListStorage& site_groups = data.arg3()->GetList();
- EXPECT_EQ(3UL, site_groups.size());
+ EXPECT_EQ(2UL, site_groups.size());
+ EXPECT_EQ("example.com", site_groups[0].FindKey("etldPlus1")->GetString());
+ EXPECT_EQ("example2.net", site_groups[1].FindKey("etldPlus1")->GetString());
}
- clock.SetNow(base::Time::Now());
+ // Add an expired embargo to a new eTLD+1 and make sure it doesn't appear.
const GURL url5("http://test.example5.com");
for (int i = 0; i < 3; ++i) {
auto_blocker->RecordDismissAndEmbargo(url5,
@@ -510,6 +563,7 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
auto_blocker->GetEmbargoResult(url5, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)
.content_setting);
+ handler()->HandleGetAllSites(&get_all_sites_args);
{
const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
EXPECT_EQ("cr.webUIResponse", data.function_name());
@@ -517,8 +571,71 @@ TEST_F(SiteSettingsHandlerTest, GetAllSites) {
ASSERT_TRUE(data.arg2()->GetBool());
const base::Value::ListStorage& site_groups = data.arg3()->GetList();
- EXPECT_EQ(3UL, site_groups.size());
+ EXPECT_EQ(2UL, site_groups.size());
+ EXPECT_EQ("example.com", site_groups[0].FindKey("etldPlus1")->GetString());
+ EXPECT_EQ("example2.net", site_groups[1].FindKey("etldPlus1")->GetString());
}
+
+ // Each call to HandleGetAllSites() above added a callback to the profile's
+ // BrowsingDataLocalStorageHelper, so make sure these aren't stuck waiting to
+ // run at the end of the test.
+ base::RunLoop run_loop;
+ run_loop.RunUntilIdle();
+}
+
+TEST_F(SiteSettingsHandlerTest, GetAllSitesLocalStorage) {
+ scoped_refptr<MockBrowsingDataLocalStorageHelper>
+ mock_browsing_data_local_storage_helper =
+ new MockBrowsingDataLocalStorageHelper(profile());
+ handler()->SetBrowsingDataLocalStorageHelperForTesting(
+ mock_browsing_data_local_storage_helper);
+
+ // Add local storage for |origin|.
+ const GURL origin("https://example.com:12378");
+ mock_browsing_data_local_storage_helper->AddLocalStorageForOrigin(origin, 1);
+
+ // Check these sites are included in the callback.
+ base::ListValue get_all_sites_args;
+ get_all_sites_args.AppendString(kCallbackId);
+ base::Value category_list(base::Value::Type::LIST);
+ get_all_sites_args.GetList().push_back(std::move(category_list));
+
+ // Wait for the fetch handler to finish, then check it includes |origin| in
+ // its result.
+ handler()->HandleGetAllSites(&get_all_sites_args);
+ EXPECT_EQ(1U, web_ui()->call_data().size());
+ mock_browsing_data_local_storage_helper->Notify();
+ EXPECT_EQ(2U, web_ui()->call_data().size());
+ base::RunLoop run_loop;
+ run_loop.RunUntilIdle();
+
+ const content::TestWebUI::CallData& data = *web_ui()->call_data().back();
+ EXPECT_EQ("cr.webUIListenerCallback", data.function_name());
+
+ std::string callback_id;
+ ASSERT_TRUE(data.arg1()->GetAsString(&callback_id));
+ EXPECT_EQ("onLocalStorageListFetched", callback_id);
+
+ const base::ListValue* local_storage_list;
+ ASSERT_TRUE(data.arg2()->GetAsList(&local_storage_list));
+ EXPECT_EQ(1U, local_storage_list->GetSize());
+
+ const base::DictionaryValue* site_group;
+ ASSERT_TRUE(local_storage_list->GetDictionary(0, &site_group));
+
+ std::string etld_plus1_string;
+ ASSERT_TRUE(site_group->GetString("etldPlus1", &etld_plus1_string));
+ ASSERT_EQ("example.com", etld_plus1_string);
+
+ const base::ListValue* origin_list;
+ ASSERT_TRUE(site_group->GetList("origins", &origin_list));
+ EXPECT_EQ(1U, origin_list->GetSize());
+
+ const base::DictionaryValue* origin_info;
+ ASSERT_TRUE(origin_list->GetDictionary(0, &origin_info));
+ EXPECT_EQ(origin.spec(), origin_info->FindKey("origin")->GetString());
+ EXPECT_EQ(0, origin_info->FindKey("engagement")->GetDouble());
+ EXPECT_EQ(1, origin_info->FindKey("usage")->GetDouble());
}
TEST_F(SiteSettingsHandlerTest, Origins) {
@@ -1147,4 +1264,50 @@ TEST_F(SiteSettingsHandlerTest, SessionOnlyException) {
histograms.ExpectTotalCount(uma_base + ".SessionOnly", 1);
}
+TEST_F(SiteSettingsHandlerTest, BlockAutoplay_SendOnRequest) {
+ base::ListValue args;
+ handler()->HandleFetchBlockAutoplayStatus(&args);
+
+ // Check that we are checked and enabled.
+ ValidateBlockAutoplay(true, true);
+}
+
+TEST_F(SiteSettingsHandlerTest, BlockAutoplay_SoundSettingUpdate) {
+ SetSoundContentSettingDefault(CONTENT_SETTING_BLOCK);
+ base::RunLoop().RunUntilIdle();
+
+ // Check that we are not checked or enabled.
+ ValidateBlockAutoplay(false, false);
+
+ SetSoundContentSettingDefault(CONTENT_SETTING_ALLOW);
+ base::RunLoop().RunUntilIdle();
+
+ // Check that we are checked and enabled.
+ ValidateBlockAutoplay(true, true);
+}
+
+TEST_F(SiteSettingsHandlerTest, BlockAutoplay_PrefUpdate) {
+ profile()->GetPrefs()->SetBoolean(prefs::kBlockAutoplayEnabled, false);
+ base::RunLoop().RunUntilIdle();
+
+ // Check that we are not checked but are enabled.
+ ValidateBlockAutoplay(false, true);
+
+ profile()->GetPrefs()->SetBoolean(prefs::kBlockAutoplayEnabled, true);
+ base::RunLoop().RunUntilIdle();
+
+ // Check that we are checked and enabled.
+ ValidateBlockAutoplay(true, true);
+}
+
+TEST_F(SiteSettingsHandlerTest, BlockAutoplay_Update) {
+ EXPECT_TRUE(profile()->GetPrefs()->GetBoolean(prefs::kBlockAutoplayEnabled));
+
+ base::ListValue data;
+ data.AppendBoolean(false);
+
+ handler()->HandleSetBlockAutoplayEnabled(&data);
+ EXPECT_FALSE(profile()->GetPrefs()->GetBoolean(prefs::kBlockAutoplayEnabled));
+}
+
} // namespace settings
diff --git a/chromium/chrome/browser/ui/webui/settings/tts_handler.cc b/chromium/chrome/browser/ui/webui/settings/tts_handler.cc
index 0984278d7eb..d4298910124 100644
--- a/chromium/chrome/browser/ui/webui/settings/tts_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/tts_handler.cc
@@ -18,12 +18,18 @@
#include "content/public/browser/web_ui.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest_handlers/options_page_info.h"
#include "ui/base/l10n/l10n_util.h"
namespace settings {
+TtsHandler::TtsHandler() : weak_factory_(this) {}
+
+TtsHandler::~TtsHandler() {
+ TtsController::GetInstance()->RemoveVoicesChangedDelegate(this);
+}
void TtsHandler::HandleGetAllTtsVoiceData(const base::ListValue* args) {
OnVoicesChanged();
@@ -31,8 +37,8 @@ void TtsHandler::HandleGetAllTtsVoiceData(const base::ListValue* args) {
void TtsHandler::HandleGetTtsExtensions(const base::ListValue* args) {
// Ensure the built in tts engine is loaded to be able to respond to messages.
- TtsExtensionEngine::GetInstance()->LoadBuiltInTtsExtension(
- Profile::FromWebUI(web_ui()));
+ WakeTtsEngine(nullptr);
+
base::ListValue responses;
Profile* profile = Profile::FromWebUI(web_ui());
extensions::ExtensionRegistry* registry =
@@ -141,6 +147,9 @@ void TtsHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback(
"previewTtsVoice", base::BindRepeating(&TtsHandler::HandlePreviewTtsVoice,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "wakeTtsEngine",
+ base::BindRepeating(&TtsHandler::WakeTtsEngine, base::Unretained(this)));
}
void TtsHandler::OnJavascriptAllowed() {
@@ -163,4 +172,17 @@ int TtsHandler::GetVoiceLangMatchScore(const VoiceData* voice,
: 0;
}
+void TtsHandler::WakeTtsEngine(const base::ListValue* args) {
+ Profile* profile = Profile::FromWebUI(web_ui());
+ TtsExtensionEngine::GetInstance()->LoadBuiltInTtsExtension(profile);
+ extensions::ProcessManager::Get(profile)->WakeEventPage(
+ extension_misc::kSpeechSynthesisExtensionId,
+ base::BindRepeating(&TtsHandler::OnTtsEngineAwake,
+ weak_factory_.GetWeakPtr()));
+}
+
+void TtsHandler::OnTtsEngineAwake(bool success) {
+ OnVoicesChanged();
+}
+
} // namespace settings
diff --git a/chromium/chrome/browser/ui/webui/settings/tts_handler.h b/chromium/chrome/browser/ui/webui/settings/tts_handler.h
index 94dfef0c727..0f9d26426d8 100644
--- a/chromium/chrome/browser/ui/webui/settings/tts_handler.h
+++ b/chromium/chrome/browser/ui/webui/settings/tts_handler.h
@@ -5,16 +5,19 @@
#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_TTS_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_SETTINGS_TTS_HANDLER_H_
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/speech/tts_controller.h"
#include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h"
+class Profile;
+
namespace settings {
// Chrome "/manageAccessibility/tts/*" settings page UI handler.
class TtsHandler : public SettingsPageUIHandler, public VoicesChangedDelegate {
public:
- TtsHandler() = default;
- ~TtsHandler() override = default;
+ TtsHandler();
+ ~TtsHandler() override;
void HandleGetAllTtsVoiceData(const base::ListValue* args);
void HandleGetTtsExtensions(const base::ListValue* args);
@@ -29,9 +32,13 @@ class TtsHandler : public SettingsPageUIHandler, public VoicesChangedDelegate {
void OnVoicesChanged() override;
private:
+ void WakeTtsEngine(const base::ListValue* args);
+ void OnTtsEngineAwake(bool success);
int GetVoiceLangMatchScore(const VoiceData* voice,
const std::string& app_locale);
+ base::WeakPtrFactory<TtsHandler> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(TtsHandler);
};
diff --git a/chromium/chrome/browser/ui/webui/settings_utils_linux.cc b/chromium/chrome/browser/ui/webui/settings_utils_linux.cc
index 7cf91d35e41..638dc467cbe 100644
--- a/chromium/chrome/browser/ui/webui/settings_utils_linux.cc
+++ b/chromium/chrome/browser/ui/webui/settings_utils_linux.cc
@@ -11,8 +11,8 @@
#include "base/files/file_util.h"
#include "base/nix/xdg_util.h"
#include "base/process/launch.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/task/post_task.h"
+#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "content/public/browser/browser_thread.h"
@@ -63,7 +63,7 @@ void ShowLinuxProxyConfigUrl(int render_process_id, int render_view_id) {
// Start the given proxy configuration utility.
bool StartProxyConfigUtil(const char* const command[]) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
// base::LaunchProcess() returns true ("success") if the fork()
// succeeds, but not necessarily the exec(). We'd like to be able to
// use StartProxyConfigUtil() to search possible options and stop on
@@ -89,7 +89,7 @@ bool StartProxyConfigUtil(const char* const command[]) {
// failure to do so, show the Linux proxy config URL in a new tab instead.
void DetectAndStartProxyConfigUtil(int render_process_id,
int render_view_id) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
std::unique_ptr<base::Environment> env(base::Environment::Create());
bool launched = false;
diff --git a/chromium/chrome/browser/ui/webui/settings_utils_win.cc b/chromium/chrome/browser/ui/webui/settings_utils_win.cc
index 4445ceebfe2..46a7ca83fcd 100644
--- a/chromium/chrome/browser/ui/webui/settings_utils_win.cc
+++ b/chromium/chrome/browser/ui/webui/settings_utils_win.cc
@@ -13,7 +13,7 @@
#include "base/macros.h"
#include "base/path_service.h"
#include "base/single_thread_task_runner.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
diff --git a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc
index fcf3c8d6c03..6f8e2de423a 100644
--- a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc
+++ b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc
@@ -22,7 +22,6 @@
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/signin_util.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_delegate_impl.h"
#include "chrome/browser/ui/webui/signin/signin_utils_desktop.h"
@@ -37,9 +36,9 @@
#include "components/signin/core/browser/signin_metrics.h"
#include "components/signin/core/browser/signin_pref_names.h"
#include "components/sync/base/sync_prefs.h"
+#include "components/unified_consent/feature.h"
#include "components/unified_consent/unified_consent_service.h"
#include "content/public/browser/storage_partition.h"
-#include "net/url_request/url_request_context_getter.h"
namespace {
@@ -255,7 +254,6 @@ void DiceTurnSyncOnHelper::LoadPolicyWithCachedCredentials() {
policy::UserPolicySigninServiceFactory::GetForProfile(profile_);
policy_service->FetchPolicyForSignedInUser(
AccountIdFromAccountInfo(account_info_), dm_token_, client_id_,
- profile_->GetRequestContext(),
content::BrowserContext::GetDefaultStoragePartition(profile_)
->GetURLLoaderFactoryForBrowserProcess(),
base::Bind(&DiceTurnSyncOnHelper::OnPolicyFetchComplete,
@@ -281,8 +279,7 @@ void DiceTurnSyncOnHelper::CreateNewSignedInProfile() {
base::UTF8ToUTF16(account_info_.email),
profiles::GetDefaultAvatarIconUrl(icon_index),
base::BindRepeating(&DiceTurnSyncOnHelper::CompleteInitForNewProfile,
- weak_pointer_factory_.GetWeakPtr()),
- std::string());
+ weak_pointer_factory_.GetWeakPtr()));
}
void DiceTurnSyncOnHelper::CompleteInitForNewProfile(
@@ -410,7 +407,7 @@ void DiceTurnSyncOnHelper::AbortAndDelete() {
}
void DiceTurnSyncOnHelper::EnableUnifiedConsentIfNeeded() {
- if (IsUnifiedConsentEnabled(profile_)) {
+ if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
UnifiedConsentServiceFactory::GetForProfile(profile_)
->SetUnifiedConsentGiven(true);
}
diff --git a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc
index cfd7e7c2862..d962685badd 100644
--- a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc
+++ b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper_unittest.cc
@@ -24,7 +24,6 @@
#include "chrome/browser/signin/scoped_account_consistency.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/signin/test_signin_client_builder.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_test_util.h"
#include "chrome/browser/unified_consent/unified_consent_service_factory.h"
@@ -39,11 +38,11 @@
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_metrics.h"
#include "components/signin/core/browser/signin_pref_names.h"
+#include "components/unified_consent/feature.h"
#include "components/unified_consent/scoped_unified_consent.h"
#include "components/unified_consent/unified_consent_service.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "google_apis/gaia/google_service_auth_error.h"
-#include "net/url_request/url_request_context_getter.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -139,7 +138,6 @@ class FakeUserPolicySigninService : public policy::UserPolicySigninService {
nullptr,
signin_manager,
nullptr,
- nullptr,
oauth2_token_service) {}
void set_dm_token(const std::string& dm_token) { dm_token_ = dm_token; }
@@ -164,7 +162,6 @@ class FakeUserPolicySigninService : public policy::UserPolicySigninService {
const AccountId& account_id,
const std::string& dm_token,
const std::string& client_id,
- scoped_refptr<net::URLRequestContextGetter> profile_request_context,
scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory,
const PolicyFetchCallback& callback) override {
callback.Run(true);
@@ -262,8 +259,8 @@ class DiceTurnSyncOnHelperTestBase : public testing::Test {
EXPECT_CALL(*sync_service_mock, GetSetupInProgressHandle()).Times(1);
ON_CALL(*sync_service_mock, GetDisableReasons())
.WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
- ON_CALL(*sync_service_mock, IsEngineInitialized())
- .WillByDefault(Return(true));
+ ON_CALL(*sync_service_mock, GetTransportState())
+ .WillByDefault(Return(syncer::SyncService::TransportState::ACTIVE));
}
void SetExpectationsForSyncStartupPending() {
@@ -272,8 +269,9 @@ class DiceTurnSyncOnHelperTestBase : public testing::Test {
EXPECT_CALL(*sync_service_mock, GetSetupInProgressHandle()).Times(1);
ON_CALL(*sync_service_mock, GetDisableReasons())
.WillByDefault(Return(syncer::SyncService::DISABLE_REASON_NONE));
- ON_CALL(*sync_service_mock, IsEngineInitialized())
- .WillByDefault(Return(false));
+ ON_CALL(*sync_service_mock, GetTransportState())
+ .WillByDefault(
+ Return(syncer::SyncService::TransportState::INITIALIZING));
ON_CALL(*sync_service_mock, GetAuthError())
.WillByDefault(ReturnRef(kNoAuthError));
}
@@ -403,13 +401,13 @@ class DiceTurnSyncOnHelperTestBase : public testing::Test {
GoogleServiceAuthError::AuthErrorNone();
};
-// Test class with only DicePrepareMigration enabled.
+// Test class with only DiceMigration enabled.
class DiceTurnSyncOnHelperTest : public DiceTurnSyncOnHelperTestBase {
public:
DiceTurnSyncOnHelperTest() = default;
private:
- ScopedAccountConsistencyDicePrepareMigration scoped_dice_;
+ ScopedAccountConsistencyDiceMigration scoped_dice_;
};
// Test class with Dice and UnifiedConsent enabled.
@@ -704,7 +702,7 @@ TEST_F(DiceTurnSyncOnHelperTest, ShowSyncDialogForEndConsumerAccount) {
// Tests that the user enabled unified consent,
TEST_F(DiceTurnSyncOnHelperTestWithUnifiedConsent,
ShowSyncDialogForEndConsumerAccount_UnifiedConsentEnabled) {
- ASSERT_TRUE(IsUnifiedConsentEnabled(profile()));
+ ASSERT_TRUE(unified_consent::IsUnifiedConsentFeatureEnabled());
// Set expectations.
expected_sync_confirmation_shown_ = true;
sync_confirmation_result_ = LoginUIService::SyncConfirmationUIClosedResult::
diff --git a/chromium/chrome/browser/ui/webui/signin/inline_login_handler.cc b/chromium/chrome/browser/ui/webui/signin/inline_login_handler.cc
index 0738564db13..c50be63d5fa 100644
--- a/chromium/chrome/browser/ui/webui/signin/inline_login_handler.cc
+++ b/chromium/chrome/browser/ui/webui/signin/inline_login_handler.cc
@@ -154,7 +154,54 @@ void InlineLoginHandler::ContinueHandleInitializeMessage() {
void InlineLoginHandler::HandleCompleteLoginMessage(
const base::ListValue* args) {
- CompleteLogin(args);
+ // When the network service is enabled, the webRequest API doesn't expose
+ // cookie headers. So manually fetch the cookies for the GAIA URL from the
+ // CookieManager.
+ content::WebContents* contents = web_ui()->GetWebContents();
+ content::StoragePartition* partition =
+ content::BrowserContext::GetStoragePartitionForSite(
+ contents->GetBrowserContext(), signin::GetSigninPartitionURL());
+
+ net::CookieOptions cookie_options;
+ cookie_options.set_include_httponly();
+
+ partition->GetCookieManagerForBrowserProcess()->GetCookieList(
+ GaiaUrls::GetInstance()->gaia_url(), cookie_options,
+ base::BindOnce(&InlineLoginHandler::HandleCompleteLoginMessageWithCookies,
+ weak_ptr_factory_.GetWeakPtr(),
+ base::ListValue(args->GetList())));
+}
+
+void InlineLoginHandler::HandleCompleteLoginMessageWithCookies(
+ const base::ListValue& args,
+ const std::vector<net::CanonicalCookie>& cookies) {
+ const base::DictionaryValue* dict = nullptr;
+ args.GetDictionary(0, &dict);
+
+ const std::string& email = dict->FindKey("email")->GetString();
+ const std::string& password = dict->FindKey("password")->GetString();
+ const std::string& gaia_id = dict->FindKey("gaiaId")->GetString();
+
+ std::string auth_code;
+ for (const auto& cookie : cookies) {
+ if (cookie.Name() == "oauth_code")
+ auth_code = cookie.Value();
+ }
+
+ bool skip_for_now = false;
+ dict->GetBoolean("skipForNow", &skip_for_now);
+ bool trusted = false;
+ bool trusted_found = dict->GetBoolean("trusted", &trusted);
+
+ bool choose_what_to_sync = false;
+ dict->GetBoolean("chooseWhatToSync", &choose_what_to_sync);
+
+ base::string16 session_index_string16;
+ dict->GetString("sessionIndex", &session_index_string16);
+ std::string session_index = base::UTF16ToASCII(session_index_string16);
+
+ CompleteLogin(email, password, gaia_id, auth_code, skip_for_now, trusted,
+ trusted_found, choose_what_to_sync, session_index);
}
void InlineLoginHandler::HandleSwitchToFullTabMessage(
diff --git a/chromium/chrome/browser/ui/webui/signin/inline_login_handler.h b/chromium/chrome/browser/ui/webui/signin/inline_login_handler.h
index 58abbe7bafc..51e7508ae88 100644
--- a/chromium/chrome/browser/ui/webui/signin/inline_login_handler.h
+++ b/chromium/chrome/browser/ui/webui/signin/inline_login_handler.h
@@ -13,6 +13,10 @@ namespace base {
class DictionaryValue;
}
+namespace net {
+class CanonicalCookie;
+}
+
namespace signin_metrics {
enum class AccessPoint;
}
@@ -54,6 +58,12 @@ class InlineLoginHandler : public content::WebUIMessageHandler {
// work.
void HandleCompleteLoginMessage(const base::ListValue* args);
+ // Called by HandleCompleteLoginMessage after it gets the GAIA URL's cookies
+ // from the CookieManager.
+ void HandleCompleteLoginMessageWithCookies(
+ const base::ListValue& args,
+ const std::vector<net::CanonicalCookie>& cookies);
+
// JS callback to switch the UI from a constrainted dialog to a full tab.
void HandleSwitchToFullTabMessage(const base::ListValue* args);
@@ -65,7 +75,15 @@ class InlineLoginHandler : public content::WebUIMessageHandler {
void HandleDialogClose(const base::ListValue* args);
virtual void SetExtraInitParams(base::DictionaryValue& params) {}
- virtual void CompleteLogin(const base::ListValue* args) = 0;
+ virtual void CompleteLogin(const std::string& email,
+ const std::string& password,
+ const std::string& gaia_id,
+ const std::string& auth_code,
+ bool skip_for_now,
+ bool trusted,
+ bool trusted_found,
+ bool choose_what_to_sync,
+ const std::string& session_index) = 0;
base::WeakPtrFactory<InlineLoginHandler> weak_ptr_factory_;
diff --git a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.cc b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.cc
index 35d3c1e7e66..233761c741d 100644
--- a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.cc
+++ b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.cc
@@ -118,15 +118,17 @@ void InlineLoginHandlerChromeOS::SetExtraInitParams(
params.SetKey("flow", base::Value("addaccount"));
}
-void InlineLoginHandlerChromeOS::CompleteLogin(const base::ListValue* args) {
- const base::DictionaryValue* auth_data = nullptr;
- CHECK(args->GetDictionary(0, &auth_data));
-
- const std::string& auth_code = auth_data->FindKey("authCode")->GetString();
+void InlineLoginHandlerChromeOS::CompleteLogin(const std::string& email,
+ const std::string& password,
+ const std::string& gaia_id,
+ const std::string& auth_code,
+ bool skip_for_now,
+ bool trusted,
+ bool trusted_found,
+ bool choose_what_to_sync,
+ const std::string& session_index) {
CHECK(!auth_code.empty());
- const std::string& gaia_id = auth_data->FindKey("gaiaId")->GetString();
CHECK(!gaia_id.empty());
- const std::string& email = auth_data->FindKey("email")->GetString();
CHECK(!email.empty());
// TODO(sinhak): Do not depend on Profile unnecessarily.
diff --git a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.h b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.h
index 5844d592c34..18ea95dfc62 100644
--- a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.h
+++ b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_chromeos.h
@@ -21,7 +21,15 @@ class InlineLoginHandlerChromeOS : public InlineLoginHandler {
// InlineLoginHandler overrides.
void SetExtraInitParams(base::DictionaryValue& params) override;
- void CompleteLogin(const base::ListValue* args) override;
+ void CompleteLogin(const std::string& email,
+ const std::string& password,
+ const std::string& gaia_id,
+ const std::string& auth_code,
+ bool skip_for_now,
+ bool trusted,
+ bool trusted_found,
+ bool choose_what_to_sync,
+ const std::string& session_index) override;
private:
base::RepeatingClosure close_dialog_closure_;
diff --git a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
index b9b1305bba4..57223ddd6f1 100644
--- a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
+++ b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
@@ -31,7 +31,7 @@
#include "chrome/browser/signin/about_signin_internals_factory.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
-#include "chrome/browser/signin/chrome_signin_client_factory.h"
+#include "chrome/browser/signin/chrome_device_id_helper.h"
#include "chrome/browser/signin/local_auth.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_error_controller_factory.h"
@@ -499,15 +499,18 @@ void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) {
is_constrained == "1");
}
-void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) {
+void InlineLoginHandlerImpl::CompleteLogin(const std::string& email,
+ const std::string& password,
+ const std::string& gaia_id,
+ const std::string& auth_code,
+ bool skip_for_now,
+ bool trusted,
+ bool trusted_found,
+ bool choose_what_to_sync,
+ const std::string& session_index) {
content::WebContents* contents = web_ui()->GetWebContents();
const GURL& current_url = contents->GetURL();
- const base::DictionaryValue* dict = NULL;
- args->GetDictionary(0, &dict);
-
- bool skip_for_now = false;
- dict->GetBoolean("skipForNow", &skip_for_now);
if (skip_for_now) {
signin::SetUserSkippedPromo(Profile::FromWebUI(web_ui()));
SyncStarterCallback(OneClickSigninSyncStarter::SYNC_SETUP_FAILURE);
@@ -515,41 +518,18 @@ void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) {
}
// This value exists only for webview sign in.
- bool trusted = false;
- if (dict->GetBoolean("trusted", &trusted))
+ if (trusted_found)
confirm_untrusted_signin_ = !trusted;
- base::string16 email_string16;
- dict->GetString("email", &email_string16);
- DCHECK(!email_string16.empty());
- std::string email(base::UTF16ToASCII(email_string16));
-
- base::string16 password_string16;
- dict->GetString("password", &password_string16);
- std::string password(base::UTF16ToASCII(password_string16));
-
- base::string16 gaia_id_string16;
- dict->GetString("gaiaId", &gaia_id_string16);
- DCHECK(!gaia_id_string16.empty());
- std::string gaia_id = base::UTF16ToASCII(gaia_id_string16);
-
std::string is_constrained;
net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained);
- const bool is_password_separated_signin_flow = is_constrained == "1";
- base::string16 session_index_string16;
- dict->GetString("sessionIndex", &session_index_string16);
- std::string session_index = base::UTF16ToASCII(session_index_string16);
+ DCHECK(!email.empty());
+ DCHECK(!gaia_id.empty());
+ const bool is_password_separated_signin_flow = is_constrained == "1";
DCHECK(is_password_separated_signin_flow || !session_index.empty());
-
- base::string16 auth_code_string16;
- dict->GetString("authCode", &auth_code_string16);
- std::string auth_code = base::UTF16ToASCII(auth_code_string16);
DCHECK(!is_password_separated_signin_flow || !auth_code.empty());
- bool choose_what_to_sync = false;
- dict->GetBoolean("chooseWhatToSync", &choose_what_to_sync);
-
content::StoragePartition* partition =
content::BrowserContext::GetStoragePartitionForSite(
contents->GetBrowserContext(), signin::GetSigninPartitionURL());
@@ -716,10 +696,8 @@ void InlineLoginHandlerImpl::FinishCompleteLogin(
AboutSigninInternalsFactory::GetForProfile(profile);
about_signin_internals->OnAuthenticationResultReceived("Successful");
- SigninClient* signin_client =
- ChromeSigninClientFactory::GetForProfile(profile);
std::string signin_scoped_device_id =
- signin_client->GetSigninScopedDeviceId();
+ GetSigninScopedDeviceIdForProfile(profile);
base::WeakPtr<InlineLoginHandlerImpl> handler_weak_ptr;
if (params.handler)
handler_weak_ptr = params.handler->GetWeakPtr();
@@ -784,9 +762,8 @@ void InlineLoginHandlerImpl::SyncStarterCallback(
RedirectToNtpOrAppsPage(contents, access_point);
} else if (auto_close) {
bool show_account_management = ShouldShowAccountManagement(
- current_url,
- AccountConsistencyModeManager::IsMirrorEnabledForProfile(
- Profile::FromBrowserContext(contents->GetBrowserContext())));
+ current_url, AccountConsistencyModeManager::IsMirrorEnabledForProfile(
+ Profile::FromWebUI(web_ui())));
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(&InlineLoginHandlerImpl::CloseTab,
diff --git a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.h b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.h
index fb2d86fd6e3..1e95466923c 100644
--- a/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.h
+++ b/chromium/chrome/browser/ui/webui/signin/inline_login_handler_impl.h
@@ -50,7 +50,15 @@ class InlineLoginHandlerImpl : public InlineLoginHandler,
private:
// InlineLoginHandler overrides:
void SetExtraInitParams(base::DictionaryValue& params) override;
- void CompleteLogin(const base::ListValue* args) override;
+ void CompleteLogin(const std::string& email,
+ const std::string& password,
+ const std::string& gaia_id,
+ const std::string& auth_code,
+ bool skip_for_now,
+ bool trusted,
+ bool trusted_found,
+ bool choose_what_to_sync,
+ const std::string& session_index) override;
// This struct exists to pass paramters to the FinishCompleteLogin() method,
// since the base::Bind() call does not support this many template args.
diff --git a/chromium/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc b/chromium/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
index 6e672bea55e..0fd4b89993f 100644
--- a/chromium/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
+++ b/chromium/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc
@@ -112,7 +112,7 @@ ContentInfo NavigateAndGetInfo(
// Returns a new WebUI object for the WebContents from |arg0|.
ACTION(ReturnNewWebUI) {
- return new content::WebUIController(arg0);
+ return std::make_unique<content::WebUIController>(arg0);
}
GURL GetSigninPromoURL() {
@@ -126,8 +126,9 @@ GURL GetSigninPromoURL() {
class FooWebUIProvider
: public TestChromeWebUIControllerFactory::WebUIProvider {
public:
- MOCK_METHOD2(NewWebUI, content::WebUIController*(content::WebUI* web_ui,
- const GURL& url));
+ MOCK_METHOD2(NewWebUI,
+ std::unique_ptr<content::WebUIController>(content::WebUI* web_ui,
+ const GURL& url));
};
const char kFooWebUIURL[] = "chrome://foo/";
@@ -140,8 +141,7 @@ bool AddToSet(std::set<content::WebContents*>* set,
std::unique_ptr<net::test_server::HttpResponse> EmptyHtmlResponseHandler(
const net::test_server::HttpRequest& request) {
- std::unique_ptr<net::test_server::BasicHttpResponse> http_response(
- new net::test_server::BasicHttpResponse());
+ auto http_response = std::make_unique<net::test_server::BasicHttpResponse>();
http_response->set_code(net::HTTP_OK);
http_response->set_content_type("text/html");
http_response->set_content(
@@ -882,7 +882,7 @@ class InlineLoginUISafeIframeBrowserTest : public InProcessBrowserTest {
content::WebUIControllerFactory::UnregisterFactoryForTesting(
ChromeWebUIControllerFactory::GetInstance());
- test_factory_.reset(new TestChromeWebUIControllerFactory);
+ test_factory_ = std::make_unique<TestChromeWebUIControllerFactory>();
content::WebUIControllerFactory::RegisterFactory(test_factory_.get());
test_factory_->AddFactoryOverride(
GURL(kFooWebUIURL).host(), &foo_provider_);
diff --git a/chromium/chrome/browser/ui/webui/signin/login_ui_service.cc b/chromium/chrome/browser/ui/webui/signin/login_ui_service.cc
index cf0bf54fbfd..f5ca3a721c6 100644
--- a/chromium/chrome/browser/ui/webui/signin/login_ui_service.cc
+++ b/chromium/chrome/browser/ui/webui/signin/login_ui_service.cc
@@ -24,7 +24,6 @@
#include "base/scoped_observer.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/sync_ui_util.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -34,6 +33,7 @@
#include "chrome/browser/unified_consent/unified_consent_service_factory.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/sync/base/sync_prefs.h"
+#include "components/unified_consent/feature.h"
#include "components/unified_consent/pref_names.h"
#include "components/unified_consent/unified_consent_service.h"
@@ -79,8 +79,10 @@ class ConsentBumpActivator : public BrowserListObserver,
signin_manager->GetAuthenticatedAccountId())) {
unified_consent::UnifiedConsentService* consent_service =
UnifiedConsentServiceFactory::GetForProfile(profile_);
- consent_service->RecordConsentBumpSuppressReason(
- unified_consent::ConsentBumpSuppressReason::kSyncPaused);
+ if (consent_service->ShouldShowConsentBump()) {
+ consent_service->RecordConsentBumpSuppressReason(
+ unified_consent::ConsentBumpSuppressReason::kSyncPaused);
+ }
return;
}
@@ -139,7 +141,8 @@ class ConsentBumpActivator : public BrowserListObserver,
// This should only be called after the browser has been set up, otherwise
// this might crash because the profile has not been fully initialized yet.
static bool ShouldShowConsentBumpFor(Profile* profile) {
- if (!profile->IsSyncAllowed() || !IsUnifiedConsentBumpEnabled(profile) ||
+ if (!profile->IsSyncAllowed() ||
+ !unified_consent::IsUnifiedConsentFeatureWithBumpEnabled() ||
!ProfileSyncServiceFactory::HasProfileSyncService(profile))
return false;
@@ -181,7 +184,7 @@ LoginUIService::LoginUIService(Profile* profile)
#endif
{
#if !defined(OS_CHROMEOS)
- if (IsUnifiedConsentBumpEnabled(profile)) {
+ if (unified_consent::IsUnifiedConsentFeatureWithBumpEnabled()) {
consent_bump_activator_ =
std::make_unique<ConsentBumpActivator>(this, profile);
}
diff --git a/chromium/chrome/browser/ui/webui/signin/login_ui_service.h b/chromium/chrome/browser/ui/webui/signin/login_ui_service.h
index 438d77285fb..7b154a3037e 100644
--- a/chromium/chrome/browser/ui/webui/signin/login_ui_service.h
+++ b/chromium/chrome/browser/ui/webui/signin/login_ui_service.h
@@ -111,7 +111,7 @@ class LoginUIService : public KeyedService {
#endif
// List of observers.
- base::ObserverList<Observer> observer_list_;
+ base::ObserverList<Observer>::Unchecked observer_list_;
base::string16 last_login_result_;
base::string16 last_login_error_email_;
diff --git a/chromium/chrome/browser/ui/webui/signin/login_ui_test_utils.cc b/chromium/chrome/browser/ui/webui/signin/login_ui_test_utils.cc
index ba4b6ef5ea3..499700b37f2 100644
--- a/chromium/chrome/browser/ui/webui/signin/login_ui_test_utils.cc
+++ b/chromium/chrome/browser/ui/webui/signin/login_ui_test_utils.cc
@@ -141,7 +141,7 @@ bool IsDiceSigninPageEnabled(Profile* profile) {
return (account_consistency != signin::AccountConsistencyMethod::kMirror) &&
signin::DiceMethodGreaterOrEqual(
account_consistency,
- signin::AccountConsistencyMethod::kDicePrepareMigration);
+ signin::AccountConsistencyMethod::kDiceMigration);
}
// Returns the render frame host where Gaia credentials can be filled in.
@@ -150,10 +150,9 @@ content::RenderFrameHost* GetSigninFrame(content::WebContents* web_contents) {
Profile::FromBrowserContext(web_contents->GetBrowserContext()))) {
// Dice displays the Gaia page directly in a tab.
return web_contents->GetMainFrame();
- } else {
- // Embedded signin flow, uses a sub-frame in WebUI.
- return signin::GetAuthFrame(web_contents, "signin-frame");
}
+ // Embedded signin flow, uses a sub-frame in WebUI.
+ return signin::GetAuthFrame(web_contents, "signin-frame");
}
// Waits until the condition is met, by polling.
diff --git a/chromium/chrome/browser/ui/webui/signin/md_user_manager_ui.cc b/chromium/chrome/browser/ui/webui/signin/md_user_manager_ui.cc
index 9a8756624e9..350714cd436 100644
--- a/chromium/chrome/browser/ui/webui/signin/md_user_manager_ui.cc
+++ b/chromium/chrome/browser/ui/webui/signin/md_user_manager_ui.cc
@@ -45,8 +45,7 @@ MDUserManagerUI::MDUserManagerUI(content::WebUI* web_ui)
content::WebUIDataSource::Add(profile, CreateUIDataSource(localized_strings));
// Set up the chrome://theme/ source
- ThemeSource* theme = new ThemeSource(profile);
- content::URLDataSource::Add(profile, theme);
+ content::URLDataSource::Add(profile, std::make_unique<ThemeSource>(profile));
}
MDUserManagerUI::~MDUserManagerUI() {}
diff --git a/chromium/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc b/chromium/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
index f8777b673ec..fcaa6c1b2a5 100644
--- a/chromium/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
+++ b/chromium/chrome/browser/ui/webui/signin/signin_create_profile_handler.cc
@@ -144,8 +144,7 @@ void SigninCreateProfileHandler::DoCreateProfile(const base::string16& name,
profile_path_being_created_ = ProfileManager::CreateMultiProfileAsync(
name, icon_url,
base::Bind(&SigninCreateProfileHandler::OnProfileCreated,
- weak_ptr_factory_.GetWeakPtr(), create_shortcut),
- /*supervised_user_id=*/std::string());
+ weak_ptr_factory_.GetWeakPtr(), create_shortcut));
}
void SigninCreateProfileHandler::OnProfileCreated(
diff --git a/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc b/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc
index 1fb615c2036..06d478de150 100644
--- a/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc
+++ b/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.cc
@@ -14,7 +14,6 @@
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/signin/account_tracker_service_factory.h"
#include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/signin_view_controller_delegate.h"
@@ -26,6 +25,7 @@
#include "components/signin/core/browser/account_tracker_service.h"
#include "components/signin/core/browser/avatar_icon_util.h"
#include "components/signin/core/browser/signin_manager.h"
+#include "components/unified_consent/feature.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "url/gurl.h"
@@ -96,6 +96,10 @@ void SyncConfirmationHandler::RegisterMessages() {
"initializedWithSize",
base::BindRepeating(&SyncConfirmationHandler::HandleInitializedWithSize,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "accountImageRequest",
+ base::BindRepeating(&SyncConfirmationHandler::HandleAccountImageRequest,
+ base::Unretained(this)));
}
void SyncConfirmationHandler::HandleConfirm(const base::ListValue* args) {
@@ -115,6 +119,21 @@ void SyncConfirmationHandler::HandleUndo(const base::ListValue* args) {
CloseModalSigninWindow(LoginUIService::ABORT_SIGNIN);
}
+void SyncConfirmationHandler::HandleAccountImageRequest(
+ const base::ListValue* args) {
+ std::string account_id = SigninManagerFactory::GetForProfile(profile_)
+ ->GetAuthenticatedAccountId();
+ AccountInfo account_info =
+ AccountTrackerServiceFactory::GetForProfile(profile_)->GetAccountInfo(
+ account_id);
+
+ // Fire the "account-image-changed" listener from |SetUserImageURL()|.
+ // Note: If the account info is not available yet in the
+ // AccountTrackerService, i.e. account_info is empty, the listener will be
+ // fired again through |OnAccountUpdated()|.
+ SetUserImageURL(account_info.picture_url);
+}
+
void SyncConfirmationHandler::RecordConsent(const base::ListValue* args) {
CHECK_EQ(2U, args->GetSize());
const std::vector<base::Value>& consent_description =
@@ -139,11 +158,31 @@ void SyncConfirmationHandler::RecordConsent(const base::ListValue* args) {
<< consent_confirmation;
int consent_confirmation_id = iter->second;
- ConsentAuditorFactory::GetForProfile(profile_)->RecordGaiaConsent(
- SigninManagerFactory::GetForProfile(profile_)
- ->GetAuthenticatedAccountId(),
- consent_feature_, consent_text_ids, consent_confirmation_id,
- consent_auditor::ConsentStatus::GIVEN);
+ consent_auditor::ConsentAuditor* consent_auditor =
+ ConsentAuditorFactory::GetForProfile(profile_);
+ const std::string& account_id = SigninManagerFactory::GetForProfile(profile_)
+ ->GetAuthenticatedAccountId();
+ // TODO(markusheintz): Use a bool unified_consent_enabled instead of a
+ // consent_auditor::Feature type variable.
+ if (consent_feature_ == consent_auditor::Feature::CHROME_UNIFIED_CONSENT) {
+ sync_pb::UserConsentTypes::UnifiedConsent unified_consent;
+ unified_consent.set_confirmation_grd_id(consent_confirmation_id);
+ for (int id : consent_text_ids) {
+ unified_consent.add_description_grd_ids(id);
+ }
+ unified_consent.set_status(sync_pb::UserConsentTypes::ConsentStatus::
+ UserConsentTypes_ConsentStatus_GIVEN);
+ consent_auditor->RecordUnifiedConsent(account_id, unified_consent);
+ } else {
+ sync_pb::UserConsentTypes::SyncConsent sync_consent;
+ sync_consent.set_confirmation_grd_id(consent_confirmation_id);
+ for (int id : consent_text_ids) {
+ sync_consent.add_description_grd_ids(id);
+ }
+ sync_consent.set_status(sync_pb::UserConsentTypes::ConsentStatus::
+ UserConsentTypes_ConsentStatus_GIVEN);
+ consent_auditor->RecordSyncConsent(account_id, sync_consent);
+ }
}
void SyncConfirmationHandler::SetUserImageURL(const std::string& picture_url) {
@@ -161,6 +200,11 @@ void SyncConfirmationHandler::SetUserImageURL(const std::string& picture_url) {
base::Value picture_url_value(picture_url_to_load);
web_ui()->CallJavascriptFunctionUnsafe("sync.confirmation.setUserImageURL",
picture_url_value);
+
+ if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
+ AllowJavascript();
+ FireWebUIListener("account-image-changed", picture_url_value);
+ }
}
void SyncConfirmationHandler::OnAccountUpdated(const AccountInfo& info) {
diff --git a/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.h b/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.h
index 3eb4b5bb536..9269e688a2e 100644
--- a/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.h
+++ b/chromium/chrome/browser/ui/webui/signin/sync_confirmation_handler.h
@@ -63,6 +63,11 @@ class SyncConfirmationHandler : public content::WebUIMessageHandler,
// a single integer value for the height the native view should resize to.
virtual void HandleInitializedWithSize(const base::ListValue* args);
+ // Handles the "accountImageRequest" message sent after the
+ // "account-image-changed" WebUIListener was added. This method calls
+ // |SetUserImageURL| with the signed-in user's picture url.
+ virtual void HandleAccountImageRequest(const base::ListValue* args);
+
// Records the user's consent to sync. Called from |HandleConfirm| and
// |HandleGoToSettings|, and expects two parameters to be passed through
// these methods from the WebUI:
diff --git a/chromium/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc b/chromium/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc
index 48e1cd78036..df687d3b6c2 100644
--- a/chromium/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc
+++ b/chromium/chrome/browser/ui/webui/signin/sync_confirmation_ui.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/signin/identity_manager_factory.h"
-#include "chrome/browser/signin/unified_consent_helper.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/webui/signin/sync_confirmation_handler.h"
#include "chrome/common/url_constants.h"
@@ -19,6 +18,7 @@
#include "chrome/grit/generated_resources.h"
#include "components/signin/core/browser/avatar_icon_util.h"
#include "components/strings/grit/components_strings.h"
+#include "components/unified_consent/feature.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "services/identity/public/cpp/identity_manager.h"
@@ -30,7 +30,8 @@ SyncConfirmationUI::SyncConfirmationUI(content::WebUI* web_ui)
consent_feature_(consent_auditor::Feature::CHROME_SYNC) {
Profile* profile = Profile::FromWebUI(web_ui);
bool is_sync_allowed = profile->IsSyncAllowed();
- bool is_unified_consent_enabled = IsUnifiedConsentEnabled(profile);
+ bool is_unified_consent_enabled =
+ unified_consent::IsUnifiedConsentFeatureEnabled();
content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUISyncConfirmationHost);
@@ -133,8 +134,8 @@ SyncConfirmationUI::SyncConfirmationUI(content::WebUI* web_ui)
title_ids = AccountConsistencyModeManager::IsDiceEnabledForProfile(profile)
? IDS_SYNC_CONFIRMATION_DICE_TITLE
: IDS_SYNC_CONFIRMATION_TITLE;
- confirm_button_ids = IDS_SYNC_CONFIRMATION_CONFIRM_BUTTON_LABEL;
- undo_button_ids = IDS_SYNC_CONFIRMATION_UNDO_BUTTON_LABEL;
+ confirm_button_ids = IDS_SETTINGS_TURN_ON;
+ undo_button_ids = IDS_CANCEL;
consent_feature_ = consent_auditor::Feature::CHROME_SYNC;
if (!is_sync_allowed) {
title_ids = IDS_SYNC_DISABLED_CONFIRMATION_CHROME_SYNC_TITLE;
diff --git a/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
index e83ded59827..d6285df2ec5 100644
--- a/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -351,8 +351,8 @@ void UserManagerScreenHandler::HandleAuthenticatedLaunchUser(
if (!oauth_client_) {
oauth_client_.reset(new gaia::GaiaOAuthClient(
content::BrowserContext::GetDefaultStoragePartition(
- web_ui()->GetWebContents()->GetBrowserContext())->
- GetURLRequestContext()));
+ web_ui()->GetWebContents()->GetBrowserContext())
+ ->GetURLLoaderFactoryForBrowserProcess()));
}
const std::string token = entry->GetPasswordChangeDetectionToken();
@@ -496,13 +496,6 @@ void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) {
ProfileMetrics::SWITCH_PROFILE_MANAGER);
}
-void UserManagerScreenHandler::HandleHardlockUserPod(
- const base::ListValue* args) {
- std::string email;
- CHECK(args->GetString(0, &email));
- const AccountId account_id = AccountId::FromUserEmail(email);
-}
-
void UserManagerScreenHandler::HandleRemoveUserWarningLoadStats(
const base::ListValue* args) {
const base::Value* profile_path_value;
@@ -796,8 +789,8 @@ void UserManagerScreenHandler::SendUserList() {
profile_value->SetString(kKeyEmailAddress, entry->GetUserName());
profile_value->SetString(kKeyDisplayName,
profiles::GetAvatarNameForProfile(profile_path));
- profile_value->Set(kKeyProfilePath,
- base::CreateFilePathValue(profile_path));
+ profile_value->SetKey(kKeyProfilePath,
+ base::CreateFilePathValue(profile_path));
profile_value->SetBoolean(kKeyPublicAccount, false);
profile_value->SetBoolean(kKeyLegacySupervisedUser,
entry->IsLegacySupervised());
diff --git a/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.h b/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.h
index eac65e54b00..7a138993aa9 100644
--- a/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.h
+++ b/chromium/chrome/browser/ui/webui/signin/user_manager_screen_handler.h
@@ -72,8 +72,6 @@ class UserManagerScreenHandler
void HandleLaunchUser(const base::ListValue* args);
void HandleRemoveUser(const base::ListValue* args);
void HandleAreAllProfilesLocked(const base::ListValue* args);
- void HandleAttemptUnlock(const base::ListValue* args);
- void HandleHardlockUserPod(const base::ListValue* args);
void HandleRemoveUserWarningLoadStats(const base::ListValue* args);
void HandleGetRemoveWarningDialogMessage(const base::ListValue* args);
diff --git a/chromium/chrome/browser/ui/webui/sync_file_system_internals/DEPS b/chromium/chrome/browser/ui/webui/sync_file_system_internals/DEPS
deleted file mode 100644
index cdad3c26c29..00000000000
--- a/chromium/chrome/browser/ui/webui/sync_file_system_internals/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-include_rules = [
- "+components/drive",
-]
diff --git a/chromium/chrome/browser/ui/webui/sync_file_system_internals/OWNERS b/chromium/chrome/browser/ui/webui/sync_file_system_internals/OWNERS
index 6bf7d0a8f63..b3c989cfce8 100644
--- a/chromium/chrome/browser/ui/webui/sync_file_system_internals/OWNERS
+++ b/chromium/chrome/browser/ui/webui/sync_file_system_internals/OWNERS
@@ -1,6 +1,7 @@
calvinlo@chromium.org
kinuko@chromium.org
nhiroki@chromium.org
+pwnall@chromium.org
tzik@chromium.org
# TEAM: storage-dev@chromium.org
diff --git a/chromium/chrome/browser/ui/webui/sync_internals_browsertest.js b/chromium/chrome/browser/ui/webui/sync_internals_browsertest.js
index 273c0056480..51cf439a4b8 100644
--- a/chromium/chrome/browser/ui/webui/sync_internals_browsertest.js
+++ b/chromium/chrome/browser/ui/webui/sync_internals_browsertest.js
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+GEN('#include "components/sync/driver/sync_driver_switches.h"');
+
/**
* Test fixture for sync internals WebUI testing.
* @constructor
@@ -56,6 +58,22 @@ SyncInternalsWebUITest.prototype = {
}
};
+function SyncInternalsWebUITestWithStandaloneTransport() {}
+
+SyncInternalsWebUITestWithStandaloneTransport.prototype = {
+ __proto__: SyncInternalsWebUITest.prototype,
+
+ featureList: ['switches::kSyncStandaloneTransport', ''],
+};
+
+function SyncInternalsWebUITestWithoutStandaloneTransport() {}
+
+SyncInternalsWebUITestWithoutStandaloneTransport.prototype = {
+ __proto__: SyncInternalsWebUITest.prototype,
+
+ featureList: ['', 'switches::kSyncStandaloneTransport'],
+};
+
/**
* Constant hard-coded value to return from mock getAllNodes.
* @const
@@ -241,15 +259,25 @@ TEST_F('SyncInternalsWebUITest', 'Uninitialized', function() {
// On chromeos, browser tests are signed in by default. On other platforms,
// browser tests are signed out.
GEN('#if defined(OS_CHROMEOS)');
-TEST_F('SyncInternalsWebUITest', 'SignedIn', function() {
+TEST_F('SyncInternalsWebUITestWithStandaloneTransport', 'SignedIn', function() {
assertNotEquals(null, chrome.sync.aboutInfo);
- expectTrue(this.hasInDetails(true, 'Summary', 'Waiting for start request'));
+ expectTrue(this.hasInDetails(true, 'Transport State', 'Initializing'));
+ expectTrue(this.hasInDetails(true, 'Disable Reasons', 'None'));
expectTrue(this.hasInDetails(true, 'Username', 'stub-user@example.com'));
});
+TEST_F(
+ 'SyncInternalsWebUITestWithoutStandaloneTransport', 'SignedIn', function() {
+ assertNotEquals(null, chrome.sync.aboutInfo);
+ expectTrue(this.hasInDetails(
+ true, 'Transport State', 'Waiting for start request'));
+ expectTrue(this.hasInDetails(true, 'Disable Reasons', 'None'));
+ expectTrue(this.hasInDetails(true, 'Username', 'stub-user@example.com'));
+ });
GEN('#else');
TEST_F('SyncInternalsWebUITest', 'SignedOut', function() {
assertNotEquals(null, chrome.sync.aboutInfo);
- expectTrue(this.hasInDetails(true, 'Summary', 'Disabled (Not signed in)'));
+ expectTrue(this.hasInDetails(true, 'Transport State', 'Disabled'));
+ expectTrue(this.hasInDetails(true, 'Disable Reasons', 'Not signed in'));
expectTrue(this.hasInDetails(true, 'Username', ''));
});
GEN('#endif // defined(OS_CHROMEOS)');
diff --git a/chromium/chrome/browser/ui/webui/sync_internals_message_handler.cc b/chromium/chrome/browser/ui/webui/sync_internals_message_handler.cc
index 49fe3b36d86..adb42796719 100644
--- a/chromium/chrome/browser/ui/webui/sync_internals_message_handler.cc
+++ b/chromium/chrome/browser/ui/webui/sync_internals_message_handler.cc
@@ -64,6 +64,13 @@ bool HasSomethingAtIndex(const base::ListValue* list, int index) {
return false;
}
+// Returns the initial state of the "include specifics" flag, based on whether
+// or not the corresponding command-line switch is set.
+bool GetIncludeSpecificsInitialState() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSyncIncludeSpecificsInProtocolLog);
+}
+
} // namespace
SyncInternalsMessageHandler::SyncInternalsMessageHandler()
@@ -72,7 +79,8 @@ SyncInternalsMessageHandler::SyncInternalsMessageHandler()
SyncInternalsMessageHandler::SyncInternalsMessageHandler(
AboutSyncDataDelegate about_sync_data_delegate)
- : about_sync_data_delegate_(std::move(about_sync_data_delegate)),
+ : include_specifics_(GetIncludeSpecificsInitialState()),
+ about_sync_data_delegate_(std::move(about_sync_data_delegate)),
weak_ptr_factory_(this) {}
SyncInternalsMessageHandler::~SyncInternalsMessageHandler() {
@@ -115,6 +123,12 @@ void SyncInternalsMessageHandler::RegisterMessages() {
base::Unretained(this)));
web_ui()->RegisterMessageCallback(
+ syncer::sync_ui_util::kRequestIncludeSpecificsInitialState,
+ base::BindRepeating(&SyncInternalsMessageHandler::
+ HandleRequestIncludeSpecificsInitialState,
+ base::Unretained(this)));
+
+ web_ui()->RegisterMessageCallback(
syncer::sync_ui_util::kRequestUserEventsVisibility,
base::BindRepeating(
&SyncInternalsMessageHandler::HandleRequestUserEventsVisibility,
@@ -204,14 +218,26 @@ void SyncInternalsMessageHandler::HandleRequestListOfTypes(
DictionaryValue event_details;
auto type_list = std::make_unique<ListValue>();
ModelTypeSet protocol_types = syncer::ProtocolTypes();
- for (ModelTypeSet::Iterator it = protocol_types.First(); it.Good();
- it.Inc()) {
- type_list->AppendString(ModelTypeToString(it.Get()));
+ for (syncer::ModelType type : protocol_types) {
+ type_list->AppendString(ModelTypeToString(type));
}
event_details.Set(syncer::sync_ui_util::kTypes, std::move(type_list));
DispatchEvent(syncer::sync_ui_util::kOnReceivedListOfTypes, event_details);
}
+void SyncInternalsMessageHandler::HandleRequestIncludeSpecificsInitialState(
+ const ListValue* args) {
+ DCHECK(args->empty());
+ AllowJavascript();
+
+ DictionaryValue value;
+ value.SetBoolean(syncer::sync_ui_util::kIncludeSpecifics,
+ GetIncludeSpecificsInitialState());
+
+ DispatchEvent(syncer::sync_ui_util::kOnReceivedIncludeSpecificsInitialState,
+ value);
+}
+
void SyncInternalsMessageHandler::HandleGetAllNodes(const ListValue* args) {
DCHECK_EQ(1U, args->GetSize());
AllowJavascript();
@@ -292,7 +318,7 @@ void SyncInternalsMessageHandler::HandleRequestStop(
if (!service)
return;
- service->RequestStop(SyncService::KEEP_DATA);
+ service->RequestStop(SyncService::CLEAR_DATA);
}
void SyncInternalsMessageHandler::HandleTriggerRefresh(
diff --git a/chromium/chrome/browser/ui/webui/sync_internals_message_handler.h b/chromium/chrome/browser/ui/webui/sync_internals_message_handler.h
index 6d721993633..1ba4fc3b769 100644
--- a/chromium/chrome/browser/ui/webui/sync_internals_message_handler.h
+++ b/chromium/chrome/browser/ui/webui/sync_internals_message_handler.h
@@ -52,9 +52,12 @@ class SyncInternalsMessageHandler : public content::WebUIMessageHandler,
// Fires an event to send updated info back to the page.
void HandleRequestUpdatedAboutInfo(const base::ListValue* args);
- // Fires and event to send the list of types back to the page.
+ // Fires an event to send the list of types back to the page.
void HandleRequestListOfTypes(const base::ListValue* args);
+ // Fires an event to send the initial state of the "include specifics" flag.
+ void HandleRequestIncludeSpecificsInitialState(const base::ListValue* args);
+
// Handler for getAllNodes message. Needs a |request_id| argument.
void HandleGetAllNodes(const base::ListValue* args);
diff --git a/chromium/chrome/browser/ui/webui/task_scheduler_internals/OWNERS b/chromium/chrome/browser/ui/webui/task_scheduler_internals/OWNERS
index ffc802c14e6..495a17c74d4 100644
--- a/chromium/chrome/browser/ui/webui/task_scheduler_internals/OWNERS
+++ b/chromium/chrome/browser/ui/webui/task_scheduler_internals/OWNERS
@@ -1 +1 @@
-file://base/task_scheduler/OWNERS
+file://base/task/task_scheduler/OWNERS
diff --git a/chromium/chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc b/chromium/chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc
index 641156f4958..a00370db585 100644
--- a/chromium/chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc
+++ b/chromium/chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc
@@ -11,7 +11,7 @@
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_samples.h"
#include "base/numerics/safe_conversions.h"
-#include "base/task_scheduler/task_scheduler.h"
+#include "base/task/task_scheduler/task_scheduler.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h"
diff --git a/chromium/chrome/browser/ui/webui/theme_handler.cc b/chromium/chrome/browser/ui/webui/theme_handler.cc
index b1aaf4cdfbd..d0696a73f7b 100644
--- a/chromium/chrome/browser/ui/webui/theme_handler.cc
+++ b/chromium/chrome/browser/ui/webui/theme_handler.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/webui/theme_handler.h"
+#include <memory>
+
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
@@ -49,8 +51,7 @@ void ThemeHandler::Observe(int type,
void ThemeHandler::InitializeCSSCaches() {
Profile* profile = GetProfile();
- ThemeSource* theme = new ThemeSource(profile);
- content::URLDataSource::Add(profile, theme);
+ content::URLDataSource::Add(profile, std::make_unique<ThemeSource>(profile));
}
Profile* ThemeHandler::GetProfile() const {
diff --git a/chromium/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc b/chromium/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc
index 5525c24d8fc..220af586aef 100644
--- a/chromium/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc
+++ b/chromium/chrome/browser/ui/webui/translate_internals/translate_internals_handler.cc
@@ -131,9 +131,7 @@ void TranslateInternalsHandler::OnTranslateEvent(
}
void TranslateInternalsHandler::OnRemovePrefItem(const base::ListValue* args) {
- content::WebContents* web_contents = web_ui()->GetWebContents();
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ Profile* profile = Profile::FromWebUI(web_ui());
PrefService* prefs = profile->GetOriginalProfile()->GetPrefs();
std::unique_ptr<translate::TranslatePrefs> translate_prefs(
ChromeTranslateClient::CreateTranslatePrefs(prefs));
@@ -170,9 +168,7 @@ void TranslateInternalsHandler::OnRemovePrefItem(const base::ListValue* args) {
void TranslateInternalsHandler::OnSetRecentTargetLanguage(
const base::ListValue* args) {
- content::WebContents* web_contents = web_ui()->GetWebContents();
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ Profile* profile = Profile::FromWebUI(web_ui());
PrefService* prefs = profile->GetOriginalProfile()->GetPrefs();
std::unique_ptr<translate::TranslatePrefs> translate_prefs(
ChromeTranslateClient::CreateTranslatePrefs(prefs));
@@ -212,14 +208,12 @@ void TranslateInternalsHandler::SendMessageToJs(const std::string& message,
}
void TranslateInternalsHandler::SendPrefsToJs() {
- content::WebContents* web_contents = web_ui()->GetWebContents();
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ Profile* profile = Profile::FromWebUI(web_ui());
PrefService* prefs = profile->GetOriginalProfile()->GetPrefs();
base::DictionaryValue dict;
- static const char* keys[] = {
+ static const char* const keys[] = {
prefs::kOfferTranslateEnabled,
translate::TranslatePrefs::kPrefTranslateRecentTarget,
translate::TranslatePrefs::kPrefTranslateBlockedLanguages,
@@ -242,9 +236,7 @@ void TranslateInternalsHandler::SendPrefsToJs() {
void TranslateInternalsHandler::SendSupportedLanguagesToJs() {
// Create translate prefs.
- content::WebContents* web_contents = web_ui()->GetWebContents();
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
+ Profile* profile = Profile::FromWebUI(web_ui());
PrefService* prefs = profile->GetOriginalProfile()->GetPrefs();
std::unique_ptr<translate::TranslatePrefs> translate_prefs(
ChromeTranslateClient::CreateTranslatePrefs(prefs));
@@ -257,11 +249,8 @@ void TranslateInternalsHandler::SendSupportedLanguagesToJs() {
translate::TranslateDownloadManager::GetSupportedLanguagesLastUpdated();
auto languages_list = std::make_unique<base::ListValue>();
- for (std::vector<std::string>::iterator it = languages.begin();
- it != languages.end(); ++it) {
- const std::string& lang = *it;
+ for (const std::string& lang : languages)
languages_list->AppendString(lang);
- }
base::DictionaryValue dict;
dict.Set("languages", std::move(languages_list));
diff --git a/chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.cc b/chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.cc
new file mode 100644
index 00000000000..0b69b7bb827
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.cc
@@ -0,0 +1,100 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/ukm/ukm_internals_ui.h"
+
+#include <stddef.h>
+
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/common/url_constants.h"
+#include "chrome/grit/browser_resources.h"
+#include "components/metrics_services_manager/metrics_services_manager.h"
+#include "components/ukm/debug/ukm_debug_data_extractor.h"
+#include "components/ukm/ukm_service.h"
+#include "content/public/browser/browser_thread.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 "content/public/browser/web_ui_message_handler.h"
+
+namespace {
+
+content::WebUIDataSource* CreateUkmHTMLSource() {
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUIUkmHost);
+
+ source->AddResourcePath("ukm_internals.js", IDR_UKM_INTERNALS_JS);
+ source->SetDefaultResource(IDR_UKM_INTERNALS_HTML);
+ source->UseGzip();
+ return source;
+}
+
+// This class receives javascript messages from the renderer.
+// Note that the WebUI infrastructure runs on the UI thread, therefore all of
+// this class's methods are expected to run on the UI thread.
+class UkmMessageHandler : public content::WebUIMessageHandler {
+ public:
+ explicit UkmMessageHandler(const ukm::UkmService* ukm_service);
+ ~UkmMessageHandler() override;
+
+ // WebUIMessageHandler:
+ void RegisterMessages() override;
+
+ private:
+ void HandleRequestUkmData(const base::ListValue* args);
+
+ const ukm::UkmService* ukm_service_;
+
+ DISALLOW_COPY_AND_ASSIGN(UkmMessageHandler);
+};
+
+UkmMessageHandler::UkmMessageHandler(const ukm::UkmService* ukm_service)
+ : ukm_service_(ukm_service) {}
+
+UkmMessageHandler::~UkmMessageHandler() {}
+
+void UkmMessageHandler::HandleRequestUkmData(const base::ListValue* args) {
+ AllowJavascript();
+
+ // Identifies the callback, used for when resolving.
+ std::string callback_id;
+ args->GetString(0, &callback_id);
+
+ base::Value ukm_debug_data =
+ ukm::debug::UkmDebugDataExtractor::GetStructuredData(ukm_service_);
+
+ ResolveJavascriptCallback(base::Value(callback_id),
+ std::move(ukm_debug_data));
+}
+
+void UkmMessageHandler::RegisterMessages() {
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
+ // We can use base::Unretained() here, as both the callback and this class are
+ // owned by UkmInternalsUI.
+ web_ui()->RegisterMessageCallback(
+ "requestUkmData",
+ base::BindRepeating(&UkmMessageHandler::HandleRequestUkmData,
+ base::Unretained(this)));
+}
+
+} // namespace
+
+// Changes to this class should be in sync with its iOS equivalent
+// ios/chrome/browser/ui/webui/ukm_internals_ui.cc
+UkmInternalsUI::UkmInternalsUI(content::WebUI* web_ui)
+ : content::WebUIController(web_ui) {
+ ukm::UkmService* ukm_service =
+ g_browser_process->GetMetricsServicesManager()->GetUkmService();
+ web_ui->AddMessageHandler(std::make_unique<UkmMessageHandler>(ukm_service));
+
+ // Set up the chrome://ukm/ source.
+ content::BrowserContext* browser_context =
+ web_ui->GetWebContents()->GetBrowserContext();
+ content::WebUIDataSource::Add(browser_context, CreateUkmHTMLSource());
+}
diff --git a/chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.h b/chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.h
new file mode 100644
index 00000000000..16055360210
--- /dev/null
+++ b/chromium/chrome/browser/ui/webui/ukm/ukm_internals_ui.h
@@ -0,0 +1,20 @@
+// 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 CHROME_BROWSER_UI_WEBUI_UKM_UKM_INTERNALS_UI_H_
+#define CHROME_BROWSER_UI_WEBUI_UKM_UKM_INTERNALS_UI_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_ui_controller.h"
+
+// Handles serving the chrome://ukm HTML and JS.
+class UkmInternalsUI : public content::WebUIController {
+ public:
+ explicit UkmInternalsUI(content::WebUI* web_ui);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UkmInternalsUI);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_UKM_UKM_INTERNALS_UI_H_
diff --git a/chromium/chrome/browser/ui/webui/version_handler.cc b/chromium/chrome/browser/ui/webui/version_handler.cc
index 90a780dc97a..919e04bc47d 100644
--- a/chromium/chrome/browser/ui/webui/version_handler.cc
+++ b/chromium/chrome/browser/ui/webui/version_handler.cc
@@ -12,8 +12,8 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/task_scheduler/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/task/post_task.h"
+#include "base/threading/scoped_blocking_call.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/grit/generated_resources.h"
@@ -36,7 +36,7 @@ namespace {
void GetFilePaths(const base::FilePath& profile_path,
base::string16* exec_path_out,
base::string16* profile_path_out) {
- base::AssertBlockingAllowed();
+ base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
base::FilePath executable_path = base::MakeAbsoluteFilePath(
base::CommandLine::ForCurrentProcess()->GetProgram());
diff --git a/chromium/chrome/browser/ui/webui/version_handler_chromeos.cc b/chromium/chrome/browser/ui/webui/version_handler_chromeos.cc
index 95bdee7b4b3..c877fabee31 100644
--- a/chromium/chrome/browser/ui/webui/version_handler_chromeos.cc
+++ b/chromium/chrome/browser/ui/webui/version_handler_chromeos.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/webui/version_handler_chromeos.h"
#include "base/bind.h"
-#include "base/task_scheduler/post_task.h"
+#include "base/task/post_task.h"
#include "content/public/browser/web_ui.h"
VersionHandlerChromeOS::VersionHandlerChromeOS() : weak_factory_(this) {}
@@ -16,18 +16,18 @@ void VersionHandlerChromeOS::HandleRequestVersionInfo(
const base::ListValue* args) {
// Start the asynchronous load of the versions.
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&chromeos::version_loader::GetVersion,
chromeos::version_loader::VERSION_FULL),
base::Bind(&VersionHandlerChromeOS::OnVersion,
weak_factory_.GetWeakPtr()));
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&chromeos::version_loader::GetFirmware),
base::Bind(&VersionHandlerChromeOS::OnOSFirmware,
weak_factory_.GetWeakPtr()));
base::PostTaskWithTraitsAndReplyWithResult(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::Bind(&chromeos::version_loader::GetARCVersion),
base::Bind(&VersionHandlerChromeOS::OnARCVersion,
weak_factory_.GetWeakPtr()));
diff --git a/chromium/chrome/browser/ui/webui/version_ui.cc b/chromium/chrome/browser/ui/webui/version_ui.cc
index bc9b88c1335..3c38271942a 100644
--- a/chromium/chrome/browser/ui/webui/version_ui.cc
+++ b/chromium/chrome/browser/ui/webui/version_ui.cc
@@ -117,13 +117,9 @@ WebUIDataSource* CreateVersionUIDataSource() {
html_source->AddString(version_ui::kFlashVersion, std::string());
#endif // OS_ANDROID
-#if defined(ARCH_CPU_64_BITS)
- html_source->AddLocalizedString(version_ui::kVersionBitSize,
- IDS_VERSION_UI_64BIT);
-#else
- html_source->AddLocalizedString(version_ui::kVersionBitSize,
- IDS_VERSION_UI_32BIT);
-#endif
+ html_source->AddLocalizedString(
+ version_ui::kVersionBitSize,
+ sizeof(void*) == 8 ? IDS_VERSION_UI_64BIT : IDS_VERSION_UI_32BIT);
#if defined(OS_WIN)
html_source->AddString(
@@ -141,8 +137,6 @@ WebUIDataSource* CreateVersionUIDataSource() {
#endif
#if defined(OS_WIN)
- html_source->AddString("linker", CHROMIUM_LINKER_NAME);
-
base::string16 update_cohort_name =
install_static::InstallDetails::Get().update_cohort_name();
if (!update_cohort_name.empty()) {
@@ -177,8 +171,7 @@ VersionUI::VersionUI(content::WebUI* web_ui)
#if !defined(OS_ANDROID)
// Set up the chrome://theme/ source.
- ThemeSource* theme = new ThemeSource(profile);
- content::URLDataSource::Add(profile, theme);
+ content::URLDataSource::Add(profile, std::make_unique<ThemeSource>(profile));
#endif
WebUIDataSource::Add(profile, CreateVersionUIDataSource());
diff --git a/chromium/chrome/browser/ui/webui/welcome_ui.cc b/chromium/chrome/browser/ui/webui/welcome_ui.cc
index 4bcca49cb97..36b786ce5fe 100644
--- a/chromium/chrome/browser/ui/webui/welcome_ui.cc
+++ b/chromium/chrome/browser/ui/webui/welcome_ui.cc
@@ -25,9 +25,10 @@
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
+#include "components/nux/constants.h"
+#include "components/nux/email/email_handler.h"
+#include "components/nux/google_apps/google_apps_handler.h"
#include "components/nux/show_promo_delegate.h"
-#include "components/nux_google_apps/constants.h"
-#include "components/nux_google_apps/google_apps_handler.h"
#include "content/public/browser/web_contents.h"
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
@@ -63,7 +64,6 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
// There are multiple possible configurations that affects the layout, but
// first add resources that are shared across all layouts.
- html_source->AddLocalizedString("acceptText", IDS_WELCOME_ACCEPT_BUTTON);
html_source->AddResourcePath("logo.png", IDR_PRODUCT_LOGO_128);
html_source->AddResourcePath("logo2x.png", IDR_PRODUCT_LOGO_256);
@@ -71,6 +71,8 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
// Otherwise use the default layout.
if (kIsBranded && is_dice) {
html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER);
+ html_source->AddLocalizedString("acceptText",
+ IDS_PROFILES_DICE_SIGNIN_BUTTON);
html_source->AddLocalizedString("secondHeaderText",
IDS_DICE_WELCOME_SECOND_HEADER);
html_source->AddLocalizedString("descriptionText",
@@ -103,6 +105,7 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
int header_id = is_everywhere_variant ? IDS_WELCOME_HEADER_AFTER_FIRST_RUN
: IDS_WELCOME_HEADER;
html_source->AddString("headerText", l10n_util::GetStringUTF16(header_id));
+ html_source->AddLocalizedString("acceptText", IDS_WELCOME_ACCEPT_BUTTON);
html_source->AddLocalizedString("descriptionText", IDS_WELCOME_DESCRIPTION);
html_source->AddLocalizedString("declineText", IDS_WELCOME_DECLINE_BUTTON);
html_source->AddResourcePath("welcome.js", IDR_WELCOME_JS);
@@ -111,17 +114,33 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
}
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
- if (base::FeatureList::IsEnabled(nux_google_apps::kNuxGoogleAppsFeature)) {
+ // To avoid diluting data collection, existing users should not be assigned
+ // an NUX group. So, the kOnboardDuringNUX flag is used to short-circuit the
+ // feature checks below.
+ PrefService* prefs = profile->GetPrefs();
+ bool onboard_during_nux =
+ prefs && prefs->GetBoolean(prefs::kOnboardDuringNUX);
+
+ if (onboard_during_nux &&
+ base::FeatureList::IsEnabled(nux::kNuxEmailFeature)) {
+ web_ui->AddMessageHandler(std::make_unique<nux::EmailHandler>(
+ profile->GetPrefs(), FaviconServiceFactory::GetForProfile(
+ profile, ServiceAccessType::EXPLICIT_ACCESS)));
+
+ nux::EmailHandler::AddSources(html_source, profile->GetPrefs());
+ }
+
+ if (onboard_during_nux &&
+ base::FeatureList::IsEnabled(nux::kNuxGoogleAppsFeature)) {
content::BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
- web_ui->AddMessageHandler(
- std::make_unique<nux_google_apps::GoogleAppsHandler>(
- profile->GetPrefs(),
- FaviconServiceFactory::GetForProfile(
- profile, ServiceAccessType::EXPLICIT_ACCESS),
- BookmarkModelFactory::GetForBrowserContext(browser_context)));
-
- nux_google_apps::GoogleAppsHandler::AddSources(html_source);
+ web_ui->AddMessageHandler(std::make_unique<nux::GoogleAppsHandler>(
+ profile->GetPrefs(),
+ FaviconServiceFactory::GetForProfile(
+ profile, ServiceAccessType::EXPLICIT_ACCESS),
+ BookmarkModelFactory::GetForBrowserContext(browser_context)));
+
+ nux::GoogleAppsHandler::AddSources(html_source);
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD
@@ -132,15 +151,23 @@ WelcomeUI::~WelcomeUI() {}
void WelcomeUI::StorePageSeen(Profile* profile, const GURL& url) {
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
- if (url.EqualsIgnoringRef(GURL(nux_google_apps::kNuxGoogleAppsUrl))) {
+ if (url.EqualsIgnoringRef(GURL(nux::kNuxGoogleAppsUrl))) {
// Record that the new user experience page was visited.
profile->GetPrefs()->SetBoolean(prefs::kHasSeenGoogleAppsPromoPage, true);
// Record UMA.
- UMA_HISTOGRAM_ENUMERATION(
- nux_google_apps::kGoogleAppsInteractionHistogram,
- nux_google_apps::GoogleAppsInteraction::kPromptShown,
- nux_google_apps::GoogleAppsInteraction::kCount);
+ UMA_HISTOGRAM_ENUMERATION(nux::kGoogleAppsInteractionHistogram,
+ nux::GoogleAppsInteraction::kPromptShown,
+ nux::GoogleAppsInteraction::kCount);
+ return;
+ }
+
+ if (url.EqualsIgnoringRef(GURL(nux::kNuxEmailUrl))) {
+ // Record that the new user experience page was visited.
+ profile->GetPrefs()->SetBoolean(prefs::kHasSeenEmailPromoPage, true);
+
+ // TODO(scottchen): Record UMA.
+
return;
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
diff --git a/chromium/chrome/browser/ui/webui/welcome_win10_handler.cc b/chromium/chrome/browser/ui/webui/welcome_win10_handler.cc
index eb83e52757c..da5eeb1c7f2 100644
--- a/chromium/chrome/browser/ui/webui/welcome_win10_handler.cc
+++ b/chromium/chrome/browser/ui/webui/welcome_win10_handler.cc
@@ -70,8 +70,8 @@ WelcomeWin10Handler::~WelcomeWin10Handler() {
histogram_suffix += pin_instructions_shown ? "Combined" : "Default";
// Closing the page. Record whether the instructions were useful.
- (new shell_integration::DefaultBrowserWorker(
- base::Bind(&RecordDefaultBrowserResult, histogram_suffix)))
+ base::MakeRefCounted<shell_integration::DefaultBrowserWorker>(
+ base::Bind(&RecordDefaultBrowserResult, histogram_suffix))
->StartCheckIsDefault();
if (pin_instructions_shown) {
@@ -134,8 +134,8 @@ void WelcomeWin10Handler::HandleSetDefaultBrowser(const base::ListValue* args) {
base::RecordAction(
base::UserMetricsAction("Win10WelcomePage_SetAsDefaultBrowser"));
// The worker owns itself.
- (new shell_integration::DefaultBrowserWorker(
- shell_integration::DefaultWebClientWorkerCallback()))
+ base::MakeRefCounted<shell_integration::DefaultBrowserWorker>(
+ shell_integration::DefaultWebClientWorkerCallback())
->StartSetAsDefault();
}
diff --git a/chromium/chrome/browser/vr/BUILD.gn b/chromium/chrome/browser/vr/BUILD.gn
index ac40b8204e0..edcf5ac5dfc 100644
--- a/chromium/chrome/browser/vr/BUILD.gn
+++ b/chromium/chrome/browser/vr/BUILD.gn
@@ -20,16 +20,11 @@ buildflag_header("vr_build_features") {
flags = [ "USE_VR_ASSETS_COMPONENT=$use_vr_assets_component" ]
}
-component("vr_common") {
+component("vr_ui") {
sources = [
"animation.cc",
"animation.h",
- "assets_component_update_status.h",
- "assets_load_status.h",
- "assets_loader.cc",
- "assets_loader.h",
"audio_delegate.h",
- "browser_ui_interface.h",
"content_input_delegate.cc",
"content_input_delegate.h",
"databinding/binding.h",
@@ -123,62 +118,22 @@ component("vr_common") {
"elements/vector_icon_button.h",
"elements/viewport_aware_root.cc",
"elements/viewport_aware_root.h",
- "exit_vr_prompt_choice.h",
"font_fallback.cc",
"font_fallback.h",
- "fps_meter.cc",
- "fps_meter.h",
"frame_lifecycle.cc",
"frame_lifecycle.h",
"ganesh_surface_provider.cc",
"ganesh_surface_provider.h",
- "gesture_detector.cc",
- "gesture_detector.h",
- "graphics_delegate.cc",
- "graphics_delegate.h",
- "input_event.cc",
- "input_event.h",
- "keyboard_delegate.h",
- "keyboard_ui_interface.h",
- "macros.h",
- "metrics/metrics_helper.cc",
- "metrics/metrics_helper.h",
- "metrics/session_metrics_helper.cc",
- "metrics/session_metrics_helper.h",
- "mode.h",
- "model/assets.cc",
- "model/assets.h",
- "model/camera_model.h",
- "model/capturing_state_model.cc",
- "model/capturing_state_model.h",
"model/color_scheme.cc",
"model/color_scheme.h",
- "model/controller_model.cc",
- "model/controller_model.h",
- "model/hosted_platform_ui.h",
"model/modal_prompt_type.cc",
"model/modal_prompt_type.h",
"model/model.cc",
"model/model.h",
- "model/omnibox_suggestions.cc",
- "model/omnibox_suggestions.h",
"model/platform_toast.cc",
"model/platform_toast.h",
- "model/reticle_model.h",
- "model/speech_recognition_model.h",
"model/tab_model.cc",
"model/tab_model.h",
- "model/text_input_info.cc",
- "model/text_input_info.h",
- "model/toolbar_state.cc",
- "model/toolbar_state.h",
- "model/ui_mode.h",
- "model/web_vr_model.h",
- "platform_input_handler.h",
- "platform_ui_input_delegate.cc",
- "platform_ui_input_delegate.h",
- "pose_util.cc",
- "pose_util.h",
"renderers/base_quad_renderer.cc",
"renderers/base_quad_renderer.h",
"renderers/base_renderer.cc",
@@ -187,65 +142,31 @@ component("vr_common") {
"renderers/external_textured_quad_renderer.h",
"renderers/radial_gradient_quad_renderer.cc",
"renderers/radial_gradient_quad_renderer.h",
+ "renderers/texture_copy_renderer.cc",
+ "renderers/texture_copy_renderer.h",
"renderers/textured_quad_renderer.cc",
"renderers/textured_quad_renderer.h",
"renderers/transparent_quad_renderer.cc",
"renderers/transparent_quad_renderer.h",
- "renderers/web_vr_renderer.cc",
- "renderers/web_vr_renderer.h",
- "sample_queue.cc",
- "sample_queue.h",
"sequence.cc",
"sequence.h",
- "service/browser_xr_device.cc",
- "service/browser_xr_device.h",
- "service/vr_device_manager.cc",
- "service/vr_device_manager.h",
- "service/vr_display_host.cc",
- "service/vr_display_host.h",
- "service/vr_service_impl.cc",
- "service/vr_service_impl.h",
- "sliding_average.cc",
- "sliding_average.h",
- "sounds_manager_audio_delegate.cc",
- "sounds_manager_audio_delegate.h",
- "speech_recognizer.cc",
- "speech_recognizer.h",
"target_property.cc",
"target_property.h",
- "text_edit_action.cc",
- "text_edit_action.h",
- "text_input_delegate.cc",
- "text_input_delegate.h",
- "toolbar_helper.cc",
- "toolbar_helper.h",
"transition.cc",
"transition.h",
"ui.cc",
"ui.h",
- "ui_browser_interface.h",
"ui_element_renderer.cc",
"ui_element_renderer.h",
- "ui_initial_state.cc",
- "ui_initial_state.h",
"ui_input_manager.cc",
"ui_input_manager.h",
- "ui_interface.h",
"ui_renderer.cc",
"ui_renderer.h",
"ui_scene.cc",
"ui_scene.h",
"ui_scene_creator.cc",
"ui_scene_creator.h",
- "ui_support.cc",
- "ui_support.h",
- "ui_test_input.cc",
- "ui_test_input.h",
- "ui_unsupported_mode.h",
- "vr_export.h",
- "vr_features.h",
- "vr_gl_util.cc",
- "vr_gl_util.h",
+ "vr_ui_export.h",
]
public_deps = [
@@ -253,23 +174,85 @@ component("vr_common") {
]
deps = [
- ":vr_build_features",
+ ":vr_base",
"//base",
"//cc/animation",
- "//cc/paint",
"//chrome/app:generated_resources",
"//chrome/browser/vr/vector_icons",
"//chrome/common:constants",
+ "//components/toolbar:vector_icons",
+ "//components/url_formatter",
+ "//components/vector_icons",
+ "//media",
+ "//net",
+ "//skia",
+ ]
+
+ defines = [
+ "VR_IMPLEMENTATION",
+ "VR_UI_IMPLEMENTATION",
+ ]
+}
+
+component("vr_common") {
+ sources = [
+ "base_compositor_delegate.cc",
+ "base_compositor_delegate.h",
+ "compositor_delegate.h",
+ "controller_delegate.h",
+ "controller_delegate_for_testing.cc",
+ "controller_delegate_for_testing.h",
+ "fps_meter.cc",
+ "fps_meter.h",
+ "gesture_detector.cc",
+ "gesture_detector.h",
+ "platform_controller.h",
+ "render_loop.cc",
+ "render_loop.h",
+ "render_loop_browser_interface.h",
+ "sample_queue.cc",
+ "sample_queue.h",
+ "scheduler_delegate.h",
+ "service/browser_xr_runtime.cc",
+ "service/browser_xr_runtime.h",
+ "service/isolated_device_provider.cc",
+ "service/isolated_device_provider.h",
+ "service/vr_service_impl.cc",
+ "service/vr_service_impl.h",
+ "service/xr_device_impl.cc",
+ "service/xr_device_impl.h",
+ "service/xr_runtime_manager.cc",
+ "service/xr_runtime_manager.h",
+ "sliding_average.cc",
+ "sliding_average.h",
+ "sounds_manager_audio_delegate.cc",
+ "sounds_manager_audio_delegate.h",
+ "toolbar_helper.cc",
+ "toolbar_helper.h",
+ "ui_factory.cc",
+ "ui_factory.h",
+ ]
+
+ public_deps = [
+ ":vr_base",
+ ]
+
+ deps = [
+ ":vr_ui",
+ "//base",
+ "//cc/animation",
+ "//cc/paint",
+ "//chrome/browser/vr/vector_icons",
+ "//chrome/common:constants",
"//components/omnibox/browser",
- "//components/security_state/core",
- "//components/strings",
+ "//components/rappor/public:public",
"//components/toolbar",
+ "//components/toolbar:vector_icons",
"//components/ukm/content",
- "//components/url_formatter",
"//components/vector_icons",
"//content/public/browser",
- "//content/public/common",
"//device/vr",
+ "//device/vr/buildflags:buildflags",
"//device/vr/public/mojom",
"//media",
"//net",
@@ -286,6 +269,101 @@ component("vr_common") {
]
}
+# vr_base contains common dependencies of vr_common and vr_ui. It exists because
+# vr_ui must not depend on vr_common.
+source_set("vr_base") {
+ sources = [
+ "assets_component_update_status.h",
+ "assets_load_status.h",
+ "assets_loader.cc",
+ "assets_loader.h",
+ "browser_ui_interface.h",
+ "compositor_ui_interface.h",
+ "exit_vr_prompt_choice.h",
+ "gl_texture_location.h",
+ "input_event.cc",
+ "input_event.h",
+ "keyboard_delegate.h",
+ "keyboard_ui_interface.h",
+ "macros.h",
+ "metrics/metrics_helper.cc",
+ "metrics/metrics_helper.h",
+ "metrics/session_metrics_helper.cc",
+ "metrics/session_metrics_helper.h",
+ "mode.h",
+ "model/assets.cc",
+ "model/assets.h",
+ "model/camera_model.h",
+ "model/capturing_state_model.h",
+ "model/controller_model.cc",
+ "model/controller_model.h",
+ "model/hosted_platform_ui.h",
+ "model/omnibox_suggestions.cc",
+ "model/omnibox_suggestions.h",
+ "model/reticle_model.h",
+ "model/speech_recognition_model.h",
+ "model/text_input_info.cc",
+ "model/text_input_info.h",
+ "model/toolbar_state.cc",
+ "model/toolbar_state.h",
+ "model/ui_mode.h",
+ "model/web_vr_model.h",
+ "platform_input_handler.h",
+ "platform_ui_input_delegate.cc",
+ "platform_ui_input_delegate.h",
+ "pose_util.cc",
+ "pose_util.h",
+ "render_info.h",
+ "speech_recognizer.cc",
+ "speech_recognizer.h",
+ "text_edit_action.cc",
+ "text_edit_action.h",
+ "text_input_delegate.cc",
+ "text_input_delegate.h",
+ "ui_browser_interface.h",
+ "ui_initial_state.cc",
+ "ui_initial_state.h",
+ "ui_interface.h",
+ "ui_support.cc",
+ "ui_support.h",
+ "ui_test_input.h",
+ "ui_unsupported_mode.h",
+ "vr_export.h",
+ "vr_geometry_util.cc",
+ "vr_geometry_util.h",
+ "vr_gl_util.cc",
+ "vr_gl_util.h",
+ ]
+
+ defines = [
+ "VR_IMPLEMENTATION",
+ "VR_UI_IMPLEMENTATION",
+ ]
+
+ public_deps = [
+ ":vr_build_features",
+ "//components/omnibox/browser",
+ "//components/strings:components_strings_grit",
+ "//content/public/common",
+ "//ui/base",
+ "//ui/gl/init",
+ ]
+
+ deps = [
+ "//base",
+ "//chrome/app:generated_resources",
+ "//components/rappor:rappor",
+ "//components/security_state/core",
+ "//components/ukm/content",
+ "//components/url_formatter",
+ "//content/public/browser:browser",
+ "//media",
+ "//net",
+ "//services/metrics/public/cpp:ukm_builders",
+ "//skia",
+ ]
+}
+
test("vr_common_unittests") {
sources = [
"animation_unittest.cc",
@@ -319,7 +397,7 @@ test("vr_common_unittests") {
"gesture_detector_unittest.cc",
"model/text_input_info_unittest.cc",
"platform_ui_input_delegate_unittest.cc",
- "service/vr_device_manager_unittest.cc",
+ "service/xr_runtime_manager_unittest.cc",
"sliding_average_unittest.cc",
"speech_recognizer_unittest.cc",
"test/paths.cc",
@@ -330,7 +408,7 @@ test("vr_common_unittests") {
"ui_input_manager_unittest.cc",
"ui_scene_unittest.cc",
"ui_unittest.cc",
- "vr_gl_util_unittest.cc",
+ "vr_geometry_util_unittest.cc",
]
# TODO(mthiesse, crbug.com/769373): The dependency on device/vr:fakes requires
@@ -341,6 +419,7 @@ test("vr_common_unittests") {
deps = [
":vr_test_support",
"//components/url_formatter",
+ "//components/vector_icons",
"//mojo/public/cpp/bindings",
"//services/network:test_support",
"//testing/gmock",
@@ -396,6 +475,7 @@ source_set("vr_test_support") {
sources = [
"test/animation_utils.cc",
"test/animation_utils.h",
+ "test/constants.cc",
"test/constants.h",
"test/mock_browser_ui_interface.cc",
"test/mock_browser_ui_interface.h",
@@ -416,8 +496,10 @@ source_set("vr_test_support") {
public_deps = [
":vr_common",
":vr_test_pak",
+ ":vr_ui",
"//base/test:test_support",
"//cc:test_support",
+ "//components/omnibox/browser:browser",
"//components/security_state/core",
"//components/toolbar:vector_icons",
"//content/test:test_support",
@@ -451,7 +533,13 @@ source_set("vr_gl_test_support") {
public_deps = [
"//base/test:test_support",
"//skia",
+ "//testing/gtest",
"//ui/gl",
+ "//ui/gl:test_support",
+ ]
+
+ deps = [
+ ":vr_common", # For graphics delegate.
]
}
diff --git a/chromium/chrome/browser/vr/testapp/BUILD.gn b/chromium/chrome/browser/vr/testapp/BUILD.gn
index 53673df46cf..f0c114ac464 100644
--- a/chromium/chrome/browser/vr/testapp/BUILD.gn
+++ b/chromium/chrome/browser/vr/testapp/BUILD.gn
@@ -24,11 +24,15 @@ executable("vr_testapp") {
deps = [
":assets_component_version_header",
":vr_testapp_pak",
+ ":vr_testapp_resources",
"//chrome/browser/vr:vr_common",
+ "//chrome/browser/vr:vr_test_support",
+ "//chrome/browser/vr:vr_ui",
"//components:components_tests_pak",
"//components/security_state/core",
"//components/toolbar:vector_icons",
"//components/tracing:startup_tracing",
+ "//components/vector_icons:vector_icons",
"//ui/display/types",
"//ui/events",
"//ui/events:dom_keycode_converter",
diff --git a/chromium/chrome/browser/web_applications/BUILD.gn b/chromium/chrome/browser/web_applications/BUILD.gn
index b44066a1888..621fc64de21 100644
--- a/chromium/chrome/browser/web_applications/BUILD.gn
+++ b/chromium/chrome/browser/web_applications/BUILD.gn
@@ -2,7 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("//extensions/buildflags/buildflags.gni")
+group("web_app_group") {
+ public_configs = [ "//build/config/compiler:wexit_time_destructors" ]
+}
source_set("web_applications") {
sources = [
@@ -10,66 +12,35 @@ source_set("web_applications") {
"web_app_provider.h",
"web_app_provider_factory.cc",
"web_app_provider_factory.h",
-
- # TODO(loyso): move this code (and everything other than "KEEP") elsewhere.
- "web_app.cc",
- "web_app.h",
- "web_app_chromeos.cc",
- "web_app_mac.h",
- "web_app_mac.mm",
- "web_app_win.cc",
- "web_app_win.h",
]
- if (is_desktop_linux) {
- # Desktop linux, doesn't count ChromeOS.
- sources += [ "web_app_linux.cc" ]
- }
-
- configs += [ "//build/config/compiler:wexit_time_destructors" ]
-
- # TODO(loyso): Break this dependency cycle.
- allow_circular_includes_from = [ "//chrome/browser/extensions" ]
-
deps = [
- # TODO(loyso): KEEP.
+ ":web_app_group",
"//chrome/browser/web_applications/bookmark_apps",
- "//chrome/common",
- "//skia",
-
- # TODO(loyso): move this code elsewhere.
- "//base",
- "//chrome/browser/extensions",
"//chrome/browser/web_applications/components",
+ "//chrome/browser/web_applications/extensions",
+ "//chrome/common",
"//components/keyed_service/content",
- "//components/prefs",
"//extensions/browser",
- "//url",
]
}
-source_set("web_applications_unit_tests") {
+source_set("unit_tests") {
testonly = true
- sources = [
- "web_app_mac_unittest.mm",
- "web_app_unittest.cc",
- ]
-
deps = [
- ":web_applications",
- "//chrome/browser/extensions",
- "//extensions/browser",
- "//skia",
- "//testing/gmock",
+ ":web_app_group",
+ "//chrome/browser/web_applications/bookmark_apps:unit_tests",
+ "//chrome/browser/web_applications/components:unit_tests",
+ "//chrome/browser/web_applications/extensions:unit_tests",
]
}
-source_set("unit_tests") {
+source_set("browser_tests") {
testonly = true
+
deps = [
- ":web_applications_unit_tests",
- "//chrome/browser/web_applications/bookmark_apps:unit_tests",
- "//chrome/browser/web_applications/components:components_unit_tests",
+ ":web_app_group",
+ "//chrome/browser/web_applications/extensions:browser_tests",
]
}
diff --git a/chromium/chrome/browser/web_applications/bookmark_apps/BUILD.gn b/chromium/chrome/browser/web_applications/bookmark_apps/BUILD.gn
index 12dc5501d57..6e33028c983 100644
--- a/chromium/chrome/browser/web_applications/bookmark_apps/BUILD.gn
+++ b/chromium/chrome/browser/web_applications/bookmark_apps/BUILD.gn
@@ -8,6 +8,8 @@ assert(enable_extensions)
source_set("bookmark_apps") {
sources = [
+ "external_web_apps.cc",
+ "external_web_apps.h",
"policy/web_app_policy_constants.cc",
"policy/web_app_policy_constants.h",
"policy/web_app_policy_manager.cc",
@@ -16,7 +18,12 @@ source_set("bookmark_apps") {
deps = [
"//chrome/browser/extensions",
+ "//chrome/browser/web_applications:web_app_group",
+ "//chrome/browser/web_applications/components",
+ "//chrome/browser/web_applications/extensions",
"//chrome/common",
+ "//components/favicon/content",
+ "//components/pref_registry",
"//skia",
]
}
@@ -25,12 +32,28 @@ source_set("unit_tests") {
testonly = true
sources = [
+ "external_web_apps_unittest.cc",
"policy/web_app_policy_manager_unittest.cc",
]
deps = [
":bookmark_apps",
+ "//base",
+ "//chrome/browser",
+ "//chrome/browser/web_applications:web_app_group",
+ "//chrome/browser/web_applications:web_applications",
+ "//chrome/browser/web_applications/components",
+ "//chrome/browser/web_applications/components:test_support",
+ "//chrome/browser/web_applications/extensions",
+ "//chrome/common:constants",
+ "//chrome/test:test_support",
+ "//components/crx_file:crx_file",
+ "//components/sync_preferences:test_support",
+ "//content/test:test_support",
+ "//extensions/common",
"//skia",
"//testing/gmock",
+ "//testing/gtest",
+ "//url",
]
}
diff --git a/chromium/chrome/browser/web_applications/components/BUILD.gn b/chromium/chrome/browser/web_applications/components/BUILD.gn
index fb61002d2c9..3b59610fb49 100644
--- a/chromium/chrome/browser/web_applications/components/BUILD.gn
+++ b/chromium/chrome/browser/web_applications/components/BUILD.gn
@@ -4,25 +4,92 @@
source_set("components") {
sources = [
+ "pending_app_manager.cc",
+ "pending_app_manager.h",
"web_app_helpers.cc",
"web_app_helpers.h",
+ "web_app_icon_generator.cc",
+ "web_app_icon_generator.h",
+ "web_app_shortcut.cc",
+ "web_app_shortcut.h",
+ "web_app_shortcut_chromeos.cc",
+ "web_app_shortcut_mac.h",
+ "web_app_shortcut_mac.mm",
+ "web_app_shortcut_win.cc",
+ "web_app_shortcut_win.h",
+
+ # TODO(nigeltao): move these two files from
+ # //chrome/browser/web_applications/components to a stand-alone
+ # //components/web_app_icon_downloader?
+ #
+ # There's also //components/favicon, //components/image_fetcher as well as
+ # code split between //content/public/browser/manifest_icon_downloader.h
+ # and //content/browser/manfest/manifest_icon_downloader.cc. Some or all of
+ # those might be similar enough to merge.
+ "web_app_icon_downloader.cc",
+ "web_app_icon_downloader.h",
]
+ if (is_desktop_linux) {
+ # Desktop linux, doesn't count ChromeOS.
+ sources += [
+ "web_app_shortcut_linux.cc",
+ "web_app_shortcut_linux.h",
+ ]
+ }
+
deps = [
+ "//chrome/app/resources:platform_locale_settings",
+ "//chrome/app/theme:chrome_unscaled_resources",
+ "//chrome/browser/web_applications:web_app_group",
+ "//chrome/common",
+ "//components/crx_file",
+ "//components/favicon/content",
+ "//content/public/browser",
+ "//skia",
+ ]
+}
+
+source_set("test_support") {
+ testonly = true
+
+ sources = [
+ "test_pending_app_manager.cc",
+ "test_pending_app_manager.h",
+ ]
+
+ deps = [
+ ":components",
"//base",
+ "//url",
]
}
-source_set("components_unit_tests") {
+source_set("unit_tests") {
testonly = true
sources = [
"web_app_helpers_unittest.cc",
+ "web_app_icon_downloader_unittest.cc",
+ "web_app_icon_generator_unittest.cc",
+ "web_app_shortcut_mac_unittest.mm",
+ "web_app_shortcut_unittest.cc",
]
+ if (is_desktop_linux) {
+ # Desktop linux, doesn't count ChromeOS.
+ sources += [ "web_app_shortcut_linux_unittest.cc" ]
+ }
+
deps = [
":components",
+ "//base/test:test_support",
+ "//chrome/app/theme:theme_resources",
+ "//chrome/browser/web_applications:web_app_group",
+ "//chrome/test:test_support",
+ "//content/public/browser",
+ "//skia",
+ "//testing/gmock",
"//testing/gtest",
- "//url",
]
}
diff --git a/chromium/chrome/browser/web_applications/extensions/BUILD.gn b/chromium/chrome/browser/web_applications/extensions/BUILD.gn
index c8058dd64b8..f1f5ce31860 100644
--- a/chromium/chrome/browser/web_applications/extensions/BUILD.gn
+++ b/chromium/chrome/browser/web_applications/extensions/BUILD.gn
@@ -8,14 +8,85 @@ assert(enable_extensions)
source_set("extensions") {
sources = [
+ "bookmark_app_data_retriever.cc",
+ "bookmark_app_data_retriever.h",
+ "bookmark_app_installation_task.cc",
+ "bookmark_app_installation_task.h",
+ "bookmark_app_installer.cc",
+ "bookmark_app_installer.h",
+ "bookmark_app_shortcut_installation_task.cc",
+ "bookmark_app_shortcut_installation_task.h",
+ "bookmark_app_util.cc",
+ "bookmark_app_util.h",
"pending_bookmark_app_manager.cc",
"pending_bookmark_app_manager.h",
- "web_app_extension_helpers.cc",
- "web_app_extension_helpers.h",
+ "web_app_extension_ids_map.cc",
+ "web_app_extension_ids_map.h",
+ "web_app_extension_shortcut.cc",
+ "web_app_extension_shortcut.h",
+ "web_app_extension_shortcut_mac.h",
+ "web_app_extension_shortcut_mac.mm",
]
deps = [
"//base",
+ "//chrome/browser/web_applications:web_app_group",
"//chrome/browser/web_applications/components",
+ "//chrome/common",
+ "//components/pref_registry",
+ "//content/public/browser",
+ "//extensions/browser",
+ "//skia",
+ ]
+}
+
+source_set("unit_tests") {
+ testonly = true
+
+ sources = [
+ "bookmark_app_data_retriever_unittest.cc",
+ "bookmark_app_installation_task_unittest.cc",
+ "bookmark_app_installer_unittest.cc",
+ "pending_bookmark_app_manager_unittest.cc",
+ ]
+
+ deps = [
+ ":extensions",
+ "//chrome/browser",
+ "//chrome/browser/web_applications:web_app_group",
+ "//chrome/browser/web_applications/components",
+ "//chrome/common",
+ "//chrome/test:test_support",
+ "//components/crx_file:crx_file",
+ "//content/public/browser",
+ "//content/test:test_support",
+ "//extensions/browser/install",
+ "//extensions/common",
+ "//skia",
+ "//testing/gtest",
+ ]
+}
+
+source_set("browser_tests") {
+ testonly = true
+
+ sources = [
+ "pending_bookmark_app_manager_browsertest.cc",
+ ]
+
+ defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
+
+ deps = [
+ ":extensions",
+ "//base/test:test_support",
+ "//chrome/browser",
+ "//chrome/browser/ui",
+ "//chrome/browser/web_applications",
+ "//chrome/browser/web_applications:web_app_group",
+ "//chrome/browser/web_applications/components",
+ "//chrome/test:test_support_ui",
+ "//extensions/browser",
+ "//extensions/common",
+ "//net:test_support",
]
}