mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 22:36:09 +03:00
Import chromium-76.0.3809.12
This commit is contained in:
commit
1e97ab2758
39
src/.clang-format
Normal file
39
src/.clang-format
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Defines the Chromium style for automatic reformatting.
|
||||||
|
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
||||||
|
BasedOnStyle: Chromium
|
||||||
|
# This defaults to 'Auto'. Explicitly set it for a while, so that
|
||||||
|
# 'vector<vector<int> >' in existing files gets formatted to
|
||||||
|
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use
|
||||||
|
# 'int>>' if the file already contains at least one such instance.)
|
||||||
|
Standard: Cpp11
|
||||||
|
|
||||||
|
# Make sure code like:
|
||||||
|
# IPC_BEGIN_MESSAGE_MAP()
|
||||||
|
# IPC_MESSAGE_HANDLER(WidgetHostViewHost_Update, OnUpdate)
|
||||||
|
# IPC_END_MESSAGE_MAP()
|
||||||
|
# gets correctly indented.
|
||||||
|
MacroBlockBegin: "^\
|
||||||
|
BEGIN_MSG_MAP|\
|
||||||
|
BEGIN_MSG_MAP_EX|\
|
||||||
|
BEGIN_SAFE_MSG_MAP_EX|\
|
||||||
|
CR_BEGIN_MSG_MAP_EX|\
|
||||||
|
IPC_BEGIN_MESSAGE_MAP|\
|
||||||
|
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM|\
|
||||||
|
IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN|\
|
||||||
|
IPC_STRUCT_BEGIN|\
|
||||||
|
IPC_STRUCT_BEGIN_WITH_PARENT|\
|
||||||
|
IPC_STRUCT_TRAITS_BEGIN|\
|
||||||
|
POLPARAMS_BEGIN|\
|
||||||
|
PPAPI_BEGIN_MESSAGE_MAP$"
|
||||||
|
MacroBlockEnd: "^\
|
||||||
|
CR_END_MSG_MAP|\
|
||||||
|
END_MSG_MAP|\
|
||||||
|
IPC_END_MESSAGE_MAP|\
|
||||||
|
IPC_PROTOBUF_MESSAGE_TRAITS_END|\
|
||||||
|
IPC_STRUCT_END|\
|
||||||
|
IPC_STRUCT_TRAITS_END|\
|
||||||
|
POLPARAMS_END|\
|
||||||
|
PPAPI_END_MESSAGE_MAP$"
|
||||||
|
|
||||||
|
# TODO: Remove this once clang-format r357700 is rolled in.
|
||||||
|
JavaImportGroups: ['android', 'androidx', 'com', 'dalvik', 'junit', 'org', 'com.google.android.apps.chrome', 'org.chromium', 'java', 'javax']
|
52
src/.gitattributes
vendored
Normal file
52
src/.gitattributes
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# Stop Windows python license check presubmit errors by forcing LF checkout.
|
||||||
|
*.py text eol=lf
|
||||||
|
|
||||||
|
# Force LF checkout of the pins files to avoid transport_security_state_generator errors.
|
||||||
|
/net/http/*.pins text eol=lf
|
||||||
|
|
||||||
|
# Force LF checkout for all source files
|
||||||
|
*.bin binary
|
||||||
|
*.c text eol=lf
|
||||||
|
*.cc text eol=lf
|
||||||
|
*.cpp text eol=lf
|
||||||
|
*.grd text eol=lf
|
||||||
|
*.grdp text eol=lf
|
||||||
|
*.gn text eol=lf
|
||||||
|
*.gni text eol=lf
|
||||||
|
*.h text eol=lf
|
||||||
|
*.html text eol=lf
|
||||||
|
*.idl text eol=lf
|
||||||
|
*.in text eol=lf
|
||||||
|
*.inc text eol=lf
|
||||||
|
*.java text eol=lf
|
||||||
|
*.js text eol=lf
|
||||||
|
*.json text eol=lf
|
||||||
|
*.json5 text eol=lf
|
||||||
|
*.md text eol=lf
|
||||||
|
*.mm text eol=lf
|
||||||
|
*.mojom text eol=lf
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.sql text eol=lf
|
||||||
|
*.txt text eol=lf
|
||||||
|
*.xml text eol=lf
|
||||||
|
*.xslt text eol=lf
|
||||||
|
.clang-format text eol=lf
|
||||||
|
.eslintrc.js text eol=lf
|
||||||
|
.git-blame-ignore-revs text eol=lf
|
||||||
|
.gitattributes text eol=lf
|
||||||
|
.gitignore text eol=lf
|
||||||
|
.vpython text eol=lf
|
||||||
|
codereview.settings text eol=lf
|
||||||
|
DEPS text eol=lf
|
||||||
|
ENG_REVIEW_OWNERS text eol=lf
|
||||||
|
LICENSE text eol=lf
|
||||||
|
LICENSE.* text eol=lf
|
||||||
|
MAJOR_BRANCH_DATE text eol=lf
|
||||||
|
OWNERS text eol=lf
|
||||||
|
README text eol=lf
|
||||||
|
README.* text eol=lf
|
||||||
|
WATCHLISTS text eol=lf
|
||||||
|
VERSION text eol=lf
|
||||||
|
|
||||||
|
# Skip Tricium by default on files in third_party.
|
||||||
|
third_party/** -tricium
|
682
src/.gn
Normal file
682
src/.gn
Normal file
@ -0,0 +1,682 @@
|
|||||||
|
# This file is used by the GN meta build system to find the root of the source
|
||||||
|
# tree and to set startup options. For documentation on the values set in this
|
||||||
|
# file, run "gn help dotfile" at the command line.
|
||||||
|
|
||||||
|
import("//build/dotfile_settings.gni")
|
||||||
|
import("//third_party/angle/dotfile_settings.gni")
|
||||||
|
|
||||||
|
# The location of the build configuration file.
|
||||||
|
buildconfig = "//build/config/BUILDCONFIG.gn"
|
||||||
|
|
||||||
|
# These arguments override the default values for items in a declare_args
|
||||||
|
# block. "gn args" in turn can override these.
|
||||||
|
#
|
||||||
|
# In general the value for a build arg in the declare_args block should be the
|
||||||
|
# default. In some cases, a DEPS-ed in project will want different defaults for
|
||||||
|
# being built as part of Chrome vs. being built standalone. In this case, the
|
||||||
|
# Chrome defaults should go here. There should be no overrides here for
|
||||||
|
# values declared in the main Chrome repository.
|
||||||
|
#
|
||||||
|
# Important note for defining defaults: This file is executed before the
|
||||||
|
# BUILDCONFIG.gn file. That file sets up the global variables like "is_ios".
|
||||||
|
# This means that the default_args can not depend on the platform,
|
||||||
|
# architecture, or other build parameters. If you really need that, the other
|
||||||
|
# repo should define a flag that toggles on a behavior that implements the
|
||||||
|
# additional logic required by Chrome to set the variables.
|
||||||
|
default_args = {
|
||||||
|
# TODO(brettw) bug 684096: Chrome on iOS does not build v8, so "gn gen" prints
|
||||||
|
# a warning that "Build argument has no effect". When adding a v8 variable, it
|
||||||
|
# also needs to be defined to src/ios/BUILD.gn (respectively removed from both
|
||||||
|
# location when it is removed).
|
||||||
|
|
||||||
|
v8_extra_library_files = [
|
||||||
|
# Dependencies used by the extra libraries. Putting them here causes them
|
||||||
|
# to be executed first during snapshot creation.
|
||||||
|
"//third_party/blink/renderer/core/streams/CommonOperations.js",
|
||||||
|
"//third_party/blink/renderer/core/streams/CommonStrings.js",
|
||||||
|
"//third_party/blink/renderer/core/streams/SimpleQueue.js",
|
||||||
|
|
||||||
|
# Extra libraries.
|
||||||
|
"//third_party/blink/renderer/core/streams/ByteLengthQueuingStrategy.js",
|
||||||
|
"//third_party/blink/renderer/core/streams/CountQueuingStrategy.js",
|
||||||
|
"//third_party/blink/renderer/core/streams/ReadableStream.js",
|
||||||
|
"//third_party/blink/renderer/core/streams/WritableStream.js",
|
||||||
|
"//third_party/blink/renderer/core/streams/TransformStream.js",
|
||||||
|
]
|
||||||
|
v8_experimental_extra_library_files = []
|
||||||
|
v8_enable_gdbjit = false
|
||||||
|
v8_imminent_deprecation_warnings = false
|
||||||
|
|
||||||
|
# TODO(jochen): Remove this. http://crbug.com/v8/5830,
|
||||||
|
# http://crbug.com/728583.
|
||||||
|
v8_check_microtasks_scopes_consistency = false
|
||||||
|
|
||||||
|
# Don't include webrtc's builtin task queue implementation.
|
||||||
|
rtc_link_task_queue_impl = false
|
||||||
|
|
||||||
|
# Don't include the iLBC audio codec.
|
||||||
|
# TODO(bugs.webrtc.org/8396): Once WebRTC gets rid of its internal
|
||||||
|
# deps on codecs, we can remove this.
|
||||||
|
rtc_include_ilbc = false
|
||||||
|
|
||||||
|
# Changes some setup for the Crashpad build to set them to build against
|
||||||
|
# Chromium's zlib, base, etc.
|
||||||
|
crashpad_dependencies = "chromium"
|
||||||
|
}
|
||||||
|
|
||||||
|
# These are the targets to check headers for by default. The files in targets
|
||||||
|
# matching these patterns (see "gn help label_pattern" for format) will have
|
||||||
|
# their includes checked for proper dependencies when you run either
|
||||||
|
# "gn check" or "gn gen --check".
|
||||||
|
check_targets = [
|
||||||
|
"//apps/*",
|
||||||
|
"//ash/*",
|
||||||
|
"//base/*",
|
||||||
|
"//blink/*",
|
||||||
|
"//build/*",
|
||||||
|
"//buildtools/*",
|
||||||
|
"//cc/*",
|
||||||
|
|
||||||
|
#"//chrome/*", # Many errors: https://crbug.com/949535
|
||||||
|
|
||||||
|
#"//chrome/android/*", # 13 errors
|
||||||
|
"//chrome/app/*",
|
||||||
|
"//chrome/app_shim/*",
|
||||||
|
|
||||||
|
#"//chrome/browser/*", # ~1300 errors
|
||||||
|
#"//chrome/browser:*", # ~600 errors
|
||||||
|
"//chrome/browser/accessibility/*",
|
||||||
|
"//chrome/browser/android/*",
|
||||||
|
"//chrome/browser/app_mode/*",
|
||||||
|
"//chrome/browser/apps/*",
|
||||||
|
"//chrome/browser/assist_ranker/*",
|
||||||
|
"//chrome/browser/autocomplete/*",
|
||||||
|
"//chrome/browser/autofill/*",
|
||||||
|
"//chrome/browser/background/*",
|
||||||
|
"//chrome/browser/background_fetch/*",
|
||||||
|
"//chrome/browser/background_sync/*",
|
||||||
|
"//chrome/browser/banners/*",
|
||||||
|
"//chrome/browser/bitmap_fetcher/*",
|
||||||
|
"//chrome/browser/bookmarks/*",
|
||||||
|
"//chrome/browser/browsing_data/*",
|
||||||
|
"//chrome/browser/budget_service/*",
|
||||||
|
"//chrome/browser/captive_portal/*",
|
||||||
|
"//chrome/browser/chooser_controller/*",
|
||||||
|
"//chrome/browser/chromeos/*",
|
||||||
|
"//chrome/browser/client_hints/*",
|
||||||
|
"//chrome/browser/clipboard/*",
|
||||||
|
"//chrome/browser/component_updater/*",
|
||||||
|
"//chrome/browser/consent_auditor/*",
|
||||||
|
"//chrome/browser/content_settings/*",
|
||||||
|
"//chrome/browser/crash_upload_list/*",
|
||||||
|
"//chrome/browser/custom_handlers/*",
|
||||||
|
"//chrome/browser/data_saver/*",
|
||||||
|
"//chrome/browser/data_use_measurement/*",
|
||||||
|
"//chrome/browser/dbus/*",
|
||||||
|
|
||||||
|
#"//chrome/browser/devtools/*", # 93 errors
|
||||||
|
"//chrome/browser/diagnostics/*",
|
||||||
|
"//chrome/browser/domain_reliability/*",
|
||||||
|
"//chrome/browser/dom_distiller/*",
|
||||||
|
"//chrome/browser/downgrade/*",
|
||||||
|
"//chrome/browser/download/*",
|
||||||
|
"//chrome/browser/drive/*",
|
||||||
|
"//chrome/browser/engagement/*",
|
||||||
|
"//chrome/browser/extensions/*",
|
||||||
|
"//chrome/browser/external_protocol/*",
|
||||||
|
"//chrome/browser/favicon/*",
|
||||||
|
"//chrome/browser/feature_engagement/*",
|
||||||
|
"//chrome/browser/feedback/*",
|
||||||
|
"//chrome/browser/first_run/*",
|
||||||
|
"//chrome/browser/gcm/*",
|
||||||
|
"//chrome/browser/generic_sensor/*",
|
||||||
|
"//chrome/browser/geolocation/*",
|
||||||
|
"//chrome/browser/google/*",
|
||||||
|
"//chrome/browser/gpu/*",
|
||||||
|
"//chrome/browser/guest_view/*",
|
||||||
|
"//chrome/browser/hang_monitor/*",
|
||||||
|
"//chrome/browser/history/*",
|
||||||
|
"//chrome/browser/importer/*",
|
||||||
|
"//chrome/browser/infobars/*",
|
||||||
|
"//chrome/browser/installable/*",
|
||||||
|
"//chrome/browser/install_verification/*",
|
||||||
|
"//chrome/browser/internal/*",
|
||||||
|
"//chrome/browser/interstitials/*",
|
||||||
|
"//chrome/browser/invalidation/*",
|
||||||
|
"//chrome/browser/language/*",
|
||||||
|
"//chrome/browser/lifetime/*",
|
||||||
|
|
||||||
|
#"//chrome/browser/loader/*", # 2 errors
|
||||||
|
"//chrome/browser/local_discovery/*",
|
||||||
|
"//chrome/browser/mac/*",
|
||||||
|
|
||||||
|
#"//chrome/browser/media/*", # 74 errors
|
||||||
|
"//chrome/browser/media_galleries/*",
|
||||||
|
"//chrome/browser/memory/*",
|
||||||
|
"//chrome/browser/metrics/*",
|
||||||
|
"//chrome/browser/nacl_host/*",
|
||||||
|
"//chrome/browser/navigation_predictor/*",
|
||||||
|
"//chrome/browser/net/*",
|
||||||
|
"//chrome/browser/notifications/*",
|
||||||
|
"//chrome/browser/ntp_snippets/*",
|
||||||
|
"//chrome/browser/ntp_tiles/*",
|
||||||
|
"//chrome/browser/obsolete_system/*",
|
||||||
|
"//chrome/browser/offline_items_collection/*",
|
||||||
|
"//chrome/browser/offline_pages/*",
|
||||||
|
"//chrome/browser/page_load_metrics/*",
|
||||||
|
"//chrome/browser/password_manager/*",
|
||||||
|
"//chrome/browser/payments/*",
|
||||||
|
"//chrome/browser/pdf/*",
|
||||||
|
"//chrome/browser/performance_monitor/*",
|
||||||
|
"//chrome/browser/permissions/*",
|
||||||
|
"//chrome/browser/picture_in_picture/*",
|
||||||
|
"//chrome/browser/plugins/*",
|
||||||
|
|
||||||
|
# "//chrome/browser/policy/*", # 1 error on Windows
|
||||||
|
"//chrome/browser/predictors/*",
|
||||||
|
"//chrome/browser/prefetch/*",
|
||||||
|
"//chrome/browser/prefs/*",
|
||||||
|
"//chrome/browser/prerender/*",
|
||||||
|
"//chrome/browser/previews/*",
|
||||||
|
"//chrome/browser/printing/*",
|
||||||
|
"//chrome/browser/profile_resetter/*",
|
||||||
|
"//chrome/browser/profiles/*",
|
||||||
|
|
||||||
|
#"//chrome/browser/profiling_host/*", # 16 errors
|
||||||
|
"//chrome/browser/push_messaging/*",
|
||||||
|
"//chrome/browser/recovery/*",
|
||||||
|
"//chrome/browser/renderer_context_menu/*",
|
||||||
|
"//chrome/browser/renderer_host/*",
|
||||||
|
"//chrome/browser/resource_coordinator/*",
|
||||||
|
|
||||||
|
#"//chrome/browser/resources/*", # 18 errors on ChromeOS
|
||||||
|
"//chrome/browser/rlz/*",
|
||||||
|
|
||||||
|
#"//chrome/browser/safe_browsing/*", # 239 errors
|
||||||
|
"//chrome/browser/search/*",
|
||||||
|
"//chrome/browser/search_engines/*",
|
||||||
|
"//chrome/browser/search_provider_logos/*",
|
||||||
|
"//chrome/browser/service_process/*",
|
||||||
|
"//chrome/browser/sessions/*",
|
||||||
|
"//chrome/browser/signin/*",
|
||||||
|
"//chrome/browser/speech/*",
|
||||||
|
"//chrome/browser/spellchecker/*",
|
||||||
|
"//chrome/browser/ssl/*",
|
||||||
|
"//chrome/browser/status_icons/*",
|
||||||
|
"//chrome/browser/storage/*",
|
||||||
|
"//chrome/browser/subresource_filter/*",
|
||||||
|
"//chrome/browser/supervised_user/*",
|
||||||
|
"//chrome/browser/sync/*",
|
||||||
|
"//chrome/browser/sync_file_system/*",
|
||||||
|
"//chrome/browser/tab_contents/*",
|
||||||
|
"//chrome/browser/task_manager/*",
|
||||||
|
"//chrome/browser/themes/*",
|
||||||
|
"//chrome/browser/tracing/*",
|
||||||
|
"//chrome/browser/translate/*",
|
||||||
|
"//chrome/browser/ui/*",
|
||||||
|
"//chrome/browser/undo/*",
|
||||||
|
"//chrome/browser/unified_consent/*",
|
||||||
|
"//chrome/browser/update_client/*",
|
||||||
|
"//chrome/browser/upgrade_detector/*",
|
||||||
|
"//chrome/browser/usb/*",
|
||||||
|
"//chrome/browser/vr/*",
|
||||||
|
"//chrome/browser/web_applications/*",
|
||||||
|
"//chrome/browser/webauthn/*",
|
||||||
|
"//chrome/browser/webshare/*",
|
||||||
|
"//chrome/browser/win/*",
|
||||||
|
|
||||||
|
"//chrome/build/*",
|
||||||
|
|
||||||
|
#"//chrome/child/*", # 1 error on Windows
|
||||||
|
"//chrome/chrome_elf/*",
|
||||||
|
"//chrome/chrome_cleaner/*",
|
||||||
|
|
||||||
|
#"//chrome/chrome_watcher/*", # 3 errors on Windows
|
||||||
|
"//chrome/common/*",
|
||||||
|
|
||||||
|
#"//chrome/elevation_service/*", # 1 error on Windows
|
||||||
|
#"//chrome/gpu/*", # 7 errors
|
||||||
|
"//chrome/installer/*",
|
||||||
|
|
||||||
|
#"//chrome/install_static/*", # 8 errors on Windows
|
||||||
|
"//chrome/nacl/*",
|
||||||
|
|
||||||
|
#"//chrome/notification_helper/*", # 4 errors on Windows
|
||||||
|
#"//chrome/renderer/*", # ~30 errors
|
||||||
|
#"//chrome/service/*", # 2 errors
|
||||||
|
#"//chrome/services/*", # ~30 errors
|
||||||
|
#"//chrome/test/*", # ~1900 errors
|
||||||
|
"//chrome/test/chromedriver",
|
||||||
|
"//chrome/third_party/*",
|
||||||
|
"//chrome/tools/*",
|
||||||
|
"//chrome/utility/*",
|
||||||
|
|
||||||
|
"//chromecast/*",
|
||||||
|
"//chromeos/*",
|
||||||
|
"//cloud_print/*",
|
||||||
|
"//components/*",
|
||||||
|
"//content/*",
|
||||||
|
"//courgette/*",
|
||||||
|
"//crypto/*",
|
||||||
|
"//data/*",
|
||||||
|
"//dbus/*",
|
||||||
|
"//device/*",
|
||||||
|
|
||||||
|
#"//extensions/*", # Lots of errors.
|
||||||
|
"//extensions:extensions_resources",
|
||||||
|
"//extensions:extensions_browsertests",
|
||||||
|
"//extensions:extensions_unittests",
|
||||||
|
"//extensions/browser",
|
||||||
|
"//extensions/browser:browser_tests",
|
||||||
|
"//extensions/browser:unit_tests",
|
||||||
|
"//extensions/browser/api:api_registration",
|
||||||
|
"//extensions/browser/install:*",
|
||||||
|
"//extensions/browser/kiosk/*",
|
||||||
|
"//extensions/browser/guest_view/web_view/web_ui/*",
|
||||||
|
"//extensions/common/*",
|
||||||
|
"//extensions/components/javascript_dialog_extensions_client",
|
||||||
|
"//extensions/components/native_app_window",
|
||||||
|
"//extensions/renderer:unit_tests",
|
||||||
|
"//extensions/shell/*",
|
||||||
|
"//extensions/strings/*",
|
||||||
|
"//fuchsia/*",
|
||||||
|
"//gin/*",
|
||||||
|
"//google_apis/*",
|
||||||
|
"//google_update/*",
|
||||||
|
"//gpu/*",
|
||||||
|
|
||||||
|
"//ios/*",
|
||||||
|
"//ios_internal/*",
|
||||||
|
"//ipc/*",
|
||||||
|
|
||||||
|
#"//jingle/*",
|
||||||
|
|
||||||
|
"//libassistant/communication/*",
|
||||||
|
"//libinteraction/*",
|
||||||
|
|
||||||
|
"//media/*",
|
||||||
|
"//mojo/*",
|
||||||
|
|
||||||
|
#"//native_client/*",
|
||||||
|
"//net/*",
|
||||||
|
|
||||||
|
#"//pdf/*", # Medium-hard.
|
||||||
|
#"//ppapi/*", # Lots of errors.
|
||||||
|
"//ppapi/examples/*",
|
||||||
|
"//ppapi/tests/*",
|
||||||
|
"//printing/*",
|
||||||
|
|
||||||
|
#"//remoting/*", # Medium-hard.
|
||||||
|
"//rlz/*",
|
||||||
|
|
||||||
|
#"//sandbox/*", # Medium-hard.
|
||||||
|
"//services/*",
|
||||||
|
"//skia/*",
|
||||||
|
"//sql/*",
|
||||||
|
"//storage/*",
|
||||||
|
"//testing/*",
|
||||||
|
|
||||||
|
#"//third_party/*", # May not ever want this.
|
||||||
|
"//third_party:freetype_harfbuzz",
|
||||||
|
"//third_party/Python-Markdown/*",
|
||||||
|
|
||||||
|
# "//third_party/SPIRV-Tools/*", # 30ish errors
|
||||||
|
"//third_party/abseil-cpp/*",
|
||||||
|
"//third_party/accessibility-audit/*",
|
||||||
|
"//third_party/accessibility_test_framework/*",
|
||||||
|
"//third_party/adobe/*",
|
||||||
|
"//third_party/afl/*",
|
||||||
|
"//third_party/android_build_tools/*",
|
||||||
|
"//third_party/android_crazy_linker/*",
|
||||||
|
"//third_party/android_data_chart/*",
|
||||||
|
"//third_party/android_deps/*",
|
||||||
|
"//third_party/android_media/*",
|
||||||
|
"//third_party/android_ndk/*",
|
||||||
|
"//third_party/android_opengl/*",
|
||||||
|
"//third_party/android_platform/*",
|
||||||
|
"//third_party/android_protobuf/*",
|
||||||
|
"//third_party/android_sdk/*",
|
||||||
|
"//third_party/android_support_test_runner/*",
|
||||||
|
"//third_party/android_swipe_refresh/*",
|
||||||
|
"//third_party/android_system_sdk/*",
|
||||||
|
"//third_party/android_testrunner/*",
|
||||||
|
"//third_party/android_tools/*",
|
||||||
|
|
||||||
|
# "//third_party/angle/*", # 30ish errors
|
||||||
|
"//third_party/apache-portable-runtime/*",
|
||||||
|
"//third_party/apache_velocity/*",
|
||||||
|
"//third_party/apache-win32/*",
|
||||||
|
"//third_party/apk-patch-size-estimator/*",
|
||||||
|
"//third_party/apple_apsl/*",
|
||||||
|
"//third_party/appurify-python/*",
|
||||||
|
"//third_party/arcore-android-sdk/*",
|
||||||
|
"//third_party/ashmem/*",
|
||||||
|
"//third_party/auto/*",
|
||||||
|
"//third_party/axe-core/*",
|
||||||
|
"//third_party/bazel/*",
|
||||||
|
"//third_party/binutils/*",
|
||||||
|
"//third_party/blanketjs/*",
|
||||||
|
|
||||||
|
# "//third_party/blink/*", # Errors: https://crbug.com/800764
|
||||||
|
"//third_party/blink/public/*",
|
||||||
|
|
||||||
|
#"//third_party/breakpad/*", # Small errors.
|
||||||
|
"//third_party/boringssl/*",
|
||||||
|
"//third_party/bouncycastle/*",
|
||||||
|
"//third_party/brotli/*",
|
||||||
|
"//third_party/bspatch/*",
|
||||||
|
"//third_party/byte_buddy/*",
|
||||||
|
"//third_party/cacheinvalidation/*",
|
||||||
|
"//third_party/catapult/*",
|
||||||
|
"//third_party/cct_dynamic_module/*",
|
||||||
|
|
||||||
|
# "//third_party/ced/*", # 6 errors
|
||||||
|
"//third_party/chaijs/*",
|
||||||
|
"//third_party/checkstyle/*",
|
||||||
|
"//third_party/chromevox/*",
|
||||||
|
"//third_party/chromite/*",
|
||||||
|
"//third_party/cld_2/*",
|
||||||
|
"//third_party/cld_3/*",
|
||||||
|
"//third_party/closure_compiler/*",
|
||||||
|
"//third_party/colorama/*",
|
||||||
|
|
||||||
|
# "//third_party/crashpad/*", 20ish errors
|
||||||
|
"//third_party/crc32c/*",
|
||||||
|
"//third_party/cros_system_api/*",
|
||||||
|
"//third_party/custom_tabs_client/*",
|
||||||
|
"//third_party/cython/*",
|
||||||
|
"//third_party/d3/*",
|
||||||
|
"//third_party/dawn/*",
|
||||||
|
"//third_party/decklink/*",
|
||||||
|
"//third_party/depot_tools/*",
|
||||||
|
"//third_party/deqp/*",
|
||||||
|
"//third_party/devscripts/*",
|
||||||
|
"//third_party/devtools-node-modules/*",
|
||||||
|
"//third_party/dom_distiller_js/*",
|
||||||
|
"//third_party/elfutils/*",
|
||||||
|
"//third_party/errorprone/*",
|
||||||
|
"//third_party/espresso/*",
|
||||||
|
"//third_party/expat/*",
|
||||||
|
"//third_party/eyesfree/*",
|
||||||
|
"//third_party/feed/*",
|
||||||
|
|
||||||
|
# "//third_party/ffmpeg/*", # android_cronet only https://crbug.com/898793
|
||||||
|
"//third_party/flac/*",
|
||||||
|
"//third_party/flatbuffers/*",
|
||||||
|
"//third_party/flot/*",
|
||||||
|
"//third_party/fontconfig/*",
|
||||||
|
"//third_party/freetype/*",
|
||||||
|
"//third_party/freetype2/*",
|
||||||
|
"//third_party/freetype-android/*",
|
||||||
|
"//third_party/fuchsia-sdk/*",
|
||||||
|
"//third_party/gestures/*",
|
||||||
|
"//third_party/gif_player/*",
|
||||||
|
"//third_party/glfw/*",
|
||||||
|
"//third_party/glslang/*",
|
||||||
|
"//third_party/google_appengine_cloudstorage/*",
|
||||||
|
"//third_party/google_input_tools/*",
|
||||||
|
"//third_party/googletest/*",
|
||||||
|
"//third_party/google_toolbox_for_mac/*",
|
||||||
|
"//third_party/google-truth/*",
|
||||||
|
"//third_party/gradle_wrapper/*",
|
||||||
|
"//third_party/gson/*",
|
||||||
|
"//third_party/guava/*",
|
||||||
|
"//third_party/gvr-android-keyboard/*",
|
||||||
|
"//third_party/gvr-android-sdk/*",
|
||||||
|
"//third_party/hamcrest/*",
|
||||||
|
"//third_party/harfbuzz-ng/*",
|
||||||
|
"//third_party/hunspell/*",
|
||||||
|
"//third_party/hunspell/*",
|
||||||
|
"//third_party/hunspell_dictionaries/*",
|
||||||
|
"//third_party/iaccessible2/*",
|
||||||
|
"//third_party/iccjpeg/*",
|
||||||
|
|
||||||
|
# "//third_party/icu/*", # Many errors
|
||||||
|
"//third_party/icu4j/*",
|
||||||
|
"//third_party/ijar/*",
|
||||||
|
"//third_party/ink/*",
|
||||||
|
"//third_party/inspector_protocol/*",
|
||||||
|
"//third_party/instrumented_libraries/*",
|
||||||
|
"//third_party/intellij/*",
|
||||||
|
"//third_party/isimpledom/*",
|
||||||
|
"//third_party/javax_inject/*",
|
||||||
|
"//third_party/jinja2/*",
|
||||||
|
"//third_party/jsoncpp/*",
|
||||||
|
"//third_party/jsr-305/*",
|
||||||
|
"//third_party/jstemplate/*",
|
||||||
|
"//third_party/junit/*",
|
||||||
|
"//third_party/khronos/*",
|
||||||
|
"//third_party/lcov/*",
|
||||||
|
"//third_party/leakcanary/*",
|
||||||
|
"//third_party/leveldatabase/*",
|
||||||
|
"//third_party/libFuzzer/*",
|
||||||
|
"//third_party/libXNVCtrl/*",
|
||||||
|
"//third_party/libaddressinput/*",
|
||||||
|
|
||||||
|
# "//third_party/libaom/*", # https://crbug.com/899771
|
||||||
|
"//third_party/libc++/*",
|
||||||
|
"//third_party/libc++abi/*",
|
||||||
|
"//third_party/libcxx-pretty-printers/*",
|
||||||
|
"//third_party/libdrm/*",
|
||||||
|
"//third_party/libevdev/*",
|
||||||
|
"//third_party/libexif/*",
|
||||||
|
"//third_party/libjingle/*",
|
||||||
|
|
||||||
|
# "//third_party/libjingle_xmpp/*", # 30ish errors
|
||||||
|
"//third_party/libjpeg/*",
|
||||||
|
|
||||||
|
# "//third_party/libjpeg_turbo/*", # 3 errors
|
||||||
|
# "//third_party/liblouis/*", # Small errors
|
||||||
|
"//third_party/libovr/*",
|
||||||
|
"//third_party/libphonenumber/*",
|
||||||
|
"//third_party/libpng/*",
|
||||||
|
"//third_party/libprotobuf-mutator/*",
|
||||||
|
"//third_party/libsecret/*",
|
||||||
|
"//third_party/libsrtp/*",
|
||||||
|
"//third_party/libsync/*",
|
||||||
|
"//third_party/libudev/*",
|
||||||
|
"//third_party/libusb/*",
|
||||||
|
|
||||||
|
# "//third_party/libvpx/*", # Many errors
|
||||||
|
"//third_party/libvpx_new/*",
|
||||||
|
"//third_party/libwebm/*",
|
||||||
|
|
||||||
|
#"//third_party/libwebp/*", # Errors: https://crbug.com/800762
|
||||||
|
"//third_party/libxml/*",
|
||||||
|
"//third_party/libxslt/*",
|
||||||
|
"//third_party/libyuv/*",
|
||||||
|
"//third_party/llvm/*",
|
||||||
|
"//third_party/llvm-bootstrap/*",
|
||||||
|
"//third_party/llvm-bootstrap-install/*",
|
||||||
|
"//third_party/llvm-build-tools/*",
|
||||||
|
"//third_party/logilab/*",
|
||||||
|
"//third_party/lss/*",
|
||||||
|
"//third_party/lzma_sdk/*",
|
||||||
|
"//third_party/mach_override/*",
|
||||||
|
"//third_party/markdown/*",
|
||||||
|
"//third_party/markupsafe/*",
|
||||||
|
"//third_party/material_design_icons/*",
|
||||||
|
"//third_party/mesa_headers/*",
|
||||||
|
"//third_party/metrics_proto/*",
|
||||||
|
"//third_party/minigbm/*",
|
||||||
|
"//third_party/minizip/*",
|
||||||
|
"//third_party/mocha/*",
|
||||||
|
"//third_party/mockito/*",
|
||||||
|
"//third_party/modp_b64/*",
|
||||||
|
"//third_party/motemplate/*",
|
||||||
|
"//third_party/mozilla/*",
|
||||||
|
"//third_party/mtpd/*",
|
||||||
|
"//third_party/netty4/*",
|
||||||
|
"//third_party/netty-tcnative/*",
|
||||||
|
"//third_party/node/*",
|
||||||
|
"//third_party/nvml/*",
|
||||||
|
"//third_party/objenesis/*",
|
||||||
|
"//third_party/ocmock/*",
|
||||||
|
"//third_party/openh264/*",
|
||||||
|
"//third_party/openvr/*",
|
||||||
|
"//third_party/opus/*",
|
||||||
|
"//third_party/ots/*",
|
||||||
|
"//third_party/ow2_asm/*",
|
||||||
|
|
||||||
|
# "//third_party/pdfium/*", # 3 errors
|
||||||
|
"//third_party/perfetto/*",
|
||||||
|
"//third_party/pexpect/*",
|
||||||
|
"//third_party/ply/*",
|
||||||
|
"//third_party/polymer/*",
|
||||||
|
"//third_party/proguard/*",
|
||||||
|
"//third_party/protobuf/*",
|
||||||
|
"//third_party/pycoverage/*",
|
||||||
|
"//third_party/pyelftools/*",
|
||||||
|
"//third_party/pyjson5/*",
|
||||||
|
"//third_party/pylint/*",
|
||||||
|
"//third_party/pymock/*",
|
||||||
|
"//third_party/pystache/*",
|
||||||
|
"//third_party/py_trace_event/*",
|
||||||
|
"//third_party/pywebsocket/*",
|
||||||
|
"//third_party/qcms/*",
|
||||||
|
"//third_party/quic_trace/*",
|
||||||
|
"//third_party/qunit/*",
|
||||||
|
"//third_party/r8/*",
|
||||||
|
"//third_party/re2/*",
|
||||||
|
"//third_party/requests/*",
|
||||||
|
"//third_party/retrolambda/*",
|
||||||
|
"//third_party/rnnoise/*",
|
||||||
|
"//third_party/robolectric/*",
|
||||||
|
"//third_party/s2cellid/*",
|
||||||
|
"//third_party/safe_browsing/*",
|
||||||
|
"//third_party/scan-build/*",
|
||||||
|
|
||||||
|
# "//third_party/sfntly/*", # 20ish errors
|
||||||
|
"//third_party/shaderc/*",
|
||||||
|
"//third_party/simplejson/*",
|
||||||
|
"//third_party/sinonjs/*",
|
||||||
|
"//third_party/skia/*",
|
||||||
|
"//third_party/smhasher/*",
|
||||||
|
"//third_party/snappy/*",
|
||||||
|
"//third_party/speech-dispatcher/*",
|
||||||
|
"//third_party/spirv-cross/*",
|
||||||
|
"//third_party/spirv-headers/*",
|
||||||
|
"//third_party/sqlite/*",
|
||||||
|
"//third_party/sqlite4java/*",
|
||||||
|
"//third_party/stp/*",
|
||||||
|
"//third_party/sudden_motion_sensor/*",
|
||||||
|
|
||||||
|
# "//third_party/swiftshader/*", # 1 error
|
||||||
|
"//third_party/swig/*",
|
||||||
|
"//third_party/tcmalloc/*",
|
||||||
|
"//third_party/test_fonts/*",
|
||||||
|
"//third_party/tlslite/*",
|
||||||
|
"//third_party/ub-uiautomator/*",
|
||||||
|
"//third_party/unrar/*",
|
||||||
|
"//third_party/usb_ids/*",
|
||||||
|
"//third_party/usrsctp/*",
|
||||||
|
"//third_party/v4l-utils/*",
|
||||||
|
"//third_party/valgrind/*",
|
||||||
|
"//third_party/vulkan/*",
|
||||||
|
"//third_party/vulkan-validation-layers/*",
|
||||||
|
|
||||||
|
# "//third_party/wayland/*", # Small errors
|
||||||
|
"//third_party/wayland-protocols/*",
|
||||||
|
"//third_party/wds/*",
|
||||||
|
"//third_party/web-animations-js/*",
|
||||||
|
"//third_party/webdriver/*",
|
||||||
|
"//third_party/webgl/*",
|
||||||
|
"//third_party/webpagereplay/*",
|
||||||
|
"//third_party/webrtc/*",
|
||||||
|
"//third_party/webrtc_overrides/*",
|
||||||
|
"//third_party/widevine/*",
|
||||||
|
"//third_party/win_build_output/*",
|
||||||
|
"//third_party/woff2/*",
|
||||||
|
"//third_party/wtl/*",
|
||||||
|
"//third_party/xdg-utils/*",
|
||||||
|
"//third_party/xstream/*",
|
||||||
|
"//third_party/yasm/*",
|
||||||
|
"//third_party/zlib/*",
|
||||||
|
"//third_party/woff2/*",
|
||||||
|
|
||||||
|
"//tools/*",
|
||||||
|
"//ui/*",
|
||||||
|
"//url/*",
|
||||||
|
|
||||||
|
#"//v8/*", # Errors: https://bugs.chromium.org/p/v8/issues/detail?id=7330
|
||||||
|
]
|
||||||
|
|
||||||
|
# These are the list of GN files that run exec_script. This whitelist exists
|
||||||
|
# to force additional review for new uses of exec_script, which is strongly
|
||||||
|
# discouraged.
|
||||||
|
#
|
||||||
|
# PLEASE READ
|
||||||
|
#
|
||||||
|
# You should almost never need to add new exec_script calls. exec_script is
|
||||||
|
# slow, especially on Windows, and can cause confusing effects. Although
|
||||||
|
# individually each call isn't slow or necessarily very confusing, at the scale
|
||||||
|
# of our repo things get out of hand quickly. By strongly pushing back on all
|
||||||
|
# additions, we keep the build fast and clean. If you think you need to add a
|
||||||
|
# new call, please consider:
|
||||||
|
#
|
||||||
|
# - Do not use a script to check for the existence of a file or directory to
|
||||||
|
# enable a different mode. Instead, use GN build args to enable or disable
|
||||||
|
# functionality and set options. An example is checking for a file in the
|
||||||
|
# src-internal repo to see if the corresponding src-internal feature should
|
||||||
|
# be enabled. There are several things that can go wrong with this:
|
||||||
|
#
|
||||||
|
# - It's mysterious what causes some things to happen. Although in many cases
|
||||||
|
# such behavior can be conveniently automatic, GN optimizes for explicit
|
||||||
|
# and obvious behavior so people can more easily diagnose problems.
|
||||||
|
#
|
||||||
|
# - The user can't enable a mode for one build and not another. With GN build
|
||||||
|
# args, the user can choose the exact configuration of multiple builds
|
||||||
|
# using one checkout. But implicitly basing flags on the state of the
|
||||||
|
# checkout, this functionality is broken.
|
||||||
|
#
|
||||||
|
# - It's easy to get stale files. If for example the user edits the gclient
|
||||||
|
# to stop checking out src-internal (or any other optional thing), it's
|
||||||
|
# easy to end up with stale files still mysteriously triggering build
|
||||||
|
# conditions that are no longer appropriate (yes, this happens in real
|
||||||
|
# life).
|
||||||
|
#
|
||||||
|
# - Do not use a script to iterate files in a directory (glob):
|
||||||
|
#
|
||||||
|
# - This has the same "stale file" problem as the above discussion. Various
|
||||||
|
# operations can leave untracked files in the source tree which can cause
|
||||||
|
# surprising effects.
|
||||||
|
#
|
||||||
|
# - It becomes impossible to use "git grep" to find where a certain file is
|
||||||
|
# referenced. This operation is very common and people really do get
|
||||||
|
# confused when things aren't listed.
|
||||||
|
#
|
||||||
|
# - It's easy to screw up. One common case is a build-time script that packs
|
||||||
|
# up a directory. The author notices that the script isn't re-run when the
|
||||||
|
# directory is updated, so adds a glob so all the files are listed as
|
||||||
|
# inputs. This seems to work great... until a file is deleted. When a
|
||||||
|
# file is deleted, all the inputs the glob lists will still be up to date
|
||||||
|
# and no command-lines will have been changed. The action will not be
|
||||||
|
# re-run and the build will be broken. It is possible to get this correct
|
||||||
|
# using glob, and it's possible to mess it up without glob, but globs make
|
||||||
|
# this situation much easier to create. if the build always lists the
|
||||||
|
# files and passes them to a script, it will always be correct.
|
||||||
|
|
||||||
|
exec_script_whitelist =
|
||||||
|
build_dotfile_settings.exec_script_whitelist +
|
||||||
|
angle_dotfile_settings.exec_script_whitelist +
|
||||||
|
[
|
||||||
|
# Whitelist entries for //build should go into
|
||||||
|
# //build/dotfile_settings.gni instead, so that they can be shared
|
||||||
|
# with other repos. The entries in this list should be only for files
|
||||||
|
# in the Chromium repo outside of //build.
|
||||||
|
"//build_overrides/build.gni",
|
||||||
|
|
||||||
|
# TODO(dgn): Layer violation but breaks the build otherwise, see
|
||||||
|
# https://crbug.com/474506.
|
||||||
|
"//clank/java/BUILD.gn",
|
||||||
|
"//clank/native/BUILD.gn",
|
||||||
|
|
||||||
|
"//google_apis/BUILD.gn",
|
||||||
|
"//printing/BUILD.gn",
|
||||||
|
|
||||||
|
"//remoting/host/installer/linux/BUILD.gn",
|
||||||
|
"//remoting/remoting_version.gni",
|
||||||
|
"//remoting/host/installer/win/generate_clsids.gni",
|
||||||
|
|
||||||
|
"//tools/grit/grit_rule.gni",
|
||||||
|
]
|
1074
src/AUTHORS
Normal file
1074
src/AUTHORS
Normal file
File diff suppressed because it is too large
Load Diff
1289
src/BUILD.gn
Normal file
1289
src/BUILD.gn
Normal file
File diff suppressed because it is too large
Load Diff
27
src/LICENSE
Normal file
27
src/LICENSE
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright 2015 The Chromium Authors. All rights reserved.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are
|
||||||
|
// met:
|
||||||
|
//
|
||||||
|
// * Redistributions of source code must retain the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer.
|
||||||
|
// * Redistributions in binary form must reproduce the above
|
||||||
|
// copyright notice, this list of conditions and the following disclaimer
|
||||||
|
// in the documentation and/or other materials provided with the
|
||||||
|
// distribution.
|
||||||
|
// * Neither the name of Google Inc. nor the names of its
|
||||||
|
// contributors may be used to endorse or promote products derived from
|
||||||
|
// this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1155
src/android_webview/BUILD.gn
Normal file
1155
src/android_webview/BUILD.gn
Normal file
File diff suppressed because it is too large
Load Diff
37
src/android_webview/apk/BUILD.gn
Normal file
37
src/android_webview/apk/BUILD.gn
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
# Monochrome uses a different copy of LicenseContentProvider.java.
|
||||||
|
# This one is used in Trichrome and SystemWebview.
|
||||||
|
android_library("webview_license_provider_java") {
|
||||||
|
java_files =
|
||||||
|
[ "java/src/com/android/webview/chromium/LicenseContentProvider.java" ]
|
||||||
|
deps = [
|
||||||
|
":apk_java",
|
||||||
|
"//base:base_java",
|
||||||
|
"//components/about_ui/android:aboutui_java",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# TODO(agrieve): Delete once downstream reference is updated.
|
||||||
|
java_group("webview_license_activity_java") {
|
||||||
|
deps = [
|
||||||
|
":apk_java",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Contains classes needed by the webview apk, but not used when loading the apk
|
||||||
|
# as a library.
|
||||||
|
android_library("apk_java") {
|
||||||
|
java_files = [
|
||||||
|
"java/src/com/android/webview/chromium/LicenseActivity.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewApkApplication.java",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"//base:base_java",
|
||||||
|
"//components/embedder_support/android:application_java",
|
||||||
|
]
|
||||||
|
}
|
68
src/android_webview/browser/gfx/BUILD.gn
Normal file
68
src/android_webview/browser/gfx/BUILD.gn
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# Copyright 2019 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//build/config/android/config.gni")
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
source_set("gfx") {
|
||||||
|
sources = [
|
||||||
|
"aw_draw_fn_impl.cc",
|
||||||
|
"aw_draw_fn_impl.h",
|
||||||
|
"aw_gl_functor.cc",
|
||||||
|
"aw_gl_functor.h",
|
||||||
|
"aw_gl_surface.cc",
|
||||||
|
"aw_gl_surface.h",
|
||||||
|
"aw_picture.cc",
|
||||||
|
"aw_picture.h",
|
||||||
|
"aw_render_thread_context_provider.cc",
|
||||||
|
"aw_render_thread_context_provider.h",
|
||||||
|
"aw_vulkan_context_provider.cc",
|
||||||
|
"aw_vulkan_context_provider.h",
|
||||||
|
"browser_view_renderer.cc",
|
||||||
|
"browser_view_renderer.h",
|
||||||
|
"browser_view_renderer_client.h",
|
||||||
|
"child_frame.cc",
|
||||||
|
"child_frame.h",
|
||||||
|
"compositor_frame_consumer.h",
|
||||||
|
"compositor_frame_producer.h",
|
||||||
|
"compositor_id.cc",
|
||||||
|
"compositor_id.h",
|
||||||
|
"deferred_gpu_command_service.cc",
|
||||||
|
"deferred_gpu_command_service.h",
|
||||||
|
"hardware_renderer.cc",
|
||||||
|
"hardware_renderer.h",
|
||||||
|
"java_browser_view_renderer_helper.cc",
|
||||||
|
"java_browser_view_renderer_helper.h",
|
||||||
|
"parent_compositor_draw_constraints.cc",
|
||||||
|
"parent_compositor_draw_constraints.h",
|
||||||
|
"parent_output_surface.cc",
|
||||||
|
"parent_output_surface.h",
|
||||||
|
"render_thread_manager.cc",
|
||||||
|
"render_thread_manager.h",
|
||||||
|
"scoped_app_gl_state_restore.cc",
|
||||||
|
"scoped_app_gl_state_restore.h",
|
||||||
|
"surfaces_instance.cc",
|
||||||
|
"surfaces_instance.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//android_webview:native_jni",
|
||||||
|
"//base",
|
||||||
|
"//content/public/browser",
|
||||||
|
"//gpu/command_buffer/client:gles2_implementation",
|
||||||
|
"//gpu/command_buffer/service",
|
||||||
|
"//gpu/ipc:gl_in_process_context",
|
||||||
|
"//gpu/ipc/common:common",
|
||||||
|
"//gpu/skia_bindings",
|
||||||
|
"//gpu/vulkan:vulkan",
|
||||||
|
"//gpu/vulkan/init",
|
||||||
|
"//services/viz/public/interfaces",
|
||||||
|
"//skia",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/gl",
|
||||||
|
"//ui/gl/init",
|
||||||
|
]
|
||||||
|
|
||||||
|
libs = [ "jnigraphics" ]
|
||||||
|
}
|
71
src/android_webview/glue/BUILD.gn
Normal file
71
src/android_webview/glue/BUILD.gn
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//android_webview/system_webview_apk_tmpl.gni")
|
||||||
|
import("//android_webview/variables.gni")
|
||||||
|
import("//build/config/android/config.gni")
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
import("generate_resource_rewriter.gni")
|
||||||
|
import("glue.gni")
|
||||||
|
|
||||||
|
generate_resource_rewriter("glue_resource_rewriter") {
|
||||||
|
# Change deps? please modify glue_library_deps variable.
|
||||||
|
deps = glue_library_deps
|
||||||
|
package_name = "com.android.webview.chromium"
|
||||||
|
}
|
||||||
|
|
||||||
|
android_library("glue") {
|
||||||
|
# Change deps? please modify glue_library_deps variable.
|
||||||
|
deps = glue_library_deps
|
||||||
|
srcjar_deps = [ ":glue_resource_rewriter" ]
|
||||||
|
|
||||||
|
alternative_android_sdk_dep =
|
||||||
|
"//third_party/android_sdk:public_framework_system_java"
|
||||||
|
|
||||||
|
java_files = [
|
||||||
|
"java/src/com/android/webview/chromium/CallbackConverter.java",
|
||||||
|
"java/src/com/android/webview/chromium/ContentSettingsAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/CookieManagerAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/DrawFunctor.java",
|
||||||
|
"java/src/com/android/webview/chromium/DrawGLFunctor.java",
|
||||||
|
"java/src/com/android/webview/chromium/GeolocationPermissionsAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/GlueApiHelperForM.java",
|
||||||
|
"java/src/com/android/webview/chromium/GlueApiHelperForN.java",
|
||||||
|
"java/src/com/android/webview/chromium/GlueApiHelperForO.java",
|
||||||
|
"java/src/com/android/webview/chromium/GlueApiHelperForOMR1.java",
|
||||||
|
"java/src/com/android/webview/chromium/GlueApiHelperForP.java",
|
||||||
|
"java/src/com/android/webview/chromium/GraphicsUtils.java",
|
||||||
|
"java/src/com/android/webview/chromium/MonochromeLibraryPreloader.java",
|
||||||
|
"java/src/com/android/webview/chromium/SafeBrowsingResponseAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/ServiceWorkerClientAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/ServiceWorkerControllerAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/ServiceWorkerSettingsAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/SharedStatics.java",
|
||||||
|
"java/src/com/android/webview/chromium/SharedTracingControllerAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/SplitApkWorkaround.java",
|
||||||
|
"java/src/com/android/webview/chromium/TracingControllerAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebBackForwardListChromium.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebHistoryItemChromium.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebIconDatabaseAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebMessagePortAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebResourceErrorAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebResourceRequestAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebStorageAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebkitToSharedGlueConverter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewChromiumAwInit.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewChromium.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewChromiumFactoryProviderForO.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewChromiumFactoryProviderForOMR1.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewChromiumFactoryProviderForP.java",
|
||||||
|
"java/src/com/android/webview/chromium/SharedWebViewChromium.java",
|
||||||
|
"java/src/com/android/webview/chromium/SharedWebViewContentsClientAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/SharedWebViewRendererClientAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewDatabaseAdapter.java",
|
||||||
|
"java/src/com/android/webview/chromium/WebViewDelegateFactory.java",
|
||||||
|
]
|
||||||
|
|
||||||
|
android_manifest_for_lint = system_webview_android_manifest
|
||||||
|
}
|
55
src/android_webview/glue/generate_resource_rewriter.gni
Normal file
55
src/android_webview/glue/generate_resource_rewriter.gni
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
# Generate ResourceRewriter.java from Android Libraries according the dep
|
||||||
|
# graph.
|
||||||
|
# Argument:
|
||||||
|
# deps
|
||||||
|
# The same deps of target that uses the generated ResourceRewriter.
|
||||||
|
# package_name
|
||||||
|
# The package name of ResourceRewriter.java.
|
||||||
|
#
|
||||||
|
# This target generates a single srcjar containing generated
|
||||||
|
# ResourceRewrite.java which will list the R classes generated by all the
|
||||||
|
# Android libraries reachabled from the target specified in deps. Add this
|
||||||
|
# target to srcjar_deps of android_library will call ResourceRewriter.
|
||||||
|
#
|
||||||
|
template("generate_resource_rewriter") {
|
||||||
|
set_sources_assignment_filter([])
|
||||||
|
assert(defined(invoker.package_name))
|
||||||
|
|
||||||
|
_final_target_name = target_name
|
||||||
|
_build_config = "$target_gen_dir/${target_name}.build_config"
|
||||||
|
_build_config_target_name = "$target_name$build_config_target_suffix"
|
||||||
|
_srcjar = "$target_gen_dir/${target_name}.srcjar"
|
||||||
|
write_build_config(_build_config_target_name) {
|
||||||
|
possible_config_deps = invoker.deps
|
||||||
|
type = "resource_rewriter"
|
||||||
|
build_config = _build_config
|
||||||
|
}
|
||||||
|
|
||||||
|
action(_final_target_name) {
|
||||||
|
forward_variables_from(invoker, [ "visibility" ])
|
||||||
|
inputs = [
|
||||||
|
_build_config,
|
||||||
|
]
|
||||||
|
deps = invoker.deps + [ ":${_build_config_target_name}" ]
|
||||||
|
script = "//build/android/gyp/generate_resource_rewriter.py"
|
||||||
|
|
||||||
|
_rebased_build_config = rebase_path(_build_config, root_build_dir)
|
||||||
|
args = [
|
||||||
|
"--package-name",
|
||||||
|
invoker.package_name,
|
||||||
|
"--dep-packages",
|
||||||
|
"@FileArg($_rebased_build_config:resources:extra_package_names)",
|
||||||
|
"--srcjar",
|
||||||
|
rebase_path(_srcjar, root_build_dir),
|
||||||
|
]
|
||||||
|
outputs = [
|
||||||
|
_srcjar,
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
20
src/android_webview/glue/glue.gni
Normal file
20
src/android_webview/glue/glue.gni
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# This variable shared between 'glue' and 'glue_resource_rewriter' because
|
||||||
|
# ResourceRewrite.java need to be generated according 'glue' deps.
|
||||||
|
glue_library_deps = [
|
||||||
|
"//android_webview:android_webview_java",
|
||||||
|
"//android_webview:android_webview_commandline_java",
|
||||||
|
"//android_webview:android_webview_platform_services_java",
|
||||||
|
"//android_webview:system_webview_manifest",
|
||||||
|
"//android_webview/support_library/boundary_interfaces:boundary_interface_java",
|
||||||
|
"//android_webview/support_library/callback:callback_java",
|
||||||
|
"//base:base_java",
|
||||||
|
"//components/autofill/android:autofill_java",
|
||||||
|
"//components/autofill/android:provider_java",
|
||||||
|
"//content/public/android:content_java",
|
||||||
|
"//net/android:net_java",
|
||||||
|
"//ui/android:ui_java",
|
||||||
|
]
|
10
src/android_webview/proto/BUILD.gn
Normal file
10
src/android_webview/proto/BUILD.gn
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Copyright 2018 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
proto_java_library("aw_variations_seed_proto_java") {
|
||||||
|
proto_path = "."
|
||||||
|
sources = [ "aw_variations_seed.proto" ]
|
||||||
|
}
|
37
src/android_webview/support_library/BUILD.gn
Normal file
37
src/android_webview/support_library/BUILD.gn
Normal file
@ -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.
|
||||||
|
|
||||||
|
import("//build/config/android/config.gni")
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
android_library("support_lib_glue_java") {
|
||||||
|
java_files = [
|
||||||
|
"java/src/org/chromium/support_lib_glue/IsomorphicAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibProxyControllerAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibReflectionUtil.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibServiceWorkerClientAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibServiceWorkerControllerAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibServiceWorkerSettingsAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibTracingControllerAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebMessageCallbackAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebMessagePortAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebResourceRequest.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebSettingsAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebViewChromium.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebViewChromiumFactory.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebViewRendererAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebViewRendererClientAdapter.java",
|
||||||
|
"java/src/org/chromium/support_lib_glue/SupportLibWebkitToCompatConverterAdapter.java",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//android_webview:android_webview_commandline_java",
|
||||||
|
"//android_webview:android_webview_java",
|
||||||
|
"//android_webview/glue:glue",
|
||||||
|
"//android_webview/support_library/boundary_interfaces:boundary_interface_java",
|
||||||
|
"//android_webview/support_library/callback:callback_java",
|
||||||
|
"//base:base_java",
|
||||||
|
"//content/public/android:content_java",
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/android/config.gni")
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
android_library("boundary_interface_java") {
|
||||||
|
java_files = [
|
||||||
|
"src/org/chromium/support_lib_boundary/FeatureFlagHolderBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/IsomorphicObjectBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/ProxyControllerBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/SafeBrowsingResponseBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/ServiceWorkerClientBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/ServiceWorkerControllerBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/ServiceWorkerWebSettingsBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/StaticsBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/TracingControllerBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/VisualStateCallbackBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebkitToCompatConverterBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebMessageBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebMessageCallbackBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebMessagePortBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebResourceErrorBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebResourceRequestBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebSettingsBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebViewClientBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebViewProviderBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebViewProviderFactoryBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebViewRendererBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/WebViewRendererClientBoundaryInterface.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/util/BoundaryInterfaceReflectionUtil.java",
|
||||||
|
"src/org/chromium/support_lib_boundary/util/Features.java",
|
||||||
|
]
|
||||||
|
|
||||||
|
proguard_configs = [ "proguard.flags" ]
|
||||||
|
|
||||||
|
# We can't use ANY deps here, the support library should be able to build
|
||||||
|
# these interfaces without any other chromium dependencies.
|
||||||
|
deps = []
|
||||||
|
|
||||||
|
# This is to verify the boundary interfaces compile and lint correctly against
|
||||||
|
# the minSdkVersion of the webkit support library module.
|
||||||
|
android_manifest_for_lint = "AndroidManifest.xml"
|
||||||
|
}
|
21
src/android_webview/support_library/callback/BUILD.gn
Normal file
21
src/android_webview/support_library/callback/BUILD.gn
Normal file
@ -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("//build/config/android/config.gni")
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
android_library("callback_java") {
|
||||||
|
java_files = [
|
||||||
|
"java/src/org/chromium/support_lib_callback_glue/SupportLibSafeBrowsingResponse.java",
|
||||||
|
"java/src/org/chromium/support_lib_callback_glue/SupportLibWebResourceError.java",
|
||||||
|
"java/src/org/chromium/support_lib_callback_glue/SupportLibWebViewContentsClientAdapter.java",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//android_webview:android_webview_commandline_java",
|
||||||
|
"//android_webview:android_webview_java",
|
||||||
|
"//android_webview/support_library/boundary_interfaces:boundary_interface_java",
|
||||||
|
"//base:base_java",
|
||||||
|
]
|
||||||
|
}
|
147
src/android_webview/system_webview_apk_tmpl.gni
Normal file
147
src/android_webview/system_webview_apk_tmpl.gni
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//base/android/proguard/proguard.gni")
|
||||||
|
import("//build/config/android/config.gni")
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
import("//build/config/locales.gni")
|
||||||
|
import("//build/util/version.gni")
|
||||||
|
import("//chrome/android/trichrome.gni")
|
||||||
|
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
|
||||||
|
|
||||||
|
declare_args() {
|
||||||
|
# Android package name to use when compiling the system_webview_apk and
|
||||||
|
# trichrome_webview_apk targets. This should be used if the Android build
|
||||||
|
# on which you are going to install WebView is configured to load a
|
||||||
|
# different package name than the default used in AOSP.
|
||||||
|
system_webview_package_name = "com.android.webview"
|
||||||
|
}
|
||||||
|
|
||||||
|
template("system_webview_apk_tmpl") {
|
||||||
|
android_apk(target_name) {
|
||||||
|
forward_variables_from(invoker, "*")
|
||||||
|
|
||||||
|
deps += [
|
||||||
|
"//android_webview:locale_pak_assets",
|
||||||
|
"//android_webview:pak_file_assets",
|
||||||
|
"//android_webview/apk:apk_java",
|
||||||
|
"//android_webview/apk:webview_license_provider_java",
|
||||||
|
"//android_webview/glue",
|
||||||
|
"//android_webview/support_library:support_lib_glue_java",
|
||||||
|
"//base:base_java",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (!defined(alternative_android_sdk_dep)) {
|
||||||
|
alternative_android_sdk_dep = webview_framework_dep
|
||||||
|
}
|
||||||
|
|
||||||
|
_use_trichrome_library =
|
||||||
|
defined(use_trichrome_library) && use_trichrome_library
|
||||||
|
|
||||||
|
if (!_use_trichrome_library || !trichrome_shared_assets) {
|
||||||
|
deps += [ "//android_webview:monochrome_webview_assets" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_use_trichrome_library) {
|
||||||
|
shared_libraries = [ "//android_webview:libwebviewchromium" ]
|
||||||
|
deps += [
|
||||||
|
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
|
||||||
|
]
|
||||||
|
loadable_modules = [ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
|
||||||
|
|
||||||
|
if (build_apk_secondary_abi && android_64bit_target_cpu) {
|
||||||
|
secondary_abi_shared_libraries = [ "//android_webview:libwebviewchromium($android_secondary_abi_toolchain)" ]
|
||||||
|
_trampoline = "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline($android_secondary_abi_toolchain)"
|
||||||
|
deps += [ _trampoline ]
|
||||||
|
_secondary_out_dir = get_label_info(_trampoline, "root_out_dir")
|
||||||
|
secondary_abi_loadable_modules =
|
||||||
|
[ "$_secondary_out_dir/libcrashpad_handler_trampoline.so" ]
|
||||||
|
}
|
||||||
|
shared_resources = true
|
||||||
|
} else {
|
||||||
|
uncompress_shared_libraries = true
|
||||||
|
|
||||||
|
app_as_shared_lib = true
|
||||||
|
|
||||||
|
# Include placeholder libraries to ensure we are treated as the desired
|
||||||
|
# architecture.
|
||||||
|
if (android_64bit_target_cpu) {
|
||||||
|
shared_libraries = [ "//android_webview:monochrome" ]
|
||||||
|
deps += [
|
||||||
|
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
|
||||||
|
]
|
||||||
|
loadable_modules = [ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
|
||||||
|
|
||||||
|
if (build_apk_secondary_abi) {
|
||||||
|
secondary_native_lib_placeholders = [ "libdummy.so" ]
|
||||||
|
if (use_v8_context_snapshot) {
|
||||||
|
deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
|
||||||
|
} else {
|
||||||
|
deps += [ "//v8:v8_external_startup_data_assets" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
native_lib_placeholders = [ "libdummy.so" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!_use_trichrome_library || android_64bit_target_cpu) {
|
||||||
|
# 32-bit TrichromeWebView doesn't have a native library, so only do this
|
||||||
|
# for other configs.
|
||||||
|
native_lib_version_rule = "//build/util:chrome_version_json"
|
||||||
|
_native_lib_file =
|
||||||
|
rebase_path("$root_gen_dir/CHROME_VERSION.json", root_out_dir)
|
||||||
|
native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)"
|
||||||
|
}
|
||||||
|
|
||||||
|
aapt_locale_whitelist = locales
|
||||||
|
|
||||||
|
resource_blacklist_regex = "[/-]xxxhdpi[/-]"
|
||||||
|
|
||||||
|
# Exception rationale in https://crbug.com/691733.
|
||||||
|
resource_blacklist_exceptions = [
|
||||||
|
"*shadow*", # Combination of gradient & transparency cause pixelation.
|
||||||
|
"*.9.*", # Most nine-patches contain shadows.
|
||||||
|
]
|
||||||
|
|
||||||
|
# Used as an additional apk in test scripts.
|
||||||
|
never_incremental = true
|
||||||
|
|
||||||
|
if (!is_java_debug) {
|
||||||
|
proguard_enabled = true
|
||||||
|
if (!defined(proguard_configs)) {
|
||||||
|
proguard_configs = []
|
||||||
|
}
|
||||||
|
proguard_configs += [
|
||||||
|
"//android_webview/apk/java/proguard.flags",
|
||||||
|
"//base/android/proguard/chromium_apk.flags",
|
||||||
|
"//base/android/proguard/chromium_code.flags",
|
||||||
|
]
|
||||||
|
if (enable_proguard_obfuscation) {
|
||||||
|
proguard_configs +=
|
||||||
|
[ "//base/android/proguard/enable_obfuscation.flags" ]
|
||||||
|
} else {
|
||||||
|
proguard_configs +=
|
||||||
|
[ "//base/android/proguard/disable_all_obfuscation.flags" ]
|
||||||
|
}
|
||||||
|
png_to_webp = true
|
||||||
|
}
|
||||||
|
command_line_flags_file = "webview-command-line"
|
||||||
|
|
||||||
|
if (!defined(version_code)) {
|
||||||
|
if (_use_trichrome_library) {
|
||||||
|
version_code = trichrome_version_code
|
||||||
|
} else if (android_channel == "dev") {
|
||||||
|
version_code = webview_dev_version_code
|
||||||
|
} else if (android_channel == "beta") {
|
||||||
|
version_code = webview_beta_version_code
|
||||||
|
} else {
|
||||||
|
version_code = webview_stable_version_code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!defined(version_name)) {
|
||||||
|
version_name = chrome_version_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
383
src/android_webview/test/BUILD.gn
Normal file
383
src/android_webview/test/BUILD.gn
Normal file
@ -0,0 +1,383 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
import("//device/vr/buildflags/buildflags.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
|
||||||
|
|
||||||
|
# Mark all targets as test only.
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
group("test") {
|
||||||
|
deps = [
|
||||||
|
":android_webview_unittests",
|
||||||
|
":webview_instrumentation_test_apk",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (public_android_sdk) {
|
||||||
|
group("webview_cts_tests") {
|
||||||
|
_py_files =
|
||||||
|
read_file("//android_webview/tools/run_cts.pydeps", "list lines")
|
||||||
|
deps = [
|
||||||
|
"//android_webview:system_webview_apk",
|
||||||
|
]
|
||||||
|
|
||||||
|
data_deps = [
|
||||||
|
"//build/android:logdog_wrapper_py",
|
||||||
|
"//build/android:test_runner_py",
|
||||||
|
"//testing/buildbot/filters:webview_cts_tests_filters",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Filter out comments.
|
||||||
|
set_sources_assignment_filter([ "#*" ])
|
||||||
|
sources = _py_files
|
||||||
|
|
||||||
|
data = sources
|
||||||
|
data += [ "//android_webview/tools/cts_config/" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
android_apk("webview_instrumentation_apk") {
|
||||||
|
deps = [
|
||||||
|
":android_webview_apk_assets",
|
||||||
|
":android_webview_apk_resources",
|
||||||
|
"//android_webview:android_webview_java",
|
||||||
|
"//android_webview:locale_pak_assets",
|
||||||
|
"//android_webview:platform_service_bridge_upstream_implementation_java",
|
||||||
|
"//base:base_java",
|
||||||
|
"//base:base_java_test_support",
|
||||||
|
"//components/heap_profiling:heap_profiling_java_test_support",
|
||||||
|
"//components/policy/android:policy_java_test_support",
|
||||||
|
"//content/public/android:content_java",
|
||||||
|
"//third_party/android_support_test_runner:runner_java",
|
||||||
|
"//third_party/junit",
|
||||||
|
"//ui/android:ui_java",
|
||||||
|
]
|
||||||
|
|
||||||
|
apk_name = "WebViewInstrumentation"
|
||||||
|
android_manifest = "shell/AndroidManifest.xml"
|
||||||
|
java_files = [
|
||||||
|
"shell/src/org/chromium/android_webview/shell/AwShellActivity.java",
|
||||||
|
"shell/src/org/chromium/android_webview/shell/AwShellApplication.java",
|
||||||
|
"shell/src/org/chromium/android_webview/shell/AwShellResourceProvider.java",
|
||||||
|
"shell/src/org/chromium/android_webview/shell/AwShellSwitches.java",
|
||||||
|
"shell/src/org/chromium/android_webview/shell/DrawFn.java",
|
||||||
|
"shell/src/org/chromium/android_webview/test/AwTestContainerView.java",
|
||||||
|
"shell/src/org/chromium/android_webview/test/AwTestRunnerActivity.java",
|
||||||
|
"shell/src/org/chromium/android_webview/test/AwJUnit4ClassRunner.java",
|
||||||
|
"shell/src/org/chromium/android_webview/test/NullContentsClient.java",
|
||||||
|
"shell/src/org/chromium/android_webview/test/SecondBrowserProcess.java",
|
||||||
|
"shell/src/org/chromium/android_webview/test/OnlyRunIn.java",
|
||||||
|
"shell/src/org/chromium/android_webview/test/TestContentProvider.java",
|
||||||
|
]
|
||||||
|
|
||||||
|
shared_libraries = [ ":libstandalonelibwebviewchromium" ]
|
||||||
|
|
||||||
|
native_lib_version_rule = "//build/util:chrome_version_json"
|
||||||
|
_native_lib_file =
|
||||||
|
rebase_path("$root_gen_dir/CHROME_VERSION.json", root_build_dir)
|
||||||
|
native_lib_version_arg = "@FileArg($_native_lib_file:full-quoted)"
|
||||||
|
|
||||||
|
command_line_flags_file = "android-webview-command-line"
|
||||||
|
}
|
||||||
|
|
||||||
|
android_resources("android_webview_apk_resources") {
|
||||||
|
resource_dirs = [ "shell/res" ]
|
||||||
|
custom_package = "org.chromium.android_webview.shell"
|
||||||
|
}
|
||||||
|
|
||||||
|
android_assets("android_webview_apk_assets") {
|
||||||
|
deps = [
|
||||||
|
"//android_webview:pak_file_assets",
|
||||||
|
"//third_party/icu:icu_assets",
|
||||||
|
]
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"shell/assets/asset_file.html",
|
||||||
|
"shell/assets/asset_icon.png",
|
||||||
|
"shell/assets/autofill.html",
|
||||||
|
"shell/assets/cookie_test.html",
|
||||||
|
"shell/assets/full_screen_video.js",
|
||||||
|
"shell/assets/full_screen_video_inside_div_test.html",
|
||||||
|
"shell/assets/full_screen_video_test.html",
|
||||||
|
"shell/assets/full_screen_video_test_not_preloaded.html",
|
||||||
|
"shell/assets/key-system-test.html",
|
||||||
|
"shell/assets/platform-media-codec-test.html",
|
||||||
|
"shell/assets/star.svg",
|
||||||
|
"shell/assets/star.svgz",
|
||||||
|
"shell/assets/video.3gp",
|
||||||
|
"shell/assets/video.webm",
|
||||||
|
"shell/assets/visual_state_during_fullscreen_test.html",
|
||||||
|
"shell/assets/visual_state_on_page_commit_visible_test.html",
|
||||||
|
"shell/assets/visual_state_waits_for_js_detached_test.html",
|
||||||
|
"shell/assets/visual_state_waits_for_js_test.html",
|
||||||
|
"shell/assets/webvr_not_functional_test.html",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (use_v8_context_snapshot) {
|
||||||
|
deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
|
||||||
|
} else {
|
||||||
|
deps += [ "//v8:v8_external_startup_data_assets" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
shared_library("libstandalonelibwebviewchromium") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"../lib/webview_entry_point.cc",
|
||||||
|
"shell/src/draw_gl/draw_fn.cc",
|
||||||
|
]
|
||||||
|
ldflags = [ "-Wl,-shared,-Bsymbolic" ]
|
||||||
|
deps = [
|
||||||
|
"//android_webview:common",
|
||||||
|
"//base",
|
||||||
|
"//components/heap_profiling:test_support",
|
||||||
|
"//components/minidump_uploader",
|
||||||
|
"//content/public/test/android:content_native_test_support",
|
||||||
|
]
|
||||||
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
||||||
|
configs += [ "//build/config/android:hide_all_but_jni" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
instrumentation_test_apk("webview_instrumentation_test_apk") {
|
||||||
|
apk_name = "WebViewInstrumentationTest"
|
||||||
|
apk_under_test = ":webview_instrumentation_apk"
|
||||||
|
android_manifest = "../javatests/AndroidManifest.xml"
|
||||||
|
deps = [
|
||||||
|
"//android_webview:android_webview_java",
|
||||||
|
"//android_webview:android_webview_platform_services_java",
|
||||||
|
"//android_webview:android_webview_services_java",
|
||||||
|
"//android_webview:aw_variations_seed_server_aidl",
|
||||||
|
"//android_webview/test/embedded_test_server:aw_net_java_test_support",
|
||||||
|
"//base:base_java",
|
||||||
|
"//base:base_java_test_support",
|
||||||
|
"//components/autofill/android:provider_java",
|
||||||
|
"//components/embedder_support/android:web_contents_delegate_java",
|
||||||
|
"//components/minidump_uploader:minidump_uploader_java",
|
||||||
|
"//components/minidump_uploader:minidump_uploader_javatests",
|
||||||
|
"//components/policy/android:policy_java",
|
||||||
|
"//components/policy/android:policy_java_test_support",
|
||||||
|
"//components/safe_browsing/android:safe_browsing_java",
|
||||||
|
"//content/public/android:content_java",
|
||||||
|
"//content/public/test/android:content_java_test_support",
|
||||||
|
"//mojo/public/java:bindings_java",
|
||||||
|
"//net/android:net_java",
|
||||||
|
"//net/android:net_java_test_support",
|
||||||
|
"//net/android:net_javatests",
|
||||||
|
"//services/device/public/java:geolocation_java",
|
||||||
|
"//services/device/public/java:geolocation_java_test_support",
|
||||||
|
"//third_party/android_support_test_runner:rules_java",
|
||||||
|
"//third_party/android_support_test_runner:runner_java",
|
||||||
|
"//third_party/junit",
|
||||||
|
"//ui/android:ui_java",
|
||||||
|
]
|
||||||
|
java_files = [
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AcceptLanguageTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AndroidProtocolHandlerTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AndroidViewIntegrationTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ArchiveTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwActivityTestRule.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwAutocompleteTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwAutofillTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentCaptureTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsAnchorViewTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientAutoLoginTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientCallbackHelperTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientFaviconTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientFullScreenTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientGetDefaultVideoPosterTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientOnFormResubmissionTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientOnRendererUnresponsiveTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientOnRenderProcessGoneTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientOnScaleChangedTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientOnUnhandledKeyEventTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientShouldOverrideUrlLoadingTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsContainerViewTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsGarbageCollectionTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsLifecycleNotifierTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsRenderTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsStaticsTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwContentsTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwDebugTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwFormDatabaseTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwImeTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwJavaBridgeTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwLayoutSizerTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwLegacyQuirksTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwNetworkConfigurationTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwPermissionManagerTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwProxyControllerTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwQuotaManagerBridgeTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwScrollOffsetManagerTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwSecondBrowserProcessTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwServiceWorkerClientTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwSettingsTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwStrictModeTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwVariationsSeedFetcherTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwZoomTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/CleanupReferenceTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ClearHistoryTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ClientAddMessageToConsoleTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ClientOnPageFinishedTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ClientOnPageStartedTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ClientOnReceivedError2Test.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ClientOnReceivedErrorTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ClientOnReceivedHttpErrorTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ConsoleMessagesForBlockedLoadsTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/ContentViewMiscTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/CookieManagerStartupTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/CookieManagerTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/DisableHardwareAccelerationForTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/FindAddressTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/FullScreenVideoTestAwContentsClient.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/GeolocationTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/GetTitleTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/HeapProfilingTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/HttpAuthDatabaseTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/KeySystemTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/LoadDataWithBaseUrlTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/LoadUrlTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/MediaAccessPermissionRequestTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/NavigationHistoryTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/OnDiskFileTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/PlatformMediaCodecTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/PolicyUrlFilteringTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/PopupWindowTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/PostMessageTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/RenderProcessGoneHelper.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/SaveRestoreStateTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/AwUncaughtExceptionTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/SslPreferencesTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/StandaloneAwQuotaManagerBridgeTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/TestAwContents.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/TestAwContentsClient.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/TestAwServiceWorkerClient.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/UserAgentTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/VariationsSeedHolderTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/VariationsSeedLoaderTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/VariationsUtilsTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/VisualStateTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/WebKitHitTestTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/WebViewAsynchronousFindApisTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/WebViewFindApisTestRule.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/WebViewModalDialogOverrideTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/WebViewWebVrTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/services/CrashReceiverServiceTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/services/MinidumpUploaderTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/services/MockVariationsSeedServer.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/services/VariationsSeedServerTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/services/VisualStateCallbackTest.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/AwQuotaManagerBridgeTestUtil.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/AwTestTouchUtils.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/CommonResources.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/CookieUtils.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/GraphicsTestUtils.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/ImagePageGenerator.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/JSUtils.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/JavascriptEventObserver.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/VariationsTestUtils.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/VideoSurfaceViewUtils.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/VideoTestUtil.java",
|
||||||
|
"../javatests/src/org/chromium/android_webview/test/util/VideoTestWebServer.java",
|
||||||
|
]
|
||||||
|
data = [
|
||||||
|
"data/",
|
||||||
|
]
|
||||||
|
data_deps = [
|
||||||
|
"//testing/buildbot/filters:webview_instrumentation_test_apk_filters",
|
||||||
|
]
|
||||||
|
|
||||||
|
# We only want to bother including these on bots set up for VR testing
|
||||||
|
if (include_vr_data) {
|
||||||
|
data += [
|
||||||
|
"//chrome/android/shared_preference_files/test/",
|
||||||
|
"//third_party/gvr-android-sdk/test-apks/vr_services/vr_services_current.apk",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
additional_apks = [
|
||||||
|
"//android_webview/test/embedded_test_server:aw_net_test_support_apk",
|
||||||
|
"//net/android:net_test_support_apk",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
test("android_webview_unittests") {
|
||||||
|
deps = [
|
||||||
|
":android_webview_unittests_assets",
|
||||||
|
":android_webview_unittests_java",
|
||||||
|
":android_webview_unittests_jni",
|
||||||
|
"//android_webview:common",
|
||||||
|
"//base/test:test_support",
|
||||||
|
"//components/prefs:prefs",
|
||||||
|
"//components/prefs:test_support",
|
||||||
|
"//content:content",
|
||||||
|
"//content/test:test_support",
|
||||||
|
"//net:net",
|
||||||
|
"//net:test_support",
|
||||||
|
"//ui/base:ui_base_jni_headers",
|
||||||
|
"//ui/gl",
|
||||||
|
"//ui/gl:test_support",
|
||||||
|
]
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"../browser/aw_content_browser_client_unittest.cc",
|
||||||
|
"../browser/aw_contents_client_bridge_unittest.cc",
|
||||||
|
"../browser/aw_cookie_access_policy_unittest.cc",
|
||||||
|
"../browser/aw_form_database_service_unittest.cc",
|
||||||
|
"../browser/aw_media_url_interceptor_unittest.cc",
|
||||||
|
"../browser/aw_metrics_service_client_unittest.cc",
|
||||||
|
"../browser/aw_permission_manager_unittest.cc",
|
||||||
|
"../browser/gfx/browser_view_renderer_unittest.cc",
|
||||||
|
"../browser/gfx/test/fake_window.cc",
|
||||||
|
"../browser/gfx/test/fake_window.h",
|
||||||
|
"../browser/gfx/test/rendering_test.cc",
|
||||||
|
"../browser/gfx/test/rendering_test.h",
|
||||||
|
"../browser/input_stream_unittest.cc",
|
||||||
|
"../browser/net/android_stream_reader_url_request_job_unittest.cc",
|
||||||
|
"../browser/net/aw_cookie_store_wrapper_unittest.cc",
|
||||||
|
"../browser/net/aw_url_request_context_getter_unittest.cc",
|
||||||
|
"../browser/net/input_stream_reader_unittest.cc",
|
||||||
|
"../browser/network_service/android_stream_reader_url_loader_unittest.cc",
|
||||||
|
"../browser/permission/media_access_permission_request_unittest.cc",
|
||||||
|
"../browser/permission/permission_request_handler_unittest.cc",
|
||||||
|
"../browser/renderer_host/auto_login_parser_unittest.cc",
|
||||||
|
"../browser/safe_browsing/aw_safe_browsing_whitelist_manager_unittest.cc",
|
||||||
|
"../browser/scoped_add_feature_flags_unittests.cc",
|
||||||
|
"../browser/state_serializer_unittest.cc",
|
||||||
|
"../lib/webview_tests.cc",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_assets("android_webview_unittests_assets") {
|
||||||
|
sources = [
|
||||||
|
"unittest/assets/asset_file.ogg",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_library("android_webview_unittests_java") {
|
||||||
|
testonly = true
|
||||||
|
deps = [
|
||||||
|
"//android_webview:android_webview_java",
|
||||||
|
"//base:base_java",
|
||||||
|
"//content/public/test/android:content_java_test_support",
|
||||||
|
]
|
||||||
|
java_files = [
|
||||||
|
"../unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java",
|
||||||
|
"../unittestjava/src/org/chromium/android_webview/unittest/MockAwContentsClientBridge.java",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
generate_jni("android_webview_unittests_jni") {
|
||||||
|
jni_package = "android_webview_unittests"
|
||||||
|
sources = [
|
||||||
|
"../unittestjava/src/org/chromium/android_webview/unittest/InputStreamUnittest.java",
|
||||||
|
"../unittestjava/src/org/chromium/android_webview/unittest/MockAwContentsClientBridge.java",
|
||||||
|
]
|
||||||
|
}
|
76
src/android_webview/test/embedded_test_server/BUILD.gn
Normal file
76
src/android_webview/test/embedded_test_server/BUILD.gn
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/android/config.gni")
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
android_library("aw_net_java_test_support") {
|
||||||
|
testonly = true
|
||||||
|
java_files = [
|
||||||
|
"java/src/org/chromium/android_webview/test/AwEmbeddedTestServer.java",
|
||||||
|
"java/src/org/chromium/android_webview/test/AwEmbeddedTestServerImpl.java",
|
||||||
|
"java/src/org/chromium/android_webview/test/AwEmbeddedTestServerService.java",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"//base:base_java",
|
||||||
|
"//base:base_java_test_support",
|
||||||
|
"//net/android:embedded_test_server_aidl_java",
|
||||||
|
"//net/android:net_java",
|
||||||
|
"//net/android:net_java_test_support",
|
||||||
|
"//net/android:net_java_test_support_provider",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
generate_jni("aw_net_jni_headers") {
|
||||||
|
sources = [
|
||||||
|
"java/src/org/chromium/android_webview/test/AwEmbeddedTestServerImpl.java",
|
||||||
|
]
|
||||||
|
jni_package = "android_webview/test"
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("aw_java_test_native_support") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"../../../net/test/embedded_test_server/android/embedded_test_server_android.cc",
|
||||||
|
"../../../net/test/embedded_test_server/android/embedded_test_server_android.h",
|
||||||
|
"aw_embedded_test_server.cc",
|
||||||
|
"aw_test_entry_point.cc",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"//net:test_support",
|
||||||
|
]
|
||||||
|
public_deps = [
|
||||||
|
":aw_net_jni_headers",
|
||||||
|
"//net:net_test_jni_headers",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
shared_library("aw_net_java_test_native_support") {
|
||||||
|
testonly = true
|
||||||
|
deps = [
|
||||||
|
":aw_java_test_native_support",
|
||||||
|
"//net:test_support",
|
||||||
|
]
|
||||||
|
configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
|
||||||
|
configs += [ "//build/config/android:hide_all_but_jni" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_apk("aw_net_test_support_apk") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
# Used as an additional_apk in test scripts.
|
||||||
|
never_incremental = true
|
||||||
|
|
||||||
|
# Multidex requires a custom Application class to initialize it. Simpler to
|
||||||
|
# just disable it.
|
||||||
|
enable_multidex = false
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":aw_net_java_test_support",
|
||||||
|
"//base:base_java",
|
||||||
|
]
|
||||||
|
android_manifest = "java/AndroidManifest.xml"
|
||||||
|
apk_name = "ChromiumNetTestAwSupport"
|
||||||
|
shared_libraries = [ ":aw_net_java_test_native_support" ]
|
||||||
|
}
|
73
src/android_webview/tools/automated_ui_tests/BUILD.gn
Normal file
73
src/android_webview/tools/automated_ui_tests/BUILD.gn
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
|
||||||
|
group("webview_ui_test_app") {
|
||||||
|
testonly = true
|
||||||
|
deps = [
|
||||||
|
":webview_ui_test_app_apk",
|
||||||
|
":webview_ui_test_app_test_apk",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_apk("webview_ui_test_app_apk") {
|
||||||
|
apk_name = "WebViewUiTestApp"
|
||||||
|
android_manifest = "java/AndroidManifest.xml"
|
||||||
|
deps = [
|
||||||
|
":webview_ui_test_app_apk_resources",
|
||||||
|
":webview_ui_test_app_java",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_library("webview_ui_test_app_java") {
|
||||||
|
java_files =
|
||||||
|
[ "java/src/org/chromium/webview_ui_test/WebViewUiTestActivity.java" ]
|
||||||
|
deps = [
|
||||||
|
":webview_ui_test_app_apk_resources",
|
||||||
|
"//base:base_java",
|
||||||
|
]
|
||||||
|
|
||||||
|
android_manifest_for_lint = "java/AndroidManifest.xml"
|
||||||
|
}
|
||||||
|
|
||||||
|
android_resources("webview_ui_test_app_apk_resources") {
|
||||||
|
resource_dirs = [ "java/res" ]
|
||||||
|
custom_package = "org.chromium.webview_ui_test"
|
||||||
|
}
|
||||||
|
|
||||||
|
instrumentation_test_apk("webview_ui_test_app_test_apk") {
|
||||||
|
apk_name = "WebViewUiTestAppTest"
|
||||||
|
apk_under_test = ":webview_ui_test_app_apk"
|
||||||
|
android_manifest = "javatests/AndroidManifest.xml"
|
||||||
|
java_files = [
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/ActionModeTest.java",
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/DropDownListTest.java",
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/WebViewJSTest.java",
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/util/Actions.java",
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/util/Atoms.java",
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/util/UseLayout.java",
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/util/WebViewUiTestRule.java",
|
||||||
|
"javatests/src/org/chromium/webview_ui_test/test/util/WebViewSyncWrapper.java",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":webview_ui_test_app_apk_resources",
|
||||||
|
":webview_ui_test_app_java",
|
||||||
|
"//base:base_java",
|
||||||
|
"//base:base_java_test_support",
|
||||||
|
"//third_party/android_deps:com_android_support_support_annotations_java",
|
||||||
|
"//third_party/android_sdk:android_test_base_java",
|
||||||
|
"//third_party/android_support_test_runner:rules_java",
|
||||||
|
"//third_party/android_support_test_runner:runner_java",
|
||||||
|
"//third_party/espresso:espresso_all_java",
|
||||||
|
"//third_party/hamcrest:hamcrest_java",
|
||||||
|
"//third_party/junit",
|
||||||
|
"//third_party/ub-uiautomator:ub_uiautomator_java",
|
||||||
|
]
|
||||||
|
data = [
|
||||||
|
"test/data/",
|
||||||
|
]
|
||||||
|
additional_apks = [ system_webview_apk_target ]
|
||||||
|
}
|
94
src/android_webview/tools/system_webview_shell/BUILD.gn
Normal file
94
src/android_webview/tools/system_webview_shell/BUILD.gn
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
|
||||||
|
# Mark all targets as test only.
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
group("system_webview_shell") {
|
||||||
|
deps = [
|
||||||
|
":system_webview_shell_apk",
|
||||||
|
":system_webview_shell_layout_test_apk",
|
||||||
|
":system_webview_shell_page_cycler_apk",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_apk("system_webview_shell_apk") {
|
||||||
|
apk_name = "SystemWebViewShell"
|
||||||
|
java_files = [
|
||||||
|
"apk/src/org/chromium/webview_shell/JankActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/PageCyclerTestActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/StartupTimeActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/TelemetryActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/TelemetryMemoryPressureActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/WebViewAnimationTestActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/WebViewCreateDestroyActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/WebViewLayoutTestActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/WebViewThreadTestActivity.java",
|
||||||
|
"apk/src/org/chromium/webview_shell/WebViewTracingActivity.java",
|
||||||
|
]
|
||||||
|
android_manifest = "apk/AndroidManifest.xml"
|
||||||
|
deps = [
|
||||||
|
":system_webview_shell_apk_resources",
|
||||||
|
"//base:base_java",
|
||||||
|
"//third_party/android_deps:android_support_v7_appcompat_java",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_resources("system_webview_shell_apk_resources") {
|
||||||
|
resource_dirs = [ "apk/res" ]
|
||||||
|
custom_package = "org.chromium.webview_shell"
|
||||||
|
deps = [
|
||||||
|
"//third_party/android_deps:android_support_v7_appcompat_java",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
instrumentation_test_apk("system_webview_shell_page_cycler_apk") {
|
||||||
|
apk_name = "SystemWebViewShellPageCycler"
|
||||||
|
apk_under_test = ":system_webview_shell_apk"
|
||||||
|
android_manifest = "page_cycler/AndroidManifest.xml"
|
||||||
|
java_files = [ "page_cycler/src/org/chromium/webview_shell/page_cycler/PageCyclerTest.java" ]
|
||||||
|
deps = [
|
||||||
|
"//base:base_java",
|
||||||
|
"//base:base_java_test_support",
|
||||||
|
"//content/public/android:content_java",
|
||||||
|
"//content/public/test/android:content_java_test_support",
|
||||||
|
"//testing/android/reporter:reporter_java",
|
||||||
|
"//third_party/android_support_test_runner:rules_java",
|
||||||
|
"//third_party/android_support_test_runner:runner_java",
|
||||||
|
"//third_party/junit",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
instrumentation_test_apk("system_webview_shell_layout_test_apk") {
|
||||||
|
apk_name = "SystemWebViewShellLayoutTest"
|
||||||
|
apk_under_test = ":system_webview_shell_apk"
|
||||||
|
android_manifest = "layout_tests/AndroidManifest.xml"
|
||||||
|
java_files = [
|
||||||
|
"layout_tests/src/org/chromium/webview_shell/test/WebViewLayoutTest.java",
|
||||||
|
"layout_tests/src/org/chromium/webview_shell/test/WebViewThreadTest.java",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"//base:base_java",
|
||||||
|
"//base:base_java_test_support",
|
||||||
|
"//testing/android/reporter:reporter_java",
|
||||||
|
"//third_party/android_support_test_runner:rules_java",
|
||||||
|
"//third_party/android_support_test_runner:runner_java",
|
||||||
|
"//third_party/junit",
|
||||||
|
]
|
||||||
|
data = [
|
||||||
|
"test/data/",
|
||||||
|
"//third_party/blink/web_tests/platform/linux/virtual/stable/webexposed/",
|
||||||
|
"//third_party/blink/web_tests/platform/mac/virtual/stable/webexposed/",
|
||||||
|
"//third_party/blink/web_tests/platform/win/virtual/stable/webexposed/",
|
||||||
|
"//third_party/blink/web_tests/resources/global-interface-listing.js",
|
||||||
|
"//third_party/blink/web_tests/virtual/stable/webexposed/",
|
||||||
|
"//third_party/blink/web_tests/webexposed/global-interface-listing.html",
|
||||||
|
"//third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt",
|
||||||
|
]
|
||||||
|
additional_apks = [ system_webview_apk_target ]
|
||||||
|
}
|
18
src/android_webview/tools/webview_log_verbosifier/BUILD.gn
Normal file
18
src/android_webview/tools/webview_log_verbosifier/BUILD.gn
Normal file
@ -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.
|
||||||
|
|
||||||
|
import("//build/config/android/rules.gni")
|
||||||
|
|
||||||
|
android_apk("webview_log_verbosifier_apk") {
|
||||||
|
apk_name = "WebViewLogVerbosifier"
|
||||||
|
android_manifest = "AndroidManifest.xml"
|
||||||
|
deps = [
|
||||||
|
":webview_log_verbosifier_resources",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
android_resources("webview_log_verbosifier_resources") {
|
||||||
|
resource_dirs = [ "res" ]
|
||||||
|
custom_package = "org.chromium.webview_log_verbosifier"
|
||||||
|
}
|
13
src/android_webview/variables.gni
Normal file
13
src/android_webview/variables.gni
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
system_webview_android_manifest =
|
||||||
|
"$root_gen_dir/android_webview/system_webview_apk/AndroidManifest.xml"
|
||||||
|
trichrome_webview_android_manifest =
|
||||||
|
"$root_gen_dir/android_webview/trichrome_webview_apk/AndroidManifest.xml"
|
||||||
|
|
||||||
|
upstream_only_webview_deps = [
|
||||||
|
"//android_webview:platform_service_bridge_upstream_implementation_java",
|
||||||
|
"//android_webview:system_webview_resources",
|
||||||
|
]
|
35
src/android_webview/webview_repack_locales.gni
Normal file
35
src/android_webview/webview_repack_locales.gni
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//tools/grit/repack.gni")
|
||||||
|
import("webview_repack_locales_list.gni")
|
||||||
|
|
||||||
|
# Wraps repack_locales(), setting the source_patterns and deps required for
|
||||||
|
# Chrome.
|
||||||
|
template("webview_repack_locales") {
|
||||||
|
repack_locales(target_name) {
|
||||||
|
forward_variables_from(invoker, "*")
|
||||||
|
if (!defined(deps)) {
|
||||||
|
deps = []
|
||||||
|
}
|
||||||
|
|
||||||
|
# Adding webview specific pak file? You should add it to
|
||||||
|
# webview_repack_locales_source_patterns, so it is also included in
|
||||||
|
# Monochrome.
|
||||||
|
|
||||||
|
source_patterns = [
|
||||||
|
"${root_gen_dir}/android_webview/components_strings_",
|
||||||
|
"${root_gen_dir}/content/app/strings/content_strings_",
|
||||||
|
"${root_gen_dir}/ui/strings/app_locale_settings_",
|
||||||
|
]
|
||||||
|
deps += [
|
||||||
|
"//android_webview:generate_components_strings",
|
||||||
|
"//content/app/strings",
|
||||||
|
"//ui/strings:app_locale_settings",
|
||||||
|
]
|
||||||
|
source_patterns += webview_repack_locales_source_patterns
|
||||||
|
deps += webview_repack_locales_deps
|
||||||
|
output_dir = "$root_out_dir/android_webview/locales"
|
||||||
|
}
|
||||||
|
}
|
10
src/android_webview/webview_repack_locales_list.gni
Normal file
10
src/android_webview/webview_repack_locales_list.gni
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# For how to add pattern, see additional_source_patterns argument of
|
||||||
|
# _repack_one_locale in chrome/chrome_repack_locales.gni.
|
||||||
|
webview_repack_locales_source_patterns =
|
||||||
|
[ "${root_gen_dir}/android_webview/aw_strings_" ]
|
||||||
|
|
||||||
|
webview_repack_locales_deps = [ "//android_webview:generate_aw_strings" ]
|
64
src/apps/BUILD.gn
Normal file
64
src/apps/BUILD.gn
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# Copyright 2014 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//build/config/features.gni")
|
||||||
|
import("//build/config/ui.gni")
|
||||||
|
import("//extensions/buildflags/buildflags.gni")
|
||||||
|
|
||||||
|
assert(!is_android && !is_ios)
|
||||||
|
assert(enable_extensions,
|
||||||
|
"Cannot depend on extensions because enable_extensions=false.")
|
||||||
|
|
||||||
|
static_library("apps") {
|
||||||
|
sources = []
|
||||||
|
|
||||||
|
sources += [
|
||||||
|
"app_lifetime_monitor.cc",
|
||||||
|
"app_lifetime_monitor.h",
|
||||||
|
"app_lifetime_monitor_factory.cc",
|
||||||
|
"app_lifetime_monitor_factory.h",
|
||||||
|
"app_restore_service.cc",
|
||||||
|
"app_restore_service.h",
|
||||||
|
"app_restore_service_factory.cc",
|
||||||
|
"app_restore_service_factory.h",
|
||||||
|
"browser_context_keyed_service_factories.cc",
|
||||||
|
"browser_context_keyed_service_factories.h",
|
||||||
|
"launcher.cc",
|
||||||
|
"launcher.h",
|
||||||
|
"saved_files_service.cc",
|
||||||
|
"saved_files_service.h",
|
||||||
|
"saved_files_service_factory.cc",
|
||||||
|
"saved_files_service_factory.h",
|
||||||
|
"switches.cc",
|
||||||
|
"switches.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
configs += [ "//build/config/compiler:wexit_time_destructors" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//components/keyed_service/content",
|
||||||
|
"//content/public/browser",
|
||||||
|
"//content/public/common",
|
||||||
|
"//extensions/browser",
|
||||||
|
"//extensions/common",
|
||||||
|
"//extensions/common/api",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (is_chromeos) {
|
||||||
|
deps += [ "//components/user_manager" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static_library("test_support") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"test/app_window_waiter.cc",
|
||||||
|
"test/app_window_waiter.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
public_deps = [
|
||||||
|
"//content/public/browser",
|
||||||
|
"//extensions/browser",
|
||||||
|
]
|
||||||
|
}
|
26
src/apps/ui/views/BUILD.gn
Normal file
26
src/apps/ui/views/BUILD.gn
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/ui.gni")
|
||||||
|
import("//extensions/buildflags/buildflags.gni")
|
||||||
|
|
||||||
|
assert(enable_extensions)
|
||||||
|
|
||||||
|
source_set("views") {
|
||||||
|
sources = [
|
||||||
|
"app_window_frame_view.cc",
|
||||||
|
"app_window_frame_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//cc/paint",
|
||||||
|
"//chrome/app/theme:theme_resources",
|
||||||
|
"//extensions/browser",
|
||||||
|
"//extensions/common",
|
||||||
|
"//skia",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/strings",
|
||||||
|
"//ui/views",
|
||||||
|
]
|
||||||
|
}
|
2250
src/ash/BUILD.gn
Normal file
2250
src/ash/BUILD.gn
Normal file
File diff suppressed because it is too large
Load Diff
249
src/ash/app_list/BUILD.gn
Normal file
249
src/ash/app_list/BUILD.gn
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
# Copyright 2014 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//build/config/ui.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
component("app_list") {
|
||||||
|
sources = [
|
||||||
|
"app_list_export.h",
|
||||||
|
"app_list_metrics.cc",
|
||||||
|
"app_list_metrics.h",
|
||||||
|
"app_list_util.cc",
|
||||||
|
"app_list_util.h",
|
||||||
|
"app_list_view_delegate.h",
|
||||||
|
"paged_view_structure.cc",
|
||||||
|
"paged_view_structure.h",
|
||||||
|
"views/app_list_drag_and_drop_host.h",
|
||||||
|
"views/app_list_folder_view.cc",
|
||||||
|
"views/app_list_folder_view.h",
|
||||||
|
"views/app_list_item_view.cc",
|
||||||
|
"views/app_list_item_view.h",
|
||||||
|
"views/app_list_main_view.cc",
|
||||||
|
"views/app_list_main_view.h",
|
||||||
|
"views/app_list_menu_model_adapter.cc",
|
||||||
|
"views/app_list_menu_model_adapter.h",
|
||||||
|
"views/app_list_page.cc",
|
||||||
|
"views/app_list_page.h",
|
||||||
|
"views/app_list_view.cc",
|
||||||
|
"views/app_list_view.h",
|
||||||
|
"views/apps_container_view.cc",
|
||||||
|
"views/apps_container_view.h",
|
||||||
|
"views/apps_grid_view.cc",
|
||||||
|
"views/apps_grid_view.h",
|
||||||
|
"views/apps_grid_view_folder_delegate.h",
|
||||||
|
"views/assistant/assistant_main_stage.cc",
|
||||||
|
"views/assistant/assistant_main_stage.h",
|
||||||
|
"views/assistant/assistant_main_view.cc",
|
||||||
|
"views/assistant/assistant_main_view.h",
|
||||||
|
"views/assistant/assistant_page_view.cc",
|
||||||
|
"views/assistant/assistant_page_view.h",
|
||||||
|
"views/assistant/dialog_plate.cc",
|
||||||
|
"views/assistant/dialog_plate.h",
|
||||||
|
"views/assistant/privacy_info_view.cc",
|
||||||
|
"views/assistant/privacy_info_view.h",
|
||||||
|
"views/contents_view.cc",
|
||||||
|
"views/contents_view.h",
|
||||||
|
"views/expand_arrow_view.cc",
|
||||||
|
"views/expand_arrow_view.h",
|
||||||
|
"views/folder_background_view.cc",
|
||||||
|
"views/folder_background_view.h",
|
||||||
|
"views/folder_header_view.cc",
|
||||||
|
"views/folder_header_view.h",
|
||||||
|
"views/folder_header_view_delegate.h",
|
||||||
|
"views/ghost_image_view.cc",
|
||||||
|
"views/ghost_image_view.h",
|
||||||
|
"views/horizontal_page.cc",
|
||||||
|
"views/horizontal_page.h",
|
||||||
|
"views/horizontal_page_container.cc",
|
||||||
|
"views/horizontal_page_container.h",
|
||||||
|
"views/page_switcher.cc",
|
||||||
|
"views/page_switcher.h",
|
||||||
|
"views/pulsing_block_view.cc",
|
||||||
|
"views/pulsing_block_view.h",
|
||||||
|
"views/remove_query_confirmation_dialog.cc",
|
||||||
|
"views/remove_query_confirmation_dialog.h",
|
||||||
|
"views/search_box_view.cc",
|
||||||
|
"views/search_box_view.h",
|
||||||
|
"views/search_result_actions_view.cc",
|
||||||
|
"views/search_result_actions_view.h",
|
||||||
|
"views/search_result_actions_view_delegate.h",
|
||||||
|
"views/search_result_answer_card_view.cc",
|
||||||
|
"views/search_result_answer_card_view.h",
|
||||||
|
"views/search_result_base_view.cc",
|
||||||
|
"views/search_result_base_view.h",
|
||||||
|
"views/search_result_container_view.cc",
|
||||||
|
"views/search_result_container_view.h",
|
||||||
|
"views/search_result_list_view.cc",
|
||||||
|
"views/search_result_list_view.h",
|
||||||
|
"views/search_result_page_view.cc",
|
||||||
|
"views/search_result_page_view.h",
|
||||||
|
"views/search_result_suggestion_chip_view.cc",
|
||||||
|
"views/search_result_suggestion_chip_view.h",
|
||||||
|
"views/search_result_tile_item_list_view.cc",
|
||||||
|
"views/search_result_tile_item_list_view.h",
|
||||||
|
"views/search_result_tile_item_view.cc",
|
||||||
|
"views/search_result_tile_item_view.h",
|
||||||
|
"views/search_result_view.cc",
|
||||||
|
"views/search_result_view.h",
|
||||||
|
"views/suggestion_chip_container_view.cc",
|
||||||
|
"views/suggestion_chip_container_view.h",
|
||||||
|
"views/top_icon_animation_view.cc",
|
||||||
|
"views/top_icon_animation_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "APP_LIST_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/app_list/resources",
|
||||||
|
"//ash/app_menu",
|
||||||
|
"//ash/assistant/model",
|
||||||
|
"//ash/assistant/ui",
|
||||||
|
"//ash/assistant/ui:constants",
|
||||||
|
"//ash/assistant/util",
|
||||||
|
"//ash/keyboard/ui",
|
||||||
|
"//ash/public/cpp/app_list/vector_icons",
|
||||||
|
"//ash/public/cpp/vector_icons",
|
||||||
|
"//ash/resources/vector_icons",
|
||||||
|
"//ash/strings",
|
||||||
|
"//base",
|
||||||
|
"//base:i18n",
|
||||||
|
"//base/third_party/dynamic_annotations",
|
||||||
|
"//cc/paint",
|
||||||
|
"//chromeos:chromeos",
|
||||||
|
"//components/keyed_service/core",
|
||||||
|
"//components/sync",
|
||||||
|
"//mojo/public/cpp/bindings",
|
||||||
|
"//services/content/public/cpp",
|
||||||
|
"//skia",
|
||||||
|
"//third_party/icu",
|
||||||
|
"//ui/accessibility",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/base/ime",
|
||||||
|
"//ui/base/ime/chromeos",
|
||||||
|
"//ui/chromeos/search_box",
|
||||||
|
"//ui/compositor",
|
||||||
|
"//ui/display",
|
||||||
|
"//ui/events",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
"//ui/resources",
|
||||||
|
"//ui/strings",
|
||||||
|
"//ui/views",
|
||||||
|
"//ui/wm",
|
||||||
|
"//ui/wm/public",
|
||||||
|
]
|
||||||
|
|
||||||
|
# TODO(hejq): Remove this once app_list is migrated. http://crbug.com/733662
|
||||||
|
public_deps = [
|
||||||
|
"//ash/app_list/model:app_list_model",
|
||||||
|
"//ash/app_list/model:search_model",
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//services/content/public/mojom",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
static_library("test_support") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"test/app_list_test_model.cc",
|
||||||
|
"test/app_list_test_model.h",
|
||||||
|
"test/app_list_test_view_delegate.cc",
|
||||||
|
"test/app_list_test_view_delegate.h",
|
||||||
|
"test/test_search_result.cc",
|
||||||
|
"test/test_search_result.h",
|
||||||
|
"views/test/apps_grid_view_test_api.cc",
|
||||||
|
"views/test/apps_grid_view_test_api.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":app_list",
|
||||||
|
"//base",
|
||||||
|
"//services/content/public/cpp/test:test_support",
|
||||||
|
"//ui/base:base",
|
||||||
|
"//ui/events",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
executable("app_list_demo") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"demo/app_list_demo_views.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":app_list",
|
||||||
|
":test_support",
|
||||||
|
"//base",
|
||||||
|
"//build/win:default_exe_manifest",
|
||||||
|
"//content",
|
||||||
|
"//content/public/browser",
|
||||||
|
"//skia",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/events",
|
||||||
|
"//ui/resources",
|
||||||
|
"//ui/resources:ui_test_pak",
|
||||||
|
"//ui/views",
|
||||||
|
"//ui/views_content_client",
|
||||||
|
"//url",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
test("app_list_unittests") {
|
||||||
|
sources = [
|
||||||
|
"folder_image_unittest.cc",
|
||||||
|
"test/run_all_unittests.cc",
|
||||||
|
"views/app_list_main_view_unittest.cc",
|
||||||
|
"views/app_list_menu_model_adapter_unittest.cc",
|
||||||
|
"views/app_list_view_unittest.cc",
|
||||||
|
"views/apps_grid_view_unittest.cc",
|
||||||
|
"views/folder_header_view_unittest.cc",
|
||||||
|
"views/search_box_view_unittest.cc",
|
||||||
|
"views/search_result_answer_card_view_unittest.cc",
|
||||||
|
"views/search_result_list_view_unittest.cc",
|
||||||
|
"views/search_result_page_view_unittest.cc",
|
||||||
|
"views/search_result_tile_item_list_view_unittest.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":app_list",
|
||||||
|
":test_support",
|
||||||
|
"//ash/keyboard/ui",
|
||||||
|
"//ash/public/cpp/app_list/vector_icons",
|
||||||
|
"//base",
|
||||||
|
"//base/test:test_support",
|
||||||
|
"//chromeos/constants",
|
||||||
|
"//mojo/core/embedder",
|
||||||
|
"//mojo/public/cpp/bindings",
|
||||||
|
"//services/content/public/cpp",
|
||||||
|
"//services/content/public/cpp/test:test_support",
|
||||||
|
"//services/content/public/mojom",
|
||||||
|
"//skia",
|
||||||
|
"//testing/gtest",
|
||||||
|
"//ui/accessibility",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/chromeos/search_box",
|
||||||
|
"//ui/compositor",
|
||||||
|
"//ui/events:test_support",
|
||||||
|
"//ui/gfx:test_support",
|
||||||
|
"//ui/gl:test_support",
|
||||||
|
"//ui/resources",
|
||||||
|
"//ui/views",
|
||||||
|
"//ui/views:test_support",
|
||||||
|
]
|
||||||
|
|
||||||
|
data_deps = [
|
||||||
|
"//third_party/mesa_headers",
|
||||||
|
"//ui/resources:ui_test_pak_data",
|
||||||
|
]
|
||||||
|
}
|
56
src/ash/app_list/model/BUILD.gn
Normal file
56
src/ash/app_list/model/BUILD.gn
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
component("app_list_model") {
|
||||||
|
sources = [
|
||||||
|
"app_list_folder_item.cc",
|
||||||
|
"app_list_folder_item.h",
|
||||||
|
"app_list_item.cc",
|
||||||
|
"app_list_item.h",
|
||||||
|
"app_list_item_list.cc",
|
||||||
|
"app_list_item_list.h",
|
||||||
|
"app_list_item_list_observer.h",
|
||||||
|
"app_list_item_observer.h",
|
||||||
|
"app_list_model.cc",
|
||||||
|
"app_list_model.h",
|
||||||
|
"app_list_model_observer.h",
|
||||||
|
"folder_image.cc",
|
||||||
|
"folder_image.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "APP_LIST_MODEL_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/cpp:cpp",
|
||||||
|
"//base:i18n",
|
||||||
|
"//cc/paint",
|
||||||
|
"//components/sync",
|
||||||
|
"//skia",
|
||||||
|
"//third_party/icu",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/gfx",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
component("search_model") {
|
||||||
|
sources = [
|
||||||
|
"search/search_box_model.cc",
|
||||||
|
"search/search_box_model.h",
|
||||||
|
"search/search_box_model_observer.h",
|
||||||
|
"search/search_model.cc",
|
||||||
|
"search/search_model.h",
|
||||||
|
"search/search_result.cc",
|
||||||
|
"search/search_result.h",
|
||||||
|
"search/search_result_observer.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "APP_LIST_MODEL_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/cpp:cpp",
|
||||||
|
"//base:i18n",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/gfx",
|
||||||
|
]
|
||||||
|
}
|
36
src/ash/app_list/presenter/BUILD.gn
Normal file
36
src/ash/app_list/presenter/BUILD.gn
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/ui.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
|
||||||
|
assert(use_aura)
|
||||||
|
|
||||||
|
component("presenter") {
|
||||||
|
sources = [
|
||||||
|
"app_list_presenter_delegate.cc",
|
||||||
|
"app_list_presenter_delegate.h",
|
||||||
|
"app_list_presenter_export.h",
|
||||||
|
"app_list_presenter_impl.cc",
|
||||||
|
"app_list_presenter_impl.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "APP_LIST_PRESENTER_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
public_deps = [
|
||||||
|
"//ash/app_list",
|
||||||
|
"//base",
|
||||||
|
"//mojo/public/cpp/bindings",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/compositor",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
"//ui/views",
|
||||||
|
"//ui/wm",
|
||||||
|
"//ui/wm/public",
|
||||||
|
|
||||||
|
# Temporary dependency to fix compile flake in http://crbug.com/611898.
|
||||||
|
# TODO(tapted): Remove once http://crbug.com/612382 is fixed.
|
||||||
|
"//ui/accessibility:ax_enums_mojo",
|
||||||
|
]
|
||||||
|
}
|
22
src/ash/app_list/resources/BUILD.gn
Normal file
22
src/ash/app_list/resources/BUILD.gn
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//tools/grit/grit_rule.gni")
|
||||||
|
import("//tools/grit/repack.gni")
|
||||||
|
|
||||||
|
group("resources") {
|
||||||
|
public_deps = [
|
||||||
|
":resources_grd",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
grit("resources_grd") {
|
||||||
|
source = "app_list_resources.grd"
|
||||||
|
outputs = [
|
||||||
|
"grit/app_list_resources.h",
|
||||||
|
"app_list_resources_100_percent.pak",
|
||||||
|
"app_list_resources_200_percent.pak",
|
||||||
|
"app_list_resources_300_percent.pak",
|
||||||
|
]
|
||||||
|
}
|
36
src/ash/app_menu/BUILD.gn
Normal file
36
src/ash/app_menu/BUILD.gn
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# 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("//build/config/ui.gni")
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
component("app_menu") {
|
||||||
|
sources = [
|
||||||
|
"app_menu_model_adapter.cc",
|
||||||
|
"app_menu_model_adapter.h",
|
||||||
|
"notification_item_view.cc",
|
||||||
|
"notification_item_view.h",
|
||||||
|
"notification_menu_controller.cc",
|
||||||
|
"notification_menu_controller.h",
|
||||||
|
"notification_menu_header_view.cc",
|
||||||
|
"notification_menu_header_view.h",
|
||||||
|
"notification_menu_view.cc",
|
||||||
|
"notification_menu_view.h",
|
||||||
|
"notification_overflow_view.cc",
|
||||||
|
"notification_overflow_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "APP_MENU_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//base",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
"//ui/message_center",
|
||||||
|
"//ui/strings:ui_strings_grit",
|
||||||
|
"//ui/views",
|
||||||
|
]
|
||||||
|
}
|
48
src/ash/assistant/model/BUILD.gn
Normal file
48
src/ash/assistant/model/BUILD.gn
Normal file
@ -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.
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
component("model") {
|
||||||
|
output_name = "assistant_model"
|
||||||
|
|
||||||
|
defines = [ "IS_ASSISTANT_MODEL_IMPL" ]
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"assistant_alarm_timer_model.cc",
|
||||||
|
"assistant_alarm_timer_model.h",
|
||||||
|
"assistant_alarm_timer_model_observer.h",
|
||||||
|
"assistant_cache_model.cc",
|
||||||
|
"assistant_cache_model.h",
|
||||||
|
"assistant_cache_model_observer.h",
|
||||||
|
"assistant_interaction_model.cc",
|
||||||
|
"assistant_interaction_model.h",
|
||||||
|
"assistant_interaction_model_observer.h",
|
||||||
|
"assistant_notification_model.cc",
|
||||||
|
"assistant_notification_model.h",
|
||||||
|
"assistant_notification_model_observer.h",
|
||||||
|
"assistant_query.cc",
|
||||||
|
"assistant_query.h",
|
||||||
|
"assistant_query_history.cc",
|
||||||
|
"assistant_query_history.h",
|
||||||
|
"assistant_response.cc",
|
||||||
|
"assistant_response.h",
|
||||||
|
"assistant_screen_context_model.cc",
|
||||||
|
"assistant_screen_context_model.h",
|
||||||
|
"assistant_screen_context_model_observer.h",
|
||||||
|
"assistant_ui_element.cc",
|
||||||
|
"assistant_ui_element.h",
|
||||||
|
"assistant_ui_model.cc",
|
||||||
|
"assistant_ui_model.h",
|
||||||
|
"assistant_ui_model_observer.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/assistant/ui:constants",
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//chromeos/services/assistant/public/mojom",
|
||||||
|
"//services/content/public/cpp",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
]
|
||||||
|
}
|
124
src/ash/assistant/ui/BUILD.gn
Normal file
124
src/ash/assistant/ui/BUILD.gn
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
# 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("//build/config/ui.gni")
|
||||||
|
import("//chromeos/assistant/assistant.gni")
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
component("constants") {
|
||||||
|
output_name = "assistant_ui_constants"
|
||||||
|
|
||||||
|
defines = [ "IS_ASSISTANT_UI_CONSTANTS_IMPL" ]
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"assistant_ui_constants.cc",
|
||||||
|
"assistant_ui_constants.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//base",
|
||||||
|
"//skia",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/gfx",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
component("ui") {
|
||||||
|
output_name = "assistant_ui"
|
||||||
|
|
||||||
|
defines = [ "IS_ASSISTANT_UI_IMPL" ]
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"assistant_container_view.cc",
|
||||||
|
"assistant_container_view.h",
|
||||||
|
"assistant_container_view_animator.cc",
|
||||||
|
"assistant_container_view_animator.h",
|
||||||
|
"assistant_container_view_animator_legacy_impl.cc",
|
||||||
|
"assistant_container_view_animator_legacy_impl.h",
|
||||||
|
"assistant_container_view_focus_traversable.cc",
|
||||||
|
"assistant_container_view_focus_traversable.h",
|
||||||
|
"assistant_main_view.cc",
|
||||||
|
"assistant_main_view.h",
|
||||||
|
"assistant_mini_view.cc",
|
||||||
|
"assistant_mini_view.h",
|
||||||
|
"assistant_notification_overlay.cc",
|
||||||
|
"assistant_notification_overlay.h",
|
||||||
|
"assistant_notification_view.cc",
|
||||||
|
"assistant_notification_view.h",
|
||||||
|
"assistant_overlay.h",
|
||||||
|
"assistant_view_delegate.h",
|
||||||
|
"assistant_web_view.cc",
|
||||||
|
"assistant_web_view.h",
|
||||||
|
"base/assistant_button.cc",
|
||||||
|
"base/assistant_button.h",
|
||||||
|
"base/assistant_scroll_view.cc",
|
||||||
|
"base/assistant_scroll_view.h",
|
||||||
|
"caption_bar.cc",
|
||||||
|
"caption_bar.h",
|
||||||
|
"dialog_plate/dialog_plate.cc",
|
||||||
|
"dialog_plate/dialog_plate.h",
|
||||||
|
"dialog_plate/mic_view.cc",
|
||||||
|
"dialog_plate/mic_view.h",
|
||||||
|
"logo_view/logo_view.cc",
|
||||||
|
"logo_view/logo_view.h",
|
||||||
|
"main_stage/assistant_card_element_view.cc",
|
||||||
|
"main_stage/assistant_card_element_view.h",
|
||||||
|
"main_stage/assistant_footer_view.cc",
|
||||||
|
"main_stage/assistant_footer_view.h",
|
||||||
|
"main_stage/assistant_header_view.cc",
|
||||||
|
"main_stage/assistant_header_view.h",
|
||||||
|
"main_stage/assistant_main_stage.cc",
|
||||||
|
"main_stage/assistant_main_stage.h",
|
||||||
|
"main_stage/assistant_opt_in_view.cc",
|
||||||
|
"main_stage/assistant_opt_in_view.h",
|
||||||
|
"main_stage/assistant_progress_indicator.cc",
|
||||||
|
"main_stage/assistant_progress_indicator.h",
|
||||||
|
"main_stage/assistant_query_view.cc",
|
||||||
|
"main_stage/assistant_query_view.h",
|
||||||
|
"main_stage/assistant_text_element_view.cc",
|
||||||
|
"main_stage/assistant_text_element_view.h",
|
||||||
|
"main_stage/suggestion_chip_view.cc",
|
||||||
|
"main_stage/suggestion_chip_view.h",
|
||||||
|
"main_stage/suggestion_container_view.cc",
|
||||||
|
"main_stage/suggestion_container_view.h",
|
||||||
|
"main_stage/ui_element_container_view.cc",
|
||||||
|
"main_stage/ui_element_container_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/assistant/model",
|
||||||
|
"//ash/assistant/ui:constants",
|
||||||
|
"//ash/assistant/util",
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//ash/public/cpp/vector_icons",
|
||||||
|
"//ash/resources/vector_icons",
|
||||||
|
"//ash/strings",
|
||||||
|
"//base",
|
||||||
|
"//chromeos/assistant:buildflags",
|
||||||
|
"//chromeos/services/assistant/public:feature_flags",
|
||||||
|
"//chromeos/services/assistant/public/mojom",
|
||||||
|
"//services/content/public/cpp",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/compositor",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/views",
|
||||||
|
"//ui/views/window/vector_icons",
|
||||||
|
"//ui/wm",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (enable_cros_libassistant) {
|
||||||
|
sources += [
|
||||||
|
"logo_view/logo_view_impl.cc",
|
||||||
|
"logo_view/logo_view_impl.h",
|
||||||
|
"logo_view/shape/mic_part_shape.cc",
|
||||||
|
"logo_view/shape/mic_part_shape.h",
|
||||||
|
"logo_view/shape/shape.cc",
|
||||||
|
"logo_view/shape/shape.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps += [ "//chromeos/assistant/internal/logo_view" ]
|
||||||
|
}
|
||||||
|
}
|
35
src/ash/assistant/util/BUILD.gn
Normal file
35
src/ash/assistant/util/BUILD.gn
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Copyright 2019 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
component("util") {
|
||||||
|
output_name = "assistant_util"
|
||||||
|
|
||||||
|
defines = [ "IS_ASSISTANT_UTIL_IMPL" ]
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"animation_util.cc",
|
||||||
|
"animation_util.h",
|
||||||
|
"assistant_util.cc",
|
||||||
|
"assistant_util.h",
|
||||||
|
"deep_link_util.cc",
|
||||||
|
"deep_link_util.h",
|
||||||
|
"histogram_util.cc",
|
||||||
|
"histogram_util.h",
|
||||||
|
"i18n_util.cc",
|
||||||
|
"i18n_util.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/assistant/model",
|
||||||
|
"//base",
|
||||||
|
"//base:i18n",
|
||||||
|
"//net",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/views",
|
||||||
|
"//url",
|
||||||
|
]
|
||||||
|
}
|
19
src/ash/autotest/BUILD.gn
Normal file
19
src/ash/autotest/BUILD.gn
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Copyright 2019 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
# Only include files that are needed for JS autotest / integration tests.
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
source_set("autotest") {
|
||||||
|
sources = [
|
||||||
|
"shelf_integration_test_api.cc",
|
||||||
|
"shelf_integration_test_api.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//base",
|
||||||
|
]
|
||||||
|
}
|
23
src/ash/components/cursor/BUILD.gn
Normal file
23
src/ash/components/cursor/BUILD.gn
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# 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("cursor") {
|
||||||
|
sources = [
|
||||||
|
"cursor_view.cc",
|
||||||
|
"cursor_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/components/fast_ink",
|
||||||
|
"//base",
|
||||||
|
"//cc",
|
||||||
|
"//components/viz/common",
|
||||||
|
"//skia",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/events",
|
||||||
|
"//ui/events/ozone:events_ozone",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/views:views",
|
||||||
|
]
|
||||||
|
}
|
42
src/ash/components/fast_ink/BUILD.gn
Normal file
42
src/ash/components/fast_ink/BUILD.gn
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# 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("fast_ink") {
|
||||||
|
sources = [
|
||||||
|
"fast_ink_pointer_controller.cc",
|
||||||
|
"fast_ink_pointer_controller.h",
|
||||||
|
"fast_ink_points.cc",
|
||||||
|
"fast_ink_points.h",
|
||||||
|
"fast_ink_view.cc",
|
||||||
|
"fast_ink_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//base",
|
||||||
|
"//cc",
|
||||||
|
"//components/viz/service",
|
||||||
|
"//gpu",
|
||||||
|
"//gpu/command_buffer/client",
|
||||||
|
"//gpu/command_buffer/common",
|
||||||
|
"//skia",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
"//ui/gl",
|
||||||
|
"//ui/views:views",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("unit_tests") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"fast_ink_points_unittest.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":fast_ink",
|
||||||
|
"//testing/gtest",
|
||||||
|
"//ui/events:test_support",
|
||||||
|
]
|
||||||
|
}
|
16
src/ash/components/resources/BUILD.gn
Normal file
16
src/ash/components/resources/BUILD.gn
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# 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("//tools/grit/grit_rule.gni")
|
||||||
|
|
||||||
|
grit("resources") {
|
||||||
|
source = "ash_components_resources.grd"
|
||||||
|
outputs = [
|
||||||
|
"grit/ash_components_resources.h",
|
||||||
|
"grit/ash_components_resources_map.cc",
|
||||||
|
"grit/ash_components_resources_map.h",
|
||||||
|
"ash_components_resources_100_percent.pak",
|
||||||
|
"ash_components_resources_200_percent.pak",
|
||||||
|
]
|
||||||
|
}
|
59
src/ash/components/shortcut_viewer/BUILD.gn
Normal file
59
src/ash/components/shortcut_viewer/BUILD.gn
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
# KSV: Keyboard Shortcut Viewer
|
||||||
|
source_set("shortcut_viewer") {
|
||||||
|
sources = [
|
||||||
|
"keyboard_shortcut_item.cc",
|
||||||
|
"keyboard_shortcut_item.h",
|
||||||
|
"keyboard_shortcut_viewer_metadata.cc",
|
||||||
|
"keyboard_shortcut_viewer_metadata.h",
|
||||||
|
"ksv_export.h",
|
||||||
|
"views/bubble_view.cc",
|
||||||
|
"views/bubble_view.h",
|
||||||
|
"views/keyboard_shortcut_item_list_view.cc",
|
||||||
|
"views/keyboard_shortcut_item_list_view.h",
|
||||||
|
"views/keyboard_shortcut_item_view.cc",
|
||||||
|
"views/keyboard_shortcut_item_view.h",
|
||||||
|
"views/keyboard_shortcut_view.cc",
|
||||||
|
"views/keyboard_shortcut_view.h",
|
||||||
|
"views/ksv_search_box_view.cc",
|
||||||
|
"views/ksv_search_box_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "KSV_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/components/shortcut_viewer/vector_icons",
|
||||||
|
"//ash/components/strings",
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//ash/public/cpp/resources:ash_public_unscaled_resources",
|
||||||
|
"//cc/paint",
|
||||||
|
"//ui/accessibility",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/chromeos/events",
|
||||||
|
"//ui/chromeos/search_box",
|
||||||
|
"//ui/events:events_base",
|
||||||
|
"//ui/events/devices",
|
||||||
|
"//ui/events/ozone:events_ozone_layout",
|
||||||
|
"//ui/views",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("unit_tests") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"views/keyboard_shortcut_view_unittest.cc",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":shortcut_viewer",
|
||||||
|
"//ash:test_support",
|
||||||
|
"//base/test:test_support",
|
||||||
|
"//services/ws/public/cpp/input_devices:test_support",
|
||||||
|
"//testing/gtest",
|
||||||
|
"//ui/compositor:test_support",
|
||||||
|
"//ui/events:test_support",
|
||||||
|
"//ui/views",
|
||||||
|
]
|
||||||
|
}
|
40
src/ash/components/shortcut_viewer/vector_icons/BUILD.gn
Normal file
40
src/ash/components/shortcut_viewer/vector_icons/BUILD.gn
Normal file
@ -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.
|
||||||
|
|
||||||
|
import("//components/vector_icons/vector_icons.gni")
|
||||||
|
|
||||||
|
aggregate_vector_icons("ksv_vector_icons") {
|
||||||
|
icon_directory = "."
|
||||||
|
|
||||||
|
icons = [
|
||||||
|
"ksv_search_back.icon",
|
||||||
|
"ksv_search_bar.icon",
|
||||||
|
"ksv_search_close.icon",
|
||||||
|
"ksv_search_no_result.icon",
|
||||||
|
"ksv_separator_plus.icon",
|
||||||
|
"ksv_arrow_down.icon",
|
||||||
|
"ksv_arrow_left.icon",
|
||||||
|
"ksv_arrow_right.icon",
|
||||||
|
"ksv_arrow_up.icon",
|
||||||
|
"ksv_brightness_down.icon",
|
||||||
|
"ksv_brightness_up.icon",
|
||||||
|
"ksv_browser_back.icon",
|
||||||
|
"ksv_browser_forward.icon",
|
||||||
|
"ksv_fullscreen.icon",
|
||||||
|
"ksv_mute.icon",
|
||||||
|
"ksv_overview.icon",
|
||||||
|
"ksv_reload.icon",
|
||||||
|
"ksv_volume_down.icon",
|
||||||
|
"ksv_volume_up.icon",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("vector_icons") {
|
||||||
|
sources = get_target_outputs(":ksv_vector_icons")
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":ksv_vector_icons",
|
||||||
|
"//skia",
|
||||||
|
]
|
||||||
|
}
|
66
src/ash/components/strings/BUILD.gn
Normal file
66
src/ash/components/strings/BUILD.gn
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
# 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("//tools/grit/grit_rule.gni")
|
||||||
|
|
||||||
|
grit("strings") {
|
||||||
|
source = "../ash_components_strings.grd"
|
||||||
|
outputs = [
|
||||||
|
"grit/ash_components_strings.h",
|
||||||
|
"ash_components_strings_am.pak",
|
||||||
|
"ash_components_strings_ar.pak",
|
||||||
|
"ash_components_strings_bg.pak",
|
||||||
|
"ash_components_strings_bn.pak",
|
||||||
|
"ash_components_strings_ca.pak",
|
||||||
|
"ash_components_strings_cs.pak",
|
||||||
|
"ash_components_strings_da.pak",
|
||||||
|
"ash_components_strings_de.pak",
|
||||||
|
"ash_components_strings_el.pak",
|
||||||
|
"ash_components_strings_en-GB.pak",
|
||||||
|
"ash_components_strings_en-US.pak",
|
||||||
|
"ash_components_strings_es-419.pak",
|
||||||
|
"ash_components_strings_es.pak",
|
||||||
|
"ash_components_strings_et.pak",
|
||||||
|
"ash_components_strings_fake-bidi.pak",
|
||||||
|
"ash_components_strings_fa.pak",
|
||||||
|
"ash_components_strings_fil.pak",
|
||||||
|
"ash_components_strings_fi.pak",
|
||||||
|
"ash_components_strings_fr.pak",
|
||||||
|
"ash_components_strings_gu.pak",
|
||||||
|
"ash_components_strings_he.pak",
|
||||||
|
"ash_components_strings_hi.pak",
|
||||||
|
"ash_components_strings_hr.pak",
|
||||||
|
"ash_components_strings_hu.pak",
|
||||||
|
"ash_components_strings_id.pak",
|
||||||
|
"ash_components_strings_it.pak",
|
||||||
|
"ash_components_strings_ja.pak",
|
||||||
|
"ash_components_strings_kn.pak",
|
||||||
|
"ash_components_strings_ko.pak",
|
||||||
|
"ash_components_strings_lt.pak",
|
||||||
|
"ash_components_strings_lv.pak",
|
||||||
|
"ash_components_strings_ml.pak",
|
||||||
|
"ash_components_strings_mr.pak",
|
||||||
|
"ash_components_strings_ms.pak",
|
||||||
|
"ash_components_strings_nb.pak",
|
||||||
|
"ash_components_strings_nl.pak",
|
||||||
|
"ash_components_strings_pl.pak",
|
||||||
|
"ash_components_strings_pt-BR.pak",
|
||||||
|
"ash_components_strings_pt-PT.pak",
|
||||||
|
"ash_components_strings_ro.pak",
|
||||||
|
"ash_components_strings_ru.pak",
|
||||||
|
"ash_components_strings_sk.pak",
|
||||||
|
"ash_components_strings_sl.pak",
|
||||||
|
"ash_components_strings_sr.pak",
|
||||||
|
"ash_components_strings_sv.pak",
|
||||||
|
"ash_components_strings_sw.pak",
|
||||||
|
"ash_components_strings_ta.pak",
|
||||||
|
"ash_components_strings_te.pak",
|
||||||
|
"ash_components_strings_th.pak",
|
||||||
|
"ash_components_strings_tr.pak",
|
||||||
|
"ash_components_strings_uk.pak",
|
||||||
|
"ash_components_strings_vi.pak",
|
||||||
|
"ash_components_strings_zh-CN.pak",
|
||||||
|
"ash_components_strings_zh-TW.pak",
|
||||||
|
]
|
||||||
|
}
|
22
src/ash/keyboard/arc/BUILD.gn
Normal file
22
src/ash/keyboard/arc/BUILD.gn
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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("//build/config/ui.gni")
|
||||||
|
|
||||||
|
static_library("arc") {
|
||||||
|
sources = [
|
||||||
|
"arc_input_method_surface_manager.cc",
|
||||||
|
"arc_input_method_surface_manager.h",
|
||||||
|
"arc_virtual_keyboard_container_layout_manager.cc",
|
||||||
|
"arc_virtual_keyboard_container_layout_manager.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//base",
|
||||||
|
"//components/exo",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
]
|
||||||
|
}
|
189
src/ash/keyboard/ui/BUILD.gn
Normal file
189
src/ash/keyboard/ui/BUILD.gn
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
# Copyright 2014 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//build/config/jumbo.gni")
|
||||||
|
import("//mojo/public/tools/bindings/mojom.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
import("//third_party/google_input_tools/closure.gni")
|
||||||
|
import("//third_party/google_input_tools/inputview.gni")
|
||||||
|
import("//tools/grit/grit_rule.gni")
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
jumbo_component("ui") {
|
||||||
|
sources = [
|
||||||
|
"container_behavior.cc",
|
||||||
|
"container_behavior.h",
|
||||||
|
"container_floating_behavior.cc",
|
||||||
|
"container_floating_behavior.h",
|
||||||
|
"container_full_width_behavior.cc",
|
||||||
|
"container_full_width_behavior.h",
|
||||||
|
"display_util.cc",
|
||||||
|
"display_util.h",
|
||||||
|
"drag_descriptor.h",
|
||||||
|
"keyboard_controller.cc",
|
||||||
|
"keyboard_controller.h",
|
||||||
|
"keyboard_controller_observer.h",
|
||||||
|
"keyboard_event_handler.cc",
|
||||||
|
"keyboard_event_handler.h",
|
||||||
|
"keyboard_export.h",
|
||||||
|
"keyboard_layout_delegate.h",
|
||||||
|
"keyboard_layout_manager.cc",
|
||||||
|
"keyboard_layout_manager.h",
|
||||||
|
"keyboard_ui.cc",
|
||||||
|
"keyboard_ui.h",
|
||||||
|
"keyboard_ui_factory.cc",
|
||||||
|
"keyboard_ui_factory.h",
|
||||||
|
"keyboard_ui_model.cc",
|
||||||
|
"keyboard_ui_model.h",
|
||||||
|
"keyboard_ukm_recorder.cc",
|
||||||
|
"keyboard_ukm_recorder.h",
|
||||||
|
"keyboard_util.cc",
|
||||||
|
"keyboard_util.h",
|
||||||
|
"notification_manager.cc",
|
||||||
|
"notification_manager.h",
|
||||||
|
"queued_container_type.cc",
|
||||||
|
"queued_container_type.h",
|
||||||
|
"queued_display_change.cc",
|
||||||
|
"queued_display_change.h",
|
||||||
|
"resources/keyboard_resource_util.cc",
|
||||||
|
"resources/keyboard_resource_util.h",
|
||||||
|
"shaped_window_targeter.cc",
|
||||||
|
"shaped_window_targeter.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "KEYBOARD_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":resources",
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//base",
|
||||||
|
"//services/metrics/public/cpp:ukm_builders",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/base/ime",
|
||||||
|
"//ui/compositor",
|
||||||
|
"//ui/display:display",
|
||||||
|
"//ui/events",
|
||||||
|
"//ui/events:dom_keycode_converter",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
"//ui/wm",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (use_ozone) {
|
||||||
|
deps += [ "//ui/ozone" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
data_deps = [
|
||||||
|
":resources",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
static_library("test_support") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"test/keyboard_test_util.cc",
|
||||||
|
"test/keyboard_test_util.h",
|
||||||
|
"test/test_keyboard_controller_observer.cc",
|
||||||
|
"test/test_keyboard_controller_observer.h",
|
||||||
|
"test/test_keyboard_layout_delegate.cc",
|
||||||
|
"test/test_keyboard_layout_delegate.h",
|
||||||
|
"test/test_keyboard_ui_factory.cc",
|
||||||
|
"test/test_keyboard_ui_factory.h",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
":ui",
|
||||||
|
"//base",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/aura:test_support",
|
||||||
|
"//ui/base:test_support",
|
||||||
|
"//ui/display",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
grit("resources_grit") {
|
||||||
|
source = "keyboard_resources.grd"
|
||||||
|
outputs = [
|
||||||
|
"grit/keyboard_resources.h",
|
||||||
|
"grit/keyboard_resources_map.h",
|
||||||
|
"keyboard_resources.pak",
|
||||||
|
]
|
||||||
|
|
||||||
|
input_tools_root_dir = "//third_party/google_input_tools/src/chrome/os"
|
||||||
|
inputview_gen_js = "$root_gen_dir/ash/keyboard/ui/resources/inputview.js"
|
||||||
|
grit_flags = [
|
||||||
|
"-E",
|
||||||
|
"input_tools_root_dir=" + rebase_path(input_tools_root_dir, "."),
|
||||||
|
"-E",
|
||||||
|
"inputview_gen_js=" + rebase_path(inputview_gen_js, root_build_dir),
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":inputview",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
copy("resources") {
|
||||||
|
sources = [
|
||||||
|
"$target_gen_dir/keyboard_resources.pak",
|
||||||
|
]
|
||||||
|
outputs = [
|
||||||
|
"$root_out_dir/keyboard_resources.pak",
|
||||||
|
]
|
||||||
|
public_deps = [
|
||||||
|
":resources_grit",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
build_closure("inputview") {
|
||||||
|
sources = inputview_sources
|
||||||
|
target = "$target_gen_dir/resources/inputview.js"
|
||||||
|
path = rebase_path("//third_party/google_input_tools")
|
||||||
|
}
|
||||||
|
|
||||||
|
test("keyboard_unittests") {
|
||||||
|
sources = [
|
||||||
|
"container_floating_behavior_unittest.cc",
|
||||||
|
"container_full_width_behavior_unittest.cc",
|
||||||
|
"keyboard_controller_unittest.cc",
|
||||||
|
"keyboard_event_handler_unittest.cc",
|
||||||
|
"keyboard_ukm_recorder_unittest.cc",
|
||||||
|
"keyboard_util_unittest.cc",
|
||||||
|
"notification_manager_unittest.cc",
|
||||||
|
"test/run_all_unittests.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":test_support",
|
||||||
|
":ui",
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//base",
|
||||||
|
"//base/test:test_support",
|
||||||
|
"//components/ukm:test_support",
|
||||||
|
"//mojo/core/embedder",
|
||||||
|
"//services/service_manager/public/cpp",
|
||||||
|
"//testing/gmock",
|
||||||
|
"//testing/gtest",
|
||||||
|
"//ui/aura:test_support",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/base:test_support",
|
||||||
|
"//ui/base/ime/init",
|
||||||
|
"//ui/compositor:test_support",
|
||||||
|
"//ui/events:test_support",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/gfx/geometry",
|
||||||
|
"//ui/gl:test_support",
|
||||||
|
"//ui/resources:ui_test_pak",
|
||||||
|
"//ui/wm",
|
||||||
|
]
|
||||||
|
|
||||||
|
data_deps = [
|
||||||
|
"//ui/resources:ui_test_pak_data",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (use_ozone) {
|
||||||
|
deps += [ "//ui/ozone" ]
|
||||||
|
}
|
||||||
|
}
|
17
src/ash/login/resources/BUILD.gn
Normal file
17
src/ash/login/resources/BUILD.gn
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# 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("//tools/grit/grit_rule.gni")
|
||||||
|
|
||||||
|
grit("resources") {
|
||||||
|
source = "login_resources.grd"
|
||||||
|
outputs = [
|
||||||
|
"grit/login_resources.h",
|
||||||
|
"grit/login_resources_map.cc",
|
||||||
|
"grit/login_resources_map.h",
|
||||||
|
"login_resources_100_percent.pak",
|
||||||
|
"login_resources_200_percent.pak",
|
||||||
|
"login_resources_300_percent.pak",
|
||||||
|
]
|
||||||
|
}
|
288
src/ash/public/cpp/BUILD.gn
Normal file
288
src/ash/public/cpp/BUILD.gn
Normal file
@ -0,0 +1,288 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//mojo/public/tools/bindings/mojom.gni")
|
||||||
|
|
||||||
|
# C++ headers and sources that can be used outside ash.
|
||||||
|
component("cpp") {
|
||||||
|
sources = [
|
||||||
|
"accelerators.cc",
|
||||||
|
"accelerators.h",
|
||||||
|
"app_list/app_list_client.h",
|
||||||
|
"app_list/app_list_config.cc",
|
||||||
|
"app_list/app_list_config.h",
|
||||||
|
"app_list/app_list_controller.cc",
|
||||||
|
"app_list/app_list_controller.h",
|
||||||
|
"app_list/app_list_features.cc",
|
||||||
|
"app_list/app_list_features.h",
|
||||||
|
"app_list/app_list_metrics.cc",
|
||||||
|
"app_list/app_list_metrics.h",
|
||||||
|
"app_list/app_list_switches.cc",
|
||||||
|
"app_list/app_list_switches.h",
|
||||||
|
"app_list/app_list_types.cc",
|
||||||
|
"app_list/app_list_types.h",
|
||||||
|
"app_list/internal_app_id_constants.h",
|
||||||
|
"app_list/term_break_iterator.cc",
|
||||||
|
"app_list/term_break_iterator.h",
|
||||||
|
"app_list/tokenized_string.cc",
|
||||||
|
"app_list/tokenized_string.h",
|
||||||
|
"app_list/tokenized_string_char_iterator.cc",
|
||||||
|
"app_list/tokenized_string_char_iterator.h",
|
||||||
|
"app_list/tokenized_string_match.cc",
|
||||||
|
"app_list/tokenized_string_match.h",
|
||||||
|
"app_menu_constants.h",
|
||||||
|
"app_types.h",
|
||||||
|
"ash_constants.h",
|
||||||
|
"ash_features.cc",
|
||||||
|
"ash_features.h",
|
||||||
|
"ash_pref_names.cc",
|
||||||
|
"ash_pref_names.h",
|
||||||
|
"ash_public_export.h",
|
||||||
|
"ash_switches.cc",
|
||||||
|
"ash_switches.h",
|
||||||
|
"ash_typography.cc",
|
||||||
|
"ash_typography.h",
|
||||||
|
"ash_view_ids.h",
|
||||||
|
"assistant/assistant_image_downloader.cc",
|
||||||
|
"assistant/assistant_image_downloader.h",
|
||||||
|
"assistant/assistant_setup.cc",
|
||||||
|
"assistant/assistant_setup.h",
|
||||||
|
"assistant/assistant_state_base.cc",
|
||||||
|
"assistant/assistant_state_base.h",
|
||||||
|
"assistant/assistant_state_proxy.cc",
|
||||||
|
"assistant/assistant_state_proxy.h",
|
||||||
|
"assistant/default_voice_interaction_observer.h",
|
||||||
|
"caption_buttons/caption_button_model.h",
|
||||||
|
"caption_buttons/frame_back_button.cc",
|
||||||
|
"caption_buttons/frame_back_button.h",
|
||||||
|
"caption_buttons/frame_caption_button_container_view.cc",
|
||||||
|
"caption_buttons/frame_caption_button_container_view.h",
|
||||||
|
"caption_buttons/frame_size_button.cc",
|
||||||
|
"caption_buttons/frame_size_button.h",
|
||||||
|
"caption_buttons/frame_size_button_delegate.h",
|
||||||
|
"caption_buttons/snap_controller.cc",
|
||||||
|
"caption_buttons/snap_controller.h",
|
||||||
|
"cast_config_controller.cc",
|
||||||
|
"cast_config_controller.h",
|
||||||
|
"default_frame_header.cc",
|
||||||
|
"default_frame_header.h",
|
||||||
|
"default_scale_factor_retriever.cc",
|
||||||
|
"default_scale_factor_retriever.h",
|
||||||
|
"fps_counter.cc",
|
||||||
|
"fps_counter.h",
|
||||||
|
"frame_header.cc",
|
||||||
|
"frame_header.h",
|
||||||
|
"frame_utils.cc",
|
||||||
|
"frame_utils.h",
|
||||||
|
"gesture_action_type.h",
|
||||||
|
"immersive/immersive_context.cc",
|
||||||
|
"immersive/immersive_context.h",
|
||||||
|
"immersive/immersive_focus_watcher.cc",
|
||||||
|
"immersive/immersive_focus_watcher.h",
|
||||||
|
"immersive/immersive_fullscreen_controller.cc",
|
||||||
|
"immersive/immersive_fullscreen_controller.h",
|
||||||
|
"immersive/immersive_fullscreen_controller_delegate.h",
|
||||||
|
"immersive/immersive_revealed_lock.cc",
|
||||||
|
"immersive/immersive_revealed_lock.h",
|
||||||
|
"keyboard/keyboard_switches.cc",
|
||||||
|
"keyboard/keyboard_switches.h",
|
||||||
|
"keyboard_shortcut_viewer.h",
|
||||||
|
"kiosk_app_menu.cc",
|
||||||
|
"kiosk_app_menu.h",
|
||||||
|
"lock_screen_widget_factory.cc",
|
||||||
|
"lock_screen_widget_factory.h",
|
||||||
|
"login_constants.h",
|
||||||
|
"login_screen.cc",
|
||||||
|
"login_screen.h",
|
||||||
|
"login_screen_model.cc",
|
||||||
|
"login_screen_model.h",
|
||||||
|
"login_types.cc",
|
||||||
|
"login_types.h",
|
||||||
|
"network_icon_image_source.cc",
|
||||||
|
"network_icon_image_source.h",
|
||||||
|
"new_window_delegate.cc",
|
||||||
|
"new_window_delegate.h",
|
||||||
|
"note_taking_client.cc",
|
||||||
|
"note_taking_client.h",
|
||||||
|
"notification_utils.cc",
|
||||||
|
"notification_utils.h",
|
||||||
|
"pagination/pagination_controller.cc",
|
||||||
|
"pagination/pagination_controller.h",
|
||||||
|
"pagination/pagination_model.cc",
|
||||||
|
"pagination/pagination_model.h",
|
||||||
|
"pagination/pagination_model_observer.h",
|
||||||
|
"power_utils.cc",
|
||||||
|
"power_utils.h",
|
||||||
|
"presentation_time_recorder.cc",
|
||||||
|
"presentation_time_recorder.h",
|
||||||
|
"rounded_corner_decorator.cc",
|
||||||
|
"rounded_corner_decorator.h",
|
||||||
|
"scale_utility.cc",
|
||||||
|
"scale_utility.h",
|
||||||
|
"session/session_activation_observer.h",
|
||||||
|
"session/session_controller.cc",
|
||||||
|
"session/session_controller.h",
|
||||||
|
"session/session_controller_client.h",
|
||||||
|
"session/session_types.cc",
|
||||||
|
"session/session_types.h",
|
||||||
|
"session/user_info.cc",
|
||||||
|
"session/user_info.h",
|
||||||
|
"shelf_item.cc",
|
||||||
|
"shelf_item.h",
|
||||||
|
"shelf_item_delegate.cc",
|
||||||
|
"shelf_item_delegate.h",
|
||||||
|
"shelf_model.cc",
|
||||||
|
"shelf_model.h",
|
||||||
|
"shelf_model_observer.h",
|
||||||
|
"shelf_prefs.cc",
|
||||||
|
"shelf_prefs.h",
|
||||||
|
"shelf_types.cc",
|
||||||
|
"shelf_types.h",
|
||||||
|
"shell_window_ids.cc",
|
||||||
|
"shell_window_ids.h",
|
||||||
|
"split_view.cc",
|
||||||
|
"split_view.h",
|
||||||
|
"stylus_utils.cc",
|
||||||
|
"stylus_utils.h",
|
||||||
|
"system_tray.cc",
|
||||||
|
"system_tray.h",
|
||||||
|
"system_tray_client.h",
|
||||||
|
"system_tray_focus_observer.h",
|
||||||
|
"tablet_mode.cc",
|
||||||
|
"tablet_mode.h",
|
||||||
|
"tablet_mode_toggle_observer.h",
|
||||||
|
"touch_uma.cc",
|
||||||
|
"touch_uma.h",
|
||||||
|
"wallpaper_controller.cc",
|
||||||
|
"wallpaper_controller.h",
|
||||||
|
"wallpaper_controller_client.h",
|
||||||
|
"wallpaper_controller_observer.cc",
|
||||||
|
"wallpaper_controller_observer.h",
|
||||||
|
"wallpaper_info.h",
|
||||||
|
"wallpaper_types.h",
|
||||||
|
"wallpaper_user_info.h",
|
||||||
|
"window_animation_types.h",
|
||||||
|
"window_properties.cc",
|
||||||
|
"window_properties.h",
|
||||||
|
"window_state_type.cc",
|
||||||
|
"window_state_type.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
defines = [ "ASH_PUBLIC_IMPLEMENTATION" ]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/cpp/vector_icons",
|
||||||
|
"//chromeos/constants",
|
||||||
|
"//chromeos/dbus/power:power_manager_proto",
|
||||||
|
"//components/prefs",
|
||||||
|
"//components/sync:rest_of_sync",
|
||||||
|
"//mojo/public/cpp/bindings",
|
||||||
|
"//services/service_manager/public/cpp",
|
||||||
|
"//services/ws/public/mojom",
|
||||||
|
"//skia/public/interfaces",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/chromeos/strings",
|
||||||
|
"//ui/compositor_extra",
|
||||||
|
"//ui/display",
|
||||||
|
"//ui/events/devices",
|
||||||
|
"//ui/message_center/public/cpp",
|
||||||
|
"//ui/views",
|
||||||
|
"//ui/views/window/vector_icons",
|
||||||
|
"//ui/wm",
|
||||||
|
"//ui/wm/public",
|
||||||
|
]
|
||||||
|
|
||||||
|
public_deps = [
|
||||||
|
"//ash/public/interfaces:interfaces_internal",
|
||||||
|
"//base",
|
||||||
|
"//components/session_manager:base",
|
||||||
|
"//components/user_manager",
|
||||||
|
"//ui/gfx",
|
||||||
|
]
|
||||||
|
|
||||||
|
allow_circular_includes_from =
|
||||||
|
[ "//ash/public/interfaces:interfaces_internal" ]
|
||||||
|
|
||||||
|
output_name = "ash_public_cpp"
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("manifest") {
|
||||||
|
sources = [
|
||||||
|
"manifest.cc",
|
||||||
|
"manifest.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/interfaces:interfaces_internal",
|
||||||
|
"//base",
|
||||||
|
"//chromeos/services/multidevice_setup/public/mojom",
|
||||||
|
"//chromeos/services/network_config/public/mojom",
|
||||||
|
"//services/content/public/mojom",
|
||||||
|
"//services/data_decoder/public/mojom",
|
||||||
|
"//services/device/public/mojom",
|
||||||
|
"//services/preferences/public/mojom",
|
||||||
|
"//services/service_manager/public/cpp",
|
||||||
|
"//services/service_manager/public/mojom",
|
||||||
|
"//services/viz/public/interfaces",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("manifest_for_tests") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"test_manifest.cc",
|
||||||
|
"test_manifest.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":manifest",
|
||||||
|
"//ash/public/interfaces:test_interfaces",
|
||||||
|
"//base",
|
||||||
|
"//services/service_manager/public/cpp",
|
||||||
|
"//services/service_manager/public/mojom",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("unit_tests") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"default_scale_factor_retriever_unittest.cc",
|
||||||
|
"pagination/pagination_model_unittest.cc",
|
||||||
|
"power_utils_unittest.cc",
|
||||||
|
"rounded_corner_decorator_unittest.cc",
|
||||||
|
"shelf_model_unittest.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":cpp",
|
||||||
|
"//base",
|
||||||
|
"//base/test:test_support",
|
||||||
|
"//testing/gtest",
|
||||||
|
"//ui/aura:test_support",
|
||||||
|
"//ui/gfx:test_support",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("test_support") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"immersive/immersive_fullscreen_controller_test_api.cc",
|
||||||
|
"immersive/immersive_fullscreen_controller_test_api.h",
|
||||||
|
"test/test_keyboard_controller_observer.cc",
|
||||||
|
"test/test_keyboard_controller_observer.h",
|
||||||
|
"test/test_new_window_delegate.cc",
|
||||||
|
"test/test_new_window_delegate.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":cpp",
|
||||||
|
"//base",
|
||||||
|
"//services/service_manager/public/cpp",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/aura:test_support",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/views",
|
||||||
|
]
|
||||||
|
}
|
40
src/ash/public/cpp/app_list/vector_icons/BUILD.gn
Normal file
40
src/ash/public/cpp/app_list/vector_icons/BUILD.gn
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//components/vector_icons/vector_icons.gni")
|
||||||
|
|
||||||
|
aggregate_vector_icons("app_list_vector_icons") {
|
||||||
|
icon_directory = "."
|
||||||
|
|
||||||
|
icons = [
|
||||||
|
"arrow_up.icon",
|
||||||
|
"badge_instant.icon",
|
||||||
|
"badge_play.icon",
|
||||||
|
"badge_rating.icon",
|
||||||
|
"bookmark.icon",
|
||||||
|
"domain.icon",
|
||||||
|
"equal.icon",
|
||||||
|
"google_black.icon",
|
||||||
|
"google_color.icon",
|
||||||
|
"history.icon",
|
||||||
|
"mic_black.icon",
|
||||||
|
"search.icon",
|
||||||
|
"search_engine_not_google.icon",
|
||||||
|
"search_result_append.icon",
|
||||||
|
"search_result_remove.icon",
|
||||||
|
"vertical_bar_end.icon",
|
||||||
|
"vertical_bar_middle.icon",
|
||||||
|
"vertical_bar_single.icon",
|
||||||
|
"vertical_bar_start.icon",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("vector_icons") {
|
||||||
|
sources = get_target_outputs(":app_list_vector_icons")
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":app_list_vector_icons",
|
||||||
|
"//skia",
|
||||||
|
]
|
||||||
|
}
|
13
src/ash/public/cpp/resources/BUILD.gn
Normal file
13
src/ash/public/cpp/resources/BUILD.gn
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# 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("//tools/grit/grit_rule.gni")
|
||||||
|
|
||||||
|
grit("ash_public_unscaled_resources") {
|
||||||
|
source = "ash_public_unscaled_resources.grd"
|
||||||
|
outputs = [
|
||||||
|
"grit/ash_public_unscaled_resources.h",
|
||||||
|
"ash_public_unscaled_resources.pak",
|
||||||
|
]
|
||||||
|
}
|
56
src/ash/public/cpp/vector_icons/BUILD.gn
Normal file
56
src/ash/public/cpp/vector_icons/BUILD.gn
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# 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("//components/vector_icons/vector_icons.gni")
|
||||||
|
|
||||||
|
# The icons in this target, unlike those in //ash/resources/vector_icons, are ok to use from outside of ash/.
|
||||||
|
aggregate_vector_icons("ash_public_vector_icons") {
|
||||||
|
icon_directory = "."
|
||||||
|
|
||||||
|
icons = [
|
||||||
|
"assistant.icon",
|
||||||
|
"assistant_mic.icon",
|
||||||
|
"notification_assistant.icon",
|
||||||
|
"notification_captive_portal.icon",
|
||||||
|
"notification_cellular_alert.icon",
|
||||||
|
"notification_download.icon",
|
||||||
|
"notification_end_of_support.icon",
|
||||||
|
"window_control_dezoom.icon",
|
||||||
|
"window_control_back.icon",
|
||||||
|
"window_control_menu.icon",
|
||||||
|
"window_control_zoom.icon",
|
||||||
|
"notification_family_link.icon",
|
||||||
|
"notification_google.icon",
|
||||||
|
"notification_image.icon",
|
||||||
|
"notification_installed.icon",
|
||||||
|
"notification_linux.icon",
|
||||||
|
"notification_messages.icon",
|
||||||
|
"notification_mobile_data.icon",
|
||||||
|
"notification_mobile_data_off.icon",
|
||||||
|
"notification_multi_device_setup.icon",
|
||||||
|
"notification_play_prism.icon",
|
||||||
|
"notification_printing.icon",
|
||||||
|
"notification_printing_done.icon",
|
||||||
|
"notification_printing_warning.icon",
|
||||||
|
"notification_settings.icon",
|
||||||
|
"notification_storage_full.icon",
|
||||||
|
"notification_supervised_user.icon",
|
||||||
|
"notification_vpn.icon",
|
||||||
|
"notification_warning.icon",
|
||||||
|
"notification_wifi_off.icon",
|
||||||
|
"window_control_left_snapped.icon",
|
||||||
|
"window_control_right_snapped.icon",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("vector_icons") {
|
||||||
|
sources = get_target_outputs(":ash_public_vector_icons")
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":ash_public_vector_icons",
|
||||||
|
"//base",
|
||||||
|
"//skia",
|
||||||
|
"//ui/gfx",
|
||||||
|
]
|
||||||
|
}
|
90
src/ash/public/interfaces/BUILD.gn
Normal file
90
src/ash/public/interfaces/BUILD.gn
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//mojo/public/tools/bindings/mojom.gni")
|
||||||
|
|
||||||
|
# Depend upon //ash/public/cpp, which has a public_dep on this. The two targets
|
||||||
|
# must be bundled together as the typemaps depend upon //ash/public/cpp,
|
||||||
|
# and //ash/public/cpp needs to depend on this for generated code (such as
|
||||||
|
# enums and constants).
|
||||||
|
mojom("interfaces_internal") {
|
||||||
|
visibility = [
|
||||||
|
"//ash/public/cpp:*",
|
||||||
|
"//ash/public/interfaces:test_interfaces",
|
||||||
|
]
|
||||||
|
disable_variants = true
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"accessibility_controller.mojom",
|
||||||
|
"accessibility_controller_enums.mojom",
|
||||||
|
"accessibility_focus_ring_controller.mojom",
|
||||||
|
"ash_message_center_controller.mojom",
|
||||||
|
"assistant_controller.mojom",
|
||||||
|
"assistant_volume_control.mojom",
|
||||||
|
"constants.mojom",
|
||||||
|
"cros_display_config.mojom",
|
||||||
|
"event_rewriter_controller.mojom",
|
||||||
|
"ime_controller.mojom",
|
||||||
|
"ime_info.mojom",
|
||||||
|
"keyboard_config.mojom",
|
||||||
|
"keyboard_controller.mojom",
|
||||||
|
"keyboard_controller_types.mojom",
|
||||||
|
"kiosk_next_shell.mojom",
|
||||||
|
"locale.mojom",
|
||||||
|
"login_screen.mojom",
|
||||||
|
"media.mojom",
|
||||||
|
"night_light_controller.mojom",
|
||||||
|
"shelf_integration_test_api.mojom",
|
||||||
|
"shutdown.mojom",
|
||||||
|
"tray_action.mojom",
|
||||||
|
"update.mojom",
|
||||||
|
"voice_interaction_controller.mojom",
|
||||||
|
"vpn_list.mojom",
|
||||||
|
"window_pin_type.mojom",
|
||||||
|
"window_properties.mojom",
|
||||||
|
]
|
||||||
|
|
||||||
|
public_deps = [
|
||||||
|
"//chromeos/components/proximity_auth/public/interfaces",
|
||||||
|
"//chromeos/services/assistant/public/mojom",
|
||||||
|
"//components/account_id/interfaces",
|
||||||
|
"//components/arc/common:notifications",
|
||||||
|
"//components/sync/mojo:interfaces",
|
||||||
|
"//mojo/public/mojom/base",
|
||||||
|
"//services/content/public/mojom",
|
||||||
|
"//services/preferences/public/mojom",
|
||||||
|
"//skia/public/interfaces",
|
||||||
|
"//ui/accessibility:ax_enums_mojo",
|
||||||
|
"//ui/base/ime/chromeos/public/interfaces",
|
||||||
|
"//ui/base/mojo",
|
||||||
|
"//ui/display/mojo:interfaces",
|
||||||
|
"//ui/events/mojo:interfaces",
|
||||||
|
"//ui/gfx/geometry/mojo",
|
||||||
|
"//ui/gfx/image/mojo:interfaces",
|
||||||
|
"//ui/gfx/range/mojo",
|
||||||
|
"//ui/message_center/public/mojo:mojo",
|
||||||
|
"//url/mojom:url_mojom_gurl",
|
||||||
|
]
|
||||||
|
|
||||||
|
component_output_prefix = "ash_public_interfaces_internal"
|
||||||
|
export_class_attribute = "ASH_PUBLIC_EXPORT"
|
||||||
|
export_define = "ASH_PUBLIC_IMPLEMENTATION=1"
|
||||||
|
export_header = "ash/public/cpp/ash_public_export.h"
|
||||||
|
}
|
||||||
|
|
||||||
|
mojom("test_interfaces") {
|
||||||
|
testonly = true
|
||||||
|
disable_variants = true
|
||||||
|
sources = [
|
||||||
|
"login_screen_test_api.test-mojom",
|
||||||
|
"shelf_test_api.test-mojom",
|
||||||
|
"status_area_widget_test_api.test-mojom",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"//ash/public/interfaces:interfaces_internal",
|
||||||
|
"//components/account_id/interfaces",
|
||||||
|
"//mojo/public/mojom/base",
|
||||||
|
"//ui/gfx/geometry/mojo",
|
||||||
|
]
|
||||||
|
}
|
143
src/ash/public/interfaces/accessibility_controller.mojom
Normal file
143
src/ash/public/interfaces/accessibility_controller.mojom
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "ash/public/interfaces/accessibility_controller_enums.mojom";
|
||||||
|
import "mojo/public/mojom/base/string16.mojom";
|
||||||
|
import "mojo/public/mojom/base/time.mojom";
|
||||||
|
import "ui/accessibility/ax_enums.mojom";
|
||||||
|
import "ui/events/mojo/event.mojom";
|
||||||
|
import "ui/gfx/geometry/mojo/geometry.mojom";
|
||||||
|
|
||||||
|
// Allows a client to implement Select-to-Speak.
|
||||||
|
// TODO(katie): Consider combining DispatchMouseEvent and DispatchKeyEvent
|
||||||
|
// into a single DispatchEvent function.
|
||||||
|
interface SelectToSpeakEventHandlerDelegate {
|
||||||
|
// Sends a KeyEvent to the Select-to-Speak extension in Chrome. The event
|
||||||
|
// is cast to a key event with a type CHECK.
|
||||||
|
DispatchKeyEvent(ui.mojom.Event event);
|
||||||
|
|
||||||
|
// Sends a MouseEvent to the Select-to-Speak extension in Chrome. The event
|
||||||
|
// is cast to a mouse event with a type CHECK.
|
||||||
|
DispatchMouseEvent(ui.mojom.Event event);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Allows a client to implement Switch Access.
|
||||||
|
interface SwitchAccessEventHandlerDelegate {
|
||||||
|
// Sends a KeyEvent to the Switch Access extension in Chrome. The event
|
||||||
|
// is cast to a key event with a type CHECK.
|
||||||
|
DispatchKeyEvent(ui.mojom.Event event);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface for ash client (e.g. Chrome) to control and query accessibility
|
||||||
|
// features.
|
||||||
|
interface AccessibilityController {
|
||||||
|
// Sets the client interface.
|
||||||
|
SetClient(AccessibilityControllerClient client);
|
||||||
|
|
||||||
|
// Starts or stops darkening the screen (e.g. to allow chrome a11y extensions
|
||||||
|
// to darken the screen).
|
||||||
|
SetDarkenScreen(bool darken);
|
||||||
|
|
||||||
|
// Called when braille display state is changed.
|
||||||
|
BrailleDisplayStateChanged(bool connected);
|
||||||
|
|
||||||
|
// Sets the focus highlight rect using |bounds_in_screen|. Called when focus
|
||||||
|
// changed in page and a11y focus highlight feature is enabled.
|
||||||
|
SetFocusHighlightRect(gfx.mojom.Rect bounds_in_screen);
|
||||||
|
|
||||||
|
// Sets the text input caret bounds used to draw the caret highlight effect.
|
||||||
|
// For effciency, only sent when the caret highlight feature is enabled.
|
||||||
|
// Setting off-screen or empty bounds suppresses the highlight.
|
||||||
|
SetCaretBounds(gfx.mojom.Rect bounds_in_screen);
|
||||||
|
|
||||||
|
// Sets whether the accessibility panel should always be visible, regardless
|
||||||
|
// of whether the window is fullscreen.
|
||||||
|
SetAccessibilityPanelAlwaysVisible(bool always_visible);
|
||||||
|
|
||||||
|
// Sets the bounds for the accessibility panel. Overrides current
|
||||||
|
// configuration (i.e. fullscreen, full-width).
|
||||||
|
SetAccessibilityPanelBounds(gfx.mojom.Rect bounds,
|
||||||
|
AccessibilityPanelState state);
|
||||||
|
|
||||||
|
// Sets the current Select-to-Speak state. This should be used by the Select-
|
||||||
|
// to-Speak extension to inform ash of its updated state.
|
||||||
|
SetSelectToSpeakState(SelectToSpeakState state);
|
||||||
|
|
||||||
|
// Set the delegate used by the Select-to-Speak event handler.
|
||||||
|
SetSelectToSpeakEventHandlerDelegate(
|
||||||
|
SelectToSpeakEventHandlerDelegate delegate);
|
||||||
|
|
||||||
|
// Sets the key codes that Switch Access should capture.
|
||||||
|
SetSwitchAccessKeysToCapture(array<int32> keys_to_capture);
|
||||||
|
|
||||||
|
// Set the delegate used by the Switch Access event handler.
|
||||||
|
SetSwitchAccessEventHandlerDelegate(
|
||||||
|
SwitchAccessEventHandlerDelegate delegate);
|
||||||
|
|
||||||
|
// Starts or stops dictation. Records metrics for toggling via SwitchAccess.
|
||||||
|
ToggleDictationFromSource(DictationToggleSource source);
|
||||||
|
|
||||||
|
// Tells the Switch Access Event Handler whether to forward all key events to
|
||||||
|
// the Switch Access extension.
|
||||||
|
ForwardKeyEventsToSwitchAccess(bool should_forward);
|
||||||
|
|
||||||
|
// Retrieves a string description of the current battery status.
|
||||||
|
GetBatteryDescription()
|
||||||
|
=> (mojo_base.mojom.String16 battery_description);
|
||||||
|
|
||||||
|
// Shows or hides the virtual keyboard.
|
||||||
|
SetVirtualKeyboardVisible(bool is_visible);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface for ash to request accessibility service from its client (e.g.
|
||||||
|
// Chrome).
|
||||||
|
interface AccessibilityControllerClient {
|
||||||
|
// Triggers an accessibility alert to give the user feedback.
|
||||||
|
TriggerAccessibilityAlert(AccessibilityAlert alert);
|
||||||
|
|
||||||
|
// Plays an earcon. Earcons are brief and distinctive sounds that indicate
|
||||||
|
// that their mapped event has occurred. The |sound_key| enums can be found in
|
||||||
|
// chromeos/audio/chromeos_sounds.h. This method exists because the browser
|
||||||
|
// owns all media playback.
|
||||||
|
PlayEarcon(int32 sound_key);
|
||||||
|
|
||||||
|
// Initiates play of shutdown sound and returns sound duration. This method
|
||||||
|
// exists because the browser owns all media playback.
|
||||||
|
PlayShutdownSound() => (mojo_base.mojom.TimeDelta sound_duration);
|
||||||
|
|
||||||
|
// Forwards an accessibility gesture from the touch exploration controller to
|
||||||
|
// ChromeVox.
|
||||||
|
HandleAccessibilityGesture(ax.mojom.Gesture gesture);
|
||||||
|
|
||||||
|
// Starts or stops dictation (type what you speak).
|
||||||
|
// Returns the new dictation state after the toggle.
|
||||||
|
ToggleDictation() => (bool dictation_on);
|
||||||
|
|
||||||
|
// Cancels all current and queued speech immediately.
|
||||||
|
SilenceSpokenFeedback();
|
||||||
|
|
||||||
|
// Called when we first detect two fingers are held down, which can be used to
|
||||||
|
// toggle spoken feedback on some touch-only devices.
|
||||||
|
OnTwoFingerTouchStart();
|
||||||
|
|
||||||
|
// Called when the user is no longer holding down two fingers (including
|
||||||
|
// releasing one, holding down three, or moving them).
|
||||||
|
OnTwoFingerTouchStop();
|
||||||
|
|
||||||
|
// Whether or not to enable toggling spoken feedback via holding down two
|
||||||
|
// fingers on the screen.
|
||||||
|
ShouldToggleSpokenFeedbackViaTouch() => (bool should_toggle);
|
||||||
|
|
||||||
|
// Plays tick sound indicating spoken feedback will be toggled after
|
||||||
|
// countdown.
|
||||||
|
PlaySpokenFeedbackToggleCountdown(int32 tick_count);
|
||||||
|
|
||||||
|
// Requests the Select-to-Speak extension to change its state. This lets users
|
||||||
|
// do the same things in tablet mode as with a keyboard. Specifically, if
|
||||||
|
// Select-to-Speak is not speaking, move to capturing state; if
|
||||||
|
// Select-to-Speak is speaking, cancel speaking and move to inactive state.
|
||||||
|
RequestSelectToSpeakStateChange();
|
||||||
|
};
|
125
src/ash/public/interfaces/accessibility_controller_enums.mojom
Normal file
125
src/ash/public/interfaces/accessibility_controller_enums.mojom
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
// Copyright 2019 The Chromium Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// Alert sent to the accessibility api.
|
||||||
|
enum AccessibilityAlert {
|
||||||
|
// Default value, indicates no accessibility alert.
|
||||||
|
NONE,
|
||||||
|
|
||||||
|
// When caps lock is turned on.
|
||||||
|
CAPS_ON,
|
||||||
|
|
||||||
|
// When caps lock is turned off.
|
||||||
|
CAPS_OFF,
|
||||||
|
|
||||||
|
// When screen is turned on by tablet power button.
|
||||||
|
SCREEN_ON,
|
||||||
|
|
||||||
|
// When screen is turned off by tablet power button.
|
||||||
|
SCREEN_OFF,
|
||||||
|
|
||||||
|
// When window moved to another display by accelerators.
|
||||||
|
WINDOW_MOVED_TO_ANOTHER_DISPLAY,
|
||||||
|
|
||||||
|
// When the user attempts a keyboard command that requires a window to work,
|
||||||
|
// and none is available.
|
||||||
|
WINDOW_NEEDED,
|
||||||
|
|
||||||
|
// When the user enters window overview mode.
|
||||||
|
WINDOW_OVERVIEW_MODE_ENTERED,
|
||||||
|
|
||||||
|
// When workspace state just changed to WORKSPACE_WINDOW_STATE_FULL_SCREEN.
|
||||||
|
WORKSPACE_FULLSCREEN_STATE_ENTERED,
|
||||||
|
|
||||||
|
// When workspace state just changed from WORKSPACE_WINDOW_STATE_FULL_SCREEN
|
||||||
|
// to others.
|
||||||
|
WORKSPACE_FULLSCREEN_STATE_EXITED
|
||||||
|
};
|
||||||
|
|
||||||
|
enum AccessibilityPanelState {
|
||||||
|
// Window bounds are set explicitly.
|
||||||
|
BOUNDED,
|
||||||
|
|
||||||
|
// Width of panel matches screen width, y_coord and height are set by bounds.
|
||||||
|
FULL_WIDTH,
|
||||||
|
|
||||||
|
// Panel occupies the full screen. Bounds are ignored.
|
||||||
|
FULLSCREEN
|
||||||
|
};
|
||||||
|
|
||||||
|
// These values are persisted to logs and should not be renumbered or re-used.
|
||||||
|
// See tools/metrics/histograms/enums.xml.
|
||||||
|
enum DictationToggleSource {
|
||||||
|
// Toggled by the keyboard command (Search + D).
|
||||||
|
kKeyboard,
|
||||||
|
|
||||||
|
// Toggled by the dictation button in the tray.
|
||||||
|
kButton,
|
||||||
|
|
||||||
|
// Switch Access context menu button.
|
||||||
|
kSwitchAccess,
|
||||||
|
|
||||||
|
// Chromevox chrome extension.
|
||||||
|
kChromevox
|
||||||
|
};
|
||||||
|
|
||||||
|
enum SelectToSpeakState {
|
||||||
|
// Select to Speak is not actively selecting text or speaking.
|
||||||
|
kSelectToSpeakStateInactive,
|
||||||
|
|
||||||
|
// Select to Speak is being used to actively select a new region. Note that
|
||||||
|
// it might also be speaking, but the selecting state takes precedence.
|
||||||
|
kSelectToSpeakStateSelecting,
|
||||||
|
|
||||||
|
// Select to Speak is currently speaking.
|
||||||
|
kSelectToSpeakStateSpeaking,
|
||||||
|
};
|
||||||
|
|
||||||
|
// The type of mouse event the Automatic Clicks feature should perform when
|
||||||
|
// dwelling. These values are written to prefs and correspond to
|
||||||
|
// AutoclickActionType in enums.xml, so should not be changed. New values
|
||||||
|
// should be added at the end.
|
||||||
|
enum AutoclickEventType {
|
||||||
|
// Perform a left click.
|
||||||
|
kLeftClick,
|
||||||
|
|
||||||
|
// Perform a right click.
|
||||||
|
kRightClick,
|
||||||
|
|
||||||
|
// Perform a drag and drop, i.e. click down at the first dwell, and up at the
|
||||||
|
// second dwell.
|
||||||
|
kDragAndDrop,
|
||||||
|
|
||||||
|
// Perform a double-click.
|
||||||
|
kDoubleClick,
|
||||||
|
|
||||||
|
// A non-action, i.e. nothing will happen at the end of the dwell time.
|
||||||
|
kNoAction,
|
||||||
|
|
||||||
|
// TODO(katie): Add scroll.
|
||||||
|
};
|
||||||
|
|
||||||
|
// The Automatic Clicks feature's on-screen menu display location. These values
|
||||||
|
// are written to prefs so they should not be changed. New values should be
|
||||||
|
// added at the end.
|
||||||
|
enum AutoclickMenuPosition {
|
||||||
|
// The bottom right of the screen.
|
||||||
|
kBottomRight,
|
||||||
|
|
||||||
|
// The bottom left of the screen.
|
||||||
|
kBottomLeft,
|
||||||
|
|
||||||
|
// The top left of the screen.
|
||||||
|
kTopLeft,
|
||||||
|
|
||||||
|
// The top right of the screen.
|
||||||
|
kTopRight,
|
||||||
|
|
||||||
|
// The default position. This will be either the bottom right in LTR languages
|
||||||
|
// or the bottom right in RTL languages. Once the user explicitly picks
|
||||||
|
// a position it will no longer change with language direction.
|
||||||
|
kSystemDefault,
|
||||||
|
};
|
@ -0,0 +1,50 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "ui/gfx/geometry/mojo/geometry.mojom";
|
||||||
|
|
||||||
|
enum FocusRingBehavior { FADE_OUT_FOCUS_RING, PERSIST_FOCUS_RING };
|
||||||
|
|
||||||
|
enum FocusRingType { GLOW, SOLID, DASHED };
|
||||||
|
|
||||||
|
// Defines a specific focus ring by specifying:
|
||||||
|
// - |rects_in_screen| the regions around which to draw the focus ring (in
|
||||||
|
// screen coordinates).
|
||||||
|
// - |focus_ring_behavior| whether it should persist or fade.
|
||||||
|
// - |focus_ring_type| the visual style of the focus ring.
|
||||||
|
// - |color| the color of the focus ring.
|
||||||
|
// - |secondary_color| a secondary color, used by some visual styles. The
|
||||||
|
// default value is SK_ColorTRANSPARENT.
|
||||||
|
struct FocusRing {
|
||||||
|
array<gfx.mojom.Rect> rects_in_screen;
|
||||||
|
FocusRingBehavior behavior;
|
||||||
|
FocusRingType type;
|
||||||
|
uint32 color;
|
||||||
|
uint32 secondary_color = 0; // SK_ColorTRANSPARENT
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Interface for ash client (e.g. Chrome) to control and query accessibility
|
||||||
|
// focus ring features.
|
||||||
|
interface AccessibilityFocusRingController {
|
||||||
|
// Sets the focus ring with the given ID to the specifications of focus_ring.
|
||||||
|
SetFocusRing(string focus_ring_id, FocusRing focus_ring);
|
||||||
|
|
||||||
|
// Hides focus ring on screen with the given ID.
|
||||||
|
HideFocusRing(string focus_ring_id);
|
||||||
|
|
||||||
|
// Draws a highlight at the given rects in screen coordinates. Rects may be
|
||||||
|
// overlapping and will be merged into one layer. This looks similar to
|
||||||
|
// selecting a region with the cursor, except it is drawn in the foreground
|
||||||
|
// rather than behind a text layer.
|
||||||
|
// TODO(katie): Add |caller_id| to highlights as well if other Accessibility
|
||||||
|
// tools or extensions want to use this API.
|
||||||
|
SetHighlights(array<gfx.mojom.Rect> rects_in_screen, uint32 skcolor);
|
||||||
|
|
||||||
|
// Hides highlight on screen.
|
||||||
|
// TODO(katie): Add |caller_id| to highlights as well.
|
||||||
|
HideHighlights();
|
||||||
|
};
|
101
src/ash/public/interfaces/ash_message_center_controller.mojom
Normal file
101
src/ash/public/interfaces/ash_message_center_controller.mojom
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "components/arc/common/notifications.mojom";
|
||||||
|
import "ui/gfx/image/mojo/image.mojom";
|
||||||
|
import "ui/message_center/public/mojo/notification.mojom";
|
||||||
|
import "ui/message_center/public/mojo/notifier_id.mojom";
|
||||||
|
import "mojo/public/mojom/base/string16.mojom";
|
||||||
|
import "mojo/public/mojom/base/unguessable_token.mojom";
|
||||||
|
|
||||||
|
// A struct that contains information for presenting a notifier in a settings
|
||||||
|
// panel.
|
||||||
|
struct NotifierUiData {
|
||||||
|
// The notifier (e.g. an extension).
|
||||||
|
message_center.mojom.NotifierId notifier_id;
|
||||||
|
|
||||||
|
// The user-visible name of the notifier (e.g. an extension's name).
|
||||||
|
mojo_base.mojom.String16 name;
|
||||||
|
|
||||||
|
// True if notifications from the notifier are presently enabled.
|
||||||
|
bool enabled;
|
||||||
|
|
||||||
|
// True if the setting is enforced by administrator and the user can't change.
|
||||||
|
bool enforced;
|
||||||
|
|
||||||
|
// An icon displayed next to the name.
|
||||||
|
gfx.mojom.ImageSkia? icon;
|
||||||
|
};
|
||||||
|
|
||||||
|
// The message center controller funnels notification requests from the client
|
||||||
|
// to the MessageCenter.
|
||||||
|
interface AshMessageCenterController {
|
||||||
|
SetClient(associated AshMessageCenterClient client);
|
||||||
|
|
||||||
|
// Sets the ARC notification instance.
|
||||||
|
SetArcNotificationsInstance(arc.mojom.NotificationsInstance instance);
|
||||||
|
|
||||||
|
// Shows a notification. |display_token| will be used to reference this
|
||||||
|
// notification for AshMessageCenterClient::Close().
|
||||||
|
ShowClientNotification(message_center.mojom.Notification notification,
|
||||||
|
mojo_base.mojom.UnguessableToken display_token);
|
||||||
|
|
||||||
|
// Closes a notification by the notification ID.
|
||||||
|
CloseClientNotification(string id);
|
||||||
|
|
||||||
|
UpdateNotifierIcon(message_center.mojom.NotifierId notifier_id,
|
||||||
|
gfx.mojom.ImageSkia icon);
|
||||||
|
|
||||||
|
NotifierEnabledChanged(message_center.mojom.NotifierId notifier_id,
|
||||||
|
bool enabled);
|
||||||
|
|
||||||
|
// Gets a list of all the notifications in the message center.
|
||||||
|
GetActiveNotifications() =>
|
||||||
|
(array<message_center.mojom.Notification> notifications);
|
||||||
|
|
||||||
|
// Changes the quiet mode state in the message center.
|
||||||
|
SetQuietMode(bool enabled);
|
||||||
|
};
|
||||||
|
|
||||||
|
// The message center client interface mimics
|
||||||
|
// message_center::NotificationDelegate. The ID strings match the id passed in
|
||||||
|
// |notification| in ShowClientNotification and the format of the ID is up to
|
||||||
|
// the client.
|
||||||
|
interface AshMessageCenterClient {
|
||||||
|
// Called when a notification previously displayed by the client is closed.
|
||||||
|
HandleNotificationClosed(mojo_base.mojom.UnguessableToken display_token,
|
||||||
|
bool by_user);
|
||||||
|
|
||||||
|
// Called when the body of a notification is clicked.
|
||||||
|
HandleNotificationClicked(string id);
|
||||||
|
|
||||||
|
// Called when a notification that has buttons (e.g., "Learn more") receives a
|
||||||
|
// click on one of the buttons. |reply| is a user-provided string for cases
|
||||||
|
// where the button had a text input field attached to it.
|
||||||
|
HandleNotificationButtonClicked(string id, int32 button_index,
|
||||||
|
mojo_base.mojom.String16? reply);
|
||||||
|
|
||||||
|
// Called when a notification's settings button has been pressed (and the
|
||||||
|
// handler is SettingsButtonHandler::DELEGATE).
|
||||||
|
HandleNotificationSettingsButtonClicked(string id);
|
||||||
|
|
||||||
|
// Called when a notification has been disabled (via inline settings).
|
||||||
|
DisableNotification(string id);
|
||||||
|
|
||||||
|
// Called when a user enables or disables notifications from the given
|
||||||
|
// notifier.
|
||||||
|
SetNotifierEnabled(message_center.mojom.NotifierId notifier_id, bool enabled);
|
||||||
|
|
||||||
|
// Asks the client for a list of notifiers and associated UI information to be
|
||||||
|
// displayed in a settings panel.
|
||||||
|
GetNotifierList() => (array<NotifierUiData> notifiers);
|
||||||
|
|
||||||
|
// Gets ARC app id from a given package name.
|
||||||
|
GetArcAppIdByPackageName(string package_name) => (string app_id);
|
||||||
|
|
||||||
|
// Show the lockscreen notification setting on the Chrome OS setting.
|
||||||
|
ShowLockScreenNotificationSettings();
|
||||||
|
};
|
125
src/ash/public/interfaces/assistant_controller.mojom
Normal file
125
src/ash/public/interfaces/assistant_controller.mojom
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "chromeos/services/assistant/public/mojom/assistant.mojom";
|
||||||
|
import "ui/gfx/geometry/mojo/geometry.mojom";
|
||||||
|
import "mojo/public/mojom/base/time.mojom";
|
||||||
|
|
||||||
|
// Interface to AssistantController which is owned by Shell in Ash. This is
|
||||||
|
// typically used by the Assistant service to provide the controller with an
|
||||||
|
// interface to itself, as well as by the Assistant client in chrome/browser to
|
||||||
|
// provide interfaces to delegates which depend on browser.
|
||||||
|
interface AssistantController {
|
||||||
|
// Provides a reference to the underlying |assistant| service.
|
||||||
|
SetAssistant(chromeos.assistant.mojom.Assistant assistant);
|
||||||
|
|
||||||
|
// Opens Google Assistant settings.
|
||||||
|
OpenAssistantSettings();
|
||||||
|
|
||||||
|
// Show speaker id enrollment flow.
|
||||||
|
StartSpeakerIdEnrollmentFlow();
|
||||||
|
|
||||||
|
// Send Assistant feedback to Assistant server. If |pii_allowed| is
|
||||||
|
// true then the user gives permission to attach Assistant debug info.
|
||||||
|
// |feedback_description| is user's feedback input.
|
||||||
|
SendAssistantFeedback(
|
||||||
|
bool pii_allowed,
|
||||||
|
string feedback_description,
|
||||||
|
string screenshot_png);
|
||||||
|
|
||||||
|
// Provides a reference to DeviceActions service.
|
||||||
|
SetDeviceActions(chromeos.assistant.mojom.DeviceActions device_actions);
|
||||||
|
};
|
||||||
|
|
||||||
|
enum AssistantTimerState {
|
||||||
|
kUnknown,
|
||||||
|
// The timer is scheduled to fire at some future date.
|
||||||
|
kScheduled,
|
||||||
|
// The timer will not fire but is kept in the queue of scheduled events;
|
||||||
|
// it can be resumed after which it will fire in |remaining_duration_ms|.
|
||||||
|
kPaused,
|
||||||
|
// The timer has fired. In the simplest case this means the timer has
|
||||||
|
// begun ringing.
|
||||||
|
kFired,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct AssistantTimer {
|
||||||
|
string timer_id;
|
||||||
|
|
||||||
|
// The current state of this timer.
|
||||||
|
AssistantTimerState state;
|
||||||
|
|
||||||
|
// TODO(llin): Add more timer data.
|
||||||
|
};
|
||||||
|
|
||||||
|
// Assistant alarm/timer event type.
|
||||||
|
// Currently, the AlarmTimerManager maintains only one firing alarm/timer,
|
||||||
|
// the previous one will be dismissed if the second one firing.
|
||||||
|
enum AssistantAlarmTimerEventType {
|
||||||
|
kTimer
|
||||||
|
// TODO(llin): Add alarm event type.
|
||||||
|
};
|
||||||
|
|
||||||
|
union AlarmTimerData {
|
||||||
|
AssistantTimer timer_data;
|
||||||
|
// TODO(llin): Add alarm data.
|
||||||
|
};
|
||||||
|
|
||||||
|
// A composite struct that will hold exactly one alarm or timer.
|
||||||
|
struct AssistantAlarmTimerEvent {
|
||||||
|
AssistantAlarmTimerEventType type;
|
||||||
|
|
||||||
|
AlarmTimerData? data;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface to the AssistantAlarmTimerController which is owned by the
|
||||||
|
// AssistantController. Currently used by the Assistant service to notify Ash
|
||||||
|
// of changes to the underlying alarm/timer state in LibAssistant.
|
||||||
|
interface AssistantAlarmTimerController {
|
||||||
|
// Invoked when a timer has started sounding.
|
||||||
|
OnTimerSoundingStarted();
|
||||||
|
|
||||||
|
// Invoked when a timer has finished sounding.
|
||||||
|
OnTimerSoundingFinished();
|
||||||
|
|
||||||
|
// Invoked when an alarm/timer state changed. No alarm/timer is ringing if
|
||||||
|
// |event| is nullptr.
|
||||||
|
OnAlarmTimerStateChanged(AssistantAlarmTimerEvent? event);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface to the AssistantNotificationController which is owned by the
|
||||||
|
// AssistantController. Currently used by the Assistant service to modify
|
||||||
|
// Assistant notification state in Ash in response to LibAssistant events.
|
||||||
|
interface AssistantNotificationController {
|
||||||
|
// Requests that the specified |notification| be added or updated. If the
|
||||||
|
// |client_id| for |notification| matches that of an existing notification,
|
||||||
|
// an update will occur. Otherwise, a new notification will be added.
|
||||||
|
AddOrUpdateNotification(
|
||||||
|
chromeos.assistant.mojom.AssistantNotification notification);
|
||||||
|
|
||||||
|
// Requests that the notification uniquely identified by |id| be removed. If
|
||||||
|
// |from_server| is true the request to remove was initiated by the server.
|
||||||
|
RemoveNotificationById(string id, bool from_server);
|
||||||
|
|
||||||
|
// Requests that all notifications associated with the given |grouping_key|
|
||||||
|
// be removed. If |from_server| is true the request to remove was initiated
|
||||||
|
// by the server.
|
||||||
|
RemoveNotificationByGroupingKey(string grouping_key, bool from_server);
|
||||||
|
|
||||||
|
// Requests that all notifications be removed. If |from_server| is true the
|
||||||
|
// request was initiated by the server.
|
||||||
|
RemoveAllNotifications(bool from_server);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface to the AssistantScreenContextController which is owned by the
|
||||||
|
// AssistantController. Currently used by the Assistant service to request
|
||||||
|
// screenshots.
|
||||||
|
interface AssistantScreenContextController {
|
||||||
|
// Requests a screenshot of the region enclosed by |rect| and returns the
|
||||||
|
// screenshot encoded in JPEG format. If |rect| is empty, it returns a
|
||||||
|
// fullscreen screenshot.
|
||||||
|
RequestScreenshot(gfx.mojom.Rect rect) => (array<uint8> screenshot);
|
||||||
|
};
|
27
src/ash/public/interfaces/assistant_volume_control.mojom
Normal file
27
src/ash/public/interfaces/assistant_volume_control.mojom
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// Interface to control system volume through Ash.
|
||||||
|
interface AssistantVolumeControl {
|
||||||
|
// Sets system volume to |volume|, which is between 0 - 100.
|
||||||
|
SetVolume(int32 volume, bool user_initiated);
|
||||||
|
|
||||||
|
// Sets mute state to |muted|.
|
||||||
|
SetMuted(bool muted);
|
||||||
|
|
||||||
|
// Adds volume observer. The observer will be immediately notified of volume
|
||||||
|
// and mute status when added.
|
||||||
|
AddVolumeObserver(VolumeObserver observer);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Observes volume state changes.
|
||||||
|
interface VolumeObserver {
|
||||||
|
// Called when volume is updated.
|
||||||
|
OnVolumeChanged(int32 volume);
|
||||||
|
|
||||||
|
// Called when mute state changed.
|
||||||
|
OnMuteStateChanged(bool muted);
|
||||||
|
};
|
7
src/ash/public/interfaces/constants.mojom
Normal file
7
src/ash/public/interfaces/constants.mojom
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
const string kServiceName = "ash";
|
284
src/ash/public/interfaces/cros_display_config.mojom
Normal file
284
src/ash/public/interfaces/cros_display_config.mojom
Normal file
@ -0,0 +1,284 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "ui/gfx/geometry/mojo/geometry.mojom";
|
||||||
|
import "ui/display/mojo/display.mojom";
|
||||||
|
|
||||||
|
// All points, bounds, and insets are in display pixels unless otherwise
|
||||||
|
// sepcified.
|
||||||
|
|
||||||
|
// SetDisplayLayoutInfo or SetDisplayProperties result.
|
||||||
|
enum DisplayConfigResult {
|
||||||
|
kSuccess = 0,
|
||||||
|
kInvalidOperationError,
|
||||||
|
kInvalidDisplayIdError,
|
||||||
|
kUnifiedNotEnabledError,
|
||||||
|
kPropertyValueOutOfRangeError,
|
||||||
|
kNotSupportedOnInternalDisplayError,
|
||||||
|
kNegativeValueError,
|
||||||
|
kSetDisplayModeError,
|
||||||
|
kInvalidDisplayLayoutError,
|
||||||
|
kMirrorModeSingleDisplayError,
|
||||||
|
kMirrorModeSourceIdError,
|
||||||
|
kMirrorModeDestIdError,
|
||||||
|
kCalibrationNotAvailableError,
|
||||||
|
kCalibrationNotStartedError,
|
||||||
|
kCalibrationInProgressError,
|
||||||
|
kCalibrationInvalidDataError,
|
||||||
|
kCalibrationFailedError,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Describes how the displays are laid out.
|
||||||
|
enum DisplayLayoutMode {
|
||||||
|
// In normal mode displays are laid out as described by
|
||||||
|
// DisplayLayoutInfo.layouts.
|
||||||
|
kNormal = 0,
|
||||||
|
// In unified desktop mode, a single desktop will be stretched across all
|
||||||
|
// available displays.
|
||||||
|
kUnified,
|
||||||
|
// In mirrored mode, the display defined by DisplayLayoutInfo.mirrorSourceId
|
||||||
|
// will be mirrored in the displays defined by
|
||||||
|
// DisplayLayoutInfo.mirrorDestinationIds, or in all other displays if
|
||||||
|
// mirrorDestinationIds is empty.
|
||||||
|
kMirrored
|
||||||
|
};
|
||||||
|
|
||||||
|
// Describes a display edge.
|
||||||
|
enum DisplayLayoutPosition {
|
||||||
|
kTop = 0,
|
||||||
|
kRight,
|
||||||
|
kBottom,
|
||||||
|
kLeft
|
||||||
|
};
|
||||||
|
|
||||||
|
// Describes an overscan or touch calibration operation.
|
||||||
|
enum DisplayConfigOperation {
|
||||||
|
kStart = 0,
|
||||||
|
kAdjust,
|
||||||
|
kReset,
|
||||||
|
kComplete,
|
||||||
|
kShowNative,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Describes who initiated configuration change.
|
||||||
|
enum DisplayConfigSource {
|
||||||
|
kUser = 0,
|
||||||
|
kPolicy
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines a pair of display + touch points used for touch calibration.
|
||||||
|
struct TouchCalibrationPair {
|
||||||
|
// The coordinates of the display point.
|
||||||
|
gfx.mojom.Point display_point;
|
||||||
|
// The coordinates of the touch point corresponding to the display point.
|
||||||
|
gfx.mojom.Point touch_point;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines the data required for touch calibration.
|
||||||
|
struct TouchCalibration {
|
||||||
|
// Must contain exactly four pairs of touch calibration points.
|
||||||
|
array<TouchCalibrationPair> pairs;
|
||||||
|
// Width and height of the display area when the touch calibration was
|
||||||
|
// performed.
|
||||||
|
gfx.mojom.Size bounds;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines the layout of a single display.
|
||||||
|
struct DisplayLayout {
|
||||||
|
// The unique identifier of the display.
|
||||||
|
string id;
|
||||||
|
// The unique identifier of the parent display. Empty for the root display.
|
||||||
|
string parent_id;
|
||||||
|
// The edge of the display that is shared with the parent display. Ignored for
|
||||||
|
// the root display.
|
||||||
|
DisplayLayoutPosition position;
|
||||||
|
// The offset of the display along the connected edge. 0 indicates that
|
||||||
|
// the topmost or leftmost corner is aligned.
|
||||||
|
int32 offset;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines the layout mode and details.
|
||||||
|
struct DisplayLayoutInfo {
|
||||||
|
// The layout mode to use, see DisplayLayoutMode for details.
|
||||||
|
DisplayLayoutMode layout_mode;
|
||||||
|
// Ignored if If layout_mode is not kMirrored. Otherwise, if provided,
|
||||||
|
// specifies the unique identifier of the source display for mirroring. If
|
||||||
|
// not provided, mirror_destination_ids will be ignored and default ('normal')
|
||||||
|
// mirrored mode will be enabled.
|
||||||
|
string? mirror_source_id;
|
||||||
|
// Ignored if layout_mode is not kMirrored. Otherwise, if provided, specifies
|
||||||
|
// the unique identifiers of the displays to mirror the source display. If not
|
||||||
|
// provided or empty, all displays will mirror the source display.
|
||||||
|
array<string>? mirror_destination_ids;
|
||||||
|
// An array of layouts describing a directed graph of displays. Required if
|
||||||
|
// layout_mode is kNormal or kMirrored and not all displays are mirrored
|
||||||
|
// ('mixed' mode). Ignored if layout_mode is kUnified.
|
||||||
|
array<DisplayLayout>? layouts;
|
||||||
|
};
|
||||||
|
|
||||||
|
// EDID extracted parameters. Field description refers to "VESA ENHANCED
|
||||||
|
// EXTENDED DISPLAY IDENTIFICATION DATA STANDARD (Defines EDID Structure
|
||||||
|
// Version 1, Revision 4)" Release A, Revision 2 September 25, 2006.
|
||||||
|
// https://www.vesa.org/vesa-standards
|
||||||
|
struct Edid {
|
||||||
|
// Three character manufacturer code, Sec. 3.4.1 page 21.
|
||||||
|
string manufacturer_id;
|
||||||
|
// Two byte manufacturer-assigned code, Sec. 3.4.2 page 21.
|
||||||
|
string product_id;
|
||||||
|
// Year of manufacture. Sec. 3.4.4 page 22.
|
||||||
|
int32 year_of_manufacture;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Struct wrapper so that the property can be optional.
|
||||||
|
struct DisplayRotation {
|
||||||
|
display.mojom.Rotation rotation;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines the properties for a display mode, i.e. a valid size and scale.
|
||||||
|
struct DisplayMode {
|
||||||
|
// The display mode size in device independent (user visible) pixels.
|
||||||
|
gfx.mojom.Size size;
|
||||||
|
// The display mode size in native pixels.
|
||||||
|
gfx.mojom.Size size_in_native_pixels;
|
||||||
|
// The display mode device scale factor.
|
||||||
|
double device_scale_factor;
|
||||||
|
// The display mode refresh rate in hertz.
|
||||||
|
double refresh_rate;
|
||||||
|
// True if the mode is the display's native mode.
|
||||||
|
bool is_native;
|
||||||
|
// True if the mode is interlaced.
|
||||||
|
bool is_interlaced;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines the properties of an individual display, returned by
|
||||||
|
// GetDisplayLayoutInfo.
|
||||||
|
struct DisplayUnitInfo {
|
||||||
|
// The unique identifier of the display.
|
||||||
|
string id;
|
||||||
|
// The user-friendly name (e.g. "Acme LCD monitor").
|
||||||
|
string name;
|
||||||
|
// EDID properties when available.
|
||||||
|
Edid? edid;
|
||||||
|
// True if this is the primary display.
|
||||||
|
bool is_primary;
|
||||||
|
// True if this is an internal display.
|
||||||
|
bool is_internal;
|
||||||
|
// True if this display is enabled.
|
||||||
|
bool is_enabled;
|
||||||
|
// True when the display is in tablet mode.
|
||||||
|
bool is_tablet_mode;
|
||||||
|
// True if this display has a touch input device associated with it.
|
||||||
|
bool has_touch_support;
|
||||||
|
// True if this display has an accelerometer associated with it.
|
||||||
|
bool has_accelerometer_support;
|
||||||
|
// The number of pixels per inch along the x-axis.
|
||||||
|
double dpi_x;
|
||||||
|
// The number of pixels per inch along the y-axis.
|
||||||
|
double dpi_y;
|
||||||
|
// The display's clockwise rotation.
|
||||||
|
display.mojom.Rotation rotation;
|
||||||
|
// The display's logical bounds.
|
||||||
|
gfx.mojom.Rect bounds;
|
||||||
|
// The display's ovserscan insets within its screen's bounds.
|
||||||
|
gfx.mojom.Insets overscan;
|
||||||
|
// The usable work area of the display within the display bounds. Excludes
|
||||||
|
// areas of the display reserved for the OS, e.g. the taskbar and launcher.
|
||||||
|
gfx.mojom.Rect work_area;
|
||||||
|
// The index of the selected display mode.
|
||||||
|
int32 selected_display_mode_index;
|
||||||
|
// The list of available display modes.
|
||||||
|
array<DisplayMode> available_display_modes;
|
||||||
|
// The ratio between the display's current and default zoom. i.e. 1.0 is
|
||||||
|
// is equivalent to 100% zoom, and value 1.5 is equivalent to 150% zoom.
|
||||||
|
double display_zoom_factor;
|
||||||
|
// The list of allowed zoom factor values for the display.
|
||||||
|
array<double> available_display_zoom_factors;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Properties for configuring an individual display, used in
|
||||||
|
// SetDisplayProperties.
|
||||||
|
struct DisplayConfigProperties {
|
||||||
|
// If true, makes the display primary. No-op if set to false.
|
||||||
|
bool set_primary;
|
||||||
|
// If provided, sets the display's overscan insets to the provided value.
|
||||||
|
// Note: overscan values may not be negative or larger than a half of the
|
||||||
|
// screen's size. Overscan cannot be changed on the internal monitor.
|
||||||
|
gfx.mojom.Insets? overscan;
|
||||||
|
// If provided updates the display's rotation.
|
||||||
|
DisplayRotation? rotation;
|
||||||
|
// If provided, updates the display's logical bounds origin. Note: when
|
||||||
|
// updating the display origin, some constraints will be applied. so the final
|
||||||
|
// bounds origin may be different than the one set. The actual bounds will be
|
||||||
|
// reflected in DisplayUnitInfo. Cannot be changed on the primary display (or
|
||||||
|
// if set_primary is true).
|
||||||
|
gfx.mojom.Point? bounds_origin;
|
||||||
|
// If non zero, updates the zoom associated with the display. This zoom
|
||||||
|
// performs relayout and repaint thus resulting in a better quality zoom than
|
||||||
|
// just performing a pixel by pixel stretch enlargement.
|
||||||
|
double display_zoom_factor;
|
||||||
|
// Optional DisplayMode properties to set. This should match one of the
|
||||||
|
// modes listed in DisplayUnitInfo.available_display_modes. Other custom
|
||||||
|
// modes may or may not be valid.
|
||||||
|
DisplayMode? display_mode;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface for configuring displays in Chrome OS. Currently this is
|
||||||
|
// implemented in Ash through classes owned by ash::Shell, but the interface
|
||||||
|
// should not have any Ash specific dependencies.
|
||||||
|
interface CrosDisplayConfigController {
|
||||||
|
// Observers are notified when the display layout or any display properties
|
||||||
|
// change.
|
||||||
|
AddObserver(associated CrosDisplayConfigObserver observer);
|
||||||
|
|
||||||
|
// Returns the display layout info, including the list of layouts.
|
||||||
|
GetDisplayLayoutInfo() => (DisplayLayoutInfo info);
|
||||||
|
|
||||||
|
// Sets the layout mode, mirroring, and layouts. Returns kSuccess if the
|
||||||
|
// layout is valid or an error value otherwise.
|
||||||
|
SetDisplayLayoutInfo(DisplayLayoutInfo info) => (DisplayConfigResult result);
|
||||||
|
|
||||||
|
// Returns the properties for all displays. If |single_unified| is true, a
|
||||||
|
// single display will be returned if the display layout is in unifed mode.
|
||||||
|
GetDisplayUnitInfoList(bool single_unified) =>
|
||||||
|
(array<DisplayUnitInfo> info_list);
|
||||||
|
|
||||||
|
// Sets |properties| for individual display with identifier |id|. |source|
|
||||||
|
// should describe who initiated the change. Returns Success if the properties
|
||||||
|
// are valid or an error value otherwise.
|
||||||
|
SetDisplayProperties(string id,
|
||||||
|
DisplayConfigProperties properties,
|
||||||
|
DisplayConfigSource source) =>
|
||||||
|
(DisplayConfigResult result);
|
||||||
|
|
||||||
|
// Enables or disables unified desktop mode. If the current display mode is
|
||||||
|
// kMirrored the mode will not be changed, if it is kNormal then the mode will
|
||||||
|
// be set to kUnified.
|
||||||
|
SetUnifiedDesktopEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Starts, updates, completes, or resets overscan calibration for the display
|
||||||
|
// with identifier |display_id|. If |op| is kAdjust, |delta| describes the
|
||||||
|
// amount to change the overscan value. Runs the callback after performing the
|
||||||
|
// operation or on error.
|
||||||
|
OverscanCalibration(string display_id,
|
||||||
|
DisplayConfigOperation op,
|
||||||
|
gfx.mojom.Insets? delta) => (DisplayConfigResult result);
|
||||||
|
|
||||||
|
// Starts, completes, or resets touch calibration for the display with
|
||||||
|
// identifier |display_id|. If |op| is kShowNative shows the native
|
||||||
|
// calibration UI. Runs the callback after performing the operation or on
|
||||||
|
// error.
|
||||||
|
TouchCalibration(string display_id,
|
||||||
|
DisplayConfigOperation op,
|
||||||
|
TouchCalibration? calibration) =>
|
||||||
|
(DisplayConfigResult result);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface for clients needing to be informed when the display configuration
|
||||||
|
// changes.
|
||||||
|
interface CrosDisplayConfigObserver {
|
||||||
|
// Called any time the display configuration changes.
|
||||||
|
OnDisplayConfigChanged();
|
||||||
|
};
|
43
src/ash/public/interfaces/event_rewriter_controller.mojom
Normal file
43
src/ash/public/interfaces/event_rewriter_controller.mojom
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "ui/events/mojo/event.mojom";
|
||||||
|
|
||||||
|
// Allows a client to implement spoken feedback features; used for ChromeVox.
|
||||||
|
interface SpokenFeedbackEventRewriterDelegate {
|
||||||
|
// Used to send key events to the ChromeVox extension. |capture| is true if
|
||||||
|
// the rewriter discarded the event, false if the rewriter continues event
|
||||||
|
// propagation.
|
||||||
|
DispatchKeyEventToChromeVox(ui.mojom.Event event, bool capture);
|
||||||
|
|
||||||
|
// Used to send mouse events to the ChromeVox extension.
|
||||||
|
DispatchMouseEventToChromeVox(ui.mojom.Event event);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Allows clients to toggle some event rewriting behavior.
|
||||||
|
interface EventRewriterController {
|
||||||
|
// Enables the KeyboardDrivenEventRewriter, which is disabled by default.
|
||||||
|
// This only applies when the user is on the login screen.
|
||||||
|
SetKeyboardDrivenEventRewriterEnabled(bool enabled);
|
||||||
|
|
||||||
|
// If true, Shift + Arrow keys are rewritten to Tab/Shift-Tab keys.
|
||||||
|
// This only applies when the KeyboardDrivenEventRewriter is active.
|
||||||
|
SetArrowToTabRewritingEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Set the delegate used by the spoken feedback event rewriter.
|
||||||
|
SetSpokenFeedbackEventRewriterDelegate(
|
||||||
|
SpokenFeedbackEventRewriterDelegate delegate);
|
||||||
|
|
||||||
|
// Continue dispatch of key events that were unhandled by ChromeVox.
|
||||||
|
// TODO(crbug.com/839541): ChromeVox should not repost unhandled events.
|
||||||
|
OnUnhandledSpokenFeedbackEvent(ui.mojom.Event event);
|
||||||
|
|
||||||
|
// Discards key events and sends to spoken feedback when true.
|
||||||
|
CaptureAllKeysForSpokenFeedback(bool capture);
|
||||||
|
|
||||||
|
// Sends mouse events to ChromeVox when true.
|
||||||
|
SetSendMouseEventsToDelegate(bool value);
|
||||||
|
};
|
104
src/ash/public/interfaces/ime_controller.mojom
Normal file
104
src/ash/public/interfaces/ime_controller.mojom
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "ash/public/interfaces/ime_info.mojom";
|
||||||
|
import "mojo/public/mojom/base/string16.mojom";
|
||||||
|
import "ui/base/ime/chromeos/public/interfaces/ime_keyset.mojom";
|
||||||
|
import "ui/gfx/geometry/mojo/geometry.mojom";
|
||||||
|
|
||||||
|
// Interface for ash client (e.g. Chrome) to send input method info to ash.
|
||||||
|
interface ImeController {
|
||||||
|
// Sets the client interface.
|
||||||
|
SetClient(ImeControllerClient client);
|
||||||
|
|
||||||
|
// Updates the cached IME information and refreshes the IME menus.
|
||||||
|
// |current_ime_id| is empty when there is no active IME yet.
|
||||||
|
RefreshIme(string current_ime_id,
|
||||||
|
array<ImeInfo> available_imes,
|
||||||
|
array<ImeMenuItem> menu_items);
|
||||||
|
|
||||||
|
// Shows an icon in the IME menu indicating that IMEs are controlled by device
|
||||||
|
// policy.
|
||||||
|
SetImesManagedByPolicy(bool managed);
|
||||||
|
|
||||||
|
// Shows the IME menu on the shelf instead of inside the system tray menu.
|
||||||
|
// Users with multiple IMEs that have multiple configurable properties (e.g.
|
||||||
|
// some Chinese IMEs) prefer this to keeping the IME menu under the primary
|
||||||
|
// system tray menu.
|
||||||
|
ShowImeMenuOnShelf(bool show);
|
||||||
|
|
||||||
|
// Report caps lock state changes from chrome (which is the source of truth)
|
||||||
|
// to the tray.
|
||||||
|
UpdateCapsLockState(bool enabled);
|
||||||
|
|
||||||
|
// Report keyboard layout changes from chrome (which is the source of truth)
|
||||||
|
// This is also called when a connection is first established between
|
||||||
|
// ImeController and ImeControllerClient.
|
||||||
|
// The layout name is a XKB keyboard layout name (e.g. "us").
|
||||||
|
OnKeyboardLayoutNameChanged(string layout_name);
|
||||||
|
|
||||||
|
// Report the enabled state of the various extra input options (currently
|
||||||
|
// emoji, handwriting, and voice input). |is_extra_input_options_enabled| set
|
||||||
|
// to false will disable all extra input option UI regardless of the enabled
|
||||||
|
// state of the individual options (which will be ingored).
|
||||||
|
SetExtraInputOptionsEnabledState(bool is_extra_input_options_enabled,
|
||||||
|
bool is_emoji_enabled,
|
||||||
|
bool is_handwriting_enabled,
|
||||||
|
bool is_voice_enabled);
|
||||||
|
|
||||||
|
// Show the mode indicator view (e.g. a bubble with "DV" for Dvorak).
|
||||||
|
// The view fades out after a delay and close itself.
|
||||||
|
// The anchor bounds is in the universal screen coordinates in DIP.
|
||||||
|
ShowModeIndicator(gfx.mojom.Rect anchor_bounds,
|
||||||
|
mojo_base.mojom.String16 ime_short_name);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface for ash to send input method requests to its client (e.g. Chrome).
|
||||||
|
interface ImeControllerClient {
|
||||||
|
// Switches to the next input method. Does nothing if only one input method
|
||||||
|
// is installed.
|
||||||
|
SwitchToNextIme();
|
||||||
|
|
||||||
|
// Switches to the last used input method. Does nothing if only one input
|
||||||
|
// method is installed.
|
||||||
|
SwitchToLastUsedIme();
|
||||||
|
|
||||||
|
// Switches to an input method by |id|. Does nothing if the input method is
|
||||||
|
// not installed. The ID is usually the output of a call like
|
||||||
|
// chromeos::extension_ime_util::GetInputMethodIDByEngineID("xkb:jp::jpn"),
|
||||||
|
// see that function for details. Shows a bubble with the input method short
|
||||||
|
// name when |show_message| is true.
|
||||||
|
SwitchImeById(string id, bool show_message);
|
||||||
|
|
||||||
|
// Activates an input method menu item. The |key| must be a value from the
|
||||||
|
// ImeMenuItems provided via RefreshIme. Does nothing if the |key| is invalid.
|
||||||
|
ActivateImeMenuItem(string key);
|
||||||
|
|
||||||
|
// When the caps lock state change originates from the tray (i.e. clicking the
|
||||||
|
// caps lock toggle from the settings menu from the caps lock icon), from an
|
||||||
|
// accelerator (e.g. pressing Alt + Search), or from the debug UI (i.e.
|
||||||
|
// toggling the caps lock button), propagate the change to the client without
|
||||||
|
// sending a change notification back.
|
||||||
|
// TODO(crbug/759435): Ideally this interaction should only be to disable the
|
||||||
|
// caps lock.
|
||||||
|
SetCapsLockEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Notifies the mirroring state change to the client where IME lives (e.g.
|
||||||
|
// Chrome), so that the IME can behave according to the state.
|
||||||
|
UpdateMirroringState(bool enabled);
|
||||||
|
|
||||||
|
// Notifies the casting state change to the client where IME lives (e.g.
|
||||||
|
// Chrome), so that the IME can behave according to the state.
|
||||||
|
UpdateCastingState(bool enabled);
|
||||||
|
|
||||||
|
// Overrides the keyboard keyset (emoji, handwriting or voice). If keyset is
|
||||||
|
// 'kNone', we switch to the default keyset. Because this is asynchronous,
|
||||||
|
// any code that needs the keyset to be updated first must use the callback.
|
||||||
|
OverrideKeyboardKeyset(chromeos.input_method.mojom.ImeKeyset keyset) => ();
|
||||||
|
|
||||||
|
// Show the current mode.
|
||||||
|
ShowModeIndicator();
|
||||||
|
};
|
40
src/ash/public/interfaces/ime_info.mojom
Normal file
40
src/ash/public/interfaces/ime_info.mojom
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "mojo/public/mojom/base/string16.mojom";
|
||||||
|
|
||||||
|
// Metadata about an installed input method.
|
||||||
|
struct ImeInfo {
|
||||||
|
// True if the IME is a third-party extension.
|
||||||
|
bool third_party;
|
||||||
|
|
||||||
|
// ID that identifies the IME (e.g., "t:latn-post", "pinyin", "hangul").
|
||||||
|
string id;
|
||||||
|
|
||||||
|
// Long name of the IME, which is used as the user-visible name.
|
||||||
|
mojo_base.mojom.String16 name;
|
||||||
|
|
||||||
|
// Medium name of the IME, which is the same as the short name in most cases.
|
||||||
|
mojo_base.mojom.String16 medium_name;
|
||||||
|
|
||||||
|
// UI indicator for the IME (e.g., "US"). If the IME has no indicator, uses
|
||||||
|
// the first two characters in its preferred keyboard layout or language code
|
||||||
|
// (e.g., "ko", "ja", "en-US").
|
||||||
|
mojo_base.mojom.String16 short_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
// A menu item that sets an IME configuration property.
|
||||||
|
struct ImeMenuItem {
|
||||||
|
// True if the item is selected / enabled.
|
||||||
|
bool checked;
|
||||||
|
|
||||||
|
// The key which identifies the property controlled by the menu item, e.g.
|
||||||
|
// "InputMode.HalfWidthKatakana".
|
||||||
|
string key;
|
||||||
|
|
||||||
|
// The item label, e.g. "Switch to full punctuation mode" or "Hiragana".
|
||||||
|
mojo_base.mojom.String16 label;
|
||||||
|
};
|
40
src/ash/public/interfaces/keyboard_config.mojom
Normal file
40
src/ash/public/interfaces/keyboard_config.mojom
Normal file
@ -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.
|
||||||
|
|
||||||
|
module keyboard.mojom;
|
||||||
|
|
||||||
|
// Determines how the keyboard overscroll enabled state is set.
|
||||||
|
enum KeyboardOverscrollBehavior {
|
||||||
|
// Use the default behavior.
|
||||||
|
kDefault,
|
||||||
|
|
||||||
|
// Enable keyboard overscroll if allowed.
|
||||||
|
kEnabled,
|
||||||
|
|
||||||
|
// Do not enable keyboard overscroll.
|
||||||
|
kDisabled,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct KeyboardConfig {
|
||||||
|
// Whether the virtual keyboard can provide auto-complete.
|
||||||
|
bool auto_complete = true;
|
||||||
|
|
||||||
|
// Whether the virtual keyboard can provide auto-correct.
|
||||||
|
bool auto_correct = true;
|
||||||
|
|
||||||
|
// Whether the virtual keyboard can provide auto-capitalization.
|
||||||
|
bool auto_capitalize = true;
|
||||||
|
|
||||||
|
// Whether the virtual keyboard can provide input via handwriting recognition.
|
||||||
|
bool handwriting = true;
|
||||||
|
|
||||||
|
// Whether the virtual keyboard can provide spell-check.
|
||||||
|
bool spell_check = true;
|
||||||
|
|
||||||
|
// Whether the virtual keyboard can provide voice input.
|
||||||
|
bool voice_input = true;
|
||||||
|
|
||||||
|
// Whether overscroll is currently allowed by the active keyboard container.
|
||||||
|
KeyboardOverscrollBehavior overscroll_behavior = kDefault;
|
||||||
|
};
|
119
src/ash/public/interfaces/keyboard_controller.mojom
Normal file
119
src/ash/public/interfaces/keyboard_controller.mojom
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "ash/public/interfaces/keyboard_config.mojom";
|
||||||
|
import "ash/public/interfaces/keyboard_controller_types.mojom";
|
||||||
|
import "ui/gfx/geometry/mojo/geometry.mojom";
|
||||||
|
|
||||||
|
enum HideReason {
|
||||||
|
// Hide requested by an explicit user action.
|
||||||
|
kUser,
|
||||||
|
|
||||||
|
// Hide requested due to a system event (e.g. because it would interfere with
|
||||||
|
// a menu or other on screen UI).
|
||||||
|
kSystem,
|
||||||
|
};
|
||||||
|
|
||||||
|
interface KeyboardControllerObserver {
|
||||||
|
// Called when a keyboard enable flag changes.
|
||||||
|
OnKeyboardEnableFlagsChanged(array<keyboard.mojom.KeyboardEnableFlag> flags);
|
||||||
|
|
||||||
|
// Called when the keyboard is enabled or disabled. If ReloadKeyboard() is
|
||||||
|
// called or other code enables the keyboard while already enabled, this will
|
||||||
|
// be called twice, once when the keyboard is disabled and again when it is
|
||||||
|
// re-enabled.
|
||||||
|
OnKeyboardEnabledChanged(bool is_enabled);
|
||||||
|
|
||||||
|
// Called when the virtual keyboard configuration changes.
|
||||||
|
OnKeyboardConfigChanged(keyboard.mojom.KeyboardConfig config);
|
||||||
|
|
||||||
|
// Called when the visibility of the virtual keyboard changes, e.g. an input
|
||||||
|
// field is focused or blurred, or the user hides the keyboard.
|
||||||
|
OnKeyboardVisibilityChanged(bool visible);
|
||||||
|
|
||||||
|
// Called when the keyboard bounds change. |screen_bounds| is in screen
|
||||||
|
// coordinates.
|
||||||
|
OnKeyboardVisibleBoundsChanged(gfx.mojom.Rect screen_bounds);
|
||||||
|
|
||||||
|
// Called when the keyboard occluded bounds change. |screen_bounds| is in
|
||||||
|
// screen coordinates.
|
||||||
|
OnKeyboardOccludedBoundsChanged(gfx.mojom.Rect screen_bounds);
|
||||||
|
|
||||||
|
// Signals a request to load the keyboard contents. If the contents are
|
||||||
|
// already loaded, requests a reload. Once the contents have loaded,
|
||||||
|
// KeyboardController.KeyboardContentsLoaded is expected to be called by the
|
||||||
|
// client implementation.
|
||||||
|
OnLoadKeyboardContentsRequested();
|
||||||
|
|
||||||
|
// Called when the UI has been destroyed so that the client can reset the
|
||||||
|
// embedded contents and handle.
|
||||||
|
OnKeyboardUIDestroyed();
|
||||||
|
};
|
||||||
|
|
||||||
|
interface KeyboardController {
|
||||||
|
// Informs the controller that the keyboard contents have loaded.
|
||||||
|
KeyboardContentsLoaded(gfx.mojom.Size size);
|
||||||
|
|
||||||
|
// Retrieves the current keyboard configuration.
|
||||||
|
GetKeyboardConfig() => (keyboard.mojom.KeyboardConfig config);
|
||||||
|
|
||||||
|
// Sets the current keyboard configuration.
|
||||||
|
SetKeyboardConfig(keyboard.mojom.KeyboardConfig config);
|
||||||
|
|
||||||
|
// Returns whether the virtual keyboard has been enabled.
|
||||||
|
IsKeyboardEnabled() => (bool enabled);
|
||||||
|
|
||||||
|
// Sets the provided keyboard enable flag. If the computed enabled state
|
||||||
|
// changes, enables or disables the keyboard to match the new state.
|
||||||
|
SetEnableFlag(keyboard.mojom.KeyboardEnableFlag flag);
|
||||||
|
|
||||||
|
// Clears the provided keyboard enable flag. If the computed enabled state
|
||||||
|
// changes, enables or disables the keyboard to match the new state.
|
||||||
|
ClearEnableFlag(keyboard.mojom.KeyboardEnableFlag flag);
|
||||||
|
|
||||||
|
// Gets the current set of keyboard enable flags.
|
||||||
|
GetEnableFlags() => (array<keyboard.mojom.KeyboardEnableFlag> flags);
|
||||||
|
|
||||||
|
// Reloads the virtual keyboard if it is enabled and the URL has changed, e.g.
|
||||||
|
// the focus has switched from one type of field to another.
|
||||||
|
ReloadKeyboardIfNeeded();
|
||||||
|
|
||||||
|
// Rebuilds (disables and re-enables) the virtual keyboard if it is enabled.
|
||||||
|
// This is used to force a reload of the virtual keyboard when preferences or
|
||||||
|
// other configuration that affects loading the keyboard may have changed.
|
||||||
|
RebuildKeyboardIfEnabled();
|
||||||
|
|
||||||
|
// Returns whether the virtual keyboard is visible.
|
||||||
|
IsKeyboardVisible() => (bool visible);
|
||||||
|
|
||||||
|
// Shows the virtual keyboard on the current display if it is enabled.
|
||||||
|
ShowKeyboard();
|
||||||
|
|
||||||
|
// Hides the virtual keyboard if it is visible.
|
||||||
|
HideKeyboard(HideReason reason);
|
||||||
|
|
||||||
|
// Sets the keyboard container type. If non empty, |target_bounds| provides
|
||||||
|
// the container size. Returns whether the transition succeeded once the
|
||||||
|
// container type changes (or fails to change).
|
||||||
|
SetContainerType(keyboard.mojom.ContainerType container_type,
|
||||||
|
gfx.mojom.Rect? target_bounds) => (bool result);
|
||||||
|
|
||||||
|
// If |locked| is true, the keyboard remains visible even when no window has
|
||||||
|
// input focus.
|
||||||
|
SetKeyboardLocked(bool locked);
|
||||||
|
|
||||||
|
// Sets the regions of the keyboard window that occlude whatever is behind it.
|
||||||
|
SetOccludedBounds(array<gfx.mojom.Rect> bounds);
|
||||||
|
|
||||||
|
// Sets the regions of the keyboard window where events should be handled.
|
||||||
|
SetHitTestBounds(array<gfx.mojom.Rect> bounds);
|
||||||
|
|
||||||
|
// Sets the region of the keyboard window that can be used as a drag handle.
|
||||||
|
SetDraggableArea(gfx.mojom.Rect bounds);
|
||||||
|
|
||||||
|
// Adds a KeyboardControllerObserver.
|
||||||
|
AddObserver(associated KeyboardControllerObserver observer);
|
||||||
|
};
|
52
src/ash/public/interfaces/keyboard_controller_types.mojom
Normal file
52
src/ash/public/interfaces/keyboard_controller_types.mojom
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module keyboard.mojom;
|
||||||
|
|
||||||
|
// Flags that affect whether or not the virtual keyboard should be enabled.
|
||||||
|
// Enabled/Disabled flag pairs are mutually exclusive, but flags from multiple
|
||||||
|
// sources may be set. Precedence is determined by the implementation in
|
||||||
|
// KeyboardController::IsKeyboardEnableRequested.
|
||||||
|
enum KeyboardEnableFlag {
|
||||||
|
// Enabled by policy.
|
||||||
|
kPolicyEnabled,
|
||||||
|
|
||||||
|
// Disabled by policy.
|
||||||
|
kPolicyDisabled,
|
||||||
|
|
||||||
|
// Disabled by the Android keyboard.
|
||||||
|
kAndroidDisabled,
|
||||||
|
|
||||||
|
// Enabled by a first-party extension.
|
||||||
|
kExtensionEnabled,
|
||||||
|
|
||||||
|
// Disabled by a first-party extension.
|
||||||
|
kExtensionDisabled,
|
||||||
|
|
||||||
|
// Enabled by an a11y controller.
|
||||||
|
kAccessibilityEnabled,
|
||||||
|
|
||||||
|
// Enabled by the shelf/launcher controller.
|
||||||
|
kShelfEnabled,
|
||||||
|
|
||||||
|
// Enabled by the touch controller.
|
||||||
|
kTouchEnabled,
|
||||||
|
|
||||||
|
// Enabled via the "--enable-virtual-keyboard" command line switch.
|
||||||
|
// Used for development and debugging.
|
||||||
|
kCommandLineEnabled,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Container types used to set and identify container behavior. Used in UMA
|
||||||
|
// stats gathering, so values should never be changed or reused.
|
||||||
|
enum ContainerType {
|
||||||
|
// Corresponds to a ContainerFullWidthBehavior.
|
||||||
|
kFullWidth = 0,
|
||||||
|
|
||||||
|
// Corresponds to a ContainerFloatingBehavior.
|
||||||
|
kFloating = 1,
|
||||||
|
|
||||||
|
// Corresponds to a ContainerFullscreenBehavior.
|
||||||
|
// kFullscreen = 2, // Deprecated; feature was abandoned.
|
||||||
|
};
|
21
src/ash/public/interfaces/kiosk_next_shell.mojom
Normal file
21
src/ash/public/interfaces/kiosk_next_shell.mojom
Normal file
@ -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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "components/account_id/interfaces/account_id.mojom";
|
||||||
|
|
||||||
|
// Performs browser-side functionality for Kiosk Next, e.g. launching the
|
||||||
|
// KioskNextShell.
|
||||||
|
interface KioskNextShellClient {
|
||||||
|
// Launch the Kiosk Next Shell for the user identified by |account_id|.
|
||||||
|
LaunchKioskNextShell(signin.mojom.AccountId account_id);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Allows Ash and its consumers to interact with Kiosk Next.
|
||||||
|
// These requests are forwarded to the KioskNextShellClient when necessary.
|
||||||
|
interface KioskNextShellController {
|
||||||
|
// Provides a client for dispatching requests.
|
||||||
|
SetClient(KioskNextShellClient client);
|
||||||
|
};
|
34
src/ash/public/interfaces/locale.mojom
Normal file
34
src/ash/public/interfaces/locale.mojom
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "mojo/public/mojom/base/string16.mojom";
|
||||||
|
|
||||||
|
// The locale info to show in the system tray locale detailed view.
|
||||||
|
struct LocaleInfo {
|
||||||
|
// This ISO code of the locale.
|
||||||
|
string iso_code;
|
||||||
|
|
||||||
|
// The display name of the locale.
|
||||||
|
mojo_base.mojom.String16 display_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sent as the response to LocaleUpdateController.OnLocaleChanged().
|
||||||
|
enum LocaleNotificationResult {
|
||||||
|
ACCEPT,
|
||||||
|
REVERT
|
||||||
|
};
|
||||||
|
|
||||||
|
// Used by Chrome to notify locale change events.
|
||||||
|
interface LocaleUpdateController {
|
||||||
|
// When this is called in OOBE, it returnes ACCEPT immediately after invoking
|
||||||
|
// observer callbacks. |current|, |from|, and |to| are ignored in this case.
|
||||||
|
// Otherwise it displays a notification in ash prompting the user whether to
|
||||||
|
// accept a change in the locale. If the user clicks the accept button (or
|
||||||
|
// closes the notification), OnLocaleChange() returns ACCEPT. If the user
|
||||||
|
// clicks the revert button, returns REVERT.
|
||||||
|
OnLocaleChanged(string current, string from, string to)
|
||||||
|
=> (LocaleNotificationResult result);
|
||||||
|
};
|
246
src/ash/public/interfaces/login_screen.mojom
Normal file
246
src/ash/public/interfaces/login_screen.mojom
Normal file
@ -0,0 +1,246 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "chromeos/components/proximity_auth/public/interfaces/auth_type.mojom";
|
||||||
|
import "components/account_id/interfaces/account_id.mojom";
|
||||||
|
import "mojo/public/mojom/base/string16.mojom";
|
||||||
|
import "mojo/public/mojom/base/time.mojom";
|
||||||
|
|
||||||
|
// Reason why the auth is disabled. This is used to personalize the UI.
|
||||||
|
enum AuthDisabledReason {
|
||||||
|
// Auth is disabled because the device is locked by a time limit override.
|
||||||
|
TIME_LIMIT_OVERRIDE,
|
||||||
|
|
||||||
|
// Auth is disabled because the user has reached their daily usage limit on
|
||||||
|
// the device.
|
||||||
|
TIME_USAGE_LIMIT,
|
||||||
|
|
||||||
|
// Auth is disabled because the device is within a locked time window.
|
||||||
|
TIME_WINDOW_LIMIT,
|
||||||
|
};
|
||||||
|
|
||||||
|
// The data needed to customize the lock screen when auth is disabled.
|
||||||
|
struct AuthDisabledData {
|
||||||
|
// Reason why auth is disabled.
|
||||||
|
AuthDisabledReason reason;
|
||||||
|
|
||||||
|
// A future time when auth will be enabled. This value is for display purpose
|
||||||
|
// only, auth won't be automatically enabled when this time is reached.
|
||||||
|
mojo_base.mojom.Time auth_reenabled_time;
|
||||||
|
|
||||||
|
// The amount of time that the user used this device.
|
||||||
|
mojo_base.mojom.TimeDelta device_used_time;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Allows clients (e.g. the browser process) to send messages to the ash
|
||||||
|
// login/lock/user-add screens.
|
||||||
|
// TODO(estade): this is in the process of being migrated off Mojo. Methods will
|
||||||
|
// move to ash::LoginScreen or ash::LoginScreenModel.
|
||||||
|
interface LoginScreen {
|
||||||
|
// Sets the client interface.
|
||||||
|
SetClient(LoginScreenClient client);
|
||||||
|
|
||||||
|
// Displays the lock screen. |did_show| is true iff the lock UI was
|
||||||
|
// successfully displayed.
|
||||||
|
ShowLockScreen() => (bool did_show);
|
||||||
|
|
||||||
|
// Displays the login screen. |did_show| is true iff the login UI was
|
||||||
|
// successfully displayed.
|
||||||
|
ShowLoginScreen() => (bool did_show);
|
||||||
|
|
||||||
|
// Requests to show error message in the ash lock screen.
|
||||||
|
// TODO(xiaoyinh): login_attempts is probably not needed from chrome,
|
||||||
|
// remove it when we start to count the login attempts in ash lock screen.
|
||||||
|
// |login_attempts|: The number of the login authentication attempts.
|
||||||
|
// |error_text|: The error text to be shown in lock screen.
|
||||||
|
// |help_link_text|: The help link to be shown in lock screen.
|
||||||
|
// |help_topic_id|: The id of the help app topic regarding this error.
|
||||||
|
ShowErrorMessage(int32 login_attempts,
|
||||||
|
string error_text,
|
||||||
|
string help_link_text,
|
||||||
|
int32 help_topic_id);
|
||||||
|
|
||||||
|
// Requests to close any displayed error messages in ash lock screen.
|
||||||
|
ClearErrors();
|
||||||
|
|
||||||
|
// Requests to set the authentication type.
|
||||||
|
// |account_id|: The account id of the user in the user pod.
|
||||||
|
// |auth_type|: Authentication type.
|
||||||
|
// |initial_value|: A message shown in the password field of the user pod.
|
||||||
|
SetAuthType(signin.mojom.AccountId account_id,
|
||||||
|
proximity_auth.mojom.AuthType auth_type,
|
||||||
|
mojo_base.mojom.String16 initial_value);
|
||||||
|
|
||||||
|
|
||||||
|
// Called when auth should be enabled for the given user. When auth is
|
||||||
|
// disabled, the user cannot unlock the device. Auth is enabled by default.
|
||||||
|
// |account_id|: The account id of the user in the user pod.
|
||||||
|
EnableAuthForUser(signin.mojom.AccountId account_id);
|
||||||
|
|
||||||
|
// Called when auth should be disabled for the given user. When auth is
|
||||||
|
// disabled, the user cannot unlock the device. Auth is enabled by default.
|
||||||
|
// |account_id|: The account id of the user in the user pod.
|
||||||
|
// |auth_disabled_data|: The data needed to customize the lock screen UI.
|
||||||
|
DisableAuthForUser(signin.mojom.AccountId account_id,
|
||||||
|
AuthDisabledData auth_disabled_data);
|
||||||
|
|
||||||
|
// Check if the login/lock screen is ready for a password.
|
||||||
|
IsReadyForPassword() => (bool is_ready);
|
||||||
|
|
||||||
|
// Display a toast describing the latest kiosk app launch error.
|
||||||
|
ShowKioskAppError(string message);
|
||||||
|
|
||||||
|
// Sets whether users can be added from the login screen.
|
||||||
|
SetAddUserButtonEnabled(bool enable);
|
||||||
|
|
||||||
|
// Sets whether shutdown button is enabled in the login screen.
|
||||||
|
SetShutdownButtonEnabled(bool enable);
|
||||||
|
|
||||||
|
// Sets if the guest button on the login shelf can be shown. Even if set to
|
||||||
|
// true the button may still not be visible.
|
||||||
|
SetAllowLoginAsGuest(bool allow_guest);
|
||||||
|
|
||||||
|
// Sets if the guest button on the login shelf can be shown during OOBE.
|
||||||
|
SetShowGuestButtonInOobe(bool show);
|
||||||
|
|
||||||
|
// Sets whether parent access button can be shown on the login shelf.
|
||||||
|
SetShowParentAccessButton(bool show);
|
||||||
|
|
||||||
|
// Sets whether parent access code input dialog is shown on the lock screen.
|
||||||
|
SetShowParentAccessDialog(bool show);
|
||||||
|
|
||||||
|
// Transitions focus to the shelf area. If |reverse|, focuses the status area.
|
||||||
|
FocusLoginShelf(bool reverse);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Allows ash lock screen to control a client (e.g. Chrome browser). Requests
|
||||||
|
// often involve preferences or talk to cryptohome that is not available to ash.
|
||||||
|
interface LoginScreenClient {
|
||||||
|
// Attempt to authenticate a user with a password or PIN.
|
||||||
|
//
|
||||||
|
// If auth succeeds:
|
||||||
|
// chrome will hide the lock screen and clear any displayed error messages.
|
||||||
|
// If auth fails:
|
||||||
|
// chrome will request lock screen to show error messages.
|
||||||
|
// |account_id|: The AccountId to authenticate against.
|
||||||
|
// |password|: The submitted password.
|
||||||
|
// |authenticated_by_pin|: True if we are using pin to authenticate.
|
||||||
|
//
|
||||||
|
// The result will be set to true if auth was successful, false if not.
|
||||||
|
//
|
||||||
|
// TODO(jdufault): Extract authenticated_by_pin into a separate mojom method,
|
||||||
|
// similar to the other Authenticate* methods
|
||||||
|
AuthenticateUserWithPasswordOrPin(
|
||||||
|
signin.mojom.AccountId account_id,
|
||||||
|
string password,
|
||||||
|
bool authenticated_by_pin) => (bool auth_success);
|
||||||
|
|
||||||
|
// Attempt to authenticate the user with with an external binary.
|
||||||
|
AuthenticateUserWithExternalBinary(signin.mojom.AccountId account_id)
|
||||||
|
=> (bool auth_success);
|
||||||
|
|
||||||
|
// Attempt to enroll a user in the external binary authentication system.
|
||||||
|
EnrollUserWithExternalBinary() => (bool enrollment_success);
|
||||||
|
|
||||||
|
// Try to authenticate |account_id| using easy unlock. This can be used on the
|
||||||
|
// login or lock screen.
|
||||||
|
// |account_id|: The account id of the user we are authenticating.
|
||||||
|
//
|
||||||
|
// TODO(jdufault): Refactor this method to return an auth_success, similar to
|
||||||
|
// the other auth methods above.
|
||||||
|
AuthenticateUserWithEasyUnlock(signin.mojom.AccountId account_id);
|
||||||
|
|
||||||
|
// Validates parent access code for the user identified by |account_id|. When
|
||||||
|
// |account_id| is empty it tries to validate the access code for any child
|
||||||
|
// that is signed in the device. Passes validation result in the callback.
|
||||||
|
// Note: This should only be used for child user, it will always return false
|
||||||
|
// when a non-child id is used.
|
||||||
|
ValidateParentAccessCode(
|
||||||
|
signin.mojom.AccountId? account_id,
|
||||||
|
string access_code) => (bool access_code_valid);
|
||||||
|
|
||||||
|
// Request to hard lock the user pod.
|
||||||
|
// |account_id|: The account id of the user in the user pod.
|
||||||
|
HardlockPod(signin.mojom.AccountId account_id);
|
||||||
|
|
||||||
|
// Focus user pod of user with |account_id|.
|
||||||
|
OnFocusPod(signin.mojom.AccountId account_id);
|
||||||
|
|
||||||
|
// Notify that no user pod is focused.
|
||||||
|
OnNoPodFocused();
|
||||||
|
|
||||||
|
// Load wallpaper of user with |account_id|.
|
||||||
|
LoadWallpaper(signin.mojom.AccountId account_id);
|
||||||
|
|
||||||
|
// Sign out current user.
|
||||||
|
SignOutUser();
|
||||||
|
|
||||||
|
// Close add user screen.
|
||||||
|
CancelAddUser();
|
||||||
|
|
||||||
|
// Launches guest mode.
|
||||||
|
LoginAsGuest();
|
||||||
|
|
||||||
|
// User with |account_id| has reached maximum incorrect password attempts.
|
||||||
|
OnMaxIncorrectPasswordAttempted(signin.mojom.AccountId account_id);
|
||||||
|
|
||||||
|
// Should pass the focus to the active lock screen app window, if there is
|
||||||
|
// one. This is called when a lock screen app is reported to be active (using
|
||||||
|
// tray_action mojo interface), and is next in the tab order.
|
||||||
|
// |HandleFocusLeavingLockScreenApps| should be called to return focus to the
|
||||||
|
// lock screen.
|
||||||
|
// |reverse|: Whether the tab order is reversed.
|
||||||
|
FocusLockScreenApps(bool reverse);
|
||||||
|
|
||||||
|
// Passes focus to the OOBE dialog if it is showing. No-op otherwise.
|
||||||
|
FocusOobeDialog();
|
||||||
|
|
||||||
|
// Show the gaia sign-in dialog. If |can_close| is true, the dialog can be
|
||||||
|
// closed. The value in |prefilled_account| will be used to prefill the
|
||||||
|
// sign-in dialog so the user does not need to type the account email.
|
||||||
|
ShowGaiaSignin(bool can_close, signin.mojom.AccountId? prefilled_account);
|
||||||
|
|
||||||
|
// Notification that the remove user warning was shown.
|
||||||
|
OnRemoveUserWarningShown();
|
||||||
|
|
||||||
|
// Try to remove |account_id|.
|
||||||
|
RemoveUser(signin.mojom.AccountId account_id);
|
||||||
|
|
||||||
|
// Launch a public session for user with |account_id|.
|
||||||
|
// |locale|: Locale for this user.
|
||||||
|
// The value is language code like "en-US", "zh-CN"
|
||||||
|
// |input_method|: Input method for this user.
|
||||||
|
// This is the id of InputMethodDescriptor like
|
||||||
|
// "t:latn-post", "pinyin".
|
||||||
|
LaunchPublicSession(signin.mojom.AccountId account_id,
|
||||||
|
string locale,
|
||||||
|
string input_method);
|
||||||
|
|
||||||
|
// Request public session keyboard layouts for user with |account_id|.
|
||||||
|
// This function send a request to chrome and the result will be returned by
|
||||||
|
// SetPublicSessionKeyboardLayouts.
|
||||||
|
// |locale|: Request a list of keyboard layouts that can be used by this
|
||||||
|
// locale.
|
||||||
|
RequestPublicSessionKeyboardLayouts(signin.mojom.AccountId account_id,
|
||||||
|
string locale);
|
||||||
|
|
||||||
|
// Request to show a feedback report dialog in chrome.
|
||||||
|
ShowFeedback();
|
||||||
|
|
||||||
|
// Show the powerwash (device reset) dialog.
|
||||||
|
ShowResetScreen();
|
||||||
|
|
||||||
|
// Show the help app for when users have trouble signing in to their account.
|
||||||
|
ShowAccountAccessHelpApp();
|
||||||
|
|
||||||
|
// Called when the keyboard focus is about to leave from the sytem tray in
|
||||||
|
// the login screen / OOBE. |reverse| is true when the focus moves in the
|
||||||
|
// reversed direction.
|
||||||
|
OnFocusLeavingSystemTray(bool reverse);
|
||||||
|
|
||||||
|
// Used by Ash to signal that user activity occurred on the login screen.
|
||||||
|
OnUserActivity();
|
||||||
|
};
|
50
src/ash/public/interfaces/media.mojom
Normal file
50
src/ash/public/interfaces/media.mojom
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "components/account_id/interfaces/account_id.mojom";
|
||||||
|
|
||||||
|
// Describes whether media is currently being captured.
|
||||||
|
enum MediaCaptureState {
|
||||||
|
NONE = 0,
|
||||||
|
AUDIO = 1,
|
||||||
|
VIDEO = 2,
|
||||||
|
AUDIO_VIDEO = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
// Allows clients (e.g. Chrome browser) to interface with the ash media
|
||||||
|
// indicators.
|
||||||
|
interface MediaController {
|
||||||
|
// Sets the client interface.
|
||||||
|
SetClient(associated MediaClient client);
|
||||||
|
|
||||||
|
// Forces media shortcut key handling in MediaClient instead of in ash. This
|
||||||
|
// defaults to false and will be reset if the client encounters an error.
|
||||||
|
SetForceMediaClientKeyHandling(bool enabled);
|
||||||
|
|
||||||
|
// Called when the media capture state changes on the client, or in response
|
||||||
|
// to a RequestCaptureState() request. Returns a map from AccountId to
|
||||||
|
// MediaCaptureState representing every user's state.
|
||||||
|
NotifyCaptureState(map<signin.mojom.AccountId,
|
||||||
|
MediaCaptureState> capture_states);
|
||||||
|
};
|
||||||
|
|
||||||
|
// This delegate allows the UI code in ash to forward UI commands.
|
||||||
|
interface MediaClient {
|
||||||
|
// Handles the Next Track Media shortcut key.
|
||||||
|
HandleMediaNextTrack();
|
||||||
|
|
||||||
|
// Handles the Play/Pause Toggle Media shortcut key.
|
||||||
|
HandleMediaPlayPause();
|
||||||
|
|
||||||
|
// Handles the Previous Track Media shortcut key.
|
||||||
|
HandleMediaPrevTrack();
|
||||||
|
|
||||||
|
// Requests that the client resends the NotifyMediaCaptureChanged() message.
|
||||||
|
RequestCaptureState();
|
||||||
|
|
||||||
|
// Suspends all WebContents-associated media sessions to stop managed players.
|
||||||
|
SuspendMediaSessions();
|
||||||
|
};
|
52
src/ash/public/interfaces/night_light_controller.mojom
Normal file
52
src/ash/public/interfaces/night_light_controller.mojom
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// Represents a geolocation position fix. It's "simple" because it doesn't
|
||||||
|
// expose all the parameters of the position interface as defined by the
|
||||||
|
// Geolocation API Specification:
|
||||||
|
// (https://dev.w3.org/geo/api/spec-source.html#position_interface).
|
||||||
|
// The NightLightController is only interested in valid latitude and longitude.
|
||||||
|
// It also doesn't require any specific accuracy. The more accurate the
|
||||||
|
// positions, the more accurate sunset and sunrise times calculations. However,
|
||||||
|
// an IP-based geoposition is considered good enough.
|
||||||
|
struct SimpleGeoposition {
|
||||||
|
double latitude;
|
||||||
|
double longitude;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Used by a client (e.g. Chrome) to provide the current user's geoposition.
|
||||||
|
interface NightLightController {
|
||||||
|
// These values are written to logs. New enum values can be added, but
|
||||||
|
// existing enums must never be renumbered or deleted and reused.
|
||||||
|
enum ScheduleType {
|
||||||
|
// Automatic toggling of NightLight is turned off.
|
||||||
|
kNone = 0,
|
||||||
|
|
||||||
|
// Turned automatically on at the user's local sunset time, and off at the
|
||||||
|
// user's local sunrise time.
|
||||||
|
kSunsetToSunrise = 1,
|
||||||
|
|
||||||
|
// Toggled automatically based on the custom set start and end times
|
||||||
|
// selected by the user from the system settings.
|
||||||
|
kCustom = 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sets the client that will be notified of changes in the Night Light
|
||||||
|
// schedule type.
|
||||||
|
SetClient(NightLightClient client);
|
||||||
|
|
||||||
|
// Provides the NightLightController with the user's geoposition so that it
|
||||||
|
// can calculate the sunset and sunrise times. This should only be called when
|
||||||
|
// the schedule type is set to "Sunset to Sunrise".
|
||||||
|
SetCurrentGeoposition(SimpleGeoposition position);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Used by ash to notify a client (e.g. Chrome) of the changes in the Night
|
||||||
|
// Light schedule type.
|
||||||
|
interface NightLightClient {
|
||||||
|
// Notifies the client with the new schedule type whenever it changes.
|
||||||
|
OnScheduleTypeChanged(NightLightController.ScheduleType new_type);
|
||||||
|
};
|
50
src/ash/public/interfaces/shelf_integration_test_api.mojom
Normal file
50
src/ash/public/interfaces/shelf_integration_test_api.mojom
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Copyright 2019 The Chromium Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// These values match ash::ShelfAutoHideBehavior.
|
||||||
|
enum ShelfAutoHideBehavior {
|
||||||
|
SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, // Always auto-hide.
|
||||||
|
SHELF_AUTO_HIDE_BEHAVIOR_NEVER, // Never auto-hide.
|
||||||
|
SHELF_AUTO_HIDE_ALWAYS_HIDDEN, // Always hide.
|
||||||
|
};
|
||||||
|
|
||||||
|
// These values match ash::ShelfAlignment.
|
||||||
|
enum ShelfAlignment {
|
||||||
|
SHELF_ALIGNMENT_BOTTOM, // Bottom alignment.
|
||||||
|
SHELF_ALIGNMENT_LEFT, // Left alignment.
|
||||||
|
SHELF_ALIGNMENT_RIGHT, // Right alignment.
|
||||||
|
SHELF_ALIGNMENT_BOTTOM_LOCKED, // Bottom alignment, set temporarily and not
|
||||||
|
// saved to preferences.
|
||||||
|
};
|
||||||
|
|
||||||
|
// Test interface used to interact with the Shelf from integration tests.
|
||||||
|
// Note this interface applies the shelf properties from the call
|
||||||
|
// arguments and might be lost if tests do something that triggers
|
||||||
|
// applying shelf properties from prefs, such as switching user,
|
||||||
|
// entering/exiting tablet mode, changing display config, etc.
|
||||||
|
interface ShelfIntegrationTestApi {
|
||||||
|
// Returns the auto hide behavior.
|
||||||
|
// |display_id| represents the display that contains the shelf. |display_id|
|
||||||
|
// must be valid.
|
||||||
|
GetAutoHideBehavior(int64 display_id) => (ShelfAutoHideBehavior behavior);
|
||||||
|
|
||||||
|
// Sets the auto hide behavior.
|
||||||
|
// |display_id| represents the display that contains the shelf. |display_id|
|
||||||
|
// must be valid.
|
||||||
|
// |behavior| is the new behavior.
|
||||||
|
SetAutoHideBehavior(int64 display_id, ShelfAutoHideBehavior behavior) => ();
|
||||||
|
|
||||||
|
// Sets the alignment.
|
||||||
|
// |display_id| represents the display that contains the shelf. |display_id|
|
||||||
|
// must be valid.
|
||||||
|
// |alignment| is the new alignment.
|
||||||
|
SetAlignment(int64 display_id, ShelfAlignment alignment) => ();
|
||||||
|
|
||||||
|
// Returns the alignment.
|
||||||
|
// |display_id| represents the display that contains the shelf. |display_id|
|
||||||
|
// must be valid.
|
||||||
|
GetAlignment(int64 display_id) => (ShelfAlignment alignment);
|
||||||
|
};
|
13
src/ash/public/interfaces/shelf_integration_test_api.typemap
Normal file
13
src/ash/public/interfaces/shelf_integration_test_api.typemap
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Copyright 2019 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
mojom = "//ash/public/interfaces/shelf_integration_test_api.mojom"
|
||||||
|
public_headers = [ "//ash/public/cpp/shelf_types.h" ]
|
||||||
|
traits_headers =
|
||||||
|
[ "//ash/public/cpp/shelf_integration_test_api_struct_mojom_traits.h" ]
|
||||||
|
|
||||||
|
type_mappings = [
|
||||||
|
"ash.mojom.ShelfAlignment=ash::ShelfAlignment",
|
||||||
|
"ash.mojom.ShelfAutoHideBehavior=ash::ShelfAutoHideBehavior",
|
||||||
|
]
|
18
src/ash/public/interfaces/shutdown.mojom
Normal file
18
src/ash/public/interfaces/shutdown.mojom
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// Interface implemented by ash and used by chrome to provide shutdown policy
|
||||||
|
// information. Exists because device policy is owned by chrome, not ash.
|
||||||
|
interface ShutdownController {
|
||||||
|
// Sets a boolean pref that indicates whether the device automatically reboots
|
||||||
|
// when the user initiates a shutdown via an UI element. Used in enterprise
|
||||||
|
// environments for devices that should not be shut down.
|
||||||
|
SetRebootOnShutdown(bool reboot_on_shutdown);
|
||||||
|
|
||||||
|
// Triggers an animated shutdown after the login screen shutdown button was
|
||||||
|
// pressed.
|
||||||
|
RequestShutdownFromLoginScreen();
|
||||||
|
};
|
102
src/ash/public/interfaces/tray_action.mojom
Normal file
102
src/ash/public/interfaces/tray_action.mojom
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// An action handler state.
|
||||||
|
enum TrayActionState {
|
||||||
|
// The action cannot be handled - due to no client being set, the client not
|
||||||
|
// supporting the action, user session not being locked etc.
|
||||||
|
kNotAvailable,
|
||||||
|
|
||||||
|
// The client supports the action and is not currently handling the action.
|
||||||
|
kAvailable,
|
||||||
|
|
||||||
|
// The client received the request for the action and it is launching the
|
||||||
|
// flow to handle it.
|
||||||
|
kLaunching,
|
||||||
|
|
||||||
|
// The client is currently handling the action.
|
||||||
|
kActive,
|
||||||
|
};
|
||||||
|
|
||||||
|
// The user action that triggered a request for a new note.
|
||||||
|
// Used in histograms - should be kept in sync with
|
||||||
|
// NewLockScreenNoteRequestType histogram enum, and assigned values should
|
||||||
|
// never be changed.
|
||||||
|
enum LockScreenNoteOrigin {
|
||||||
|
// The note request originated from the new note button in the system
|
||||||
|
// tray - note that this UI element is deprecated.
|
||||||
|
kTrayAction = 0,
|
||||||
|
|
||||||
|
// The user tapped the note action button shown on the lock screen.
|
||||||
|
kLockScreenButtonTap = 1,
|
||||||
|
|
||||||
|
// The user swiped from the note action button shown on the lock screen.
|
||||||
|
kLockScreenButtonSwipe = 2,
|
||||||
|
|
||||||
|
// The user activated the lock screen button shown on the lock screen using
|
||||||
|
// the keyboard.
|
||||||
|
kLockScreenButtonKeyboard = 3,
|
||||||
|
|
||||||
|
// The user ejected the stylus tool from the device.
|
||||||
|
kStylusEject = 4,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Reason for closing a lock screen note, and consequentially closing any
|
||||||
|
// existing note handler app windows.
|
||||||
|
// Used primarily for metrics reporting.
|
||||||
|
// IMPORTANT: The values should be kept in sync with
|
||||||
|
// LockScreenNoteTakingExitReason histogram enum, and assigned values should
|
||||||
|
// never be changed.
|
||||||
|
enum CloseLockScreenNoteReason {
|
||||||
|
// The user session was unlocked.
|
||||||
|
kSessionUnlock = 0,
|
||||||
|
|
||||||
|
// The user session was shut down (e.g. due to user sign-out).
|
||||||
|
kShutdown = 1,
|
||||||
|
|
||||||
|
// The user display was completely dimmed (e.g. due to user inactivity).
|
||||||
|
kScreenDimmed = 2,
|
||||||
|
|
||||||
|
// Device suspended.
|
||||||
|
kSuspend = 3,
|
||||||
|
|
||||||
|
// The app window associated with the note was closed by the app.
|
||||||
|
kAppWindowClosed = 4,
|
||||||
|
|
||||||
|
// The note taking app's support for the lock screen note taking was disabled
|
||||||
|
// (e.g. because of a policy update).
|
||||||
|
kAppLockScreenSupportDisabled = 5,
|
||||||
|
|
||||||
|
// The user pressed "Unlock" button on the lock screen UI.
|
||||||
|
kUnlockButtonPressed = 6,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Used by a client (e.g. Chrome) to set up a handler for a tray action, and
|
||||||
|
// notify ash on the action handler's state changes. A tray action is one of
|
||||||
|
// predefined actions (currently only the "new note on lock screen" action is
|
||||||
|
// supported) that appear as an ash status area button if the client declares
|
||||||
|
// the action as available. Clicking the button invokes a client method that
|
||||||
|
// requests the action associated with the button to be handled.
|
||||||
|
interface TrayAction {
|
||||||
|
// Sets the client to be used to handle action requests.
|
||||||
|
// |lock_screen_note_state|: The current lock screen note action state
|
||||||
|
// associated with the client.
|
||||||
|
SetClient(TrayActionClient client, TrayActionState lock_screen_note_state);
|
||||||
|
|
||||||
|
// Updates action state for the lock screen note action. If called with no
|
||||||
|
// client set, the state change will not take effect until a client is set.
|
||||||
|
// Null client is equivalent to kNotAvailable state.
|
||||||
|
UpdateLockScreenNoteState(TrayActionState state);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Used by ash to request Chrome to handle an action.
|
||||||
|
interface TrayActionClient {
|
||||||
|
// Requests a lock screen note action to be handled.
|
||||||
|
RequestNewLockScreenNote(LockScreenNoteOrigin origin);
|
||||||
|
|
||||||
|
// Closes lock screen note.
|
||||||
|
CloseLockScreenNote(CloseLockScreenNoteReason reason);
|
||||||
|
};
|
5
src/ash/public/interfaces/typemaps.gni
Normal file
5
src/ash/public/interfaces/typemaps.gni
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
typemaps = [ "//ash/public/interfaces/shelf_integration_test_api.typemap" ]
|
36
src/ash/public/interfaces/update.mojom
Normal file
36
src/ash/public/interfaces/update.mojom
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// Urgency of a pending software update. Sets the system tray update icon color.
|
||||||
|
// These correspond to values in UpgradeDetector's
|
||||||
|
// UpgradeNotificationAnnoyanceLevel enum. Their use is platform-specific. On
|
||||||
|
// Chrome OS, LOW severity is issued when an update is detected. ELEVATED
|
||||||
|
// follows after two days, and HIGH two days after that. These time deltas may
|
||||||
|
// be overridden by administrators via the RelaunchNotificationPeriod policy
|
||||||
|
// setting.
|
||||||
|
// TODO(jamescook): UpgradeDetector::UpgradeNotificationAnnoyanceLevel could be
|
||||||
|
// replaced with this if this moves into a component shared with non-ash chrome.
|
||||||
|
enum UpdateSeverity {
|
||||||
|
NONE,
|
||||||
|
VERY_LOW,
|
||||||
|
LOW,
|
||||||
|
ELEVATED,
|
||||||
|
HIGH,
|
||||||
|
CRITICAL,
|
||||||
|
};
|
||||||
|
|
||||||
|
// The type of update being applied. Sets the string in the system tray.
|
||||||
|
enum UpdateType {
|
||||||
|
FLASH,
|
||||||
|
SYSTEM,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Notification style for system updates, set by different policies.
|
||||||
|
enum NotificationStyle {
|
||||||
|
DEFAULT,
|
||||||
|
ADMIN_RECOMMENDED, // Relaunch Notification policy
|
||||||
|
ADMIN_REQUIRED, // Relaunch Notification policy
|
||||||
|
};
|
149
src/ash/public/interfaces/voice_interaction_controller.mojom
Normal file
149
src/ash/public/interfaces/voice_interaction_controller.mojom
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// There is another copy of the VoiceInteractionState definition in
|
||||||
|
// //components/arc/common/voice_interaction_framework.mojom
|
||||||
|
// Please also update the other one if you change it.
|
||||||
|
// The duplicate definition is because we do not use extensible widely
|
||||||
|
// (crbug.com/731893).
|
||||||
|
|
||||||
|
// The initial state is NOT_READY, then it will either becomes STOPPED or
|
||||||
|
// RUNNING. If the mojo connection is lost, the state will be set back to
|
||||||
|
// NOT_READY.
|
||||||
|
enum VoiceInteractionState {
|
||||||
|
// Voice interaction service is not ready yet, request sent will be waiting.
|
||||||
|
NOT_READY = 0,
|
||||||
|
// Voice interaction session is stopped.
|
||||||
|
STOPPED,
|
||||||
|
// Voice interaction session is currently running.
|
||||||
|
RUNNING
|
||||||
|
};
|
||||||
|
|
||||||
|
enum AssistantAllowedState {
|
||||||
|
// Assistant feature is allowed.
|
||||||
|
ALLOWED = 0,
|
||||||
|
// Disallowed because ARC++ is disallowed. There could be many specific
|
||||||
|
// reasones why ARC++ is disallowed. This enum is a catch all. Some enums
|
||||||
|
// below will show specific reasons.
|
||||||
|
DISALLOWED_BY_ARC_DISALLOWED,
|
||||||
|
// Disallowed because ARC++ is disabled by policy.
|
||||||
|
DISALLOWED_BY_ARC_POLICY,
|
||||||
|
// Disallowed because user's locale is not compatible.
|
||||||
|
DISALLOWED_BY_LOCALE,
|
||||||
|
// Disallowed because the feature flag is off.
|
||||||
|
DISALLOWED_BY_FLAG,
|
||||||
|
// Disallowed because current user is not primary user.
|
||||||
|
DISALLOWED_BY_NONPRIMARY_USER,
|
||||||
|
// Disallowed because current user is supervised user.
|
||||||
|
DISALLOWED_BY_SUPERVISED_USER,
|
||||||
|
// Disallowed because incognito mode.
|
||||||
|
DISALLOWED_BY_INCOGNITO,
|
||||||
|
// Disallowed because the device is in demo mode.
|
||||||
|
DISALLOWED_BY_DEMO_MODE,
|
||||||
|
// Disallowed because the device is in public session.
|
||||||
|
DISALLOWED_BY_PUBLIC_SESSION,
|
||||||
|
// Disallowed because the user's account type is currently not supported.
|
||||||
|
DISALLOWED_BY_ACCOUNT_TYPE
|
||||||
|
};
|
||||||
|
|
||||||
|
// Allows observing changes to voice interaction status and settings.
|
||||||
|
interface VoiceInteractionObserver {
|
||||||
|
// Called when voice interaction session state changes.
|
||||||
|
OnVoiceInteractionStatusChanged(VoiceInteractionState state);
|
||||||
|
|
||||||
|
// Called when voice interaction is enabled/disabled in settings.
|
||||||
|
OnVoiceInteractionSettingsEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Called when voice interaction service is allowed/disallowed to access
|
||||||
|
// the "context" (text and graphic content that is currently on screen).
|
||||||
|
OnVoiceInteractionContextEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Called when hotword listening is enabled/disabled.
|
||||||
|
OnVoiceInteractionHotwordEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Called when hotword is set to always on/only with power source.
|
||||||
|
OnVoiceInteractionHotwordAlwaysOn(bool always_on);
|
||||||
|
|
||||||
|
// Called when consent status is updated.
|
||||||
|
OnVoiceInteractionConsentStatusUpdated(ConsentStatus consent_status);
|
||||||
|
|
||||||
|
// Called when assistant feature allowed state has changed.
|
||||||
|
OnAssistantFeatureAllowedChanged(AssistantAllowedState state);
|
||||||
|
|
||||||
|
// Called when Google Play Store is enabled/disabled.
|
||||||
|
OnArcPlayStoreEnabledChanged(bool enabled);
|
||||||
|
|
||||||
|
// Called when locale is changed in pref. The locale is in the format can be
|
||||||
|
// "en-US" or simply "en". When locale is not set in pref, it returns empty
|
||||||
|
// string.
|
||||||
|
OnLocaleChanged(string locale);
|
||||||
|
|
||||||
|
// Called when locked full screen state has changed.
|
||||||
|
OnLockedFullScreenStateChanged(bool enabled);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Interface for ash client (Chrome) to connect to the voice interaction
|
||||||
|
// controller, which notifies changes of voice interaction related flags.
|
||||||
|
interface VoiceInteractionController {
|
||||||
|
// Called when the voice interaction state is changed.
|
||||||
|
NotifyStatusChanged(VoiceInteractionState state);
|
||||||
|
|
||||||
|
// Called when the voice interaction settings is enabled/disabled.
|
||||||
|
NotifySettingsEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Called when the voice interaction context is enabled/disabled.
|
||||||
|
// If context is enabled the screenshot will be passed in voice
|
||||||
|
// interaction session.
|
||||||
|
NotifyContextEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Called when the hotword listening is enabled/disabled.
|
||||||
|
NotifyHotwordEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Called when the hotword is set to always on/only with power source.
|
||||||
|
NotifyHotwordAlwaysOn(bool enabled);
|
||||||
|
|
||||||
|
// Called when the consent status is obtained from the server.
|
||||||
|
NotifyConsentStatus(ConsentStatus consent_status);
|
||||||
|
|
||||||
|
// Notify if voice interaction feature is allowed or not. e.g. not allowed
|
||||||
|
// if disabled by policy.
|
||||||
|
NotifyFeatureAllowed(AssistantAllowedState state);
|
||||||
|
|
||||||
|
// Called when the notification is enabled/disabled.
|
||||||
|
NotifyNotificationEnabled(bool enabled);
|
||||||
|
|
||||||
|
// Called when the locale is changed.
|
||||||
|
NotifyLocaleChanged(string locale);
|
||||||
|
|
||||||
|
// Called when the launch with mic open state is changed.
|
||||||
|
NotifyLaunchWithMicOpen(bool launch_with_mic_open);
|
||||||
|
|
||||||
|
// Called when Google Play Store is enabled/disabled.
|
||||||
|
NotifyArcPlayStoreEnabledChanged(bool enabled);
|
||||||
|
|
||||||
|
// Called when locked full screen state is enabled/disabled.
|
||||||
|
NotifyLockedFullScreenStateChanged(bool enabled);
|
||||||
|
|
||||||
|
// Add an observer.
|
||||||
|
AddObserver(VoiceInteractionObserver observer);
|
||||||
|
};
|
||||||
|
|
||||||
|
// The status of the user's consent. The enum values cannot be changed because
|
||||||
|
// they are persisted on disk.
|
||||||
|
enum ConsentStatus {
|
||||||
|
// The status is unknown.
|
||||||
|
kUnknown = 0,
|
||||||
|
|
||||||
|
// The user accepted activity control access.
|
||||||
|
kActivityControlAccepted = 1,
|
||||||
|
|
||||||
|
// The user is not authorized to give consent.
|
||||||
|
kUnauthorized = 2,
|
||||||
|
|
||||||
|
// The user's consent information is not found. This is typically the case
|
||||||
|
// when consent from the user has never been requested.
|
||||||
|
kNotFound = 3,
|
||||||
|
};
|
46
src/ash/public/interfaces/vpn_list.mojom
Normal file
46
src/ash/public/interfaces/vpn_list.mojom
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
import "mojo/public/mojom/base/time.mojom";
|
||||||
|
|
||||||
|
// Describes a third-party VPN provided by an extension (e.g. Cisco AnyConnect).
|
||||||
|
struct ThirdPartyVpnProvider {
|
||||||
|
string name;
|
||||||
|
string extension_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Describes an Arc VPN provider. last_launch_time is used to sort the list of
|
||||||
|
// Arc VPN providers.
|
||||||
|
struct ArcVpnProvider {
|
||||||
|
// Unique android package name of the Arc VPN provider. e.g. vpn.app.package
|
||||||
|
string package_name;
|
||||||
|
// App name of Arc VPN provider. e.g. VPNapp
|
||||||
|
string app_name;
|
||||||
|
// Unique app id for launching the app. e.g. pbmkokpdlpfmapoiccpblbmjjhhabjaa
|
||||||
|
string app_id;
|
||||||
|
// Last launch time of the Arc VPN provider.
|
||||||
|
mojo_base.mojom.Time last_launch_time;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Manages the VPN provider list in ash. Allows extension-backed VPN providers
|
||||||
|
// to be added. Ash handles the built-in OpenVPN / L2TP provider internally.
|
||||||
|
// Allows Arc VPN providers to be added and removed, updates providers' launch
|
||||||
|
// time so that they are shown in LRU order, updates providers' name change.
|
||||||
|
interface VpnList {
|
||||||
|
// Sets the list of third-party VPN providers. The |providers| array may be
|
||||||
|
// empty to clear the list (e.g. after the last third-party VPN extension is
|
||||||
|
// uninstalled).
|
||||||
|
SetThirdPartyVpnProviders(array<ThirdPartyVpnProvider> providers);
|
||||||
|
|
||||||
|
// Sets the list of Arc VPN providers.
|
||||||
|
SetArcVpnProviders(array<ArcVpnProvider> arc_providers);
|
||||||
|
|
||||||
|
// Adds or updates an Arc VPN provider.
|
||||||
|
AddOrUpdateArcVPNProvider(ArcVpnProvider arc_provider);
|
||||||
|
|
||||||
|
// Removes an Arc VPN provider.
|
||||||
|
RemoveArcVPNProvider(string package_name);
|
||||||
|
};
|
20
src/ash/public/interfaces/window_pin_type.mojom
Normal file
20
src/ash/public/interfaces/window_pin_type.mojom
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// The window's pin type enum.
|
||||||
|
enum WindowPinType {
|
||||||
|
NONE,
|
||||||
|
|
||||||
|
// The window is pinned on top of other windows.
|
||||||
|
PINNED,
|
||||||
|
|
||||||
|
// The window is pinned on top of other windows. It is similar to
|
||||||
|
// PINNED but does not allow user to exit the mode by shortcut key.
|
||||||
|
TRUSTED_PINNED,
|
||||||
|
};
|
||||||
|
|
||||||
|
// The window's pin type. Maps to ash::kWindowPinTypeKey.
|
||||||
|
const string kWindowPinType_Property = "ash:window-pin-type";
|
88
src/ash/public/interfaces/window_properties.mojom
Normal file
88
src/ash/public/interfaces/window_properties.mojom
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
module ash.mojom;
|
||||||
|
|
||||||
|
// App type of the window, like browser or app. The type is an int but should
|
||||||
|
// be one of ash::AppType (see ash/public/cpp/app_types.h).
|
||||||
|
const string kAppType_Property = "ash:app-type";
|
||||||
|
|
||||||
|
// A bool to indicate whether this window should be replaced by a black
|
||||||
|
// rectangle in assistant screenshot for privacy purpose.
|
||||||
|
const string kBlockedForAssistantSnapshot_Property =
|
||||||
|
"ash:blocked-for-assistant-snapshot";
|
||||||
|
|
||||||
|
// A bool to indicate whether the window can attach into another window. Used
|
||||||
|
// by tab-dragging.
|
||||||
|
const string kCanAttachToAnotherWindow_Property =
|
||||||
|
"ash:can-attach-to-another-window";
|
||||||
|
|
||||||
|
// V1 apps can intercept system keys. This will let the app handle F-keys instead
|
||||||
|
// of the window manager.
|
||||||
|
const string kCanConsumeSystemKeys_Property =
|
||||||
|
"ash:can-consume-system-keys";
|
||||||
|
|
||||||
|
// True if the window should be hidden in ash overview mode. Type: bool.
|
||||||
|
const string kHideInOverview_Property = "ash:hide_in_overview";
|
||||||
|
|
||||||
|
// True if the shelf should be hidden when this window is put into fullscreen.
|
||||||
|
// Exposed because some windows want to explicitly opt-out of this.
|
||||||
|
const string kHideShelfWhenFullscreen_Property =
|
||||||
|
"ash:hide-shelf-when-fullscreen";
|
||||||
|
|
||||||
|
// See ash::kImmersiveImpliedByFullscreen.
|
||||||
|
const string kImmersiveImpliedByFullscreen_Property =
|
||||||
|
"ash:immersive-implied-by-fullscreen";
|
||||||
|
|
||||||
|
// See ash::kImmersiveIsActive.
|
||||||
|
const string kImmersiveIsActive_Property = "ash:immersive-is-active";
|
||||||
|
|
||||||
|
// See ash::kImmersiveTopContainerBoundsInScreen.
|
||||||
|
const string kImmersiveTopContainerBoundsInScreen_Property =
|
||||||
|
"ash:immersive-top-container-bounds-in-screen";
|
||||||
|
|
||||||
|
// If true, the window is the target window for the tab-dragged window. The
|
||||||
|
// key is used by overview to show a highlight indication to indicate which
|
||||||
|
// overview window the dragged tabs will merge into when the user releases the
|
||||||
|
// pointer.
|
||||||
|
const string kIsDeferredTabDraggingTargetWindow_Property =
|
||||||
|
"ash:is-deferred-tab-dragging-target-window";
|
||||||
|
|
||||||
|
// If true, the window is a browser window and its tab(s) are currently being
|
||||||
|
// dragged.
|
||||||
|
const string kIsDraggingTabs_Property = "ash:is-dragging-tabs";
|
||||||
|
|
||||||
|
// If true, the window is currently showing in overview mode.
|
||||||
|
const string kIsShowingInOverview_Property = "ash:is-showing-in-overview";
|
||||||
|
|
||||||
|
// A property key to store the address of the source window that the drag
|
||||||
|
// originated from if the window is currently in tab-dragging process.
|
||||||
|
const string kTabDraggingSourceWindow_Property =
|
||||||
|
"ash:tab-dragging-source-window";
|
||||||
|
|
||||||
|
// This is put on windows to indicate that ash should perform auto management of
|
||||||
|
// window positions; when you open a second browser, ash will move the two to
|
||||||
|
// minimize overlap.
|
||||||
|
const string kWindowPositionManaged_Property =
|
||||||
|
"ash:window-position-managed";
|
||||||
|
|
||||||
|
// A property key which stores the bounds to restore a window to. These take
|
||||||
|
// preference over the current bounds. This is used by e.g. the tablet mode
|
||||||
|
// window manager.
|
||||||
|
const string kRestoreBoundsOverride_Property =
|
||||||
|
"ash:restore-bounds-override";
|
||||||
|
|
||||||
|
// A property key which stores the window state to restore a window to. These
|
||||||
|
// take preference over the current state if
|
||||||
|
// |kRestoreWindowStateTypeOverrideKey| is set. This is used by e.g. the tablet
|
||||||
|
// mode window manager.
|
||||||
|
const string kRestoreWindowStateTypeOverride_Property =
|
||||||
|
"ash:restore-window-state-type-override";
|
||||||
|
|
||||||
|
// The height of the window header, i.e. the inset between the frame and client
|
||||||
|
// view.
|
||||||
|
const string kTopViewInset_Property = "ash:top-view-inset";
|
||||||
|
|
||||||
|
// A boolean property to indicate a picture-in-picture window.
|
||||||
|
const string kIsWindowPip_Property = "ash:is-window-pip";
|
88
src/ash/resources/BUILD.gn
Normal file
88
src/ash/resources/BUILD.gn
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
# Copyright 2014 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//tools/grit/grit_rule.gni")
|
||||||
|
import("//tools/grit/repack.gni")
|
||||||
|
import("//ui/base/ui_features.gni")
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
assert(enable_hidpi)
|
||||||
|
|
||||||
|
# Repacks resources needed for ash_unittests, etc. at a given scale.
|
||||||
|
# TODO(msw): Use ui_test.pak instead of its pieces? (no 200% support?)
|
||||||
|
template("ash_test_resources") {
|
||||||
|
percent = invoker.percent
|
||||||
|
|
||||||
|
repack("ash_test_resources_${target_name}") {
|
||||||
|
output = "$root_build_dir/${target_name}.pak"
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
"$root_gen_dir/ash/app_list/resources/app_list_resources_${percent}_percent.pak",
|
||||||
|
"$root_gen_dir/ash/components/resources/ash_components_resources_${percent}_percent.pak",
|
||||||
|
"$root_gen_dir/ash/login/resources/login_resources_${percent}_percent.pak",
|
||||||
|
"$root_gen_dir/ash/public/cpp/resources/ash_public_unscaled_resources.pak",
|
||||||
|
"$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak",
|
||||||
|
"$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
|
||||||
|
"$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (percent == "100") {
|
||||||
|
sources += [
|
||||||
|
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
|
||||||
|
"$root_gen_dir/ui/resources/webui_resources.pak",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined(invoker.sources)) {
|
||||||
|
sources += invoker.sources
|
||||||
|
}
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/app_list/resources",
|
||||||
|
"//ash/components/resources",
|
||||||
|
"//ash/login/resources",
|
||||||
|
"//ash/public/cpp/resources:ash_public_unscaled_resources",
|
||||||
|
"//mojo/public/js:resources",
|
||||||
|
"//ui/chromeos/resources",
|
||||||
|
"//ui/resources",
|
||||||
|
"//ui/views/resources",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (defined(invoker.deps)) {
|
||||||
|
deps += invoker.deps
|
||||||
|
}
|
||||||
|
|
||||||
|
if (percent == "100") {
|
||||||
|
# TODO(msw): This seems bad, but follows repack_ui_test_pak's example.
|
||||||
|
deps += [ "//third_party/blink/public:resources_grit" ]
|
||||||
|
sources += [
|
||||||
|
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ash_test_resources("100_percent") {
|
||||||
|
percent = "100"
|
||||||
|
}
|
||||||
|
|
||||||
|
ash_test_resources("200_percent") {
|
||||||
|
percent = "200"
|
||||||
|
}
|
||||||
|
|
||||||
|
# There is no with_content_200_percent as content resources are only available
|
||||||
|
# at 100%.
|
||||||
|
ash_test_resources("with_content_100_percent") {
|
||||||
|
percent = "100"
|
||||||
|
sources = [
|
||||||
|
"$root_gen_dir/content/app/strings/content_strings_en-US.pak",
|
||||||
|
"$root_gen_dir/content/content_resources.pak",
|
||||||
|
"$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
|
||||||
|
]
|
||||||
|
deps = [
|
||||||
|
"//content:resources",
|
||||||
|
"//content/app/strings",
|
||||||
|
"//third_party/blink/public:scaled_resources_100_percent",
|
||||||
|
]
|
||||||
|
}
|
273
src/ash/resources/vector_icons/BUILD.gn
Normal file
273
src/ash/resources/vector_icons/BUILD.gn
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/chrome_build.gni")
|
||||||
|
import("//components/vector_icons/vector_icons.gni")
|
||||||
|
|
||||||
|
aggregate_vector_icons("ash_vector_icons") {
|
||||||
|
icon_directory = "."
|
||||||
|
|
||||||
|
icons = [
|
||||||
|
"always_show_shelf.icon",
|
||||||
|
"auto_hide.icon",
|
||||||
|
"autoclick.icon",
|
||||||
|
"autoclick_double_click.icon",
|
||||||
|
"autoclick_drag.icon",
|
||||||
|
"autoclick_left_click.icon",
|
||||||
|
"autoclick_right_click.icon",
|
||||||
|
"autoclick_pause.icon",
|
||||||
|
"autoclick_position_bottom_left.icon",
|
||||||
|
"autoclick_position_bottom_right.icon",
|
||||||
|
"autoclick_position_top_left.icon",
|
||||||
|
"autoclick_position_top_right.icon",
|
||||||
|
"captive_portal.icon",
|
||||||
|
"check_circle.icon",
|
||||||
|
"desks_close_desk_button.icon",
|
||||||
|
"desks_new_desk_button.icon",
|
||||||
|
"dictation_menu.icon",
|
||||||
|
"dictation_off.icon",
|
||||||
|
"dictation_off_newui.icon",
|
||||||
|
"dictation_on.icon",
|
||||||
|
"dictation_on_newui.icon",
|
||||||
|
"ime_menu_emoticon.icon",
|
||||||
|
"ime_menu_microphone.icon",
|
||||||
|
"ime_menu_on_screen_keyboard.icon",
|
||||||
|
"ime_menu_write.icon",
|
||||||
|
"keyboard.icon",
|
||||||
|
"lock_screen_alert.icon",
|
||||||
|
"lock_screen_arrow.icon",
|
||||||
|
"lock_screen_arrow_back.icon",
|
||||||
|
"lock_screen_backspace.icon",
|
||||||
|
"lock_screen_caps_lock.icon",
|
||||||
|
"lock_screen_dropdown.icon",
|
||||||
|
"lock_screen_fingerprint.icon",
|
||||||
|
"lock_screen_fingerprint_success.icon",
|
||||||
|
"lock_screen_time_limit_lock.icon",
|
||||||
|
"lock_screen_time_limit_moon.icon",
|
||||||
|
"lock_screen_time_limit_timer.icon",
|
||||||
|
"login_screen_button_dropdown.icon",
|
||||||
|
"login_screen_menu_dropdown.icon",
|
||||||
|
"login_screen_enterprise.icon",
|
||||||
|
"mic.icon",
|
||||||
|
"network_badge_add_other.icon",
|
||||||
|
"network_badge_captive_portal.icon",
|
||||||
|
"network_badge_off.icon",
|
||||||
|
"network_badge_roaming.icon",
|
||||||
|
"network_badge_secure.icon",
|
||||||
|
"network_badge_technology_1x.icon",
|
||||||
|
"network_badge_technology_3g.icon",
|
||||||
|
"network_badge_technology_4g.icon",
|
||||||
|
"network_badge_technology_edge.icon",
|
||||||
|
"network_badge_technology_evdo.icon",
|
||||||
|
"network_badge_technology_gprs.icon",
|
||||||
|
"network_badge_technology_hspa.icon",
|
||||||
|
"network_badge_technology_hspa_plus.icon",
|
||||||
|
"network_badge_technology_lte.icon",
|
||||||
|
"network_badge_technology_lte_advanced.icon",
|
||||||
|
"network_badge_vpn.icon",
|
||||||
|
"network_ethernet.icon",
|
||||||
|
"network_mobile_not_connected_x.icon",
|
||||||
|
"network_vpn.icon",
|
||||||
|
"notification_accessibility.icon",
|
||||||
|
"notification_accessibility_braille.icon",
|
||||||
|
"notification_battery_critical.icon",
|
||||||
|
"notification_battery_fluctuating.icon",
|
||||||
|
"notification_battery_low.icon",
|
||||||
|
"notification_bluetooth_battery_warning.icon",
|
||||||
|
"notification_bluetooth.icon",
|
||||||
|
"notification_capslock.icon",
|
||||||
|
"notification_center_all_done.icon",
|
||||||
|
"notification_center_clear_all.icon",
|
||||||
|
"notification_center_collapse.icon",
|
||||||
|
"notification_center_do_not_disturb_off.icon",
|
||||||
|
"notification_center_do_not_disturb_on.icon",
|
||||||
|
"notification_center_empty.icon",
|
||||||
|
"notification_center_settings.icon",
|
||||||
|
"notification_charging_usb_c.icon",
|
||||||
|
"notification_chromevox.icon",
|
||||||
|
"notification_keyboard.icon",
|
||||||
|
"notification_low_power_charger.icon",
|
||||||
|
"notification_monitor_warning.icon",
|
||||||
|
"notification_screen.icon",
|
||||||
|
"notification_screenshare.icon",
|
||||||
|
"notification_sms_sync.icon",
|
||||||
|
"notification_stylus_battery_warning.icon",
|
||||||
|
"notification_timer.icon",
|
||||||
|
"overview_window_close.icon",
|
||||||
|
"overview_drop_target_plus.icon",
|
||||||
|
"palette_action_capture_region.icon",
|
||||||
|
"palette_action_capture_screen.icon",
|
||||||
|
"palette_action_create_note.icon",
|
||||||
|
"palette_mode_laser_pointer.icon",
|
||||||
|
"palette_mode_magnify.icon",
|
||||||
|
"palette_mode_metalayer.icon",
|
||||||
|
"palette_tray_icon_capture_region.icon",
|
||||||
|
"palette_tray_icon_default.icon",
|
||||||
|
"palette_tray_icon_default_newui.icon",
|
||||||
|
"palette_tray_icon_laser_pointer.icon",
|
||||||
|
"palette_tray_icon_magnify.icon",
|
||||||
|
"palette_tray_icon_metalayer.icon",
|
||||||
|
"parent_access_lock.icon",
|
||||||
|
"send.icon",
|
||||||
|
"settings.icon",
|
||||||
|
"shelf_add_person_button.icon",
|
||||||
|
"shelf_apps_button.icon",
|
||||||
|
"shelf_back.icon",
|
||||||
|
"shelf_browse_as_guest_button.icon",
|
||||||
|
"shelf_cancel_button.icon",
|
||||||
|
"shelf_globe.icon",
|
||||||
|
"shelf_keyboard.icon",
|
||||||
|
"shelf_keyboard_newui.icon",
|
||||||
|
"shelf_logout.icon",
|
||||||
|
"shelf_notifications.icon",
|
||||||
|
"shelf_overflow.icon",
|
||||||
|
"shelf_overflow_horizontal_dots.icon",
|
||||||
|
"shelf_overview.icon",
|
||||||
|
"shelf_position.icon",
|
||||||
|
"shelf_shutdown_button.icon",
|
||||||
|
"shelf_sign_out_button.icon",
|
||||||
|
"shelf_unlock_button.icon",
|
||||||
|
"switch_access.icon",
|
||||||
|
"system_menu_accessibility.icon",
|
||||||
|
"system_menu_accessibility_auto_click.icon",
|
||||||
|
"system_menu_accessibility_chromevox.icon",
|
||||||
|
"system_menu_accessibility_contrast.icon",
|
||||||
|
"system_menu_accessibility_docked_magnifier.icon",
|
||||||
|
"system_menu_accessibility_fullscreen_magnifier.icon",
|
||||||
|
"system_menu_accessibility_select_to_speak.icon",
|
||||||
|
"system_menu_audio_input.icon",
|
||||||
|
"system_menu_audio_output.icon",
|
||||||
|
"system_menu_add_connection.icon",
|
||||||
|
"system_menu_arrow_back.icon",
|
||||||
|
"system_menu_arrow_right.icon",
|
||||||
|
"system_menu_bluetooth.icon",
|
||||||
|
"system_menu_bluetooth_connected.icon",
|
||||||
|
"system_menu_bluetooth_disabled.icon",
|
||||||
|
"system_menu_brightness.icon",
|
||||||
|
"system_menu_business.icon",
|
||||||
|
"system_menu_caps_lock.icon",
|
||||||
|
"system_menu_cast.icon",
|
||||||
|
"system_menu_cast_audio.icon",
|
||||||
|
"system_menu_cast_audio_group.icon",
|
||||||
|
"system_menu_cast_enabled.icon",
|
||||||
|
"system_menu_cast_generic.icon",
|
||||||
|
"system_menu_cast_message.icon",
|
||||||
|
"system_menu_child_user.icon",
|
||||||
|
"system_menu_computer.icon",
|
||||||
|
"system_menu_gamepad.icon",
|
||||||
|
"system_menu_guest.icon",
|
||||||
|
"system_menu_hdmi.icon",
|
||||||
|
"system_menu_headset.icon",
|
||||||
|
"system_menu_help.icon",
|
||||||
|
"system_menu_info.icon",
|
||||||
|
"system_menu_keyboard.icon",
|
||||||
|
"system_menu_keyboard_brightness.icon",
|
||||||
|
"system_menu_lock.icon",
|
||||||
|
"system_menu_mouse.icon",
|
||||||
|
"system_menu_phone.icon",
|
||||||
|
"system_menu_power.icon",
|
||||||
|
"system_menu_rollback.icon",
|
||||||
|
"system_menu_rotation_lock_auto.icon",
|
||||||
|
"system_menu_rotation_lock_landscape.icon",
|
||||||
|
"system_menu_rotation_lock_portrait.icon",
|
||||||
|
"system_menu_screen_share.icon",
|
||||||
|
"system_menu_settings.icon",
|
||||||
|
"system_menu_supervised_user.icon",
|
||||||
|
"system_menu_tablet.icon",
|
||||||
|
"system_menu_tracing.icon",
|
||||||
|
"system_menu_timer.icon",
|
||||||
|
"system_menu_new_user.icon",
|
||||||
|
"system_menu_night_light_off.icon",
|
||||||
|
"system_menu_night_light_on.icon",
|
||||||
|
"system_menu_usb.icon",
|
||||||
|
"system_menu_videocam.icon",
|
||||||
|
"system_menu_volume_high.icon",
|
||||||
|
"system_menu_volume_low.icon",
|
||||||
|
"system_menu_volume_medium.icon",
|
||||||
|
"system_menu_volume_mute.icon",
|
||||||
|
"system_power_button_menu_feedback.icon",
|
||||||
|
"system_power_button_menu_lock_screen.icon",
|
||||||
|
"system_power_button_menu_power_off.icon",
|
||||||
|
"system_power_button_menu_sign_out.icon",
|
||||||
|
"system_tray_accessibility.icon",
|
||||||
|
"system_tray_caps_lock.icon",
|
||||||
|
"system_tray_cast.icon",
|
||||||
|
"system_tray_do_not_disturb.icon",
|
||||||
|
"system_tray_family_link.icon",
|
||||||
|
"system_tray_managed.icon",
|
||||||
|
"system_tray_night_light.icon",
|
||||||
|
"system_tray_notification_counter_plus.icon",
|
||||||
|
"system_tray_recording.icon",
|
||||||
|
"system_tray_rotation_lock_auto.icon",
|
||||||
|
"system_tray_rotation_lock_locked.icon",
|
||||||
|
"system_tray_select_to_speak.icon",
|
||||||
|
"system_tray_select_to_speak_newui.icon",
|
||||||
|
"system_tray_select_to_speak_active.icon",
|
||||||
|
"system_tray_select_to_speak_active_newui.icon",
|
||||||
|
"system_tray_screen_share.icon",
|
||||||
|
"system_tray_stop.icon",
|
||||||
|
"system_tray_stop_newui.icon",
|
||||||
|
"system_tray_tracing.icon",
|
||||||
|
"system_tray_update.icon",
|
||||||
|
"system_tray_volume_mute.icon",
|
||||||
|
"touch_calibration_complete_check.icon",
|
||||||
|
"touch_calibration_hand.icon",
|
||||||
|
"tray_action_new_lock_screen_note.icon",
|
||||||
|
"unified_menu_accessibility.icon",
|
||||||
|
"unified_menu_arrow_back.icon",
|
||||||
|
"unified_menu_battery_alert.icon",
|
||||||
|
"unified_menu_battery_bolt.icon",
|
||||||
|
"unified_menu_battery_unreliable.icon",
|
||||||
|
"unified_menu_battery_x.icon",
|
||||||
|
"unified_menu_bluetooth_connected.icon",
|
||||||
|
"unified_menu_bluetooth.icon",
|
||||||
|
"unified_menu_brightness.icon",
|
||||||
|
"unified_menu_cast.icon",
|
||||||
|
"unified_menu_do_not_disturb.icon",
|
||||||
|
"unified_menu_expand.icon",
|
||||||
|
"unified_menu_info.icon",
|
||||||
|
"unified_menu_keyboard_brightness.icon",
|
||||||
|
"unified_menu_keyboard.icon",
|
||||||
|
"unified_menu_locale.icon",
|
||||||
|
"unified_menu_lock.icon",
|
||||||
|
"unified_menu_managed.icon",
|
||||||
|
"unified_menu_more.icon",
|
||||||
|
"unified_menu_night_light.icon",
|
||||||
|
"unified_menu_power.icon",
|
||||||
|
"unified_menu_rotation_lock_auto.icon",
|
||||||
|
"unified_menu_rotation_lock_landscape.icon",
|
||||||
|
"unified_menu_rotation_lock_portrait.icon",
|
||||||
|
"unified_menu_settings.icon",
|
||||||
|
"unified_menu_volume_high.icon",
|
||||||
|
"unified_menu_volume_low.icon",
|
||||||
|
"unified_menu_volume_medium.icon",
|
||||||
|
"unified_menu_volume_mute.icon",
|
||||||
|
"unified_menu_vpn.icon",
|
||||||
|
"unified_menu_wifi_off.icon",
|
||||||
|
"unified_network_badge_captive_portal.icon",
|
||||||
|
"unified_network_badge_secure.icon",
|
||||||
|
"unified_network_badge_vpn.icon",
|
||||||
|
"wallpaper.icon",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (is_chrome_branded) {
|
||||||
|
icons += [
|
||||||
|
"system_menu_cast_device.icon",
|
||||||
|
"system_menu_cast_education.icon",
|
||||||
|
"system_menu_cast_hangout.icon",
|
||||||
|
"system_menu_cast_meeting.icon",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
source_set("vector_icons") {
|
||||||
|
sources = get_target_outputs(":ash_vector_icons")
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":ash_vector_icons",
|
||||||
|
"//base",
|
||||||
|
"//skia",
|
||||||
|
"//ui/gfx",
|
||||||
|
]
|
||||||
|
}
|
109
src/ash/strings/BUILD.gn
Normal file
109
src/ash/strings/BUILD.gn
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
# Copyright 2014 The Chromium Authors. All rights reserved.
|
||||||
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
|
# found in the LICENSE file.
|
||||||
|
|
||||||
|
import("//tools/grit/grit_rule.gni")
|
||||||
|
import("//tools/grit/repack.gni")
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
grit("strings") {
|
||||||
|
source = "../ash_strings.grd"
|
||||||
|
|
||||||
|
defines = [ "is_chrome_branded=$is_chrome_branded" ]
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
"grit/ash_strings.h",
|
||||||
|
"ash_strings_am.pak",
|
||||||
|
"ash_strings_ar.pak",
|
||||||
|
"ash_strings_bg.pak",
|
||||||
|
"ash_strings_bn.pak",
|
||||||
|
"ash_strings_ca.pak",
|
||||||
|
"ash_strings_cs.pak",
|
||||||
|
"ash_strings_da.pak",
|
||||||
|
"ash_strings_de.pak",
|
||||||
|
"ash_strings_el.pak",
|
||||||
|
"ash_strings_en-GB.pak",
|
||||||
|
"ash_strings_en-US.pak",
|
||||||
|
"ash_strings_es.pak",
|
||||||
|
"ash_strings_es-419.pak",
|
||||||
|
"ash_strings_et.pak",
|
||||||
|
"ash_strings_fa.pak",
|
||||||
|
"ash_strings_fake-bidi.pak",
|
||||||
|
"ash_strings_fi.pak",
|
||||||
|
"ash_strings_fil.pak",
|
||||||
|
"ash_strings_fr.pak",
|
||||||
|
"ash_strings_gu.pak",
|
||||||
|
"ash_strings_he.pak",
|
||||||
|
"ash_strings_hi.pak",
|
||||||
|
"ash_strings_hr.pak",
|
||||||
|
"ash_strings_hu.pak",
|
||||||
|
"ash_strings_id.pak",
|
||||||
|
"ash_strings_it.pak",
|
||||||
|
"ash_strings_ja.pak",
|
||||||
|
"ash_strings_kn.pak",
|
||||||
|
"ash_strings_ko.pak",
|
||||||
|
"ash_strings_lt.pak",
|
||||||
|
"ash_strings_lv.pak",
|
||||||
|
"ash_strings_ml.pak",
|
||||||
|
"ash_strings_mr.pak",
|
||||||
|
"ash_strings_ms.pak",
|
||||||
|
"ash_strings_nl.pak",
|
||||||
|
"ash_strings_nb.pak",
|
||||||
|
"ash_strings_pl.pak",
|
||||||
|
"ash_strings_pt-BR.pak",
|
||||||
|
"ash_strings_pt-PT.pak",
|
||||||
|
"ash_strings_ro.pak",
|
||||||
|
"ash_strings_ru.pak",
|
||||||
|
"ash_strings_sk.pak",
|
||||||
|
"ash_strings_sl.pak",
|
||||||
|
"ash_strings_sr.pak",
|
||||||
|
"ash_strings_sv.pak",
|
||||||
|
"ash_strings_sw.pak",
|
||||||
|
"ash_strings_ta.pak",
|
||||||
|
"ash_strings_te.pak",
|
||||||
|
"ash_strings_th.pak",
|
||||||
|
"ash_strings_tr.pak",
|
||||||
|
"ash_strings_uk.pak",
|
||||||
|
"ash_strings_vi.pak",
|
||||||
|
"ash_strings_zh-CN.pak",
|
||||||
|
"ash_strings_zh-TW.pak",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Creates locale-specific pak files with strings needed for ash_unittests, etc.
|
||||||
|
template("repack_one_locale_ash") {
|
||||||
|
locale = invoker.locale
|
||||||
|
output = invoker.output
|
||||||
|
|
||||||
|
repack(target_name) {
|
||||||
|
# Each input pak file should also have a deps line for completeness.
|
||||||
|
sources = [
|
||||||
|
"$root_gen_dir/ash/components/strings/ash_components_strings_${locale}.pak",
|
||||||
|
"$root_gen_dir/ash/strings/ash_strings_${locale}.pak",
|
||||||
|
"$root_gen_dir/chromeos/strings/chromeos_strings_${locale}.pak",
|
||||||
|
"$root_gen_dir/components/strings/components_strings_${locale}.pak",
|
||||||
|
"$root_gen_dir/device/bluetooth/strings/bluetooth_strings_${locale}.pak",
|
||||||
|
"$root_gen_dir/ui/chromeos/strings/ui_chromeos_strings_${locale}.pak",
|
||||||
|
"$root_gen_dir/ui/strings/app_locale_settings_${locale}.pak",
|
||||||
|
"$root_gen_dir/ui/strings/ui_strings_${locale}.pak",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/components/strings",
|
||||||
|
"//ash/strings",
|
||||||
|
"//chromeos/strings",
|
||||||
|
"//components/strings",
|
||||||
|
"//device/bluetooth/strings",
|
||||||
|
"//ui/chromeos/strings",
|
||||||
|
"//ui/strings:app_locale_settings",
|
||||||
|
"//ui/strings:ui_strings",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Creates a pak file containing en-US strings for ash_unittests, etc.
|
||||||
|
repack_one_locale_ash("ash_test_strings") {
|
||||||
|
output = "$root_build_dir/ash_test_strings.pak"
|
||||||
|
locale = "en-US"
|
||||||
|
}
|
72
src/ash/system/message_center/arc/BUILD.gn
Normal file
72
src/ash/system/message_center/arc/BUILD.gn
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/config/ui.gni")
|
||||||
|
import("//testing/test.gni")
|
||||||
|
|
||||||
|
static_library("arc") {
|
||||||
|
sources = [
|
||||||
|
"arc_notification_constants.h",
|
||||||
|
"arc_notification_content_view.cc",
|
||||||
|
"arc_notification_content_view.h",
|
||||||
|
"arc_notification_delegate.cc",
|
||||||
|
"arc_notification_delegate.h",
|
||||||
|
"arc_notification_item.h",
|
||||||
|
"arc_notification_item_impl.cc",
|
||||||
|
"arc_notification_item_impl.h",
|
||||||
|
"arc_notification_manager.cc",
|
||||||
|
"arc_notification_manager.h",
|
||||||
|
"arc_notification_manager_delegate.h",
|
||||||
|
"arc_notification_surface.h",
|
||||||
|
"arc_notification_surface_impl.cc",
|
||||||
|
"arc_notification_surface_impl.h",
|
||||||
|
"arc_notification_surface_manager.cc",
|
||||||
|
"arc_notification_surface_manager.h",
|
||||||
|
"arc_notification_surface_manager_impl.cc",
|
||||||
|
"arc_notification_surface_manager_impl.h",
|
||||||
|
"arc_notification_view.cc",
|
||||||
|
"arc_notification_view.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/public/cpp:cpp",
|
||||||
|
"//base",
|
||||||
|
"//components/account_id",
|
||||||
|
"//components/arc:arc_metrics_constants",
|
||||||
|
"//components/arc:connection_holder",
|
||||||
|
"//components/arc/common:notifications",
|
||||||
|
"//components/exo",
|
||||||
|
"//mojo/public/cpp/system",
|
||||||
|
"//skia",
|
||||||
|
"//ui/accessibility",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/base",
|
||||||
|
"//ui/compositor",
|
||||||
|
"//ui/display",
|
||||||
|
"//ui/events",
|
||||||
|
"//ui/gfx",
|
||||||
|
"//ui/message_center",
|
||||||
|
"//ui/message_center/public/cpp",
|
||||||
|
"//ui/resources",
|
||||||
|
"//ui/strings",
|
||||||
|
"//ui/views",
|
||||||
|
"//ui/wm",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
static_library("test_support") {
|
||||||
|
testonly = true
|
||||||
|
sources = [
|
||||||
|
"mock_arc_notification_item.cc",
|
||||||
|
"mock_arc_notification_item.h",
|
||||||
|
"mock_arc_notification_surface.cc",
|
||||||
|
"mock_arc_notification_surface.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":arc",
|
||||||
|
"//ui/aura",
|
||||||
|
"//ui/gl:test_support",
|
||||||
|
]
|
||||||
|
}
|
22
src/ash/wayland/BUILD.gn
Normal file
22
src/ash/wayland/BUILD.gn
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
assert(is_chromeos)
|
||||||
|
|
||||||
|
source_set("wayland") {
|
||||||
|
sources = [
|
||||||
|
"wayland_server_controller.cc",
|
||||||
|
"wayland_server_controller.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//ash/keyboard/arc",
|
||||||
|
"//ash/public/cpp",
|
||||||
|
"//ash/system/message_center/arc",
|
||||||
|
"//base",
|
||||||
|
"//components/exo",
|
||||||
|
"//components/exo/wayland",
|
||||||
|
"//skia",
|
||||||
|
]
|
||||||
|
}
|
3628
src/base/BUILD.gn
Normal file
3628
src/base/BUILD.gn
Normal file
File diff suppressed because it is too large
Load Diff
17
src/base/DEPS
Normal file
17
src/base/DEPS
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
include_rules = [
|
||||||
|
"+jni",
|
||||||
|
"+third_party/ashmem",
|
||||||
|
"+third_party/apple_apsl",
|
||||||
|
"+third_party/boringssl/src/include",
|
||||||
|
"+third_party/ced",
|
||||||
|
"+third_party/lss",
|
||||||
|
"+third_party/modp_b64",
|
||||||
|
"+third_party/tcmalloc",
|
||||||
|
|
||||||
|
# These are implicitly brought in from the root, and we don't want them.
|
||||||
|
"-ipc",
|
||||||
|
"-url",
|
||||||
|
|
||||||
|
# ICU dependendencies must be separate from the rest of base.
|
||||||
|
"-i18n",
|
||||||
|
]
|
42
src/base/OWNERS
Normal file
42
src/base/OWNERS
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# See //base/README.md to find qualification for being an owner.
|
||||||
|
|
||||||
|
ajwong@chromium.org
|
||||||
|
danakj@chromium.org
|
||||||
|
dcheng@chromium.org
|
||||||
|
fdoray@chromium.org
|
||||||
|
gab@chromium.org
|
||||||
|
kylechar@chromium.org
|
||||||
|
mark@chromium.org
|
||||||
|
thakis@chromium.org
|
||||||
|
thestig@chromium.org
|
||||||
|
wez@chromium.org
|
||||||
|
|
||||||
|
# For Bind/Callback:
|
||||||
|
per-file bind*=tzik@chromium.org
|
||||||
|
per-file callback*=tzik@chromium.org
|
||||||
|
|
||||||
|
# For Android-specific changes:
|
||||||
|
per-file *android*=file://base/android/OWNERS
|
||||||
|
per-file BUILD.gn=file://base/android/OWNERS
|
||||||
|
|
||||||
|
# For Fuchsia-specific changes:
|
||||||
|
per-file *_fuchsia*=file://build/fuchsia/OWNERS
|
||||||
|
|
||||||
|
# For Windows-specific changes:
|
||||||
|
per-file *_win*=file://base/win/OWNERS
|
||||||
|
|
||||||
|
# For FeatureList API:
|
||||||
|
per-file feature_list*=asvitkine@chromium.org
|
||||||
|
per-file feature_list*=isherman@chromium.org
|
||||||
|
|
||||||
|
# Restricted since rand_util.h also backs the cryptographically secure RNG.
|
||||||
|
per-file rand_util*=set noparent
|
||||||
|
per-file rand_util*=file://ipc/SECURITY_OWNERS
|
||||||
|
|
||||||
|
# For TCMalloc tests:
|
||||||
|
per-file security_unittest.cc=jln@chromium.org
|
||||||
|
|
||||||
|
# For Value:
|
||||||
|
per-file values*=jdoerrie@chromium.org
|
||||||
|
|
||||||
|
# COMPONENT: Internals>Core
|
49
src/base/PRESUBMIT.py
Normal file
49
src/base/PRESUBMIT.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
"""Chromium presubmit script for src/base.
|
||||||
|
|
||||||
|
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
|
||||||
|
for more details on the presubmit API built into depot_tools.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def _CheckNoInterfacesInBase(input_api, output_api):
|
||||||
|
"""Checks to make sure no files in libbase.a have |@interface|."""
|
||||||
|
pattern = input_api.re.compile(r'^\s*@interface', input_api.re.MULTILINE)
|
||||||
|
files = []
|
||||||
|
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
|
||||||
|
if (f.LocalPath().startswith('base/') and
|
||||||
|
not "/ios/" in f.LocalPath() and
|
||||||
|
not "/test/" in f.LocalPath() and
|
||||||
|
not f.LocalPath().endswith('_unittest.mm') and
|
||||||
|
not f.LocalPath().endswith('mac/sdk_forward_declarations.h')):
|
||||||
|
contents = input_api.ReadFile(f)
|
||||||
|
if pattern.search(contents):
|
||||||
|
files.append(f)
|
||||||
|
|
||||||
|
if len(files):
|
||||||
|
return [ output_api.PresubmitError(
|
||||||
|
'Objective-C interfaces or categories are forbidden in libbase. ' +
|
||||||
|
'See http://groups.google.com/a/chromium.org/group/chromium-dev/' +
|
||||||
|
'browse_thread/thread/efb28c10435987fd',
|
||||||
|
files) ]
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def _CommonChecks(input_api, output_api):
|
||||||
|
"""Checks common to both upload and commit."""
|
||||||
|
results = []
|
||||||
|
results.extend(_CheckNoInterfacesInBase(input_api, output_api))
|
||||||
|
return results
|
||||||
|
|
||||||
|
def CheckChangeOnUpload(input_api, output_api):
|
||||||
|
results = []
|
||||||
|
results.extend(_CommonChecks(input_api, output_api))
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
|
def CheckChangeOnCommit(input_api, output_api):
|
||||||
|
results = []
|
||||||
|
results.extend(_CommonChecks(input_api, output_api))
|
||||||
|
return results
|
75
src/base/README.md
Normal file
75
src/base/README.md
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
# What is this
|
||||||
|
Contains a written down set of principles and other information on //base.
|
||||||
|
Please add to it!
|
||||||
|
|
||||||
|
## About //base:
|
||||||
|
|
||||||
|
Chromium is a very mature project. Most things that are generally useful are
|
||||||
|
already here and things not here aren't generally useful.
|
||||||
|
|
||||||
|
Base is pulled into many projects. For example, various ChromeOS daemons. So
|
||||||
|
the bar for adding stuff is that it must have demonstrated wide
|
||||||
|
applicability. Prefer to add things closer to where they're used (i.e. "not
|
||||||
|
base"), and pull into base only when needed. In a project our size,
|
||||||
|
sometimes even duplication is OK and inevitable.
|
||||||
|
|
||||||
|
Adding a new logging macro `DPVELOG_NE` is not more clear than just
|
||||||
|
writing the stuff you want to log in a regular logging statement, even
|
||||||
|
if it makes your calling code longer. Just add it to your own code.
|
||||||
|
|
||||||
|
If the code in question does not need to be used inside base, but will have
|
||||||
|
multiple consumers across the codebase, consider placing it in a new directory
|
||||||
|
under components/ instead.
|
||||||
|
|
||||||
|
## Qualifications for being in //base OWNERS
|
||||||
|
* interest and ability to learn low level/high detail/complex c++ stuff
|
||||||
|
* inclination to always ask why and understand everything (including external
|
||||||
|
interactions like win32) rather than just hoping the author did it right
|
||||||
|
* mentorship/experience
|
||||||
|
* demonstrated good judgement (esp with regards to public APIs) over a length
|
||||||
|
of time
|
||||||
|
|
||||||
|
Owners are added when a contributor has shown the above qualifications and
|
||||||
|
when they express interest. There isn't an upper bound on the number of OWNERS.
|
||||||
|
|
||||||
|
## Design and naming
|
||||||
|
* Be sure to use the base namespace.
|
||||||
|
* STL-like constructs should adhere as closely to STL as possible. Functions
|
||||||
|
and behaviors not present in STL should only be added when they are related
|
||||||
|
to the specific data structure implemented by the container.
|
||||||
|
* For STL-like constructs our policy is that they should use STL-like naming
|
||||||
|
even when it may conflict with the style guide. So functions and class names
|
||||||
|
should be lower case with underscores. Non-STL-like classes and functions
|
||||||
|
should use Google naming.
|
||||||
|
|
||||||
|
## Performance testing
|
||||||
|
|
||||||
|
Since the primitives provided by //base are used very widely, it is important to
|
||||||
|
ensure they scale to the necessary workloads and perform well under all
|
||||||
|
supported platforms. The `base_perftests` target is a suite of
|
||||||
|
synthetic microbenchmarks that measure performance in various scenarios:
|
||||||
|
|
||||||
|
* BasicPostTaskPerfTest: Exercises MessageLoopTaskRunner's multi-threaded
|
||||||
|
queue in isolation.
|
||||||
|
* ConditionVariablePerfTest: Measures thread switching cost of condition
|
||||||
|
variables.
|
||||||
|
* IntegratedPostTaskPerfTest: Exercises the full MessageLoop/RunLoop
|
||||||
|
machinery.
|
||||||
|
* JSONPerfTest: Tests JSONWriter and JSONReader performance.
|
||||||
|
* MessageLoopPerfTest: Measures the speed of task posting in various
|
||||||
|
configurations.
|
||||||
|
* ObserverListPerfTest: Exercises adding, removing and signalling observers.
|
||||||
|
* PthreadEventPerfTest: Establishes the baseline thread switching cost using
|
||||||
|
pthreads.
|
||||||
|
* ScheduleWorkTest: Measures the overhead of MessagePump::ScheduleWork.
|
||||||
|
* SequenceManagerPerfTest: Benchmarks SequenceManager scheduling with various
|
||||||
|
underlying task runners.
|
||||||
|
* TaskObserverPerfTest: Measures the incremental cost of adding task
|
||||||
|
observers.
|
||||||
|
* TaskPerfTest: Checks the cost of posting tasks between threads.
|
||||||
|
* WaitableEvent{Thread,}PerfTest: Measures waitable events in single and
|
||||||
|
multithreaded scenarios.
|
||||||
|
|
||||||
|
Regressions in these benchmarks can generally by caused by 1) operating system
|
||||||
|
changes, 2) compiler version or flag changes or 3) changes in //base code
|
||||||
|
itself.
|
14
src/base/SECURITY_OWNERS
Normal file
14
src/base/SECURITY_OWNERS
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Changes to code that runs at high privilege and which has a high risk of
|
||||||
|
# memory corruption, such as parsers for complex inputs, require a security
|
||||||
|
# review to avoid introducing sandbox escapes.
|
||||||
|
#
|
||||||
|
# Although this file is in base/, it may apply to more than just base, OWNERS
|
||||||
|
# files outside of base may also include this file.
|
||||||
|
#
|
||||||
|
# Security team: If you are uncomfortable reviewing a particular bit of code
|
||||||
|
# yourself, don't hesitate to seek help from another security team member!
|
||||||
|
# Nobody knows everything, and the only way to learn is from experience.
|
||||||
|
dcheng@chromium.org
|
||||||
|
palmer@chromium.org
|
||||||
|
rsesek@chromium.org
|
||||||
|
tsepez@chromium.org
|
311
src/base/allocator/BUILD.gn
Normal file
311
src/base/allocator/BUILD.gn
Normal file
@ -0,0 +1,311 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//build/buildflag_header.gni")
|
||||||
|
import("//build/config/allocator.gni")
|
||||||
|
import("//build/config/compiler/compiler.gni")
|
||||||
|
|
||||||
|
declare_args() {
|
||||||
|
# Provide a way to force disable debugallocation in Debug builds,
|
||||||
|
# e.g. for profiling (it's more rare to profile Debug builds,
|
||||||
|
# but people sometimes need to do that).
|
||||||
|
enable_debugallocation = is_debug
|
||||||
|
|
||||||
|
# Provide a way to build tcmalloc with a low memory footprint.
|
||||||
|
use_tcmalloc_small_but_slow = false
|
||||||
|
}
|
||||||
|
|
||||||
|
# This "allocator" meta-target will forward to the default allocator according
|
||||||
|
# to the build settings.
|
||||||
|
group("allocator") {
|
||||||
|
public_deps = []
|
||||||
|
deps = []
|
||||||
|
|
||||||
|
if (use_allocator == "tcmalloc") {
|
||||||
|
deps += [ ":tcmalloc" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
config("tcmalloc_flags") {
|
||||||
|
defines = [
|
||||||
|
"TCMALLOC_USE_DOUBLYLINKED_FREELIST",
|
||||||
|
"TCMALLOC_DISABLE_HUGE_ALLOCATIONS",
|
||||||
|
]
|
||||||
|
if (enable_debugallocation) {
|
||||||
|
defines += [
|
||||||
|
# Use debugallocation for Debug builds to catch problems early
|
||||||
|
# and cleanly, http://crbug.com/30715 .
|
||||||
|
"TCMALLOC_FOR_DEBUGALLOCATION",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
if (use_allocator_shim) {
|
||||||
|
defines += [ "TCMALLOC_DONT_REPLACE_SYSTEM_ALLOC" ]
|
||||||
|
}
|
||||||
|
if (use_tcmalloc_small_but_slow) {
|
||||||
|
defines += [ "TCMALLOC_SMALL_BUT_SLOW" ]
|
||||||
|
}
|
||||||
|
if (is_clang) {
|
||||||
|
cflags = [
|
||||||
|
# tcmalloc initializes some fields in the wrong order.
|
||||||
|
"-Wno-reorder",
|
||||||
|
|
||||||
|
# tcmalloc contains some unused local template specializations.
|
||||||
|
"-Wno-unused-function",
|
||||||
|
|
||||||
|
# tcmalloc uses COMPILE_ASSERT without static_assert but with typedefs.
|
||||||
|
"-Wno-unused-local-typedefs",
|
||||||
|
|
||||||
|
# for magic2_ in debugallocation.cc (only built in Debug builds) typedefs.
|
||||||
|
"-Wno-unused-private-field",
|
||||||
|
]
|
||||||
|
} else {
|
||||||
|
cflags = []
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_linux || is_android) {
|
||||||
|
# We enable all warnings by default, but upstream disables a few.
|
||||||
|
# Keep "-Wno-*" flags in sync with upstream by comparing against:
|
||||||
|
# http://code.google.com/p/google-perftools/source/browse/trunk/Makefile.am
|
||||||
|
cflags += [
|
||||||
|
"-Wno-sign-compare",
|
||||||
|
"-Wno-unused-result",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (use_allocator == "tcmalloc") {
|
||||||
|
# tcmalloc currently won't compile on Android.
|
||||||
|
source_set("tcmalloc") {
|
||||||
|
if (use_new_tcmalloc) {
|
||||||
|
tcmalloc_dir = "//third_party/tcmalloc/chromium"
|
||||||
|
} else {
|
||||||
|
tcmalloc_dir = "//third_party/tcmalloc/gperftools-2.0/chromium"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Don't check tcmalloc's includes. These files include various files like
|
||||||
|
# base/foo.h and they actually refer to tcmalloc's forked copy of base
|
||||||
|
# rather than the regular one, which confuses the header checker.
|
||||||
|
check_includes = false
|
||||||
|
|
||||||
|
sources = [
|
||||||
|
# Generated for our configuration from tcmalloc's build
|
||||||
|
# and checked in.
|
||||||
|
"$tcmalloc_dir/src/config.h",
|
||||||
|
"$tcmalloc_dir/src/config_android.h",
|
||||||
|
"$tcmalloc_dir/src/config_linux.h",
|
||||||
|
"$tcmalloc_dir/src/config_win.h",
|
||||||
|
|
||||||
|
# tcmalloc native and forked files.
|
||||||
|
"$tcmalloc_dir/src/base/abort.cc",
|
||||||
|
"$tcmalloc_dir/src/base/abort.h",
|
||||||
|
"$tcmalloc_dir/src/base/arm_instruction_set_select.h",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops-internals-arm-generic.h",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops-internals-arm-v6plus.h",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops-internals-linuxppc.h",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops-internals-macosx.h",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops-internals-windows.h",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops-internals-x86.cc",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops-internals-x86.h",
|
||||||
|
"$tcmalloc_dir/src/base/atomicops.h",
|
||||||
|
"$tcmalloc_dir/src/base/commandlineflags.h",
|
||||||
|
"$tcmalloc_dir/src/base/cycleclock.h",
|
||||||
|
|
||||||
|
# We don't list dynamic_annotations.c since its copy is already
|
||||||
|
# present in the dynamic_annotations target.
|
||||||
|
"$tcmalloc_dir/src/base/elf_mem_image.cc",
|
||||||
|
"$tcmalloc_dir/src/base/elf_mem_image.h",
|
||||||
|
"$tcmalloc_dir/src/base/linuxthreads.cc",
|
||||||
|
"$tcmalloc_dir/src/base/linuxthreads.h",
|
||||||
|
"$tcmalloc_dir/src/base/logging.cc",
|
||||||
|
"$tcmalloc_dir/src/base/logging.h",
|
||||||
|
"$tcmalloc_dir/src/base/low_level_alloc.cc",
|
||||||
|
"$tcmalloc_dir/src/base/low_level_alloc.h",
|
||||||
|
"$tcmalloc_dir/src/base/spinlock.cc",
|
||||||
|
"$tcmalloc_dir/src/base/spinlock.h",
|
||||||
|
"$tcmalloc_dir/src/base/spinlock_internal.cc",
|
||||||
|
"$tcmalloc_dir/src/base/spinlock_internal.h",
|
||||||
|
"$tcmalloc_dir/src/base/synchronization_profiling.h",
|
||||||
|
"$tcmalloc_dir/src/base/sysinfo.cc",
|
||||||
|
"$tcmalloc_dir/src/base/sysinfo.h",
|
||||||
|
"$tcmalloc_dir/src/base/vdso_support.cc",
|
||||||
|
"$tcmalloc_dir/src/base/vdso_support.h",
|
||||||
|
"$tcmalloc_dir/src/central_freelist.cc",
|
||||||
|
"$tcmalloc_dir/src/central_freelist.h",
|
||||||
|
"$tcmalloc_dir/src/common.cc",
|
||||||
|
"$tcmalloc_dir/src/common.h",
|
||||||
|
|
||||||
|
# #included by debugallocation_shim.cc
|
||||||
|
#"$tcmalloc_dir/src/debugallocation.cc",
|
||||||
|
"$tcmalloc_dir/src/free_list.cc",
|
||||||
|
"$tcmalloc_dir/src/free_list.h",
|
||||||
|
"$tcmalloc_dir/src/gperftools/heap-profiler.h",
|
||||||
|
"$tcmalloc_dir/src/gperftools/malloc_extension.h",
|
||||||
|
"$tcmalloc_dir/src/gperftools/malloc_hook.h",
|
||||||
|
"$tcmalloc_dir/src/gperftools/stacktrace.h",
|
||||||
|
"$tcmalloc_dir/src/internal_logging.cc",
|
||||||
|
"$tcmalloc_dir/src/internal_logging.h",
|
||||||
|
"$tcmalloc_dir/src/linked_list.h",
|
||||||
|
"$tcmalloc_dir/src/malloc_extension.cc",
|
||||||
|
"$tcmalloc_dir/src/malloc_hook-inl.h",
|
||||||
|
"$tcmalloc_dir/src/malloc_hook.cc",
|
||||||
|
"$tcmalloc_dir/src/maybe_threads.cc",
|
||||||
|
"$tcmalloc_dir/src/maybe_threads.h",
|
||||||
|
"$tcmalloc_dir/src/page_heap.cc",
|
||||||
|
"$tcmalloc_dir/src/page_heap.h",
|
||||||
|
"$tcmalloc_dir/src/raw_printer.cc",
|
||||||
|
"$tcmalloc_dir/src/raw_printer.h",
|
||||||
|
"$tcmalloc_dir/src/sampler.cc",
|
||||||
|
"$tcmalloc_dir/src/sampler.h",
|
||||||
|
"$tcmalloc_dir/src/span.cc",
|
||||||
|
"$tcmalloc_dir/src/span.h",
|
||||||
|
"$tcmalloc_dir/src/stack_trace_table.cc",
|
||||||
|
"$tcmalloc_dir/src/stack_trace_table.h",
|
||||||
|
"$tcmalloc_dir/src/stacktrace.cc",
|
||||||
|
"$tcmalloc_dir/src/static_vars.cc",
|
||||||
|
"$tcmalloc_dir/src/static_vars.h",
|
||||||
|
"$tcmalloc_dir/src/symbolize.cc",
|
||||||
|
"$tcmalloc_dir/src/symbolize.h",
|
||||||
|
"$tcmalloc_dir/src/system-alloc.cc",
|
||||||
|
"$tcmalloc_dir/src/system-alloc.h",
|
||||||
|
|
||||||
|
# #included by debugallocation_shim.cc
|
||||||
|
#"$tcmalloc_dir/src/tcmalloc.cc",
|
||||||
|
#"$tcmalloc_dir/src/tcmalloc.h",
|
||||||
|
"$tcmalloc_dir/src/thread_cache.cc",
|
||||||
|
"$tcmalloc_dir/src/thread_cache.h",
|
||||||
|
"$tcmalloc_dir/src/windows/port.cc",
|
||||||
|
"$tcmalloc_dir/src/windows/port.h",
|
||||||
|
"debugallocation_shim.cc",
|
||||||
|
|
||||||
|
# These are both #included by allocator_shim for maximal linking.
|
||||||
|
#"generic_allocators.cc",
|
||||||
|
#"win_allocator.cc",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Account for file changes in the new tcmalloc version.
|
||||||
|
if (use_new_tcmalloc) {
|
||||||
|
sources -= [ "$tcmalloc_dir/src/base/cycleclock.h" ]
|
||||||
|
sources += [
|
||||||
|
"$tcmalloc_dir/src/fake_stacktrace_scope.cc",
|
||||||
|
"$tcmalloc_dir/src/maybe_emergency_malloc.h",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Not included on mips64el.
|
||||||
|
if (current_cpu == "mips64el") {
|
||||||
|
sources -= [
|
||||||
|
"$tcmalloc_dir/src/base/linuxthreads.cc",
|
||||||
|
"$tcmalloc_dir/src/base/linuxthreads.h",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Disable the heap checker in tcmalloc.
|
||||||
|
defines = [ "NO_HEAP_CHECK" ]
|
||||||
|
|
||||||
|
include_dirs = [
|
||||||
|
".",
|
||||||
|
"$tcmalloc_dir/src/base",
|
||||||
|
"$tcmalloc_dir/src",
|
||||||
|
]
|
||||||
|
|
||||||
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||||
|
configs += [
|
||||||
|
"//build/config/compiler:no_chromium_code",
|
||||||
|
":tcmalloc_flags",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Thumb mode disabled due to bug in clang integrated assembler
|
||||||
|
# TODO(https://llvm.org/bugs/show_bug.cgi?id=31058)
|
||||||
|
configs -= [ "//build/config/compiler:compiler_arm_thumb" ]
|
||||||
|
configs += [ "//build/config/compiler:compiler_arm" ]
|
||||||
|
|
||||||
|
# TODO(crbug.com/633719) Make tcmalloc work with AFDO on GCC if possible.
|
||||||
|
if (!is_clang) {
|
||||||
|
configs -= [ "//build/config/compiler:afdo" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":buildflags",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (enable_profiling) {
|
||||||
|
sources += [
|
||||||
|
"$tcmalloc_dir/src/base/thread_lister.c",
|
||||||
|
"$tcmalloc_dir/src/base/thread_lister.h",
|
||||||
|
"$tcmalloc_dir/src/heap-profile-table.cc",
|
||||||
|
"$tcmalloc_dir/src/heap-profile-table.h",
|
||||||
|
"$tcmalloc_dir/src/heap-profiler.cc",
|
||||||
|
"$tcmalloc_dir/src/memory_region_map.cc",
|
||||||
|
"$tcmalloc_dir/src/memory_region_map.h",
|
||||||
|
"$tcmalloc_dir/src/profile-handler.cc",
|
||||||
|
"$tcmalloc_dir/src/profile-handler.h",
|
||||||
|
"$tcmalloc_dir/src/profiledata.cc",
|
||||||
|
"$tcmalloc_dir/src/profiledata.h",
|
||||||
|
"$tcmalloc_dir/src/profiler.cc",
|
||||||
|
]
|
||||||
|
defines += [ "ENABLE_PROFILING=1" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_linux || is_android) {
|
||||||
|
sources -= [
|
||||||
|
"$tcmalloc_dir/src/system-alloc.h",
|
||||||
|
"$tcmalloc_dir/src/windows/port.cc",
|
||||||
|
"$tcmalloc_dir/src/windows/port.h",
|
||||||
|
]
|
||||||
|
|
||||||
|
# Compiling tcmalloc with -fvisibility=default is only necessary when
|
||||||
|
# not using the allocator shim, which provides the correct visibility
|
||||||
|
# annotations for those symbols which need to be exported (see
|
||||||
|
# //base/allocator/allocator_shim_override_glibc_weak_symbols.h and
|
||||||
|
# //base/allocator/allocator_shim_internals.h for the definition of
|
||||||
|
# SHIM_ALWAYS_EXPORT).
|
||||||
|
if (!use_allocator_shim) {
|
||||||
|
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
|
||||||
|
configs += [ "//build/config/gcc:symbol_visibility_default" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
ldflags = [
|
||||||
|
# Don't let linker rip this symbol out, otherwise the heap&cpu
|
||||||
|
# profilers will not initialize properly on startup.
|
||||||
|
"-Wl,-uIsHeapProfilerRunning,-uProfilerStart",
|
||||||
|
|
||||||
|
# Do the same for heap leak checker.
|
||||||
|
"-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi",
|
||||||
|
"-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl",
|
||||||
|
"-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14UnIgnoreObjectEPKv",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Make sure the allocation library is optimized as much as possible when
|
||||||
|
# we"re in release mode.
|
||||||
|
if (!is_debug) {
|
||||||
|
configs -= [ "//build/config/compiler:default_optimization" ]
|
||||||
|
configs += [ "//build/config/compiler:optimize_max" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
deps += [ "//base/third_party/dynamic_annotations" ]
|
||||||
|
}
|
||||||
|
} # use_allocator == "tcmalloc"
|
||||||
|
|
||||||
|
buildflag_header("buildflags") {
|
||||||
|
header = "buildflags.h"
|
||||||
|
flags = [
|
||||||
|
"USE_ALLOCATOR_SHIM=$use_allocator_shim",
|
||||||
|
"USE_NEW_TCMALLOC=$use_new_tcmalloc",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Used to shim malloc symbols on Android. see //base/allocator/README.md.
|
||||||
|
config("wrap_malloc_symbols") {
|
||||||
|
ldflags = [
|
||||||
|
"-Wl,-wrap,calloc",
|
||||||
|
"-Wl,-wrap,free",
|
||||||
|
"-Wl,-wrap,malloc",
|
||||||
|
"-Wl,-wrap,memalign",
|
||||||
|
"-Wl,-wrap,posix_memalign",
|
||||||
|
"-Wl,-wrap,pvalloc",
|
||||||
|
"-Wl,-wrap,realloc",
|
||||||
|
"-Wl,-wrap,valloc",
|
||||||
|
]
|
||||||
|
}
|
4
src/base/allocator/OWNERS
Normal file
4
src/base/allocator/OWNERS
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
primiano@chromium.org
|
||||||
|
wfh@chromium.org
|
||||||
|
|
||||||
|
# COMPONENT: Internals
|
197
src/base/allocator/README.md
Normal file
197
src/base/allocator/README.md
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
This document describes how malloc / new calls are routed in the various Chrome
|
||||||
|
platforms.
|
||||||
|
|
||||||
|
Bare in mind that the chromium codebase does not always just use `malloc()`.
|
||||||
|
Some examples:
|
||||||
|
- Large parts of the renderer (Blink) use two home-brewed allocators,
|
||||||
|
PartitionAlloc and BlinkGC (Oilpan).
|
||||||
|
- Some subsystems, such as the V8 JavaScript engine, handle memory management
|
||||||
|
autonomously.
|
||||||
|
- Various parts of the codebase use abstractions such as `SharedMemory` or
|
||||||
|
`DiscardableMemory` which, similarly to the above, have their own page-level
|
||||||
|
memory management.
|
||||||
|
|
||||||
|
Background
|
||||||
|
----------
|
||||||
|
The `allocator` target defines at compile-time the platform-specific choice of
|
||||||
|
the allocator and extra-hooks which services calls to malloc/new. The relevant
|
||||||
|
build-time flags involved are `use_allocator` and `use_allocator_shim`.
|
||||||
|
|
||||||
|
The default choices are as follows:
|
||||||
|
|
||||||
|
**Windows**
|
||||||
|
`use_allocator: winheap`, the default Windows heap.
|
||||||
|
Additionally, `static_library` (i.e. non-component) builds have a shim
|
||||||
|
layer wrapping malloc/new, which is controlled by `use_allocator_shim`.
|
||||||
|
The shim layer provides extra security features, such as preventing large
|
||||||
|
allocations that can hit signed vs. unsigned bugs in third_party code.
|
||||||
|
|
||||||
|
**Linux Desktop / CrOS**
|
||||||
|
`use_allocator: tcmalloc`, a forked copy of tcmalloc which resides in
|
||||||
|
`third_party/tcmalloc/chromium`. Setting `use_allocator: none` causes the build
|
||||||
|
to fall back to the system (Glibc) symbols.
|
||||||
|
|
||||||
|
**Android**
|
||||||
|
`use_allocator: none`, always use the allocator symbols coming from Android's
|
||||||
|
libc (Bionic). As it is developed as part of the OS, it is considered to be
|
||||||
|
optimized for small devices and more memory-efficient than other choices.
|
||||||
|
The actual implementation backing malloc symbols in Bionic is up to the board
|
||||||
|
config and can vary (typically *dlmalloc* or *jemalloc* on most Nexus devices).
|
||||||
|
|
||||||
|
**Mac/iOS**
|
||||||
|
`use_allocator: none`, we always use the system's allocator implementation.
|
||||||
|
|
||||||
|
In addition, when building for `asan` / `msan` both the allocator and the shim
|
||||||
|
layer are disabled.
|
||||||
|
|
||||||
|
Layering and build deps
|
||||||
|
-----------------------
|
||||||
|
The `allocator` target provides both the source files for tcmalloc (where
|
||||||
|
applicable) and the linker flags required for the Windows shim layer.
|
||||||
|
The `base` target is (almost) the only one depending on `allocator`. No other
|
||||||
|
targets should depend on it, with the exception of the very few executables /
|
||||||
|
dynamic libraries that don't depend, either directly or indirectly, on `base`
|
||||||
|
within the scope of a linker unit.
|
||||||
|
|
||||||
|
More importantly, **no other place outside of `/base` should depend on the
|
||||||
|
specific allocator** (e.g., directly include `third_party/tcmalloc`).
|
||||||
|
If such a functional dependency is required that should be achieved using
|
||||||
|
abstractions in `base` (see `/base/allocator/allocator_extension.h` and
|
||||||
|
`/base/memory/`)
|
||||||
|
|
||||||
|
**Why `base` depends on `allocator`?**
|
||||||
|
Because it needs to provide services that depend on the actual allocator
|
||||||
|
implementation. In the past `base` used to pretend to be allocator-agnostic
|
||||||
|
and get the dependencies injected by other layers. This ended up being an
|
||||||
|
inconsistent mess.
|
||||||
|
See the [allocator cleanup doc][url-allocator-cleanup] for more context.
|
||||||
|
|
||||||
|
Linker unit targets (executables and shared libraries) that depend in some way
|
||||||
|
on `base` (most of the targets in the codebase) get automatically the correct
|
||||||
|
set of linker flags to pull in tcmalloc or the Windows shim-layer.
|
||||||
|
|
||||||
|
|
||||||
|
Source code
|
||||||
|
-----------
|
||||||
|
This directory contains just the allocator (i.e. shim) layer that switches
|
||||||
|
between the different underlying memory allocation implementations.
|
||||||
|
|
||||||
|
The tcmalloc library originates outside of Chromium and exists in
|
||||||
|
`../../third_party/tcmalloc` (currently, the actual location is defined in the
|
||||||
|
allocator.gyp file). The third party sources use a vendor-branch SCM pattern to
|
||||||
|
track Chromium-specific changes independently from upstream changes.
|
||||||
|
|
||||||
|
The general intent is to push local changes upstream so that over
|
||||||
|
time we no longer need any forked files.
|
||||||
|
|
||||||
|
|
||||||
|
Unified allocator shim
|
||||||
|
----------------------
|
||||||
|
On most platforms, Chrome overrides the malloc / operator new symbols (and
|
||||||
|
corresponding free / delete and other variants). This is to enforce security
|
||||||
|
checks and lately to enable the
|
||||||
|
[memory-infra heap profiler][url-memory-infra-heap-profiler].
|
||||||
|
Historically each platform had its special logic for defining the allocator
|
||||||
|
symbols in different places of the codebase. The unified allocator shim is
|
||||||
|
a project aimed to unify the symbol definition and allocator routing logic in
|
||||||
|
a central place.
|
||||||
|
|
||||||
|
- Full documentation: [Allocator shim design doc][url-allocator-shim].
|
||||||
|
- Current state: Available and enabled by default on Android, CrOS, Linux,
|
||||||
|
Mac OS and Windows.
|
||||||
|
- Tracking bug: [https://crbug.com/550886][crbug.com/550886].
|
||||||
|
- Build-time flag: `use_allocator_shim`.
|
||||||
|
|
||||||
|
**Overview of the unified allocator shim**
|
||||||
|
The allocator shim consists of three stages:
|
||||||
|
```
|
||||||
|
+-------------------------+ +-----------------------+ +----------------+
|
||||||
|
| malloc & friends | -> | shim layer | -> | Routing to |
|
||||||
|
| symbols definition | | implementation | | allocator |
|
||||||
|
+-------------------------+ +-----------------------+ +----------------+
|
||||||
|
| - libc symbols (malloc, | | - Security checks | | - tcmalloc |
|
||||||
|
| calloc, free, ...) | | - Chain of dispatchers| | - glibc |
|
||||||
|
| - C++ symbols (operator | | that can intercept | | - Android |
|
||||||
|
| new, delete, ...) | | and override | | bionic |
|
||||||
|
| - glibc weak symbols | | allocations | | - WinHeap |
|
||||||
|
| (__libc_malloc, ...) | +-----------------------+ +----------------+
|
||||||
|
+-------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
**1. malloc symbols definition**
|
||||||
|
This stage takes care of overriding the symbols `malloc`, `free`,
|
||||||
|
`operator new`, `operator delete` and friends and routing those calls inside the
|
||||||
|
allocator shim (next point).
|
||||||
|
This is taken care of by the headers in `allocator_shim_override_*`.
|
||||||
|
|
||||||
|
*On Linux/CrOS*: the allocator symbols are defined as exported global symbols
|
||||||
|
in `allocator_shim_override_libc_symbols.h` (for `malloc`, `free` and friends)
|
||||||
|
and in `allocator_shim_override_cpp_symbols.h` (for `operator new`,
|
||||||
|
`operator delete` and friends).
|
||||||
|
This enables proper interposition of malloc symbols referenced by the main
|
||||||
|
executable and any third party libraries. Symbol resolution on Linux is a breadth first search that starts from the root link unit, that is the executable
|
||||||
|
(see EXECUTABLE AND LINKABLE FORMAT (ELF) - Portable Formats Specification).
|
||||||
|
Additionally, when tcmalloc is the default allocator, some extra glibc symbols
|
||||||
|
are also defined in `allocator_shim_override_glibc_weak_symbols.h`, for subtle
|
||||||
|
reasons explained in that file.
|
||||||
|
The Linux/CrOS shim was introduced by
|
||||||
|
[crrev.com/1675143004](https://crrev.com/1675143004).
|
||||||
|
|
||||||
|
*On Android*: load-time symbol interposition (unlike the Linux/CrOS case) is not
|
||||||
|
possible. This is because Android processes are `fork()`-ed from the Android
|
||||||
|
zygote, which pre-loads libc.so and only later native code gets loaded via
|
||||||
|
`dlopen()` (symbols from `dlopen()`-ed libraries get a different resolution
|
||||||
|
scope).
|
||||||
|
In this case, the approach instead of wrapping symbol resolution at link time
|
||||||
|
(i.e. during the build), via the `--Wl,-wrap,malloc` linker flag.
|
||||||
|
The use of this wrapping flag causes:
|
||||||
|
- All references to allocator symbols in the Chrome codebase to be rewritten as
|
||||||
|
references to `__wrap_malloc` and friends. The `__wrap_malloc` symbols are
|
||||||
|
defined in the `allocator_shim_override_linker_wrapped_symbols.h` and
|
||||||
|
route allocator calls inside the shim layer.
|
||||||
|
- The reference to the original `malloc` symbols (which typically is defined by
|
||||||
|
the system's libc.so) are accessible via the special `__real_malloc` and
|
||||||
|
friends symbols (which will be relocated, at load time, against `malloc`).
|
||||||
|
|
||||||
|
In summary, this approach is transparent to the dynamic loader, which still sees
|
||||||
|
undefined symbol references to malloc symbols.
|
||||||
|
These symbols will be resolved against libc.so as usual.
|
||||||
|
More details in [crrev.com/1719433002](https://crrev.com/1719433002).
|
||||||
|
|
||||||
|
**2. Shim layer implementation**
|
||||||
|
This stage contains the actual shim implementation. This consists of:
|
||||||
|
- A singly linked list of dispatchers (structs with function pointers to `malloc`-like functions). Dispatchers can be dynamically inserted at runtime
|
||||||
|
(using the `InsertAllocatorDispatch` API). They can intercept and override
|
||||||
|
allocator calls.
|
||||||
|
- The security checks (suicide on malloc-failure via `std::new_handler`, etc).
|
||||||
|
This happens inside `allocator_shim.cc`
|
||||||
|
|
||||||
|
**3. Final allocator routing**
|
||||||
|
The final element of the aforementioned dispatcher chain is statically defined
|
||||||
|
at build time and ultimately routes the allocator calls to the actual allocator
|
||||||
|
(as described in the *Background* section above). This is taken care of by the
|
||||||
|
headers in `allocator_shim_default_dispatch_to_*` files.
|
||||||
|
|
||||||
|
|
||||||
|
Appendixes
|
||||||
|
----------
|
||||||
|
**How does the Windows shim layer replace the malloc symbols?**
|
||||||
|
The mechanism for hooking LIBCMT in Windows is rather tricky. The core
|
||||||
|
problem is that by default, the Windows library does not declare malloc and
|
||||||
|
free as weak symbols. Because of this, they cannot be overridden. To work
|
||||||
|
around this, we start with the LIBCMT.LIB, and manually remove all allocator
|
||||||
|
related functions from it using the visual studio library tool. Once removed,
|
||||||
|
we can now link against the library and provide custom versions of the
|
||||||
|
allocator related functionality.
|
||||||
|
See the script `preb_libc.py` in this folder.
|
||||||
|
|
||||||
|
Related links
|
||||||
|
-------------
|
||||||
|
- [Unified allocator shim doc - Feb 2016][url-allocator-shim]
|
||||||
|
- [Allocator cleanup doc - Jan 2016][url-allocator-cleanup]
|
||||||
|
- [Proposal to use PartitionAlloc as default allocator](https://crbug.com/339604)
|
||||||
|
- [Memory-Infra: Tools to profile memory usage in Chrome](/docs/memory-infra/README.md)
|
||||||
|
|
||||||
|
[url-allocator-cleanup]: https://docs.google.com/document/d/1V77Kgp_4tfaaWPEZVxNevoD02wXiatnAv7Ssgr0hmjg/edit?usp=sharing
|
||||||
|
[url-memory-infra-heap-profiler]: /docs/memory-infra/heap_profiler.md
|
||||||
|
[url-allocator-shim]: https://docs.google.com/document/d/1yKlO1AO4XjpDad9rjcBOI15EKdAGsuGO_IeZy0g0kxo/edit?usp=sharing
|
46
src/base/allocator/allocator_check.cc
Normal file
46
src/base/allocator/allocator_check.cc
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
// 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 "base/allocator/allocator_check.h"
|
||||||
|
|
||||||
|
#include "base/allocator/buildflags.h"
|
||||||
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
#if defined(OS_WIN)
|
||||||
|
#include "base/allocator/winheap_stubs_win.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(OS_MACOSX)
|
||||||
|
#include "base/allocator/allocator_interception_mac.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
namespace allocator {
|
||||||
|
|
||||||
|
bool IsAllocatorInitialized() {
|
||||||
|
#if defined(OS_WIN) && BUILDFLAG(USE_ALLOCATOR_SHIM)
|
||||||
|
// Set by allocator_shim_override_ucrt_symbols_win.h when the
|
||||||
|
// shimmed _set_new_mode() is called.
|
||||||
|
return g_is_win_shim_layer_initialized;
|
||||||
|
#elif defined(OS_LINUX) && defined(USE_TCMALLOC) && \
|
||||||
|
!defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
|
||||||
|
// From third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h.
|
||||||
|
// TODO(primiano): replace with an include once base can depend on allocator.
|
||||||
|
#define TC_MALLOPT_IS_OVERRIDDEN_BY_TCMALLOC 0xbeef42
|
||||||
|
return (mallopt(TC_MALLOPT_IS_OVERRIDDEN_BY_TCMALLOC, 0) ==
|
||||||
|
TC_MALLOPT_IS_OVERRIDDEN_BY_TCMALLOC);
|
||||||
|
#elif defined(OS_MACOSX) && !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
|
||||||
|
// From allocator_interception_mac.mm.
|
||||||
|
return base::allocator::g_replaced_default_zone;
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace allocator
|
||||||
|
} // namespace base
|
18
src/base/allocator/allocator_check.h
Normal file
18
src/base/allocator/allocator_check.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
// 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 BASE_ALLOCATOR_ALLOCATOR_ALLOCATOR_CHECK_H_
|
||||||
|
#define BASE_ALLOCATOR_ALLOCATOR_ALLOCATOR_CHECK_H_
|
||||||
|
|
||||||
|
#include "base/base_export.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
namespace allocator {
|
||||||
|
|
||||||
|
BASE_EXPORT bool IsAllocatorInitialized();
|
||||||
|
|
||||||
|
} // namespace allocator
|
||||||
|
} // namespace base
|
||||||
|
|
||||||
|
#endif // BASE_ALLOCATOR_ALLOCATOR_ALLOCATOR_CHECK_H_
|
79
src/base/allocator/allocator_extension.cc
Normal file
79
src/base/allocator/allocator_extension.cc
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
// 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 "base/allocator/allocator_extension.h"
|
||||||
|
#include "base/allocator/buildflags.h"
|
||||||
|
#include "base/logging.h"
|
||||||
|
|
||||||
|
#if defined(USE_TCMALLOC)
|
||||||
|
#if BUILDFLAG(USE_NEW_TCMALLOC)
|
||||||
|
#include "third_party/tcmalloc/chromium/src/gperftools/heap-profiler.h"
|
||||||
|
#include "third_party/tcmalloc/chromium/src/gperftools/malloc_extension.h"
|
||||||
|
#include "third_party/tcmalloc/chromium/src/gperftools/malloc_hook.h"
|
||||||
|
#else
|
||||||
|
#include "third_party/tcmalloc/gperftools-2.0/chromium/src/gperftools/heap-profiler.h"
|
||||||
|
#include "third_party/tcmalloc/gperftools-2.0/chromium/src/gperftools/malloc_extension.h"
|
||||||
|
#include "third_party/tcmalloc/gperftools-2.0/chromium/src/gperftools/malloc_hook.h"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
namespace allocator {
|
||||||
|
|
||||||
|
void ReleaseFreeMemory() {
|
||||||
|
#if defined(USE_TCMALLOC)
|
||||||
|
::MallocExtension::instance()->ReleaseFreeMemory();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GetNumericProperty(const char* name, size_t* value) {
|
||||||
|
#if defined(USE_TCMALLOC)
|
||||||
|
return ::MallocExtension::instance()->GetNumericProperty(name, value);
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SetNumericProperty(const char* name, size_t value) {
|
||||||
|
#if defined(USE_TCMALLOC)
|
||||||
|
return ::MallocExtension::instance()->SetNumericProperty(name, value);
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GetHeapSample(std::string* writer) {
|
||||||
|
#if defined(USE_TCMALLOC)
|
||||||
|
::MallocExtension::instance()->GetHeapSample(writer);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsHeapProfilerRunning() {
|
||||||
|
#if defined(USE_TCMALLOC) && defined(ENABLE_PROFILING)
|
||||||
|
return ::IsHeapProfilerRunning();
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetHooks(AllocHookFunc alloc_hook, FreeHookFunc free_hook) {
|
||||||
|
// TODO(sque): Use allocator shim layer instead.
|
||||||
|
#if defined(USE_TCMALLOC)
|
||||||
|
// Make sure no hooks get overwritten.
|
||||||
|
auto prev_alloc_hook = MallocHook::SetNewHook(alloc_hook);
|
||||||
|
if (alloc_hook)
|
||||||
|
DCHECK(!prev_alloc_hook);
|
||||||
|
|
||||||
|
auto prev_free_hook = MallocHook::SetDeleteHook(free_hook);
|
||||||
|
if (free_hook)
|
||||||
|
DCHECK(!prev_free_hook);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetCallStack(void** stack, int max_stack_size) {
|
||||||
|
#if defined(USE_TCMALLOC)
|
||||||
|
return MallocHook::GetCallerStackTrace(stack, max_stack_size, 0);
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace allocator
|
||||||
|
} // namespace base
|
67
src/base/allocator/allocator_extension.h
Normal file
67
src/base/allocator/allocator_extension.h
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// 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 BASE_ALLOCATOR_ALLOCATOR_EXTENSION_H_
|
||||||
|
#define BASE_ALLOCATOR_ALLOCATOR_EXTENSION_H_
|
||||||
|
|
||||||
|
#include <stddef.h> // for size_t
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "base/base_export.h"
|
||||||
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
namespace allocator {
|
||||||
|
|
||||||
|
// Callback types for alloc and free.
|
||||||
|
using AllocHookFunc = void (*)(const void*, size_t);
|
||||||
|
using FreeHookFunc = void (*)(const void*);
|
||||||
|
|
||||||
|
// Request that the allocator release any free memory it knows about to the
|
||||||
|
// system.
|
||||||
|
BASE_EXPORT void ReleaseFreeMemory();
|
||||||
|
|
||||||
|
// Get the named property's |value|. Returns true if the property is known.
|
||||||
|
// Returns false if the property is not a valid property name for the current
|
||||||
|
// allocator implementation.
|
||||||
|
// |name| or |value| cannot be NULL
|
||||||
|
BASE_EXPORT bool GetNumericProperty(const char* name, size_t* value);
|
||||||
|
|
||||||
|
// Set the named property's |value|. Returns true if the property is known and
|
||||||
|
// writable. Returns false if the property is not a valid property name for the
|
||||||
|
// current allocator implementation, or is not writable. |name| cannot be NULL.
|
||||||
|
BASE_EXPORT bool SetNumericProperty(const char* name, size_t value);
|
||||||
|
|
||||||
|
// Outputs to |writer| a sample of live objects and the stack traces
|
||||||
|
// that allocated these objects. The format of the returned output
|
||||||
|
// is equivalent to the output of the heap profiler and can
|
||||||
|
// therefore be passed to "pprof".
|
||||||
|
// NOTE: by default, the allocator does not do any heap sampling, and this
|
||||||
|
// function will always return an empty sample. To get useful
|
||||||
|
// data from GetHeapSample, you must also set the numeric property
|
||||||
|
// "tcmalloc.sampling_period_bytes" to a value such as 524288.
|
||||||
|
BASE_EXPORT void GetHeapSample(std::string* writer);
|
||||||
|
|
||||||
|
BASE_EXPORT bool IsHeapProfilerRunning();
|
||||||
|
|
||||||
|
// Register callbacks for alloc and free. Can only store one callback at a time
|
||||||
|
// for each of alloc and free.
|
||||||
|
BASE_EXPORT void SetHooks(AllocHookFunc alloc_hook, FreeHookFunc free_hook);
|
||||||
|
|
||||||
|
// Attempts to unwind the call stack from the current location where this
|
||||||
|
// function is being called from. Must be called from a hook function registered
|
||||||
|
// by calling SetSingle{Alloc,Free}Hook, directly or indirectly.
|
||||||
|
//
|
||||||
|
// Arguments:
|
||||||
|
// stack: pointer to a pre-allocated array of void*'s.
|
||||||
|
// max_stack_size: indicates the size of the array in |stack|.
|
||||||
|
//
|
||||||
|
// Returns the number of call stack frames stored in |stack|, or 0 if no call
|
||||||
|
// stack information is available.
|
||||||
|
BASE_EXPORT int GetCallStack(void** stack, int max_stack_size);
|
||||||
|
|
||||||
|
} // namespace allocator
|
||||||
|
} // namespace base
|
||||||
|
|
||||||
|
#endif // BASE_ALLOCATOR_ALLOCATOR_EXTENSION_H_
|
56
src/base/allocator/allocator_interception_mac.h
Normal file
56
src/base/allocator/allocator_interception_mac.h
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// 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 BASE_ALLOCATOR_ALLOCATOR_INTERCEPTION_MAC_H_
|
||||||
|
#define BASE_ALLOCATOR_ALLOCATOR_INTERCEPTION_MAC_H_
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "base/base_export.h"
|
||||||
|
#include "third_party/apple_apsl/malloc.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
namespace allocator {
|
||||||
|
|
||||||
|
struct MallocZoneFunctions;
|
||||||
|
|
||||||
|
// Saves the function pointers currently used by the default zone.
|
||||||
|
void StoreFunctionsForDefaultZone();
|
||||||
|
|
||||||
|
// Same as StoreFunctionsForDefaultZone, but for all malloc zones.
|
||||||
|
void StoreFunctionsForAllZones();
|
||||||
|
|
||||||
|
// For all malloc zones that have been stored, replace their functions with
|
||||||
|
// |functions|.
|
||||||
|
void ReplaceFunctionsForStoredZones(const MallocZoneFunctions* functions);
|
||||||
|
|
||||||
|
extern bool g_replaced_default_zone;
|
||||||
|
|
||||||
|
// Calls the original implementation of malloc/calloc prior to interception.
|
||||||
|
bool UncheckedMallocMac(size_t size, void** result);
|
||||||
|
bool UncheckedCallocMac(size_t num_items, size_t size, void** result);
|
||||||
|
|
||||||
|
// Intercepts calls to default and purgeable malloc zones. Intercepts Core
|
||||||
|
// Foundation and Objective-C allocations.
|
||||||
|
// Has no effect on the default malloc zone if the allocator shim already
|
||||||
|
// performs that interception.
|
||||||
|
BASE_EXPORT void InterceptAllocationsMac();
|
||||||
|
|
||||||
|
// Updates all malloc zones to use their original functions.
|
||||||
|
// Also calls ClearAllMallocZonesForTesting.
|
||||||
|
BASE_EXPORT void UninterceptMallocZonesForTesting();
|
||||||
|
|
||||||
|
// Periodically checks for, and shims new malloc zones. Stops checking after 1
|
||||||
|
// minute.
|
||||||
|
BASE_EXPORT void PeriodicallyShimNewMallocZones();
|
||||||
|
|
||||||
|
// Exposed for testing.
|
||||||
|
BASE_EXPORT void ShimNewMallocZones();
|
||||||
|
BASE_EXPORT void ReplaceZoneFunctions(ChromeMallocZone* zone,
|
||||||
|
const MallocZoneFunctions* functions);
|
||||||
|
|
||||||
|
} // namespace allocator
|
||||||
|
} // namespace base
|
||||||
|
|
||||||
|
#endif // BASE_ALLOCATOR_ALLOCATOR_INTERCEPTION_MAC_H_
|
568
src/base/allocator/allocator_interception_mac.mm
Normal file
568
src/base/allocator/allocator_interception_mac.mm
Normal file
@ -0,0 +1,568 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// This file contains all the logic necessary to intercept allocations on
|
||||||
|
// macOS. "malloc zones" are an abstraction that allows the process to intercept
|
||||||
|
// all malloc-related functions. There is no good mechanism [short of
|
||||||
|
// interposition] to determine new malloc zones are added, so there's no clean
|
||||||
|
// mechanism to intercept all malloc zones. This file contains logic to
|
||||||
|
// intercept the default and purgeable zones, which always exist. A cursory
|
||||||
|
// review of Chrome seems to imply that non-default zones are almost never used.
|
||||||
|
//
|
||||||
|
// This file also contains logic to intercept Core Foundation and Objective-C
|
||||||
|
// allocations. The implementations forward to the default malloc zone, so the
|
||||||
|
// only reason to intercept these calls is to re-label OOM crashes with slightly
|
||||||
|
// more details.
|
||||||
|
|
||||||
|
#include "base/allocator/allocator_interception_mac.h"
|
||||||
|
|
||||||
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <mach/mach.h>
|
||||||
|
#include <mach/mach_vm.h>
|
||||||
|
#import <objc/runtime.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include <new>
|
||||||
|
|
||||||
|
#include "base/allocator/buildflags.h"
|
||||||
|
#include "base/allocator/malloc_zone_functions_mac.h"
|
||||||
|
#include "base/bind.h"
|
||||||
|
#include "base/bits.h"
|
||||||
|
#include "base/logging.h"
|
||||||
|
#include "base/mac/mac_util.h"
|
||||||
|
#include "base/mac/mach_logging.h"
|
||||||
|
#include "base/process/memory.h"
|
||||||
|
#include "base/threading/sequenced_task_runner_handle.h"
|
||||||
|
#include "build/build_config.h"
|
||||||
|
#include "third_party/apple_apsl/CFBase.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
|
namespace allocator {
|
||||||
|
|
||||||
|
bool g_replaced_default_zone = false;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
bool g_oom_killer_enabled;
|
||||||
|
|
||||||
|
// Starting with Mac OS X 10.7, the zone allocators set up by the system are
|
||||||
|
// read-only, to prevent them from being overwritten in an attack. However,
|
||||||
|
// blindly unprotecting and reprotecting the zone allocators fails with
|
||||||
|
// GuardMalloc because GuardMalloc sets up its zone allocator using a block of
|
||||||
|
// memory in its bss. Explicit saving/restoring of the protection is required.
|
||||||
|
//
|
||||||
|
// This function takes a pointer to a malloc zone, de-protects it if necessary,
|
||||||
|
// and returns (in the out parameters) a region of memory (if any) to be
|
||||||
|
// re-protected when modifications are complete. This approach assumes that
|
||||||
|
// there is no contention for the protection of this memory.
|
||||||
|
void DeprotectMallocZone(ChromeMallocZone* default_zone,
|
||||||
|
mach_vm_address_t* reprotection_start,
|
||||||
|
mach_vm_size_t* reprotection_length,
|
||||||
|
vm_prot_t* reprotection_value) {
|
||||||
|
mach_port_t unused;
|
||||||
|
*reprotection_start = reinterpret_cast<mach_vm_address_t>(default_zone);
|
||||||
|
struct vm_region_basic_info_64 info;
|
||||||
|
mach_msg_type_number_t count = VM_REGION_BASIC_INFO_COUNT_64;
|
||||||
|
kern_return_t result = mach_vm_region(
|
||||||
|
mach_task_self(), reprotection_start, reprotection_length,
|
||||||
|
VM_REGION_BASIC_INFO_64, reinterpret_cast<vm_region_info_t>(&info),
|
||||||
|
&count, &unused);
|
||||||
|
MACH_CHECK(result == KERN_SUCCESS, result) << "mach_vm_region";
|
||||||
|
|
||||||
|
// The kernel always returns a null object for VM_REGION_BASIC_INFO_64, but
|
||||||
|
// balance it with a deallocate in case this ever changes. See 10.9.2
|
||||||
|
// xnu-2422.90.20/osfmk/vm/vm_map.c vm_map_region.
|
||||||
|
mach_port_deallocate(mach_task_self(), unused);
|
||||||
|
|
||||||
|
// Does the region fully enclose the zone pointers? Possibly unwarranted
|
||||||
|
// simplification used: using the size of a full version 8 malloc zone rather
|
||||||
|
// than the actual smaller size if the passed-in zone is not version 8.
|
||||||
|
CHECK(*reprotection_start <=
|
||||||
|
reinterpret_cast<mach_vm_address_t>(default_zone));
|
||||||
|
mach_vm_size_t zone_offset =
|
||||||
|
reinterpret_cast<mach_vm_size_t>(default_zone) -
|
||||||
|
reinterpret_cast<mach_vm_size_t>(*reprotection_start);
|
||||||
|
CHECK(zone_offset + sizeof(ChromeMallocZone) <= *reprotection_length);
|
||||||
|
|
||||||
|
if (info.protection & VM_PROT_WRITE) {
|
||||||
|
// No change needed; the zone is already writable.
|
||||||
|
*reprotection_start = 0;
|
||||||
|
*reprotection_length = 0;
|
||||||
|
*reprotection_value = VM_PROT_NONE;
|
||||||
|
} else {
|
||||||
|
*reprotection_value = info.protection;
|
||||||
|
result = mach_vm_protect(mach_task_self(), *reprotection_start,
|
||||||
|
*reprotection_length, false,
|
||||||
|
info.protection | VM_PROT_WRITE);
|
||||||
|
MACH_CHECK(result == KERN_SUCCESS, result) << "mach_vm_protect";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !defined(ADDRESS_SANITIZER)
|
||||||
|
|
||||||
|
MallocZoneFunctions g_old_zone;
|
||||||
|
MallocZoneFunctions g_old_purgeable_zone;
|
||||||
|
|
||||||
|
void* oom_killer_malloc(struct _malloc_zone_t* zone, size_t size) {
|
||||||
|
void* result = g_old_zone.malloc(zone, size);
|
||||||
|
if (!result && size)
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_calloc(struct _malloc_zone_t* zone,
|
||||||
|
size_t num_items,
|
||||||
|
size_t size) {
|
||||||
|
void* result = g_old_zone.calloc(zone, num_items, size);
|
||||||
|
if (!result && num_items && size)
|
||||||
|
TerminateBecauseOutOfMemory(num_items * size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_valloc(struct _malloc_zone_t* zone, size_t size) {
|
||||||
|
void* result = g_old_zone.valloc(zone, size);
|
||||||
|
if (!result && size)
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void oom_killer_free(struct _malloc_zone_t* zone, void* ptr) {
|
||||||
|
g_old_zone.free(zone, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_realloc(struct _malloc_zone_t* zone, void* ptr, size_t size) {
|
||||||
|
void* result = g_old_zone.realloc(zone, ptr, size);
|
||||||
|
if (!result && size)
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_memalign(struct _malloc_zone_t* zone,
|
||||||
|
size_t alignment,
|
||||||
|
size_t size) {
|
||||||
|
void* result = g_old_zone.memalign(zone, alignment, size);
|
||||||
|
// Only die if posix_memalign would have returned ENOMEM, since there are
|
||||||
|
// other reasons why NULL might be returned (see
|
||||||
|
// http://opensource.apple.com/source/Libc/Libc-583/gen/malloc.c ).
|
||||||
|
if (!result && size && alignment >= sizeof(void*) &&
|
||||||
|
base::bits::IsPowerOfTwo(alignment)) {
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_malloc_purgeable(struct _malloc_zone_t* zone, size_t size) {
|
||||||
|
void* result = g_old_purgeable_zone.malloc(zone, size);
|
||||||
|
if (!result && size)
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_calloc_purgeable(struct _malloc_zone_t* zone,
|
||||||
|
size_t num_items,
|
||||||
|
size_t size) {
|
||||||
|
void* result = g_old_purgeable_zone.calloc(zone, num_items, size);
|
||||||
|
if (!result && num_items && size)
|
||||||
|
TerminateBecauseOutOfMemory(num_items * size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_valloc_purgeable(struct _malloc_zone_t* zone, size_t size) {
|
||||||
|
void* result = g_old_purgeable_zone.valloc(zone, size);
|
||||||
|
if (!result && size)
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void oom_killer_free_purgeable(struct _malloc_zone_t* zone, void* ptr) {
|
||||||
|
g_old_purgeable_zone.free(zone, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_realloc_purgeable(struct _malloc_zone_t* zone,
|
||||||
|
void* ptr,
|
||||||
|
size_t size) {
|
||||||
|
void* result = g_old_purgeable_zone.realloc(zone, ptr, size);
|
||||||
|
if (!result && size)
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_memalign_purgeable(struct _malloc_zone_t* zone,
|
||||||
|
size_t alignment,
|
||||||
|
size_t size) {
|
||||||
|
void* result = g_old_purgeable_zone.memalign(zone, alignment, size);
|
||||||
|
// Only die if posix_memalign would have returned ENOMEM, since there are
|
||||||
|
// other reasons why NULL might be returned (see
|
||||||
|
// http://opensource.apple.com/source/Libc/Libc-583/gen/malloc.c ).
|
||||||
|
if (!result && size && alignment >= sizeof(void*) &&
|
||||||
|
base::bits::IsPowerOfTwo(alignment)) {
|
||||||
|
TerminateBecauseOutOfMemory(size);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // !defined(ADDRESS_SANITIZER)
|
||||||
|
|
||||||
|
#if !defined(ADDRESS_SANITIZER)
|
||||||
|
|
||||||
|
// === Core Foundation CFAllocators ===
|
||||||
|
|
||||||
|
bool CanGetContextForCFAllocator() {
|
||||||
|
return !base::mac::IsOSLaterThan10_14_DontCallThis();
|
||||||
|
}
|
||||||
|
|
||||||
|
CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
|
||||||
|
ChromeCFAllocatorLions* our_allocator = const_cast<ChromeCFAllocatorLions*>(
|
||||||
|
reinterpret_cast<const ChromeCFAllocatorLions*>(allocator));
|
||||||
|
return &our_allocator->_context;
|
||||||
|
}
|
||||||
|
|
||||||
|
CFAllocatorAllocateCallBack g_old_cfallocator_system_default;
|
||||||
|
CFAllocatorAllocateCallBack g_old_cfallocator_malloc;
|
||||||
|
CFAllocatorAllocateCallBack g_old_cfallocator_malloc_zone;
|
||||||
|
|
||||||
|
void* oom_killer_cfallocator_system_default(CFIndex alloc_size,
|
||||||
|
CFOptionFlags hint,
|
||||||
|
void* info) {
|
||||||
|
void* result = g_old_cfallocator_system_default(alloc_size, hint, info);
|
||||||
|
if (!result)
|
||||||
|
TerminateBecauseOutOfMemory(alloc_size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_cfallocator_malloc(CFIndex alloc_size,
|
||||||
|
CFOptionFlags hint,
|
||||||
|
void* info) {
|
||||||
|
void* result = g_old_cfallocator_malloc(alloc_size, hint, info);
|
||||||
|
if (!result)
|
||||||
|
TerminateBecauseOutOfMemory(alloc_size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* oom_killer_cfallocator_malloc_zone(CFIndex alloc_size,
|
||||||
|
CFOptionFlags hint,
|
||||||
|
void* info) {
|
||||||
|
void* result = g_old_cfallocator_malloc_zone(alloc_size, hint, info);
|
||||||
|
if (!result)
|
||||||
|
TerminateBecauseOutOfMemory(alloc_size);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // !defined(ADDRESS_SANITIZER)
|
||||||
|
|
||||||
|
// === Cocoa NSObject allocation ===
|
||||||
|
|
||||||
|
typedef id (*allocWithZone_t)(id, SEL, NSZone*);
|
||||||
|
allocWithZone_t g_old_allocWithZone;
|
||||||
|
|
||||||
|
id oom_killer_allocWithZone(id self, SEL _cmd, NSZone* zone) {
|
||||||
|
id result = g_old_allocWithZone(self, _cmd, zone);
|
||||||
|
if (!result)
|
||||||
|
TerminateBecauseOutOfMemory(0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UninterceptMallocZoneForTesting(struct _malloc_zone_t* zone) {
|
||||||
|
ChromeMallocZone* chrome_zone = reinterpret_cast<ChromeMallocZone*>(zone);
|
||||||
|
if (!IsMallocZoneAlreadyStored(chrome_zone))
|
||||||
|
return;
|
||||||
|
MallocZoneFunctions& functions = GetFunctionsForZone(zone);
|
||||||
|
ReplaceZoneFunctions(chrome_zone, &functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
bool UncheckedMallocMac(size_t size, void** result) {
|
||||||
|
#if defined(ADDRESS_SANITIZER)
|
||||||
|
*result = malloc(size);
|
||||||
|
#else
|
||||||
|
if (g_old_zone.malloc) {
|
||||||
|
*result = g_old_zone.malloc(malloc_default_zone(), size);
|
||||||
|
} else {
|
||||||
|
*result = malloc(size);
|
||||||
|
}
|
||||||
|
#endif // defined(ADDRESS_SANITIZER)
|
||||||
|
|
||||||
|
return *result != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool UncheckedCallocMac(size_t num_items, size_t size, void** result) {
|
||||||
|
#if defined(ADDRESS_SANITIZER)
|
||||||
|
*result = calloc(num_items, size);
|
||||||
|
#else
|
||||||
|
if (g_old_zone.calloc) {
|
||||||
|
*result = g_old_zone.calloc(malloc_default_zone(), num_items, size);
|
||||||
|
} else {
|
||||||
|
*result = calloc(num_items, size);
|
||||||
|
}
|
||||||
|
#endif // defined(ADDRESS_SANITIZER)
|
||||||
|
|
||||||
|
return *result != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void StoreFunctionsForDefaultZone() {
|
||||||
|
ChromeMallocZone* default_zone = reinterpret_cast<ChromeMallocZone*>(
|
||||||
|
malloc_default_zone());
|
||||||
|
StoreMallocZone(default_zone);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StoreFunctionsForAllZones() {
|
||||||
|
// This ensures that the default zone is always at the front of the array,
|
||||||
|
// which is important for performance.
|
||||||
|
StoreFunctionsForDefaultZone();
|
||||||
|
|
||||||
|
vm_address_t* zones;
|
||||||
|
unsigned int count;
|
||||||
|
kern_return_t kr = malloc_get_all_zones(mach_task_self(), 0, &zones, &count);
|
||||||
|
if (kr != KERN_SUCCESS)
|
||||||
|
return;
|
||||||
|
for (unsigned int i = 0; i < count; ++i) {
|
||||||
|
ChromeMallocZone* zone = reinterpret_cast<ChromeMallocZone*>(zones[i]);
|
||||||
|
StoreMallocZone(zone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReplaceFunctionsForStoredZones(const MallocZoneFunctions* functions) {
|
||||||
|
// The default zone does not get returned in malloc_get_all_zones().
|
||||||
|
ChromeMallocZone* default_zone =
|
||||||
|
reinterpret_cast<ChromeMallocZone*>(malloc_default_zone());
|
||||||
|
if (DoesMallocZoneNeedReplacing(default_zone, functions)) {
|
||||||
|
ReplaceZoneFunctions(default_zone, functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
vm_address_t* zones;
|
||||||
|
unsigned int count;
|
||||||
|
kern_return_t kr =
|
||||||
|
malloc_get_all_zones(mach_task_self(), nullptr, &zones, &count);
|
||||||
|
if (kr != KERN_SUCCESS)
|
||||||
|
return;
|
||||||
|
for (unsigned int i = 0; i < count; ++i) {
|
||||||
|
ChromeMallocZone* zone = reinterpret_cast<ChromeMallocZone*>(zones[i]);
|
||||||
|
if (DoesMallocZoneNeedReplacing(zone, functions)) {
|
||||||
|
ReplaceZoneFunctions(zone, functions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g_replaced_default_zone = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InterceptAllocationsMac() {
|
||||||
|
if (g_oom_killer_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
g_oom_killer_enabled = true;
|
||||||
|
|
||||||
|
// === C malloc/calloc/valloc/realloc/posix_memalign ===
|
||||||
|
|
||||||
|
// This approach is not perfect, as requests for amounts of memory larger than
|
||||||
|
// MALLOC_ABSOLUTE_MAX_SIZE (currently SIZE_T_MAX - (2 * PAGE_SIZE)) will
|
||||||
|
// still fail with a NULL rather than dying (see
|
||||||
|
// http://opensource.apple.com/source/Libc/Libc-583/gen/malloc.c for details).
|
||||||
|
// Unfortunately, it's the best we can do. Also note that this does not affect
|
||||||
|
// allocations from non-default zones.
|
||||||
|
|
||||||
|
#if !defined(ADDRESS_SANITIZER)
|
||||||
|
// Don't do anything special on OOM for the malloc zones replaced by
|
||||||
|
// AddressSanitizer, as modifying or protecting them may not work correctly.
|
||||||
|
ChromeMallocZone* default_zone =
|
||||||
|
reinterpret_cast<ChromeMallocZone*>(malloc_default_zone());
|
||||||
|
if (!IsMallocZoneAlreadyStored(default_zone)) {
|
||||||
|
StoreZoneFunctions(default_zone, &g_old_zone);
|
||||||
|
MallocZoneFunctions new_functions = {};
|
||||||
|
new_functions.malloc = oom_killer_malloc;
|
||||||
|
new_functions.calloc = oom_killer_calloc;
|
||||||
|
new_functions.valloc = oom_killer_valloc;
|
||||||
|
new_functions.free = oom_killer_free;
|
||||||
|
new_functions.realloc = oom_killer_realloc;
|
||||||
|
new_functions.memalign = oom_killer_memalign;
|
||||||
|
|
||||||
|
ReplaceZoneFunctions(default_zone, &new_functions);
|
||||||
|
g_replaced_default_zone = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ChromeMallocZone* purgeable_zone =
|
||||||
|
reinterpret_cast<ChromeMallocZone*>(malloc_default_purgeable_zone());
|
||||||
|
if (purgeable_zone && !IsMallocZoneAlreadyStored(purgeable_zone)) {
|
||||||
|
StoreZoneFunctions(purgeable_zone, &g_old_purgeable_zone);
|
||||||
|
MallocZoneFunctions new_functions = {};
|
||||||
|
new_functions.malloc = oom_killer_malloc_purgeable;
|
||||||
|
new_functions.calloc = oom_killer_calloc_purgeable;
|
||||||
|
new_functions.valloc = oom_killer_valloc_purgeable;
|
||||||
|
new_functions.free = oom_killer_free_purgeable;
|
||||||
|
new_functions.realloc = oom_killer_realloc_purgeable;
|
||||||
|
new_functions.memalign = oom_killer_memalign_purgeable;
|
||||||
|
ReplaceZoneFunctions(purgeable_zone, &new_functions);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// === C malloc_zone_batch_malloc ===
|
||||||
|
|
||||||
|
// batch_malloc is omitted because the default malloc zone's implementation
|
||||||
|
// only supports batch_malloc for "tiny" allocations from the free list. It
|
||||||
|
// will fail for allocations larger than "tiny", and will only allocate as
|
||||||
|
// many blocks as it's able to from the free list. These factors mean that it
|
||||||
|
// can return less than the requested memory even in a non-out-of-memory
|
||||||
|
// situation. There's no good way to detect whether a batch_malloc failure is
|
||||||
|
// due to these other factors, or due to genuine memory or address space
|
||||||
|
// exhaustion. The fact that it only allocates space from the "tiny" free list
|
||||||
|
// means that it's likely that a failure will not be due to memory exhaustion.
|
||||||
|
// Similarly, these constraints on batch_malloc mean that callers must always
|
||||||
|
// be expecting to receive less memory than was requested, even in situations
|
||||||
|
// where memory pressure is not a concern. Finally, the only public interface
|
||||||
|
// to batch_malloc is malloc_zone_batch_malloc, which is specific to the
|
||||||
|
// system's malloc implementation. It's unlikely that anyone's even heard of
|
||||||
|
// it.
|
||||||
|
|
||||||
|
#ifndef ADDRESS_SANITIZER
|
||||||
|
// === Core Foundation CFAllocators ===
|
||||||
|
|
||||||
|
// This will not catch allocation done by custom allocators, but will catch
|
||||||
|
// all allocation done by system-provided ones.
|
||||||
|
|
||||||
|
CHECK(!g_old_cfallocator_system_default && !g_old_cfallocator_malloc &&
|
||||||
|
!g_old_cfallocator_malloc_zone)
|
||||||
|
<< "Old allocators unexpectedly non-null";
|
||||||
|
|
||||||
|
bool cf_allocator_internals_known = CanGetContextForCFAllocator();
|
||||||
|
|
||||||
|
if (cf_allocator_internals_known) {
|
||||||
|
CFAllocatorContext* context =
|
||||||
|
ContextForCFAllocator(kCFAllocatorSystemDefault);
|
||||||
|
CHECK(context) << "Failed to get context for kCFAllocatorSystemDefault.";
|
||||||
|
g_old_cfallocator_system_default = context->allocate;
|
||||||
|
CHECK(g_old_cfallocator_system_default)
|
||||||
|
<< "Failed to get kCFAllocatorSystemDefault allocation function.";
|
||||||
|
context->allocate = oom_killer_cfallocator_system_default;
|
||||||
|
|
||||||
|
context = ContextForCFAllocator(kCFAllocatorMalloc);
|
||||||
|
CHECK(context) << "Failed to get context for kCFAllocatorMalloc.";
|
||||||
|
g_old_cfallocator_malloc = context->allocate;
|
||||||
|
CHECK(g_old_cfallocator_malloc)
|
||||||
|
<< "Failed to get kCFAllocatorMalloc allocation function.";
|
||||||
|
context->allocate = oom_killer_cfallocator_malloc;
|
||||||
|
|
||||||
|
context = ContextForCFAllocator(kCFAllocatorMallocZone);
|
||||||
|
CHECK(context) << "Failed to get context for kCFAllocatorMallocZone.";
|
||||||
|
g_old_cfallocator_malloc_zone = context->allocate;
|
||||||
|
CHECK(g_old_cfallocator_malloc_zone)
|
||||||
|
<< "Failed to get kCFAllocatorMallocZone allocation function.";
|
||||||
|
context->allocate = oom_killer_cfallocator_malloc_zone;
|
||||||
|
} else {
|
||||||
|
DLOG(WARNING) << "Internals of CFAllocator not known; out-of-memory "
|
||||||
|
"failures via CFAllocator will not result in termination. "
|
||||||
|
"http://crbug.com/45650";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// === Cocoa NSObject allocation ===
|
||||||
|
|
||||||
|
// Note that both +[NSObject new] and +[NSObject alloc] call through to
|
||||||
|
// +[NSObject allocWithZone:].
|
||||||
|
|
||||||
|
CHECK(!g_old_allocWithZone) << "Old allocator unexpectedly non-null";
|
||||||
|
|
||||||
|
Class nsobject_class = [NSObject class];
|
||||||
|
Method orig_method =
|
||||||
|
class_getClassMethod(nsobject_class, @selector(allocWithZone:));
|
||||||
|
g_old_allocWithZone =
|
||||||
|
reinterpret_cast<allocWithZone_t>(method_getImplementation(orig_method));
|
||||||
|
CHECK(g_old_allocWithZone)
|
||||||
|
<< "Failed to get allocWithZone allocation function.";
|
||||||
|
method_setImplementation(orig_method,
|
||||||
|
reinterpret_cast<IMP>(oom_killer_allocWithZone));
|
||||||
|
}
|
||||||
|
|
||||||
|
void UninterceptMallocZonesForTesting() {
|
||||||
|
UninterceptMallocZoneForTesting(malloc_default_zone());
|
||||||
|
vm_address_t* zones;
|
||||||
|
unsigned int count;
|
||||||
|
kern_return_t kr = malloc_get_all_zones(mach_task_self(), 0, &zones, &count);
|
||||||
|
CHECK(kr == KERN_SUCCESS);
|
||||||
|
for (unsigned int i = 0; i < count; ++i) {
|
||||||
|
UninterceptMallocZoneForTesting(
|
||||||
|
reinterpret_cast<struct _malloc_zone_t*>(zones[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearAllMallocZonesForTesting();
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
void ShimNewMallocZonesAndReschedule(base::Time end_time,
|
||||||
|
base::TimeDelta delay) {
|
||||||
|
ShimNewMallocZones();
|
||||||
|
|
||||||
|
if (base::Time::Now() > end_time)
|
||||||
|
return;
|
||||||
|
|
||||||
|
base::TimeDelta next_delay = delay * 2;
|
||||||
|
SequencedTaskRunnerHandle::Get()->PostDelayedTask(
|
||||||
|
FROM_HERE,
|
||||||
|
base::BindOnce(&ShimNewMallocZonesAndReschedule, end_time, next_delay),
|
||||||
|
delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
void PeriodicallyShimNewMallocZones() {
|
||||||
|
base::Time end_time = base::Time::Now() + base::TimeDelta::FromMinutes(1);
|
||||||
|
base::TimeDelta initial_delay = base::TimeDelta::FromSeconds(1);
|
||||||
|
ShimNewMallocZonesAndReschedule(end_time, initial_delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShimNewMallocZones() {
|
||||||
|
StoreFunctionsForAllZones();
|
||||||
|
|
||||||
|
// Use the functions for the default zone as a template to replace those
|
||||||
|
// new zones.
|
||||||
|
ChromeMallocZone* default_zone =
|
||||||
|
reinterpret_cast<ChromeMallocZone*>(malloc_default_zone());
|
||||||
|
DCHECK(IsMallocZoneAlreadyStored(default_zone));
|
||||||
|
|
||||||
|
MallocZoneFunctions new_functions;
|
||||||
|
StoreZoneFunctions(default_zone, &new_functions);
|
||||||
|
ReplaceFunctionsForStoredZones(&new_functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReplaceZoneFunctions(ChromeMallocZone* zone,
|
||||||
|
const MallocZoneFunctions* functions) {
|
||||||
|
// Remove protection.
|
||||||
|
mach_vm_address_t reprotection_start = 0;
|
||||||
|
mach_vm_size_t reprotection_length = 0;
|
||||||
|
vm_prot_t reprotection_value = VM_PROT_NONE;
|
||||||
|
DeprotectMallocZone(zone, &reprotection_start, &reprotection_length,
|
||||||
|
&reprotection_value);
|
||||||
|
|
||||||
|
CHECK(functions->malloc && functions->calloc && functions->valloc &&
|
||||||
|
functions->free && functions->realloc);
|
||||||
|
zone->malloc = functions->malloc;
|
||||||
|
zone->calloc = functions->calloc;
|
||||||
|
zone->valloc = functions->valloc;
|
||||||
|
zone->free = functions->free;
|
||||||
|
zone->realloc = functions->realloc;
|
||||||
|
if (functions->batch_malloc)
|
||||||
|
zone->batch_malloc = functions->batch_malloc;
|
||||||
|
if (functions->batch_free)
|
||||||
|
zone->batch_free = functions->batch_free;
|
||||||
|
if (functions->size)
|
||||||
|
zone->size = functions->size;
|
||||||
|
if (zone->version >= 5 && functions->memalign) {
|
||||||
|
zone->memalign = functions->memalign;
|
||||||
|
}
|
||||||
|
if (zone->version >= 6 && functions->free_definite_size) {
|
||||||
|
zone->free_definite_size = functions->free_definite_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore protection if it was active.
|
||||||
|
if (reprotection_start) {
|
||||||
|
kern_return_t result =
|
||||||
|
mach_vm_protect(mach_task_self(), reprotection_start,
|
||||||
|
reprotection_length, false, reprotection_value);
|
||||||
|
MACH_CHECK(result == KERN_SUCCESS, result) << "mach_vm_protect";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace allocator
|
||||||
|
} // namespace base
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user