From 337d48c73f8305617d6a408789b46e41343190de Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Fri, 9 Dec 2022 15:41:09 -0500 Subject: [PATCH 01/61] Update cookie banner functionality (#574) Co-authored-by: Sam Richard --- site/_components/cookie-disclaimer.njk | 4 ++-- site/_layouts/_wrapper.njk | 1 - site/en/_data/cookieDisclaimer.yml | 12 +++++------ site/es/_data/cookieDisclaimer.yml | 12 +++++------ site/js/components/cookie-disclaimer.js | 27 +++++++++++++++++++++---- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/site/_components/cookie-disclaimer.njk b/site/_components/cookie-disclaimer.njk index 86b32f3a..cf39d53a 100644 --- a/site/_components/cookie-disclaimer.njk +++ b/site/_components/cookie-disclaimer.njk @@ -21,8 +21,8 @@ diff --git a/site/_layouts/_wrapper.njk b/site/_layouts/_wrapper.njk index 616c09d3..55c6845c 100644 --- a/site/_layouts/_wrapper.njk +++ b/site/_layouts/_wrapper.njk @@ -23,7 +23,6 @@ - {% from 'header.njk' import header %} {{ header(nav, search.placeholder, subscribe.cta, locale) }} diff --git a/site/en/_data/cookieDisclaimer.yml b/site/en/_data/cookieDisclaimer.yml index 26ebc65e..c389ec4a 100644 --- a/site/en/_data/cookieDisclaimer.yml +++ b/site/en/_data/cookieDisclaimer.yml @@ -1,11 +1,9 @@ title: Cookie Consent. content: - disclaimer: Google uses cookies to deliver its services, to personalize ads, and to analyze traffic. You can adjust your privacy controls anytime in ((t)). + disclaimer: ChromeOS.dev uses cookies to deliver and enhance the quality of its services and to analyze traffic. If you agree, cookies are also used to serve advertising and to personalize the content and advertisements that you see. ((t)). settings: - text: Google settings - url: https://support.google.com/accounts/answer/3118621 -ctas: - accept: Ok, Got it. - info: text: Learn more. - url: https://www.google.com/policies/technologies/cookies + url: https://policies.google.com/technologies/cookies +ctas: + accept: Agree + decline: No thanks diff --git a/site/es/_data/cookieDisclaimer.yml b/site/es/_data/cookieDisclaimer.yml index 014e9832..4398f87e 100644 --- a/site/es/_data/cookieDisclaimer.yml +++ b/site/es/_data/cookieDisclaimer.yml @@ -1,11 +1,9 @@ title: Acuerdo al uso de cookies. content: - disclaimer: Google usa cookies para brindar sus servicios, personalizar anuncios y analizar el tráfico. Puedes cambiar los controles de privacidad en la ((t)), en cualquier momento. + disclaimer: ChromeOS.dev utiliza cookies para ofrecer y mejorar la calidad de sus servicios y para analizar el tráfico. Si está de acuerdo, las cookies también se utilizan para mostrar publicidad y personalizar el contenido y los anuncios que ve. ((t)). settings: - text: configuración de Google - url: https://support.google.com/accounts/answer/3118621?hl=es -ctas: - accept: Ok, Acepto. - info: - text: Más información. + text: Más información url: https://www.google.com/policies/technologies/cookies?hl=es +ctas: + accept: Aceptar + decline: No, gracias diff --git a/site/js/components/cookie-disclaimer.js b/site/js/components/cookie-disclaimer.js index 8f860069..f4d6d5d8 100644 --- a/site/js/components/cookie-disclaimer.js +++ b/site/js/components/cookie-disclaimer.js @@ -25,9 +25,12 @@ export class CookieDisclaimer { */ constructor(elem, spotReference) { this.elem_ = elem; - this.acceptButton_ = this.elem_.querySelector('.cta--high'); + this.acceptButton_ = this.elem_.querySelector('[data-type="accept"]'); + this.declineButton_ = this.elem_.querySelector('[data-type="decline"]'); this.spotReference_ = spotReference; this.acceptButton_.addEventListener('click', this.acceptCookieUsage.bind(this)); + this.declineButton_.addEventListener('click', this.declineCookieUsage.bind(this)); + this.cookieStore = 'chromeos-accepts-cookies--v2'; this.checkCookieUsageAcceptance(); } @@ -35,13 +38,20 @@ export class CookieDisclaimer { * Checks if the user has accepted the use of the cookies. */ checkCookieUsageAcceptance() { - const acceptsCookies = localStorage.getItem('chromeos-accepts-cookies'); + const acceptsCookies = localStorage.getItem(this.cookieStore); - if (!acceptsCookies) { + if (acceptsCookies !== 'true' && acceptsCookies !== 'false') { this.openDialog(); this.keyHandler(); this.acceptButton_.focus(); } + + if (acceptsCookies === 'true') { + const gaScript = document.createElement('script'); + gaScript.src = 'https://www.googletagmanager.com/gtag/js?id=UA-168234575-1'; + gaScript.type = 'module'; + document.head.appendChild(gaScript); + } } /** @@ -75,7 +85,16 @@ export class CookieDisclaimer { * Sets the cookie usage acceptance flag. */ acceptCookieUsage() { - localStorage.setItem('chromeos-accepts-cookies', true); + localStorage.setItem(this.cookieStore, true); + this.closeDialog(); + this.checkCookieUsageAcceptance(); + } + + /** + * Sets the cookie usage acceptance flag to decline. + */ + declineCookieUsage() { + localStorage.setItem(this.cookieStore, false); this.closeDialog(); } From c9c7f173a3d0fd744c5404262df1e5d56b3f5493 Mon Sep 17 00:00:00 2001 From: Jenna Inouye Date: Fri, 20 Jan 2023 10:33:48 -0600 Subject: [PATCH 02/61] =?UTF-8?q?=F0=9F=93=9D(content)=20Add=20ChromeOS=20?= =?UTF-8?q?lint=20rules=20in=20Android=20Studio=20(#576)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝(content) ChromeOS lint rules in Android Studio * Update contributors.js * 📝(content) Lint rules for ChromeOS in Android Studio * Update site/en/android-environment/lint-rules-for-ChromeOS-in-Android-Studio.md Co-authored-by: Sam Richard * Update site/en/posts/chromeos-lint-rules-in-android-studio.md Co-authored-by: Sam Richard * Update site/en/android-environment/lint-rules-for-ChromeOS-in-Android-Studio.md Co-authored-by: Sam Richard * Update site/en/android-environment/lint-rules-for-ChromeOS-in-Android-Studio.md Co-authored-by: Sam Richard * Update site/en/posts/chromeos-lint-rules-in-android-studio.md Co-authored-by: Sam Richard * Update site/en/android-environment/lint-rules-for-ChromeOS-in-Android-Studio.md Co-authored-by: Sam Richard * Update site/en/android-environment/lint-rules-for-ChromeOS-in-Android-Studio.md Co-authored-by: Sam Richard * Update site/en/posts/chromeos-lint-rules-in-android-studio.md Co-authored-by: Sam Richard * Update site/en/android-environment/lint-rules-for-ChromeOS-in-Android-Studio.md Co-authored-by: Sam Richard * Rename lint-rules-for-ChromeOS-in-Android-Studio.md to lint-rules-for-chromeos-in-android-studio.md * Change to capitalization in file names. * Update site/en/posts/chromeos-lint-rules-in-android-studio.md * Update site/en/android-environment/lint-rules-for-chromeos-in-android-studio.md Co-authored-by: Sam Richard --- site/_data/contributors.js | 11 ++ ...nt-rules-for-chromeos-in-android-studio.md | 162 ++++++++++++++++++ .../chromeos-lint-rules-in-android-studio.md | 85 +++++++++ 3 files changed, 258 insertions(+) create mode 100644 site/en/android-environment/lint-rules-for-chromeos-in-android-studio.md create mode 100644 site/en/posts/chromeos-lint-rules-in-android-studio.md diff --git a/site/_data/contributors.js b/site/_data/contributors.js index 609a2522..938e2a2a 100644 --- a/site/_data/contributors.js +++ b/site/_data/contributors.js @@ -471,6 +471,17 @@ const contributors = { title: 'Product Manager', }, }, + jhale: { + name: { + given: 'Josh', + family: 'Hale', + }, + work: { + company: 'Google', + org: 'ChromeOS', + title: 'Software Engineer', + }, + }, }; module.exports = () => contributors; // By making this a function, it'll force Eleventy to reevaluate it every time it gets recompiled diff --git a/site/en/android-environment/lint-rules-for-chromeos-in-android-studio.md b/site/en/android-environment/lint-rules-for-chromeos-in-android-studio.md new file mode 100644 index 00000000..1f133133 --- /dev/null +++ b/site/en/android-environment/lint-rules-for-chromeos-in-android-studio.md @@ -0,0 +1,162 @@ +--- +title: ChromeOS lint rules in Android Studio +metadesc: An in-depth guide on how to improve the experience of large screens on ChromeOS with lint rules in Android Studio. +date: 2023-01-20 +weight: 1 +tags: + - android studio + - large screens +--- + +We, at ChromeOS, are committed to enhancing developer tools and frameworks that +enable Android app developers to optimize their apps for Chromebooks seamlessly. +In doing so, we need to look consistently at ways to bring impactful tool sets +to developers to enhance the experience of building for large screens and +ChromeOS. + +ChromeOS has evolved through the years as new challenges have presented +themselves. One of these challenges is identifying critical issues to engineers +early and often. Lint rules are at the heart of quality, as they provide flare +signals to developers for issues that will arise if not remedied. Our updated +lint rules provide developers with more visibility into how their apps run on +ChromeOS, showcasing issues, both software and hardware, that will undoubtedly +cause issues for Android applications that are run on any ChromeOS device. + +To get more background context on the existence of these lint rules and their +importance, read through our blog post. + +# Where are these lint rules? + +We have been in active development for a few months now. With the release +schedule of Android Studio, some lint rules are being introduced with the +Electric Eel Canary builds. A few of these lint rules are also now available in +the Flamingo Canary releases. We will continue to build towards having these in +the stable versions of Android Studio in the coming months. + +Another major thing to note is that these rules will be **_enabled by +default_** in newer versions of Android Studio. The goal of this is to have more +strongly opinionated guidance on how we want to help engineers build for +ChromeOS and larger screens going forward. + +# New lint rules (updated as of Flamingo Canary 3) + +### x86/x86_64 ABI support + +The majority of Chromebooks run on the Intel architecture, thus making them a +predominantly x86 architectural platform. For ChromeOS to properly be supported +when NDK code is included as part of the binary, having x86 is a performance +boost due to removing the translation required from ARM libraries. Therefore, it +is strongly recommended that your development team adds `x86` or preferably +`x86_64` architecture support as it would be a performance boon for any native +code on ChromeOS or any Intel device. + +#### Remedy + +If possible, add `x86` and `x86_64` inside of your `abiSplits` within your +`build.gradle`. Also, ensure that you are adding the code to the appropriate +folders to support these ABIs. To get more information, reference the +documentation on [Android ABIs](https://developer.android.com/ndk/guides/abis) +and the talk on [ABI Support from ADS](https://youtu.be/C0IuT0O2wlM?t=229). + +!!! aside.message--note +**Note:** Ensure that whatever included third-party libraries that are being +utilized also have x86 and x86_64 binaries. +!!! + +### ChromeOS hardware limitation + +The majority of ChromeOS devices come with a smaller sample set of hardware +sensors and other features compared to an Android phone. The goal of this rule +is to flag to developers that if you are using the flag `` with +`android:required=true`, your app will not be available on the Google Play Store +on ChromeOS. A strong recommendation to ensure that your app can be accessed on +as many devices as possible is to ensure that the hardware feature is not +required by default. Instead, you can add defensive code to check for specific +hardware at run time rather. An example of this would be + +``` +%lt;uses-feature android:name="android.hardware.camera" android:required="true"%gt; +``` + +#### Remedy + +Ensure that the features that are within your application are actually +required, and if they are not, change the `android:required` parameter to +`false` and add defensive programming when API calls are required. To get more +information, reference the documentation on +[explicitly declared features.](https://developer.android.com/guide/topics/manifest/uses-feature-element#declared) + +![Feature 'camera flash required' rule, showcasing the lint warning and the inspection description](ix://posts/android-studio-lint-rules/lint.gif) + +### Non-resizable activities + +By default, Android Runtime for ChromeOS, running Android R or higher on +Chromebooks, starts an Android app in either the phone or tablet version of the +application, based on the default UI state. However, there is a third option +that is a better experience for ChromeOS users, the Resizable mode. By enabling +this flag as part of your Activity, users that can use your application in any +multi-window environments can take advantage of resizing your application to the +appropriate size. These changes will allow users to scale the UI to meet their +needs. After adding these changes to your Manifest, test your application +against the Desktop Emulator referenced below. + +![Android Virtual Device Creation for Desktop Emulator](ix://posts/android-studio-lint-rules/avd.gif) + +#### Remedy + +Add the `resizableActivity="true"` attribute to your Activity in your +`AndroidManifest.xml` file. To get more information, reference the documentation +on +[large screen restrictions](https://developer.android.com/guide/topics/large-screens/multi-window-support#resizeableActivity). + +### Configuration changes + +One major caveat to resizable screens is that every time a user changes the +size of the application, `onConfigurationChanged()` is called. If your app is +issuing a full redraw inside of that method, there will be performance +implications associated with it. Currently, we are checking to ensure that +`finish()` is not called within `onConfigurationChanged`, as you should be +handling the savedInstanceState with more granularity versus enforcing a full +redraw. We will continue to find cases where performance degradation will occur +and update this rule accordingly. + +#### Remedy + +Ensure that `finish()` is not called within the `onConfigurationChanged()` API +in your Activities and Fragments. To get more information, reference the +documentation on +[handling configuration changes](https://developer.android.com/guide/topics/resources/runtime-changes). + +### Keyboard and mouse support + +With the increased adoption of Jetpack Compose, we wanted to ensure that +building with those libraries also included functionality for mouse and keyboard +support going forward. Over time, we will continue to increase the usability of +mouse, keyboard, trackpad, and other peripheral interactions. In order to get +the baseline experiences, you'll have to update your Gradle dependencies to the +minimum required versions. + +#### Remedy + +Update `androidx.compose.foundation:foundation` to a minimum version of 1.2. To +get more information, reference the +[compose version release notes](https://developer.android.com/jetpack/androidx/releases/compose#versions). + +!!! aside.message--tip +**Tip:** 90% of users interact with apps on Chromebooks by using a keyboard and +mouse. (Source: +[2022 Google Internal Data\*](https://chromeos.dev/en/posts/game-controls-for-android-games#fn1)) +!!! + +## Feedback + +The team is constantly looking to improve these tools and documentation +surrounding optimizations for large screens. A critical step in this process is +to give us feedback on the accuracy and usefulness of the lint rules that are +deployed in Android Studio. You can do this by providing feedback for the rule. +When the lint rule shows up in Android Studio, click on "Provide feedback on +this warning". You should be taken to a dialog that looks similar to the one +below. The more accurate and descriptive the information given, the more we are +able to iterate quickly on making the appropriate changes. + +![Provide Feedback Dialog in Android Studio](ix://posts/android-studio-lint-rules/feedback.png) diff --git a/site/en/posts/chromeos-lint-rules-in-android-studio.md b/site/en/posts/chromeos-lint-rules-in-android-studio.md new file mode 100644 index 00000000..55febe84 --- /dev/null +++ b/site/en/posts/chromeos-lint-rules-in-android-studio.md @@ -0,0 +1,85 @@ +--- +title: ChromeOS lint rules in Android Studio +metadesc: Use lint rules in Android Studio to enhance the experience of building for large screens and ChromeOS. +tags: + - android + - large screens +authors: + - jhale +date: 2023-01-20 +--- + +At ChromeOS, we are committed to enhancing developer tools and frameworks that +enable Android app developers to seamlessly optimize their apps for Chromebooks. +In doing so, we need to explore ways to bring impactful tool sets to developers +to enhance the experience of building for large screens and ChromeOS. + +## What are lint rules? + +Linting is an automated checking of your source code for various programmatic +and stylistic errors such as correctness, security, performance, usability, +accessibility, and internationalization. A lint rule is the code that backs any +individual potential error. Android Studio has a built in lint tool that +notifies developers of any errors and the severity of those errors. + +For more information on lint rules in your Android Studio environment, refer to +the documentation on +[improving your code with lint checks](https://developer.android.com/studio/write/lint). + +## Linting for large screen testing + +One of the largest challenges we face on ChromeOS is that the vast majority of +app developers are not aware that their app is automatically deployed to the +ChromeOS Play Store. As such, the normal development and testing processes of +many apps omit testing on large screens or ChromeOS. As a result, the overall +app experience on these devices will trail behind their phone counterparts, and +users on those platforms will suffer from a poor experience. + +The goal of these initial lint rules is to start the process of bringing +ChromeOS and large screens to the forefront of app development, and start to +create a unified toolkit that developers can leverage easily to kickstart the +process of developing a great ChromeOS or other large screen application. + +## How to test with lint rules + +When you upgrade your development environment to Electric Eel or Flamingo +versions of Android Studio, you will get these lint rules for free. These lint +rules are enabled by default; if your application was violating these rules +previously you will be notified as soon as your application is done building and +the static analysis tools can be run. + +Another way to test these is by launching your application on the Desktop +Emulator in Android Studio and seeing how your application performs in this +specialized environment. You can create a new Desktop emulator through the AVD +menus built into Android Studio. + +![Android Virtual Device Creation for Desktop Emulator](ix://posts/android-studio-lint-rules/avd.gif) + +## Feedback + +The team is constantly looking to improve these tools and documentation +surrounding optimizations for large screens. A critical step in this process is +to give us feedback on the accuracy and usefulness of the lint rules that are +deployed in Android Studio. + +You can do this by providing feedback for the rule. When the lint rule shows up +in Android Studio, click on "Provide feedback on this warning". You should be +taken to a dialog that looks similar to the one below. The more accurate and +descriptive the information given, the more we are able to iterate quickly on +making the appropriate changes. + +![Provide Feedback Dialog in Android Studio](ix://posts/android-studio-lint-rules/feedback.png) + +## What's next? + +Optimizing for +[ChromeOS and Large Screen Guidance](https://developer.android.com/guide/topics/large-screens/get-started-with-large-screens) +will continue to evolve. We want to continue to improve our existing toolkits to +bring more awareness to developers early and often. +We want developers to feel empowered to make large screen improvements for their +apps. Showcasing potential issues earlier in the development process is one way +to achieve this. + +For further reading and a detailed recommendation on best practices for +ChromeOS and large screen guidance, refer to the +[large screen documentation](https://developer.android.com/guide/topics/large-screens/get-started-with-large-screens). From e5c0b846c5befd1e673b44828f6c714668f5df3c Mon Sep 17 00:00:00 2001 From: Jenna Inouye Date: Tue, 24 Jan 2023 10:31:08 -0600 Subject: [PATCH 03/61] =?UTF-8?q?=F0=9F=93=9D(content)=20Add=20Windows=20g?= =?UTF-8?q?ames=20on=20ChromeOS=20(#582)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 📝(content) Windows games on ChromeOS * Rename Windows-games-on-ChromeOS.md to windows-games-on-chromeos.md * Prettier on windows-games-on-chromeos.md * Update positioning and contributors.js * Update site/en/posts/windows-games-on-chromeos.md Co-authored-by: Sam Richard * Updated for formatting. * Updates to content and links per writer. * Update site/en/posts/windows-games-on-chromeos.md Co-authored-by: Sam Richard * Update site/en/posts/windows-games-on-chromeos.md Co-authored-by: Sam Richard * Update site/en/posts/windows-games-on-chromeos.md Co-authored-by: Sam Richard * Update windows-games-on-chromeos.md Co-authored-by: Sam Richard --- site/_data/contributors.js | 11 ++ site/en/posts/windows-games-on-chromeos.md | 157 +++++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 site/en/posts/windows-games-on-chromeos.md diff --git a/site/_data/contributors.js b/site/_data/contributors.js index 938e2a2a..5f9b3447 100644 --- a/site/_data/contributors.js +++ b/site/_data/contributors.js @@ -471,6 +471,17 @@ const contributors = { title: 'Product Manager', }, }, + renatopereyra: { + name: { + given: 'Renato', + family: 'Pereyra', + }, + work: { + company: 'Google', + org: 'ChromeOS', + title: 'Software Engineer', + }, + }, jhale: { name: { given: 'Josh', diff --git a/site/en/posts/windows-games-on-chromeos.md b/site/en/posts/windows-games-on-chromeos.md new file mode 100644 index 00000000..9b4868e0 --- /dev/null +++ b/site/en/posts/windows-games-on-chromeos.md @@ -0,0 +1,157 @@ +--- +title: 'Windows games on ChromeOS with Proton' +metadesc: 'Discover how Proton and Steam make it possible to play Windows games on ChromeOS.' +tags: + - games + - technical + +authors: + - renatopereyra +date: 2023-01-24 +--- + +[Steam is now available on ChromeOS](https://www.chromium.org/chromium-os/steam-on-chromeos/) +and many users are already enjoying some of their favorite games. But you may be +wondering how the magic happens. +[Borealis is a VM running Arch Linux](https://chromeos.dev/en/posts/bringing-steam-to-chromeos), +so Linux titles run the same way that they run on any Linux distribution. For +Windows games, the story is more complex. Windows games run through a +compatibility layer called Proton, which Steam downloads automatically when a +user installs a Windows game on a Linux system. + +# So… what exactly is Proton? + +Scrolling through the [Proton +repository](https://github.com/ValveSoftware/Proton), you'll quickly notice that +the vast majority of Proton consists of git submodules. Proton is a collection +of modules that grew organically in the open-source community out of a desire to +bring widely-available cross-platform support to the world. Proton's real +value-add is sorting out _how_ to get all of these modules working together +properly and with good performance. This is no easy goal since the support +offered by Proton is fraught with corner cases. Achieving synergy of these +modules requires applying and maintaining meaningful modifications on top of +upstream open source projects. + +Proton support is still growing and can vary a lot even between similar games. +The dedicated Linux gaming community has created +[ProtonDB](https://www.protondb.com/) to keep track of supported games. Most of +the time, titles marked as Platinum and Gold work well on most Linux systems. +Being an Arch Linux VM, Borealis often supports most of these titles as well, +when device hardware specs allow. + +Windows games can be installed by Steam on ChromeOS after either enabling +Proton in the Steam Play tab of the Steam settings or enabling Proton for a +specific game in the Compatibility tab of the game properties. Proton is +automatically installed by Steam alongside game installations that require it. + +# Standardizing Proton dependencies + +In general, software will work best when the runtime system has libraries with +ABIs and APIs that match the build system's. Unfortunately, there are no strong +ABI or API guarantees in Linux across distros or library versions. Package +managers traditionally work around this issue via dependency tracking. However, +this approach breaks down when the list of dependencies is as long and as +sensitive as Proton's. Therefore, a big challenge for Proton has been ensuring +consistent behavior across devices. + +The +[Steam Linux Runtime](https://gitlab.steamos.cloud/steamrt/steamlinuxruntime/-/tree/master/) +(SLR), introduced in Proton 5.13, aims to solve this. It's a [Flatpak-style +sandbox](https://flatpak.org/faq/) that bundles a specific set of libraries +known to work well with Proton. This set of libraries is referred to as the +[Steam runtime](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/main/docs/ld-library-path-runtime.md). +When a Proton game is run, a tool called +[pressure-vessel](https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/blob/master/docs/pressure-vessel.md) +combines this runtime with the graphics stack installed on the host system +to round out the sandbox required by Proton games. The advantage of using a +Flatpak sandbox over containers like Docker is that Flatpak sandboxes are meant +to be +[created and run by an unprivileged user](https://docs.flatpak.org/en/latest/under-the-hood.html#underlying-technologies) +on the host system. This avoids some security concerns that would have come from +using a true Linux container to run Proton. + +# Windows applications in Linux + +Proton uses a [fork](https://github.com/ValveSoftware/wine/tree/proton_7.0) of +[Wine](https://www.winehq.org/) to run Windows games in Linux. This Valve-owned +fork maintains patches on top of upstream Wine to improve the compatibility of +Proton. Most of these patches are eventually improved on and merged upstream. + +For performance reasons, Wine is very much _not_ an emulator or a virtual +machine. Wine does not attempt to maintain or simulate the internal state that +would be required to implement Windows at run time. Instead, Wine aims to +maintain as little state as possible and to translate incoming Windows API calls +into POSIX-compliant calls on the fly. Wine developers leverage +publicly-available Windows API documentation and black-box testing techniques in +their effort to approximate Windows API calls as closely as possible. + +One of the unavoidable pieces of state that Wine requires to work correctly is +a directory structure that resembles the standard directory structure available +in Windows since applications generally expect to be able to open and load files +from pre-specified paths. This directory structure created by Wine is called a +[wineprefix](https://wiki.winehq.org/FAQ#Wineprefixes). When Steam first runs a +Proton game, it sets up this wineprefix automatically. The result is called the +game's +[compatdata directory](https://github.com/ValveSoftware/Proton/blob/proton_7.0/proton#L401). +It is within this directory structure that Proton games execute when they run +within the sandbox created by pressure-vessel. + +To minimize the chance of games stepping on each other when they read or write +files, each game gets its own compatdata directory. The effect is similar to +each game +[running within its own computer](https://wiki.winehq.org/FAQ#How_can_I_run_two_programs_as_if_they_were_on_different_computers.3F), +maximizing Proton compatibility. Unfortunately, due to duplicate files and +directories, this also wastes some disk space. However, there are ongoing +efforts to de-duplicate across compatdata directories. + +# Direct3D supported by Vulkan + +Finally, one of the most integral parts of gaming: graphics. We've previously +discussed the importance of shifting toward low-overhead graphics APIs like +[Vulkan](https://chromeos.dev/en/posts/improving-vulkan-availability-with-venus). +ChromeOS is not the only Linux-based platform shifting toward the improved +performance that Vulkan offers, though. Many open-source projects are doing the +same. Proton leverages two such projects: +[DXVK](https://github.com/doitsujin/dxvk/tree/279b4b7ec225c2c4bddc4eb6ddfa8bfe89c8bf5c) +and +[VKD3D-Proton](https://github.com/HansKristian-Work/vkd3d-proton/tree/3e5aab6fb3e18f81a71b339be4cb5cdf55140980), +the latter being a fork of a [project driven by +WineHQ](https://source.winehq.org/git/vkd3d.git/). + +Both DXVK and VKD3D-Proton translate +[Direct3D](https://docs.microsoft.com/en-us/windows/win32/direct3d) API calls +into Vulkan calls on the fly within the Borealis VM. Their difference is in the +Direct3D version that each supports. DXVK supports Direct3D versions 9 to 11 and +DXGI. VKD3D-Proton supports Direct3D 12. These two are different projects +because Direct3D 12 is +[substantially more low-level](https://www.anandtech.com/show/7889/microsoft-announces-directx-12-low-level-graphics-programming-comes-to-directx) +than Direct3D 9-11 and requires different design considerations. Given the +Direct3D version differences, it is more performant to design translation layers +independently. + +While DXVK, and VKD3D-Proton are quite performant, there is a non-zero +performance cost to translate all the Direct3D API state when a Proton game +runs. A good way to counteract this is with caching. Both DXVK and VKD3D-Proton +implement caching schemes to help mitigate the cost of translation. +[DXVK's](https://github.com/doitsujin/dxvk#state-cache) and +[VKD3D-Proton's](https://github.com/HansKristian-Work/vkd3d-proton/blob/c47a6a904bbeebcb2fbed4e7accfae5bd17cff2f/README.md#shader-cache) +caching schemes are functionally similar: both focus on caching the result of +the translation of Direct3D graphics state and shaders to Vulkan. + +Despite caching efforts by DXVK and VKD3D-Proton, it is still far more +performant to avoid misses in the caches managed by device-specific +graphics drivers. Proton games make heavy use of driver-managed shader caches to squeeze out as +much performance as possible. To improve the performance of Proton games, Steam +uses a tool called [Fossilize](https://github.com/ValveSoftware/Fossilize) to +warm up +[Mesa's Vulkan shader cache](https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15390). +When a Steam user is presented with the "Processing Vulkan Shaders" stage before +a Proton game starts, Fossilize is warming up the shader cache behind the +scenes. Having a warm shader cache can greatly improve FPS and reduce unpleasant +jank. + +--- + +Proton has grown thanks to the hard work of a diverse group of contributors +from all over the world. We're excited to join this effort to increase support +for gaming on Linux. Game on! From 4be21ba47b0098b0a57117be5651eb91d7cce657 Mon Sep 17 00:00:00 2001 From: Jenna Inouye Date: Wed, 25 Jan 2023 11:10:41 -0600 Subject: [PATCH 04/61] =?UTF-8?q?=F0=9F=93=9D(content)=20New=20to=20Chrome?= =?UTF-8?q?OS:=20Highlights=20from=20ChromeOS=20106,=20107,=20108,=20and?= =?UTF-8?q?=20109=20(#592)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sam Richard --- ...ights-from-chromeos-106-107-108-and-109.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 site/en/posts/new-to-chromeos-highlights-from-chromeos-106-107-108-and-109.md diff --git a/site/en/posts/new-to-chromeos-highlights-from-chromeos-106-107-108-and-109.md b/site/en/posts/new-to-chromeos-highlights-from-chromeos-106-107-108-and-109.md new file mode 100644 index 00000000..25a986df --- /dev/null +++ b/site/en/posts/new-to-chromeos-highlights-from-chromeos-106-107-108-and-109.md @@ -0,0 +1,50 @@ +--- +title: 'New to ChromeOS: Highlights from ChromeOS 106, 107, 108, and 109' +metadesc: Take a look at some of the exciting new features of ChromeOS. ChromeOS 106 through 109 introduces RGB keyboard support, accessibility improvements, prioritized audio device detection, and more. +tags: + - announcement + - product news + - gaming + - technical +authors: + - samrichard +date: 2023-01-25 +--- + +New features have come to ChromeOS! ChromeOS devs have been hard at work implementing features such as 4-zone RGB keyboard support, accessibility improvements, and prioritized audio device detection. Today, we're highlighting a few interesting and impactful features introduced with ChromeOS 106, 107, 108, and 109. + +## Highlights for ChromeOS 106 + +ChromeOS 106 moved into stable release on September 27, 2022. New features included changes to default link capture behavior, 4-zone RGB keyboard support, and setting persistence for the note pen. + +- **RGB keyboard:** Control your RGB keyboard across four defined zones with the Personalization Hub UI. When you click the **Rainbow** option, the colors will appear across four zones—rather than a per-key rainbow effect. Read more about using keyboard backlighting on supported devices: [Use gaming features on your Chromebook](https://support.google.com/chromebook/answer/12313257?hl=en). +- **Links:** Newly installed apps will no longer handle links clicked in the browser by default. Links clicked in the browser will now open in the browser, unless the "Opening supported links" setting is enabled within the Settings app. +- **Note pen:** Color and size settings now persist. Customize your pen while writing notes and your customization will persist into a new session. In the note library, your favorite pen settings—such as color or size—will carry into new notes. + +## Highlights for ChromeOS 107 + +On October 25, 2022, ChromeOS 107 introduced a variety of new features, including: save and recall desks, the Human Presence Sensor, and accessibility enhancements. + +- **Virtual Desks:** As of ChromeOS 107, you can save and close an entire [Virtual Desk](https://support.google.com/chromebook/answer/9594869?hl=en). Save your desk state—including app windows and layouts—whenever you want to switch gears or focus on a different task. When you're ready to switch back, you can open your saved desk with a click. +- **Human Presence Sensor:** ChromeOS 107 introduced new privacy features leveraging the [Human Presence Sensor](https://chromium.googlesource.com/chromiumos/platform/hps-firmware/+/refs/heads/main/README.md). The Human Presence Sensor will lock the screen when you leave—and alert you when another person is looking at your screen. Related features include "Keep Awake," which prevents the screen from dimming when you're present, and "Viewing Protection," which alerts you when an additional person is detected. +- **ChromeOS accessibility:** ChromeOS 107 provides a variety of improvements to its [accessibility settings](https://support.google.com/chromebook/answer/177893?hl=en), including more accurate search results, easier to understand feature descriptions, and modifications to the layout for increased discoverability. + +## Highlights for ChromeOS 108 + +On November 29, 2022, ChromeOS 108 moved into stable release. ChromeOS 108's highlights included a faster virtual keyboard, multi-page document scanning, and improved trash management. + +- **Virtual keyboard:** If you have a Chromebook with a touchscreen, it's now even easier to type what you want with a newly redesigned [virtual keyboard](https://support.google.com/chromebook/answer/6076237?hl=en). With just a tap on the new header bar, you can switch between languages, pull up the emoji library, or access the handwriting tool. The virtual keyboard also processes fast typing even faster—no need to slow yourself down. +- **ChromeOS Camera App:** Manage your documents digitally. Now you can create multi-page PDFs using the document scanning function in the [ChromeOS Camera App](https://support.google.com/chromebook/answer/4487486?hl=en). +- **FileApps trash:** Previously, deleting a file from "My files" would instantly and permanently delete it. Now, it will go to a new "Trash" section. You'll have 30 days to change your mind before it's permanently deleted. Note: This new feature doesn't support Play, Linux, or Windows file locations. + +## Highlights for ChromeOS 109 + +On January 12, 2023, ChromeOS 109 was released to the stable channel. Highlights of this release include prioritized audio device selection, color picker improvements, and an expansion of user satisfaction surveys. + +- **Audio devices:** If you use your ChromeOS device in multiple scenarios—such as in the office, school, and home—switching between audio devices just became easier. ChromeOS 109 maintains a priority list of audio devices, ordered by user preference. Activate, plug in, or unplug a headset or speakers, and your ChromeOS device will pull the associated settings. +- **Color picker improvements:** In the ChromeOS color palette dialog, you can now choose between **Palette** and **Custom** tabs. Tapping the **Custom** tab displays a freeform color select tool. Users can also enter a HEX code to choose a specific color. +- **Happiness tracking:** ChromeOS uses [Happiness Tracking Surveys (HaTS)](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43221.pdf) surveys to measure user attitudes and ultimately improve user experiences. In ChromeOS 109, we send an expanded dataset for analysis to the [User Metrics Analysis (UMA) server](https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/metrics/README.md). + +## ChromeOS is built for you + +We're always excited to find out more about what you enjoy (and what you still need) from ChromeOS—and more user-centered refinements and features are still in the works. Have any suggestions or feedback regarding our releases? [Send us feedback](https://support.google.com/chromebook/answer/2982029?hl=en). From cd6825fa9f25d6949eee9651b64f7a59d796324a Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Mon, 30 Jan 2023 15:11:23 -0500 Subject: [PATCH 05/61] =?UTF-8?q?=E2=99=BB=EF=B8=8F(site)=20Migrate=20to?= =?UTF-8?q?=20Google=20Tag=20Manager=20(#593)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update Browserlist * Migrate to tag manager for all tags * Send cookie_consent event when someone agrees to ad cookies * Send cookie consent status with events * Condense events down into single object * Change how things are pushed to the data layer * Remove unneeded event * 🔮 is it a variable? * 🔮 is it a variable from the GTM region of France? * Use full GTM script as-is * Fix dataLayer check * Push cookie_consent to data layer * Improve GTM loading --------- Co-authored-by: Sam Richard --- package-lock.json | 6 +++--- site/_layouts/_wrapper.njk | 15 ++++++++------- site/js/components/cookie-disclaimer.js | 9 ++++----- site/js/lib/tracking.js | 12 ++++++------ site/js/main.js | 4 ++-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 336578d4..caf01e26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3065,9 +3065,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001363", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz", - "integrity": "sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==" + "version": "1.0.30001447", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz", + "integrity": "sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw==" }, "ccount": { "version": "1.1.0", diff --git a/site/_layouts/_wrapper.njk b/site/_layouts/_wrapper.njk index 55c6845c..93790ae3 100644 --- a/site/_layouts/_wrapper.njk +++ b/site/_layouts/_wrapper.njk @@ -23,6 +23,7 @@ + {% from 'header.njk' import header %} {{ header(nav, search.placeholder, subscribe.cta, locale) }} @@ -32,15 +33,15 @@ {% endif %} {% from 'footer.njk' import footer %}{{ footer(locale.code, site.languages, footerContent, true) }} {% from 'cookie-disclaimer.njk' import cookieDisclaimer %}{{ cookieDisclaimer(locale.code, cookies.title, cookies.content, cookies.ctas) }} - + + + + + + diff --git a/site/js/components/cookie-disclaimer.js b/site/js/components/cookie-disclaimer.js index f4d6d5d8..e7ab54ed 100644 --- a/site/js/components/cookie-disclaimer.js +++ b/site/js/components/cookie-disclaimer.js @@ -38,6 +38,7 @@ export class CookieDisclaimer { * Checks if the user has accepted the use of the cookies. */ checkCookieUsageAcceptance() { + /* global dataLayer */ const acceptsCookies = localStorage.getItem(this.cookieStore); if (acceptsCookies !== 'true' && acceptsCookies !== 'false') { @@ -46,11 +47,9 @@ export class CookieDisclaimer { this.acceptButton_.focus(); } - if (acceptsCookies === 'true') { - const gaScript = document.createElement('script'); - gaScript.src = 'https://www.googletagmanager.com/gtag/js?id=UA-168234575-1'; - gaScript.type = 'module'; - document.head.appendChild(gaScript); + if (acceptsCookies === 'true' && Array.isArray(dataLayer)) { + dataLayer.push({ event: 'cookie_consent' }); + dataLayer.push({ cookie_consent: true }); } } diff --git a/site/js/lib/tracking.js b/site/js/lib/tracking.js index b1db383c..ee62171a 100644 --- a/site/js/lib/tracking.js +++ b/site/js/lib/tracking.js @@ -34,11 +34,7 @@ export class Tracking { subscribeForm.addEventListener('submit', this.sendEvent('click_subscribe_submit')); } - if (typeof google === 'function') { - this.google = google; - } else { - this.google = () => {}; - } + this.google = google || []; } /** @@ -48,6 +44,10 @@ export class Tracking { * @return {function} */ sendEvent(name, options = {}) { - return () => this.google('event', name, Object.assign(options, { transport_type: 'beacon' })); + const event = Object.assign(options, { + event: name, + transport: 'beacon', + }); + return () => this.google.push(event); } } diff --git a/site/js/main.js b/site/js/main.js index 6bdd7a6f..c376ef75 100644 --- a/site/js/main.js +++ b/site/js/main.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* global gtag */ +/* global dataLayer */ import { preferences } from 'service-worker-i18n-redirect/preferences'; import { MainNavigation } from './components/nav'; import circleWorklet from './worklets/circles.js?url'; @@ -148,7 +148,7 @@ window.addEventListener('load', async () => { } const { Tracking } = await import('./lib/tracking'); - window.tracking = new Tracking(gtag); + window.tracking = new Tracking(dataLayer); if (import.meta.env.MODE === 'production') { if ('serviceWorker' in navigator) { From b1b53fd3a0a3ec7b5d1be40302f67b85f5c0807e Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Tue, 31 Jan 2023 11:09:49 -0500 Subject: [PATCH 06/61] =?UTF-8?q?=F0=9F=90=9B(content)=20Add=20missing=20l?= =?UTF-8?q?ink=20to=20lint=20rules=20docs=20(#599)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add link to docs --- site/en/posts/chromeos-lint-rules-in-android-studio.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/en/posts/chromeos-lint-rules-in-android-studio.md b/site/en/posts/chromeos-lint-rules-in-android-studio.md index 55febe84..47ccbbdd 100644 --- a/site/en/posts/chromeos-lint-rules-in-android-studio.md +++ b/site/en/posts/chromeos-lint-rules-in-android-studio.md @@ -22,7 +22,7 @@ accessibility, and internationalization. A lint rule is the code that backs any individual potential error. Android Studio has a built in lint tool that notifies developers of any errors and the severity of those errors. -For more information on lint rules in your Android Studio environment, refer to +For more information on configuring lint rules in your Android Studio environment, refer to the documentation on [improving your code with lint checks](https://developer.android.com/studio/write/lint). @@ -33,7 +33,7 @@ app developers are not aware that their app is automatically deployed to the ChromeOS Play Store. As such, the normal development and testing processes of many apps omit testing on large screens or ChromeOS. As a result, the overall app experience on these devices will trail behind their phone counterparts, and -users on those platforms will suffer from a poor experience. +users on those platforms will suffer from a poor experience. To help combat this, we've introduced [ChromeOS lint rules to Android Studio](/{{locale.code}}/android-environment/lint-rules-for-chromeos-in-android-studio). The goal of these initial lint rules is to start the process of bringing ChromeOS and large screens to the forefront of app development, and start to From b406aa3842f77d675a50e933c8a3974e00e2ef38 Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Tue, 31 Jan 2023 15:47:53 -0500 Subject: [PATCH 07/61] =?UTF-8?q?=F0=9F=86=95(content)=20Add=202022=20Reca?= =?UTF-8?q?p=20post=20(#596)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add 2022 Recap post Fix homepage banner not reacting to defaults * Update tags --------- Co-authored-by: Sam Richard --- site/_components/banner-interstitial.njk | 6 +- site/_data/contributors.js | 2 +- ...spiration-for-delighting-chromeos-users.md | 78 +++++++++++++++++++ 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 site/en/posts/grow-your-ideas-in-2023-dev-guidance-and-inspiration-for-delighting-chromeos-users.md diff --git a/site/_components/banner-interstitial.njk b/site/_components/banner-interstitial.njk index 2249b7a8..b1cf1c70 100644 --- a/site/_components/banner-interstitial.njk +++ b/site/_components/banner-interstitial.njk @@ -18,7 +18,7 @@ #}--> {% from 'icon.njk' import icon %} {% macro bannerInterstitial(content, microcopy) %}