Add files via upload
1846
chrome/BUILD.gn
Normal file
1567
chrome/app/chromium_strings.grd
Normal file
300
chrome/app/settings_chromium_strings.grdp
Normal file
|
@ -0,0 +1,300 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Settings-specific Chromium strings (included from chromium_strings.grd). -->
|
||||
<!-- Copyright (c) 2022 Alex313031. -->
|
||||
<grit-part>
|
||||
<!-- Shared across multiple page -->
|
||||
<if expr="not chromeos_ash">
|
||||
<message name="IDS_RELAUNCH_CONFIRMATION_DIALOG_TITLE" desc="The title of the modal dialog that we show when users click on relaunch and they have open Incognito windows. The dialog serves to warn the users about losing their Incognito windows if they proceed with the relaunch.">
|
||||
Relaunch Thorium?
|
||||
</message>
|
||||
</if>
|
||||
<!-- About Page -->
|
||||
<message name="IDS_SETTINGS_ABOUT_PROGRAM" desc="Menu title for the About Chromium page.">
|
||||
About Thorium
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_GET_HELP_USING_CHROME" desc="Text of the button which takes the user to the Chrome help page.">
|
||||
Get help with Thorium
|
||||
</message>
|
||||
<if expr="not chromeos_ash">
|
||||
<message name="IDS_SETTINGS_UPGRADE_UPDATING" desc="Status label: Updating Chromium">
|
||||
Updating Thorium
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_UPGRADE_UPDATING_PERCENT" desc="Status label: Updating Chromium (90%)">
|
||||
Updating Thorium (<ph name="PROGRESS_PERCENT">$1<ex>90%</ex></ph>)
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_UPGRADE_SUCCESSFUL_RELAUNCH" desc="Status label: Successfully updated Chromium">
|
||||
Nearly up to date! Relaunch Thorium to finish updating.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_UPGRADE_UP_TO_DATE" desc="Status label: Already up to date (Chromium)">
|
||||
Thorium is up to date
|
||||
</message>
|
||||
</if>
|
||||
<if expr="chromeos_ash">
|
||||
<message name="IDS_SETTINGS_ABOUT_OS" desc="Menu title for the About ChromiumOS page.">
|
||||
About ThoriumOS
|
||||
</message>
|
||||
<message name="IDS_OS_SETTINGS_TAG_OS_VERSION" desc="Text for search result item which, when clicked, navigates the user to about ChromeOS settings, which gives information about the current ChromeOS version.">
|
||||
ThoriumOS version
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_ABOUT_SEE_OS_SETTINGS_FOR_UPDATE_MESSAGE" desc="Message shown to users on Chromium browser settings which alerts the user that OS updates are shown in ChromiumOS settings.">
|
||||
To see if your device is up to date, go to <ph name="LINK_BEGIN"><a href="chrome://os-settings/help"></ph>ThoriumOS Settings<ph name="LINK_END"></a></ph>
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_GET_HELP_USING_CHROME_OS" desc="Text of the button which takes the user to the Chrome help page.">
|
||||
Get help with ThoriumOS
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<!-- Autofill Page -->
|
||||
<message name="IDS_SETTINGS_GOOGLE_PAYMENTS_CACHED" desc="Label that will be used to show that a credit card comes from Google Pay and is saved locally. This should follow the casing of the 'Google Pay' and 'Chrome' brands. 'Copied to Chromium' is short for 'The credit card is copied to Chromium'. 'Google Pay' should not be translated as it is the product name.">
|
||||
Google Pay (copied to Thorium)
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_CHECK_PASSWORDS_ERROR_OFFLINE" desc="Error message when the password check can't be completed because the user is offline.">
|
||||
Thorium can't check your passwords. Try checking your internet connection.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_CHECK_PASSWORDS_ERROR_SIGNED_OUT" desc="Error message when the password check can't be completed because the user is not signed in.">
|
||||
Thorium can check your passwords when you sign in with your Google Account
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_CHECK_PASSWORDS_ERROR_NO_PASSWORDS" desc="Error message when the password check can't be completed since no passwords could be checked.">
|
||||
No saved passwords. Thorium can check your passwords when you save them.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_CHECK_PASSWORDS_ERROR_QUOTA_LIMIT_GOOGLE_ACCOUNT" desc="Error message when the password check can't be completed since the user hit the quota limit, but the user is able to check their passwords in their Google account.">
|
||||
Thorium can't check your passwords. Try again after 24 hours or <ph name="BEGIN_LINK"><a href="$1" target="_blank"></ph>check passwords in your Google Account<ph name="END_LINK"></a></ph>.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_CHECK_PASSWORDS_ERROR_QUOTA_LIMIT" desc="Error message when the password check can't be completed since the user hit the quota limit.">
|
||||
Thorium can't check your passwords. Try again after 24 hours.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_CHECK_PASSWORDS_ERROR_GENERIC" desc="Error message when the password check can't be completed for an unspecified reason.">
|
||||
Thorium can't check your passwords. Try again later.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_NO_COMPROMISED_CREDENTIALS_LABEL" desc="Label which is shown when there were no compromised passwords detected.">
|
||||
Thorium will notify you when you sign in with a compromised password
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SIGNED_OUT_USER_LABEL" desc="Label which is shown at the top of the compromised password section if user is signed out.">
|
||||
To check if your passwords are safe from data breaches and other security issues, <ph name="BEGIN_LINK"><a target='_blank' href='$1'></ph>sign in to Thorium<ph name="END_LINK"></a></ph>.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SIGNED_OUT_USER_HAS_COMPROMISED_CREDENTIALS_LABEL" desc="Label which is shown at the bottom of the compromised password section if user is signed out and has compromised credentials.">
|
||||
To check if your other passwords are safe from data breaches and other security issues, <ph name="BEGIN_LINK"><a target='_blank' href='$1'></ph>sign in to Thorium<ph name="END_LINK"></a></ph>.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_WEAK_PASSWORDS_DESCRIPTION_GENERATION" desc="Information about why weak passwords are a security issue and what syncing user should do to fix the problem. Has a link.">
|
||||
Weak passwords are easy to guess. Let Thorium <ph name="BEGIN_LINK"><a target='_blank' href='$1'></ph>create and remember strong passwords for you<ph name="END_LINK"></a></ph>.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_COMPROMISED_EDIT_DISCLAIMER_DESCRIPTION" desc="A description for the dialog which tells the user to edit password in Chromium if it was changed already.">
|
||||
If so, please edit your saved password in Thorium so it matches your new password.
|
||||
</message>
|
||||
<!-- Default Browser Page -->
|
||||
<if expr="not chromeos_ash">
|
||||
<message name="IDS_SETTINGS_DEFAULT_BROWSER_DEFAULT" desc="The text displayed when Chrome is the default browser">
|
||||
Thorium is your default browser
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_DEFAULT_BROWSER_MAKE_DEFAULT" desc="Default browser checkbox label">
|
||||
Make Thorium the default browser
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_DEFAULT_BROWSER_ERROR" desc="The text displayed when Chrome cannot determine or set the default browser">
|
||||
Thorium cannot determine or set the default browser
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY" desc="The text displayed when Chromium is installed in side-by-side mode, which does not support setting as the default browser.">
|
||||
This is a secondary installation of Thorium, and cannot be made your default browser.
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<!-- Main Page -->
|
||||
<if expr="chromeos_ash or chromeos_lacros">
|
||||
<!-- No target="_blank" because OS settings opens its own window. -->
|
||||
<message name="IDS_SETTINGS_OS_SETTINGS_BANNER" desc="Banner displayed in browser settings page that links to OS settings.">
|
||||
If a setting doesn't show on this page, look in your <ph name="LINK_BEGIN"><a href="$1<ex>https://google.com/</ex>"></ph>
|
||||
ThoriumOS settings<ph name="LINK_END"></a></ph>
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<!-- Privacy Page -->
|
||||
<message name="IDS_SETTINGS_SPELLING_PREF_DESC" desc="Description of using a web serviced to help resolve spelling errors. It is important to convey that what the user types will be sent to Google.">
|
||||
To fix spelling errors, Thorium sends the text you type in text fields to Google
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_RESTART_TO_APPLY_CHANGES" desc="Description in the snackbar to restart Chrome and apply changes.">
|
||||
To apply your changes, relaunch Thorium
|
||||
</message>
|
||||
|
||||
<if expr="not chromeos_ash and not chromeos_lacros">
|
||||
<message name="IDS_SETTINGS_SIGNIN_ALLOWED" desc="The title of the preference to allow to sign-in to Chrome">
|
||||
Allow Thorium sign-in
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SIGNIN_ALLOWED_DESC" desc="The description of the preference to allow to sign-in to Chrome">
|
||||
By turning this off, you can sign in to Google sites like Gmail without signing in to Thorium
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<!-- Site Settings -->
|
||||
<message name="IDS_SETTINGS_SITE_SETTINGS_PDFS_BLOCKED" desc="Label for the disabled option of the pdfs content setting.">
|
||||
Open PDFs in Thorium
|
||||
</message>
|
||||
|
||||
<!-- Privacy Guide -->
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_PROMO_BODY" desc="Body text of a card in the settings page that explains what the 'Privacy Guide' feature is.">
|
||||
Review key privacy and security controls in Thorium
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_CLEAR_ON_EXIT_FEATURE_DESCRIPTION1" desc="A part of the feature description of 'clear cookies on exit' card in the 'Privacy Guide'.">
|
||||
When you close all Thorium windows, cookies and site data are automatically cleared
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_CLEAR_ON_EXIT_FEATURE_DESCRIPTION2" desc="A part of the feature description of 'clear cookies on exit' card in the 'Privacy Guide'.">
|
||||
You will be <ph name="BEGIN_BOLD"><b></ph>signed out of most sites<ph name="END_BOLD"></b></ph> when you close Thorium. If sync is off, you will also be <ph name="BEGIN_BOLD"><b></ph>signed out of Google services and Thorium<ph name="END_BOLD"></b></ph>.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_CLEAR_ON_EXIT_FEATURE_DESCRIPTION3" desc="A part of the feature description of 'clear cookies on exit' card in the 'Privacy Guide'.">
|
||||
Sites you visit remember your information until you close Thorium
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_SAFE_BROWSING_CARD_STANDARD_PROTECTION_FEATURE_DESCRIPTION2" desc="A part of the feature description of the standard protection section of the safe browsing card in the 'Privacy Guide'.">
|
||||
Checks URLs with a list of unsafe sites stored in Thorium
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_SAFE_BROWSING_CARD_STANDARD_PROTECTION_PRIVACY_DESCRIPTION1" desc="A part of the privacy description of the standard protection section of the safe browsing card in the 'Privacy Guide'.">
|
||||
If a site tries to steal your password, or when you download a harmful file, Thorium may also send URLs, including bits of page content, to Safe Browsing
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_COMPLETION_CARD_PRIVACY_SANDBOX_SUB_LABEL" desc="Text of the Privacy Sandbox sublabel in the completion card of the 'Privacy Guide'.">
|
||||
Thorium is exploring new features that allow sites to deliver the same browsing experience using less of your data
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_COMPLETION_CARD_WAA_SUB_LABEL" desc="Text of the Web and App Activity sublabel in the completion card of the 'Privacy Guide'.">
|
||||
Choose whether to include Thorium history for more personalized experiences in Google services
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_GUIDE_MSBB_PRIVACY_DESCRIPTION2" desc="A part of the privacy description of 'make searches and browsing better' in the 'Privacy Guide'.">
|
||||
If you also share Thorium usage reports, those reports include the URLs you visit
|
||||
</message>
|
||||
|
||||
<!-- Privacy Sandbox -->
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_TITLE" desc="TOPICS API A sub title that describes the first of 2 ways a site can get info from Chrome in order to target ads to the user. Topics of interest include things like “Live comedy” and “Rock music”. Chrome estimates these interests based on the sites users visit. * “Your”: we need to convey a sense of ownership, even if the user didn’t explicitly choose the interests we’re talking about. Without the “your”, it could sound like Chrome is simply building a generic library of interests. * “estimated”: It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”). * “by Chrome”: This is new behavior for a browser (Chrome) to take an active role in processing user data for the purposes of showing ads. It’s important to convey “chrome”, the actor in this case.">
|
||||
Your interests as estimated by Thorium
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_TYPES" desc="TOPICS API Bullet 1 of 3 that appear beneath the “Your interests as estimated by Chrome” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “What data is used:” is bold and serves as a label to help people skimming the page. * “Your browsing history”: The user’s browsing history is available beneath the “History” menu at Chrome’s top level. The Topics API estimates topics of interest based on sites in the user’s browsing history that are participating in the trials.">
|
||||
Your browsing history, a record of sites you've visited using Thorium on this device.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_USAGE" desc="TOPICS API Bullet 2 of 3 that appear beneath the “Your interests as estimated by Chrome” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How we use this data:” is bold and serves as a label to help people skimming the page. * “estimate your interests”: Topics of interest include things like “Live comedy” and “Rock music”. Chrome estimates these interests based on the sites users visit. It’s an “estimation”, and we don’t want to suggest that we know with certainty the user’s interests. Avoid words like “guess”, “establish”, “define”, etc. (in place of “estimate”).">
|
||||
Thorium can estimate your interests. Later, a site you visit can ask Thorium to see your interests in order to personalize the ads you see.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_TOPICS_DATA_MANAGEMENT" desc="TOPICS API Bullet 3 of 3 that appear beneath the “Your interests as estimated by Chrome” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How you can manage your data:” is bold and serves as a label to help people skimming the page. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “older than 4 weeks”: We’re trying to convey a rolling delete. Imagine a user opens a browser for the very first time. As the user browses, Chrome will estimate up to 5 topics of interest in the first week. In the second week, Chrome will estimate up to 5 additional topics of interest. The same for the third week, for a total of 15 potential interests. In week 4, Chrome will automatically delete the 5 interests from week 1 so that there aren’t ever more than 15 topics associated with a user at any given time. * “interests can refresh”: If a user loves horror films and reads about them for months on end, the interest “Horror movies” might get deleted and refreshed in the same week, so that “Horror movies” doesn’t ever disappear from the user’s list of interests. * “Or you can…”: A user might love horror movies but can’t stand the idea of seeing ads about horror movies (because even the visuals will ruin the surprise of opening night). In this case, the user can remove “Horror movies” from the list of interests Chrome will consider. This removal remains in place indefinitely. Note that the user might still see ads about Horror movies from different ad networks or by other means than Chrome’s “Browser-based ad personalization” setting.">
|
||||
To protect your privacy, we auto-delete your interests that are older than 4 weeks. As you keep browsing, an interest might appear on the list again. Or you can remove interests you don't want Thorium to consider.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_TYPES" desc="FLEDGE API Bullet 1 of 3 that appear beneath the “Sites you visit that define your interests” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “What data is used:” is bold and serves as a label to help people skimming the page. * “Your browsing history”: The user’s browsing history is available beneath the “History” menu at Chrome’s top level. This content taken in isolation is somewhat misleading. With FLEDGE, a site can store information in Chrome about the user’s visit to their site. For example, the site might store “running_shoes_red_size_35” to indicate that the user showed interest in a particular shoe. We’re OK with the simplification in this bullet because 1) we explain it in the next bullet and 2) we want the user to understand that at the top level, both Topics & Fledge are based on the same thing and that is the user’s browsing history.">
|
||||
Your browsing history, a record of sites you've visited using Thorium on this device.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_LEARN_MORE_DIALOG_FLEDGE_DATA_USAGE" desc="FLEDGE API Bullet 2 of 3 that appear beneath the “Sites you visit that define your interests” subtitle. We break the description into the 3 pieces users most care about: 1) what data, 2) why this data, 3) what can I do about it? * “How we use this data:” is bold and serves as a label to help people skimming the page. With FLEDGE, a site can store information in Chrome about the user’s visit to their site. For example, the site might store “running_shoes_red_size_35” to indicate that the user showed interest in a particular shoe. We’re OK with the simplification in this bullet because 1) we explain it in the next bullet and 2) we want the user to understand that at the top level, both Topics & Fledge are based on the same thing and that is the user’s browsing history. * “Later”: is important to convey the passage of time. We don’t want to convey how much time (it could be tiny). What’s important is that the user understands this is essentially a two-step process. They browse, and Chrome might estimate their interests as they do so. At a later point when they continue to visit a site, that’s when the estimated interests might come into play.">
|
||||
Sites can store information with Thorium about your interests. For example, if you visit a site to buy shoes for a marathon, the site might define your interest as running marathons. Later, if you visit a different site to register for a race, that site can show you an ad for running shoes based on your interests.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_DESCRIPTION" desc="A paragraph beneath the card title. Note that this paragraph is written so that it describes both the Topics API and the FLEDGE API. Some things are described slightly differently for this reason. Version 1 of 3 of this paragraph. 1) The first line is written with the assumption that the user a) has Privacy Sandbox trials turned on and b) has been randomly selected by Chrome to be in an active experiment. As a result of both conditions, this user should have data on this page (a list of interests and a list of sites). 2) NOT THE CASE FOR THIS STRING: A different version of this first line is written for the case that a user has the Privacy Sandbox trials turned on but they haven’t been randomly selected to be in a trial. 3) NOT THE CASE FOR THIS STRING: A different version of this first line is written for the case that a user doesn’t have the Privacy Sandbox trials turned on. * “browsing history”: “a record of sites you’ve visited using Chrome on this device.” * “affects the ads you see and the interests as estimated below”: browsing history leads to Chrome establishing user interests leads to 1) the ads you see are different, and 2) the list of things on this page changes based on what Chrome establishes.* “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “rolling basis each month”: Information associated with Topics and FLEDGE are deleted on a rolling basis at least once per month. It’s simpler to talk about “once per month” rather than 3 weeks for Topics and 4 weeks for FLEDGE. * “Interests can refresh…”: We intend for this line to cover both Topics and FLEDGE. It’s slightly messy, because there is a suggestion that this line is more about Topics than FLEDGE (“interests” is more prominent in the Topics subtitle).">
|
||||
Your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Thorium auto-deletes your interests on a rolling basis each month. Interests can refresh unless you remove them.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_DESCRIPTION_TRIALS_OFF" desc="A paragraph beneath the card title. Note that this paragraph is written so that it describes both the Topics API and the FLEDGE API. Some things are described slightly differently for this reason. Version 2 of 3 of this paragraph. 1) NOT THE CASE FOR THIS STRING: A different version of this first line is written for the case that a user has Privacy Sandbox trials turned on AND that they’ve been randomly selected for a trial. 2) The first line is written with the assumption that the user 1) has Privacy Sandbox trials turned on but 2) has NOT been randomly selected by Chrome to be in an active experiment. This explains why the user doesn’t have data shown on the page. 3) NOT THE CASE FOR THIS STRING: A different version of this first line is written for the case that a user doesn’t have the Privacy Sandbox trials turned on. * “browsing history”: “a record of sites you’ve visited using Chrome on this device.” * “affects the ads you see and the interests as estimated below”: browsing history leads to Chrome establishing user interests leads to 1) the ads you see are different, and 2) the list of things on this page changes based on what Chrome establishes. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “rolling basis each month”: Information associated with Topics and FLEDGE are deleted on a rolling basis at least once per month. It’s simpler to talk about “once per month” rather than 3 weeks for Topics and 4 weeks for FLEDGE.* “Interests can refresh…”: We intend for this line to cover both Topics and FLEDGE. It’s slightly messy, because there is a suggestion that this line is more about Topics than FLEDGE (“interests” is more prominent in the Topics subtitle).">
|
||||
When trials are on and if Thorium has randomly placed you in an active trial, your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Thorium deletes your interests on a rolling basis each month.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_DESCRIPTION_LISTS_EMPTY" desc="A paragraph beneath the card title. Note that this paragraph is written so that it describes both the Topics API and the FLEDGE API. Some things are described slightly differently for this reason. Version 3 of 3 of this paragraph. 1) NOT THE CASE FOR THIS STRING: A different version of this first line is written for the case that a user has Privacy Sandbox trials turned on AND that they’ve been randomly selected for a trial. 2) NOT THE CASE FOR THIS STRING: A different version of this first line is written for the case that a user has the Privacy Sandbox trials turned on but they haven’t been randomly selected to be in a trial. 3) The first line is written with the assumption that the user a) doesn’t have Privacy Sandbox trials turned on. b) Because of this, they can’t be randomly selected for a trial. This explains why the user doesn’t have data shown on the page. * “browsing history”: “a record of sites you’ve visited using Chrome on this device.” * “affects the ads you see and the interests as estimated below”: browsing history leads to Chrome establishing user interests leads to 1) the ads you see are different, and 2) the list of things on this page changes based on what Chrome establishes. * “To protect your privacy”: Today, most data is kept for long periods of time. This new Topics API doesn’t retain estimated topics for more than 3 weeks. The only reason for this feature is to protect the user’s privacy. * “auto”: isn’t strictly necessary, but it conveys that this feature is an ongoing part of the service. This isn’t describing, for example, a one-time deletion. * “rolling basis each month”: Information associated with Topics and FLEDGE are deleted on a rolling basis at least once per month. It’s simpler to talk about “once per month” rather than 3 weeks for Topics and 4 weeks for FLEDGE. * “Interests can refresh…”: We intend for this line to cover both Topics and FLEDGE. It’s slightly messy, because there is a suggestion that this line is more about Topics than FLEDGE (“interests” is more prominent in the Topics subtitle).">
|
||||
If Thorium has randomly placed you in an active trial, your browsing history affects the ads you see and the interests as estimated below. To protect your privacy, Thorium deletes your interests on a rolling basis each month. Interests refresh unless you remove them.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_TITLE" desc="Title of the browser-based interests section of the 'ad personalization' dialog.">
|
||||
Your interests as estimated by Thorium
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_1" desc="First learn more description of the browser-based interests section of the 'ad personalization' dialog.">
|
||||
Thorium can estimate your interests based on your browsing history from the last few weeks. This info stays on your device.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_2" desc="Second learn more description of the browser-based interests section of the 'ad personalization' dialog.">
|
||||
Later, a site you visit can ask Thorium to see your interests in order to personalize the ads you see. Thorium can share up to 3 interests.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_TOPICS_LEARN_MORE_3" desc="Third learn more description of the browser-based interests section of the 'ad personalization' dialog.">
|
||||
To protect your privacy, we auto-delete your interests that are older than 4 weeks. As you keep browsing, an interest might appear on the list again. And if Thorium gets it wrong or you don't want to see certain ads, you can remove an interest.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_PERSONALIZATION_DIALOG_FLEDGE_LEARN_MORE_1" desc="First learn more description of the website-based interests section of the 'ad personalization' dialog.">
|
||||
It's common for sites you visit to remember things you're interested in, to personalize your experience. Sites can also store information with Thorium about your interests.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_DESCRIPTION" desc="A description of the Ad measurement API. * “Ad measurement” is the name of an API in this context. We don’t use “API” with the user, but they need to know that there is something called “A measurement” and what it does. * “sites you visit”: call the API to get information. The actor is the site, not Chrome. * “restricts cross-site tracking”: Today, with 3rd-party cookies, ad measurement technologies can inadvertently (and intentionally) share considerable information from one site to another). This feature restricts that sharing in order to improve the user’s privacy.">
|
||||
Ad measurement allows sites you visit to request information from Thorium that helps the site measure the performance of their ads. Ad measurement restricts cross-site tracking by transferring as little information as possible between sites.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_PRIVACY_SANDBOX_AD_MEASUREMENT_DIALOG_DESCRIPTION_TRIALS_OFF" desc="A description of the Ad measurement API. * “Ad measurement” is the name of an API in this context. We don’t use “API” with the user, but they need to know that there is something called “A measurement” and what it does. * “sites you visit”: call the API to get information. The actor is the site, not Chrome. * “restricts cross-site tracking”: Today, with 3rd-party cookies, ad measurement technologies can inadvertently (and intentionally) share considerable information from one site to another). This feature restricts that sharing in order to improve the user’s privacy.">
|
||||
When trials are on, Ad measurement allows sites you visit to request information from Thorium that helps the site measure the performance of their ads. Ad measurement restricts cross-site tracking by transferring as little information as possible between sites.
|
||||
</message>
|
||||
|
||||
<!-- Safety check -->
|
||||
<message name="IDS_SETTINGS_SAFETY_CHECK_PARENT_PRIMARY_LABEL_BEFORE" desc="This text describes what the safety check is. (It's an area of the Settings page where users can quickly check whether their safety-related settings are fully protecting them.)">
|
||||
Thorium can help keep you safe from data breaches, bad extensions, and more
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SAFETY_CHECK_UPDATES_FAILED_OFFLINE" desc="This text describes that Chromium cannot check for updates because there currently is no internet connection.">
|
||||
Thorium can't check for updates. Try checking your internet connection.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SAFETY_CHECK_UPDATES_FAILED" desc="This text describes that Chromium cannot update due to an unknown error.">
|
||||
Thorium didn't update, something went wrong. <ph name="BEGIN_LINK"><a target="_blank" href="$1"></ph>Fix Thorium update problems and failed updates.<ph name="END_LINK"></a></ph>
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SAFETY_CHECK_UPDATES_UNKNOWN" desc="This text displays the installed version of Chromium when it is not possible to check for updates on non-Chrome branded browsers.">
|
||||
Thorium version <ph name="PRODUCT_VERSION">$1<ex>15.0.865.0</ex></ph> is installed
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SAFETY_CHECK_PASSWORDS_SIGNED_OUT" desc="This text points out that the password check can only run when the user is signed in.">
|
||||
Thorium can't check your passwords because you're not signed in
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SAFETY_CHECK_SAFE_BROWSING_DISABLED" desc="This text points out that Safe Browsing is disabled and that the user is not protected.">
|
||||
Safe Browsing is off. Thorium recommends turning it on.
|
||||
</message>
|
||||
|
||||
<!-- Safe Browsing -->
|
||||
<message name="IDS_SETTINGS_SAFEBROWSING_ENHANCED_BULLET_TWO" desc="Second bullet point under the safe browsing enhanced protection mode">
|
||||
Keeps you safe on Thorium and may be used to improve your security in other Google apps when you are signed in
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SAFEBROWSING_STANDARD_BULLET_TWO" desc="First bullet point under the safe browsing standard protection mode">
|
||||
Checks URLs with a list of unsafe sites stored in Thorium. If a site tries to steal your password, or when you download a harmful file, Thorium may also send URLs, including bits of page content, to Safe Browsing.
|
||||
</message>
|
||||
|
||||
<!-- People Page -->
|
||||
<message name="IDS_SETTINGS_SYNC_DISCONNECT_DELETE_PROFILE_WARNING_WITH_COUNTS_SINGULAR" desc="Warning message displayed in the Sign out of Chrome dialog that indicates profile browsing data will be removed from the device.">
|
||||
This will delete 1 item from this device. To retrieve your data later, sign in to Thorium as <ph name="USER_EMAIL">$1<ex>foo@example.com</ex></ph>.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SYNC_DISCONNECT_DELETE_PROFILE_WARNING_WITH_COUNTS_PLURAL" desc="Warning message displayed in the Sign out of Chrome dialog that indicates profile browsing data will be removed from the device.">
|
||||
This will delete <ph name="ITEMS_COUNT">$1<ex>66</ex></ph> items from this device. To retrieve your data later, sign in to Thorium as <ph name="USER_EMAIL">$2<ex>foo@example.com</ex></ph>.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SYNC_DISCONNECT_DELETE_PROFILE_WARNING_WITHOUT_COUNTS" desc="Warning message displayed in the Sign out of Chrome dialog that indicates profile browsing data will be removed from the device.">
|
||||
This will delete your browsing data from this device. To retrieve your data later, sign in to Thorium as <ph name="USER_EMAIL">$1<ex>foo@example.com</ex></ph>.
|
||||
</message>
|
||||
<if expr="not chromeos_ash">
|
||||
<message name="IDS_SETTINGS_CUSTOMIZE_YOUR_CHROME_PROFILE" desc="Label of the link that takes you to the page to customize your chrome profile.">
|
||||
Customize your Thorium profile
|
||||
</message>
|
||||
<message name="IDS_SETTING_NAME_YOUR_PROFILE" desc="Title of the edit local profile name section on the manage profile page.">
|
||||
Name your Thorium profile
|
||||
</message>
|
||||
</if>
|
||||
<message name="IDS_SETTINGS_PEOPLE_SIGN_IN_PROMPT_SECONDARY_WITH_ACCOUNT" desc="The secondary text displayed to prompt users to enable sync for an account that is alredy present in Chromium.">
|
||||
Sync and personalize Thorium across your devices
|
||||
</message>
|
||||
<if expr="chromeos_ash">
|
||||
<message name="IDS_SETTINGS_ACCOUNT_MANAGER_DESCRIPTION_V2" desc="Description of the Account Manager Settings page. Shown just below the title of the page.">
|
||||
You can manage your signed-in Google Accounts. Your Google Accounts are used for Thorium browser, Play Store, Gmail, and more. If you want to add an account for someone else, like a family member, add a new person to your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> instead. <ph name="LINK_BEGIN"><a></ph>Learn more<ph name="LINK_END"></a></ph>
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<!-- Sync Page -->
|
||||
<message name="IDS_SETTINGS_SYNC_DATA_ENCRYPTED_TEXT" desc="Text alerting the user that synced data is encrypted.">
|
||||
For added security, Thorium will encrypt your data.
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SYNC_DISCONNECT_TITLE" desc="The title of the dialog to stop syncing and sign out.">
|
||||
Sign out of Thorium?
|
||||
</message>
|
||||
<message name="IDS_DRIVE_SUGGEST_PREF_DESC" desc="The documentation string of the 'Show Drive Results in Omnibox' - full description sentence">
|
||||
Thorium will access your Drive to make suggestions in the address bar
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_SYNC_SIGN_IN_PROMPT_WITH_NO_ACCOUNT" desc="The text displayed to prompt users to sign in to Chromium.">
|
||||
Sign in to sync and personalize Thorium across your devices
|
||||
</message>
|
||||
|
||||
<!-- Languages Page -->
|
||||
<if expr="is_win">
|
||||
<message name="IDS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE" desc="The label for a language that is currently used as the UI display language.">
|
||||
This language is used to display the Thorium UI
|
||||
</message>
|
||||
<message name="IDS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE" desc="The label used for a button that changes the UI language.">
|
||||
Display Thorium in this language
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<!-- System Page -->
|
||||
<if expr="not chromeos_ash">
|
||||
<message name="IDS_SETTINGS_SYSTEM_BACKGROUND_APPS_LABEL" desc="Label for the checkbox to allow apps to run in the background, when Chrome is closed.">
|
||||
Continue running background apps when Thorium is closed
|
||||
</message>
|
||||
</if>
|
||||
|
||||
<!-- Reset Page -->
|
||||
<message name="IDS_SETTINGS_RESET_PROFILE_FEEDBACK" desc="Feedback label in the Reset Profile Settings dialog">
|
||||
Help make Thorium better by reporting the <ph name="BEGIN_LINK"><a is="action-link" target="_blank"></ph>current settings<ph name="END_LINK"></a></ph>
|
||||
</message>
|
||||
</grit-part>
|
3990
chrome/app/settings_strings.grdp
Normal file
10
chrome/app/theme/chromium/BRANDING
Normal file
|
@ -0,0 +1,10 @@
|
|||
COMPANY_FULLNAME=The Chromium Authors and Alex313031
|
||||
COMPANY_SHORTNAME=The Chromium Authors and Alex313031
|
||||
PRODUCT_FULLNAME=Thorium
|
||||
PRODUCT_SHORTNAME=Thorium
|
||||
PRODUCT_INSTALLER_FULLNAME=Thorium Installer
|
||||
PRODUCT_INSTALLER_SHORTNAME=Thorium Installer
|
||||
COPYRIGHT=Copyright @LASTCHANGE_YEAR@ The Chromium Authors and Alex313031. All rights reserved.
|
||||
MAC_BUNDLE_ID=org.chromium.Chromium
|
||||
MAC_CREATOR_CODE=Cr24
|
||||
MAC_TEAM_ID=
|
BIN
chrome/app/theme/chromium/chromeos/chrome_app_icon_192.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
chrome/app/theme/chromium/chromeos/chrome_app_icon_32.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
chrome/app/theme/chromium/linux/product_logo_128.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
chrome/app/theme/chromium/linux/product_logo_24.png
Normal file
After Width: | Height: | Size: 795 B |
BIN
chrome/app/theme/chromium/linux/product_logo_256.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
168
chrome/app/theme/chromium/linux/product_logo_32.xpm
Normal file
|
@ -0,0 +1,168 @@
|
|||
/* XPM */
|
||||
static char * product_logo_64_xpm[] = {
|
||||
"64 64 101 2",
|
||||
" c None",
|
||||
". c #1967D2",
|
||||
"+ c #4782E2",
|
||||
"@ c #1761C6",
|
||||
"# c #114EA2",
|
||||
"$ c #0D428B",
|
||||
"% c #062E65",
|
||||
"& c #536B99",
|
||||
"* c #6D87B7",
|
||||
"= c #93B0E4",
|
||||
"- c #9EBCF3",
|
||||
"; c #A3C1F5",
|
||||
"> c #649BF5",
|
||||
", c #266DD5",
|
||||
"' c #1253AC",
|
||||
") c #0D346C",
|
||||
"! c #000000",
|
||||
"~ c #5B6A84",
|
||||
"{ c #8EA6CD",
|
||||
"] c #AECBFA",
|
||||
"^ c #669DF6",
|
||||
"/ c #548DEA",
|
||||
"( c #185FC2",
|
||||
"_ c #526179",
|
||||
": c #A1BCE7",
|
||||
"< c #3575DB",
|
||||
"[ c #1251A7",
|
||||
"} c #01112D",
|
||||
"| c #073470",
|
||||
"1 c #1054AD",
|
||||
"2 c #1668D2",
|
||||
"3 c #1A73E8",
|
||||
"4 c #232B37",
|
||||
"5 c #8AA1C7",
|
||||
"6 c #5D94EF",
|
||||
"7 c #052E65",
|
||||
"8 c #1665CD",
|
||||
"9 c #427EE0",
|
||||
"0 c #0E4EA1",
|
||||
"a c #1971E4",
|
||||
"b c #8EA6CC",
|
||||
"c c #629AF3",
|
||||
"d c #206AD4",
|
||||
"e c #1E61C3",
|
||||
"f c #125AB9",
|
||||
"g c #4D87E6",
|
||||
"h c #5D6B82",
|
||||
"i c #3072D8",
|
||||
"j c #568FEB",
|
||||
"k c #08336E",
|
||||
"l c #5A6A84",
|
||||
"m c #3877DB",
|
||||
"n c #A4C0EC",
|
||||
"o c #5E96F1",
|
||||
"p c #104EA2",
|
||||
"q c #90A7CD",
|
||||
"r c #4782E3",
|
||||
"s c #7286A6",
|
||||
"t c #4F89E7",
|
||||
"u c #5991ED",
|
||||
"v c #3F7CDE",
|
||||
"w c #1A52A4",
|
||||
"x c #869CC1",
|
||||
"y c #477ED8",
|
||||
"z c #244276",
|
||||
"A c #596881",
|
||||
"B c #5280CA",
|
||||
"C c #2D4977",
|
||||
"D c #5F92E4",
|
||||
"E c #101F36",
|
||||
"F c #9CB9E7",
|
||||
"G c #507CC4",
|
||||
"H c #7794C6",
|
||||
"I c #557FC4",
|
||||
"J c #A9C7FA",
|
||||
"K c #91B7F8",
|
||||
"L c #6092E4",
|
||||
"M c #72A3F6",
|
||||
"N c #ACC9FA",
|
||||
"O c #355281",
|
||||
"P c #325182",
|
||||
"Q c #99BCF9",
|
||||
"R c #6094E9",
|
||||
"S c #4D78BE",
|
||||
"T c #4167A3",
|
||||
"U c #7CAAF7",
|
||||
"V c #A4C4F9",
|
||||
"W c #89B1F8",
|
||||
"X c #6A9FF6",
|
||||
"Y c #AAC8FA",
|
||||
"Z c #94B9F8",
|
||||
"` c #75A5F7",
|
||||
" . c #9EBFF9",
|
||||
".. c #80ACF7",
|
||||
"+. c #A5C5F9",
|
||||
"@. c #8CB3F8",
|
||||
"#. c #6EA1F6",
|
||||
"$. c #96BAF8",
|
||||
"%. c #A0C1F9",
|
||||
"&. c #83ADF7",
|
||||
"*. c #9FC0F9",
|
||||
" ",
|
||||
" ",
|
||||
" . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
|
||||
" + . . . . . . . . . . . . . . . . . . . . @ # $ % % % % & * = - - - - - - - - - - - - - - - - - - - - ; ",
|
||||
" > , . . . . . . . . . . . . . . . . . ' ) ! ! ! ! ! ! ! ! ! ! ~ { ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ / . . . . . . . . . . . . . . . ( % ! ! ! ! ! ! ! ! ! ! ! ! ! ! _ : ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ < . . . . . . . . . . . . . [ } ! ! ! | 1 2 3 3 3 3 2 1 | ! ! ! 4 5 ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ 6 . . . . . . . . . . . . [ ! ! ! 7 8 3 3 3 3 3 3 3 3 3 3 8 7 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] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ..] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ +.] ] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ @.] ] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ #.Y ] ] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ $.] ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ` ] ] ] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ %.] ] ] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ ^ ^ ^ ^ ^ &.] ] ] ] ] ] ] ",
|
||||
" ^ ^ ^ *.] ] ",
|
||||
" ",
|
||||
" "};
|
BIN
chrome/app/theme/chromium/linux/product_logo_48.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
chrome/app/theme/chromium/linux/product_logo_64.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
chrome/app/theme/chromium/mac/app.icns
Normal file
BIN
chrome/app/theme/chromium/mac/document.icns
Normal file
BIN
chrome/app/theme/chromium/product_logo_128.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
chrome/app/theme/chromium/product_logo_24.png
Normal file
After Width: | Height: | Size: 795 B |
BIN
chrome/app/theme/chromium/product_logo_256.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
chrome/app/theme/chromium/product_logo_48.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
chrome/app/theme/chromium/product_logo_64.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
chrome/app/theme/chromium/win/chromium.ico
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
chrome/app/theme/chromium/win/tiles/Logo.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
chrome/app/theme/chromium/win/tiles/SmallLogo.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 538 B |
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 538 B |
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 7 KiB |
BIN
chrome/app/theme/default_100_percent/chromium/webstore_icon.png
Normal file
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 5.1 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 1 KiB |
After Width: | Height: | Size: 2 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 9.3 KiB |
BIN
chrome/app/theme/default_200_percent/chromium/webstore_icon.png
Normal file
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 6.8 KiB |
1050
chrome/browser/background/background_mode_manager.cc
Normal file
380
chrome/browser/net/stub_resolver_config_reader.cc
Normal file
|
@ -0,0 +1,380 @@
|
|||
// Copyright 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/net/stub_resolver_config_reader.h"
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/check.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/location.h"
|
||||
#include "base/metrics/field_trial_params.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/notreached.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/values.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/net/secure_dns_config.h"
|
||||
#include "chrome/browser/net/secure_dns_util.h"
|
||||
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
|
||||
#include "chrome/common/chrome_features.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/flags_ui/pref_service_flags_storage.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/network_service_instance.h"
|
||||
#include "net/dns/public/dns_over_https_config.h"
|
||||
#include "net/dns/public/secure_dns_mode.h"
|
||||
#include "net/dns/public/util.h"
|
||||
#include "services/network/public/mojom/host_resolver.mojom.h"
|
||||
#include "services/network/public/mojom/network_service.mojom.h"
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
#include "base/android/build_info.h"
|
||||
#include "chrome/browser/enterprise/util/android_enterprise_info.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
#include "base/enterprise_util.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "chrome/browser/win/parental_controls.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
// Detailed descriptions of the secure DNS mode. These values are logged to UMA.
|
||||
// Entries should not be renumbered and numeric values should never be reused.
|
||||
// Please keep in sync with "SecureDnsModeDetails" in
|
||||
// src/tools/metrics/histograms/enums.xml.
|
||||
enum class SecureDnsModeDetailsForHistogram {
|
||||
// The mode is controlled by the user and is set to 'off'.
|
||||
kOffByUser = 0,
|
||||
// The mode is controlled via enterprise policy and is set to 'off'.
|
||||
kOffByEnterprisePolicy = 1,
|
||||
// Chrome detected a managed environment and forced the mode to 'off'.
|
||||
kOffByDetectedManagedEnvironment = 2,
|
||||
// Chrome detected parental controls and forced the mode to 'off'.
|
||||
kOffByDetectedParentalControls = 3,
|
||||
// The mode is controlled by the user and is set to 'automatic' (the default
|
||||
// mode).
|
||||
kAutomaticByUser = 4,
|
||||
// The mode is controlled via enterprise policy and is set to 'automatic'.
|
||||
kAutomaticByEnterprisePolicy = 5,
|
||||
// The mode is controlled by the user and is set to 'secure'.
|
||||
kSecureByUser = 6,
|
||||
// The mode is controlled via enterprise policy and is set to 'secure'.
|
||||
kSecureByEnterprisePolicy = 7,
|
||||
kMaxValue = kSecureByEnterprisePolicy,
|
||||
};
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
bool ShouldDisableDohForWindowsParentalControls() {
|
||||
const WinParentalControls& parental_controls = GetWinParentalControls();
|
||||
if (parental_controls.web_filter)
|
||||
return true;
|
||||
|
||||
// Some versions before Windows 8 may not fully support |web_filter|, so
|
||||
// conservatively disable doh for any recognized parental controls.
|
||||
if (parental_controls.any_restrictions &&
|
||||
base::win::GetVersion() < base::win::Version::WIN8) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
// Check the AsyncDns field trial and return true if it should be enabled. On
|
||||
// Android this includes checking the Android version in the field trial.
|
||||
bool ShouldEnableAsyncDns() {
|
||||
bool feature_can_be_enabled = true;
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
int min_sdk =
|
||||
base::GetFieldTrialParamByFeatureAsInt(features::kAsyncDns, "min_sdk", 0);
|
||||
if (base::android::BuildInfo::GetInstance()->sdk_int() < min_sdk)
|
||||
feature_can_be_enabled = false;
|
||||
#endif
|
||||
return feature_can_be_enabled &&
|
||||
base::FeatureList::IsEnabled(features::kAsyncDns);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
constexpr base::TimeDelta StubResolverConfigReader::kParentalControlsCheckDelay;
|
||||
|
||||
StubResolverConfigReader::StubResolverConfigReader(PrefService* local_state,
|
||||
bool set_up_pref_defaults)
|
||||
: local_state_(local_state) {
|
||||
base::RepeatingClosure pref_callback =
|
||||
base::BindRepeating(&StubResolverConfigReader::UpdateNetworkService,
|
||||
base::Unretained(this), false /* record_metrics */);
|
||||
|
||||
pref_change_registrar_.Init(local_state_);
|
||||
|
||||
// Update the DnsClient and DoH default preferences based on the corresponding
|
||||
// features before registering change callbacks for these preferences.
|
||||
// Changing prefs or defaults after registering change callbacks could result
|
||||
// in reentrancy and mess up registration between this code and NetworkService
|
||||
// creation.
|
||||
if (set_up_pref_defaults) {
|
||||
local_state_->SetDefaultPrefValue(prefs::kBuiltInDnsClientEnabled,
|
||||
base::Value(ShouldEnableAsyncDns()));
|
||||
net::SecureDnsMode default_secure_dns_mode = net::SecureDnsMode::kOff;
|
||||
std::string default_doh_templates;
|
||||
if (base::FeatureList::IsEnabled(features::kDnsOverHttps)) {
|
||||
if (features::kDnsOverHttpsFallbackParam.Get()) {
|
||||
default_secure_dns_mode = net::SecureDnsMode::kAutomatic;
|
||||
} else {
|
||||
default_secure_dns_mode = net::SecureDnsMode::kSecure;
|
||||
}
|
||||
default_doh_templates = features::kDnsOverHttpsTemplatesParam.Get();
|
||||
}
|
||||
local_state_->SetDefaultPrefValue(
|
||||
prefs::kDnsOverHttpsMode,
|
||||
base::Value(SecureDnsConfig::ModeToString(default_secure_dns_mode)));
|
||||
local_state_->SetDefaultPrefValue(prefs::kDnsOverHttpsTemplates,
|
||||
base::Value(default_doh_templates));
|
||||
|
||||
// If the user has explicitly enabled or disabled the DoH experiment in
|
||||
// chrome://flags and the DoH UI setting is not visible, store that choice
|
||||
// in the user prefs so that it can be persisted after the experiment ends.
|
||||
// Also make sure to remove the stored prefs value if the user has changed
|
||||
// their chrome://flags selection to the default.
|
||||
if (!features::kDnsOverHttpsShowUiParam.Get()) {
|
||||
flags_ui::PrefServiceFlagsStorage flags_storage(local_state_);
|
||||
std::set<std::string> entries = flags_storage.GetFlags();
|
||||
if (entries.count("dns-over-https@1")) {
|
||||
// The user has "Enabled" selected.
|
||||
local_state_->SetString(prefs::kDnsOverHttpsMode,
|
||||
SecureDnsConfig::kModeSecure);
|
||||
} else if (entries.count("dns-over-https@2")) {
|
||||
// The user has "Disabled" selected.
|
||||
local_state_->SetString(prefs::kDnsOverHttpsMode,
|
||||
SecureDnsConfig::kModeOff);
|
||||
} else {
|
||||
// The user has "Default" selected.
|
||||
local_state_->ClearPref(prefs::kDnsOverHttpsMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pref_change_registrar_.Add(prefs::kBuiltInDnsClientEnabled, pref_callback);
|
||||
pref_change_registrar_.Add(prefs::kDnsOverHttpsMode, pref_callback);
|
||||
pref_change_registrar_.Add(prefs::kDnsOverHttpsTemplates, pref_callback);
|
||||
pref_change_registrar_.Add(prefs::kAdditionalDnsQueryTypesEnabled,
|
||||
pref_callback);
|
||||
|
||||
parental_controls_delay_timer_.Start(
|
||||
FROM_HERE, kParentalControlsCheckDelay,
|
||||
base::BindOnce(&StubResolverConfigReader::OnParentalControlsDelayTimer,
|
||||
base::Unretained(this)));
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
chrome::enterprise_util::AndroidEnterpriseInfo::GetInstance()
|
||||
->GetAndroidEnterpriseInfoState(base::BindOnce(
|
||||
&StubResolverConfigReader::OnAndroidOwnedStateCheckComplete,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
#endif
|
||||
}
|
||||
|
||||
StubResolverConfigReader::~StubResolverConfigReader() = default;
|
||||
|
||||
// static
|
||||
void StubResolverConfigReader::RegisterPrefs(PrefRegistrySimple* registry) {
|
||||
// Register the DnsClient and DoH preferences. The feature list has not been
|
||||
// initialized yet, so setting the preference defaults here to reflect the
|
||||
// corresponding features will only cause the preference defaults to reflect
|
||||
// the feature defaults (feature values set via the command line will not be
|
||||
// captured). Thus, the preference defaults are updated in the constructor
|
||||
// for SystemNetworkContextManager, at which point the feature list is ready.
|
||||
registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, false);
|
||||
registry->RegisterStringPref(prefs::kDnsOverHttpsMode, std::string());
|
||||
registry->RegisterStringPref(prefs::kDnsOverHttpsTemplates, std::string());
|
||||
registry->RegisterBooleanPref(prefs::kAdditionalDnsQueryTypesEnabled, true);
|
||||
}
|
||||
|
||||
SecureDnsConfig StubResolverConfigReader::GetSecureDnsConfiguration(
|
||||
bool force_check_parental_controls_for_automatic_mode) {
|
||||
return GetAndUpdateConfiguration(
|
||||
force_check_parental_controls_for_automatic_mode,
|
||||
false /* record_metrics */, false /* update_network_service */);
|
||||
}
|
||||
|
||||
void StubResolverConfigReader::UpdateNetworkService(bool record_metrics) {
|
||||
GetAndUpdateConfiguration(
|
||||
false /* force_check_parental_controls_for_automatic_mode */,
|
||||
record_metrics, true /* update_network_service */);
|
||||
}
|
||||
|
||||
bool StubResolverConfigReader::ShouldDisableDohForManaged() {
|
||||
// This function ignores cloud policies which are loaded on a per-profile basis.
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
// Check for MDM/management/owner apps. android_has_owner_ is true if either a
|
||||
// device or policy owner app is discovered by
|
||||
// GetAndroidEnterpriseInfoState(). If android_has_owner_ is nullopt, take a
|
||||
// value of false so that we don't disable DoH during the async check.
|
||||
|
||||
// Because Android policies can only be loaded with owner apps this is
|
||||
// sufficient to check for the prescences of policies as well.
|
||||
if (android_has_owner_.value_or(false))
|
||||
return true;
|
||||
#elif BUILDFLAG(IS_WIN)
|
||||
if (base::IsMachineExternallyManaged())
|
||||
return true;
|
||||
#endif
|
||||
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
|
||||
if (g_browser_process->browser_policy_connector()->HasMachineLevelPolicies())
|
||||
return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StubResolverConfigReader::ShouldDisableDohForParentalControls() {
|
||||
if (parental_controls_testing_override_.has_value())
|
||||
return parental_controls_testing_override_.value();
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
return ShouldDisableDohForWindowsParentalControls();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void StubResolverConfigReader::OnParentalControlsDelayTimer() {
|
||||
DCHECK(!parental_controls_delay_timer_.IsRunning());
|
||||
|
||||
// No need to act if parental controls were checked early.
|
||||
if (parental_controls_checked_)
|
||||
return;
|
||||
parental_controls_checked_ = true;
|
||||
|
||||
// If parental controls are enabled, force a config change so secure DNS can
|
||||
// be disabled.
|
||||
if (ShouldDisableDohForParentalControls())
|
||||
UpdateNetworkService(false /* record_metrics */);
|
||||
}
|
||||
|
||||
bool StubResolverConfigReader::GetInsecureStubResolverEnabled() {
|
||||
return local_state_->GetBoolean(prefs::kBuiltInDnsClientEnabled);
|
||||
}
|
||||
|
||||
SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration(
|
||||
bool force_check_parental_controls_for_automatic_mode,
|
||||
bool record_metrics,
|
||||
bool update_network_service) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
net::SecureDnsMode secure_dns_mode;
|
||||
SecureDnsModeDetailsForHistogram mode_details;
|
||||
SecureDnsConfig::ManagementMode forced_management_mode =
|
||||
SecureDnsConfig::ManagementMode::kNoOverride;
|
||||
bool is_managed =
|
||||
local_state_->FindPreference(prefs::kDnsOverHttpsMode)->IsManaged();
|
||||
if (!is_managed && ShouldDisableDohForManaged()) {
|
||||
secure_dns_mode = net::SecureDnsMode::kOff;
|
||||
forced_management_mode = SecureDnsConfig::ManagementMode::kDisabledManaged;
|
||||
} else {
|
||||
secure_dns_mode = SecureDnsConfig::ParseMode(
|
||||
local_state_->GetString(prefs::kDnsOverHttpsMode))
|
||||
.value_or(net::SecureDnsMode::kOff);
|
||||
}
|
||||
|
||||
bool check_parental_controls = false;
|
||||
if (secure_dns_mode == net::SecureDnsMode::kSecure) {
|
||||
mode_details =
|
||||
is_managed ? SecureDnsModeDetailsForHistogram::kSecureByEnterprisePolicy
|
||||
: SecureDnsModeDetailsForHistogram::kSecureByUser;
|
||||
|
||||
// SECURE mode must always check for parental controls immediately (unless
|
||||
// enabled through policy, which takes precedence over parental controls)
|
||||
// because the mode allows sending DoH requests immediately.
|
||||
check_parental_controls = !is_managed;
|
||||
} else if (secure_dns_mode == net::SecureDnsMode::kAutomatic) {
|
||||
mode_details =
|
||||
is_managed
|
||||
? SecureDnsModeDetailsForHistogram::kAutomaticByEnterprisePolicy
|
||||
: SecureDnsModeDetailsForHistogram::kAutomaticByUser;
|
||||
|
||||
// To avoid impacting startup performance, AUTOMATIC mode should defer
|
||||
// checking parental for a short period. This delay should have no practical
|
||||
// effect on DoH queries because DoH enabling probes do not start until a
|
||||
// longer period after startup.
|
||||
bool allow_check_parental_controls =
|
||||
force_check_parental_controls_for_automatic_mode ||
|
||||
parental_controls_checked_;
|
||||
check_parental_controls = !is_managed && allow_check_parental_controls;
|
||||
} else {
|
||||
switch (forced_management_mode) {
|
||||
case SecureDnsConfig::ManagementMode::kNoOverride:
|
||||
mode_details =
|
||||
is_managed
|
||||
? SecureDnsModeDetailsForHistogram::kOffByEnterprisePolicy
|
||||
: SecureDnsModeDetailsForHistogram::kOffByUser;
|
||||
break;
|
||||
case SecureDnsConfig::ManagementMode::kDisabledManaged:
|
||||
mode_details =
|
||||
SecureDnsModeDetailsForHistogram::kOffByDetectedManagedEnvironment;
|
||||
break;
|
||||
case SecureDnsConfig::ManagementMode::kDisabledParentalControls:
|
||||
NOTREACHED();
|
||||
break;
|
||||
default:
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
// No need to check for parental controls if DoH is already disabled.
|
||||
check_parental_controls = false;
|
||||
}
|
||||
|
||||
// Check parental controls last because it can be expensive and should only be
|
||||
// checked if necessary for the otherwise-determined mode.
|
||||
if (check_parental_controls) {
|
||||
parental_controls_checked_ = true;
|
||||
}
|
||||
|
||||
bool additional_dns_query_types_enabled =
|
||||
local_state_->GetBoolean(prefs::kAdditionalDnsQueryTypesEnabled);
|
||||
|
||||
if (record_metrics) {
|
||||
UMA_HISTOGRAM_ENUMERATION("Net.DNS.DnsConfig.SecureDnsMode", mode_details);
|
||||
if (!additional_dns_query_types_enabled || ShouldDisableDohForManaged()) {
|
||||
UMA_HISTOGRAM_BOOLEAN("Net.DNS.DnsConfig.AdditionalDnsQueryTypesEnabled",
|
||||
additional_dns_query_types_enabled);
|
||||
}
|
||||
}
|
||||
|
||||
net::DnsOverHttpsConfig doh_config;
|
||||
if (secure_dns_mode != net::SecureDnsMode::kOff) {
|
||||
doh_config = net::DnsOverHttpsConfig::FromStringLax(
|
||||
local_state_->GetString(prefs::kDnsOverHttpsTemplates));
|
||||
}
|
||||
if (update_network_service) {
|
||||
content::GetNetworkService()->ConfigureStubHostResolver(
|
||||
GetInsecureStubResolverEnabled(), secure_dns_mode, doh_config,
|
||||
additional_dns_query_types_enabled);
|
||||
}
|
||||
|
||||
return SecureDnsConfig(secure_dns_mode, std::move(doh_config),
|
||||
forced_management_mode);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
void StubResolverConfigReader::OnAndroidOwnedStateCheckComplete(
|
||||
bool has_profile_owner,
|
||||
bool has_device_owner) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
android_has_owner_ = has_profile_owner || has_device_owner;
|
||||
// update the network service if the actual result is "true" to save time.
|
||||
if (android_has_owner_.value())
|
||||
UpdateNetworkService(false /* record_metrics */);
|
||||
}
|
||||
#endif
|
1098
chrome/browser/profiles/profile_shortcut_manager_win.cc
Normal file
388
chrome/browser/search/search.cc
Normal file
|
@ -0,0 +1,388 @@
|
|||
// Copyright 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/search/search.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/search_engines/template_url_service_factory.h"
|
||||
#include "chrome/browser/search_engines/ui_thread_search_terms_data.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
#include "components/google/core/common/google_util.h"
|
||||
#include "components/search/ntp_features.h"
|
||||
#include "components/search/search.h"
|
||||
#include "components/search_engines/search_engine_type.h"
|
||||
#include "components/search_engines/template_url_service.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
|
||||
#include "chrome/browser/supervised_user/supervised_user_service.h"
|
||||
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
|
||||
#include "chrome/browser/supervised_user/supervised_user_url_filter.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
#include "chrome/browser/search/instant_service.h"
|
||||
#include "chrome/browser/search/instant_service_factory.h"
|
||||
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.h"
|
||||
#include "chrome/browser/ui/webui/new_tab_page_third_party/new_tab_page_third_party_ui.h"
|
||||
#endif
|
||||
|
||||
namespace search {
|
||||
|
||||
namespace {
|
||||
|
||||
const char kServiceWorkerFileName[] = "newtab-serviceworker.js";
|
||||
|
||||
bool MatchesOrigin(const GURL& my_url, const GURL& other_url) {
|
||||
return my_url.scheme_piece() == other_url.scheme_piece() &&
|
||||
my_url.host_piece() == other_url.host_piece() &&
|
||||
my_url.port() == other_url.port();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// Returns true if |my_url| matches |other_url| in terms of origin (i.e. host,
|
||||
// port, and scheme) and path.
|
||||
// Defined outside of the anonymous namespace so that it's accessible to unit
|
||||
// tests.
|
||||
bool MatchesOriginAndPath(const GURL& my_url, const GURL& other_url) {
|
||||
return MatchesOrigin(my_url, other_url) &&
|
||||
my_url.path_piece() == other_url.path_piece();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
// Status of the New Tab URL for the default Search provider. NOTE: Used in a
|
||||
// UMA histogram so values should only be added at the end and not reordered.
|
||||
enum NewTabURLState {
|
||||
// Valid URL that should be used.
|
||||
NEW_TAB_URL_VALID = 0,
|
||||
|
||||
// Corrupt state (e.g. no profile or template url).
|
||||
NEW_TAB_URL_BAD = 1,
|
||||
|
||||
// URL should not be used because in incognito window.
|
||||
NEW_TAB_URL_INCOGNITO = 2,
|
||||
|
||||
// No New Tab URL set for provider.
|
||||
NEW_TAB_URL_NOT_SET = 3,
|
||||
|
||||
// URL is not secure.
|
||||
NEW_TAB_URL_INSECURE = 4,
|
||||
|
||||
// URL should not be used because Suggest is disabled.
|
||||
// Not used anymore, see crbug.com/340424.
|
||||
// NEW_TAB_URL_SUGGEST_OFF = 5,
|
||||
|
||||
// URL should not be used because it is blocked for a supervised user.
|
||||
NEW_TAB_URL_BLOCKED = 6,
|
||||
|
||||
NEW_TAB_URL_MAX
|
||||
};
|
||||
|
||||
const TemplateURL* GetDefaultSearchProviderTemplateURL(Profile* profile) {
|
||||
if (profile) {
|
||||
TemplateURLService* template_url_service =
|
||||
TemplateURLServiceFactory::GetForProfile(profile);
|
||||
if (template_url_service)
|
||||
return template_url_service->GetDefaultSearchProvider();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool IsMatchingServiceWorker(const GURL& my_url, const GURL& document_url) {
|
||||
// The origin should match.
|
||||
if (!MatchesOrigin(my_url, document_url))
|
||||
return false;
|
||||
|
||||
// The url filename should be the new tab page ServiceWorker.
|
||||
std::string my_filename = my_url.ExtractFileName();
|
||||
if (my_filename != kServiceWorkerFileName)
|
||||
return false;
|
||||
|
||||
// The paths up to the filenames should be the same.
|
||||
std::string my_path_without_filename = my_url.path();
|
||||
my_path_without_filename = my_path_without_filename.substr(
|
||||
0, my_path_without_filename.length() - my_filename.length());
|
||||
std::string document_filename = document_url.ExtractFileName();
|
||||
std::string document_path_without_filename = document_url.path();
|
||||
document_path_without_filename = document_path_without_filename.substr(
|
||||
0, document_path_without_filename.length() - document_filename.length());
|
||||
|
||||
return my_path_without_filename == document_path_without_filename;
|
||||
}
|
||||
|
||||
// Returns true if |url| matches the NTP URL or the URL of the NTP's associated
|
||||
// service worker.
|
||||
bool IsNTPOrRelatedURLHelper(const GURL& url, Profile* profile) {
|
||||
if (!url.is_valid())
|
||||
return false;
|
||||
|
||||
const GURL new_tab_url(GetNewTabPageURL(profile));
|
||||
return new_tab_url.is_valid() && (MatchesOriginAndPath(url, new_tab_url) ||
|
||||
IsMatchingServiceWorker(url, new_tab_url));
|
||||
}
|
||||
|
||||
bool IsURLAllowedForSupervisedUser(const GURL& url, Profile* profile) {
|
||||
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
|
||||
// If this isn't a supervised child user, skip the URL filter check, since it
|
||||
// can be fairly expensive.
|
||||
if (!profile->IsChild())
|
||||
return true;
|
||||
SupervisedUserService* supervised_user_service =
|
||||
SupervisedUserServiceFactory::GetForProfile(profile);
|
||||
SupervisedUserURLFilter* url_filter = supervised_user_service->GetURLFilter();
|
||||
if (url_filter->GetFilteringBehaviorForURL(url) ==
|
||||
SupervisedUserURLFilter::BLOCK) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ShouldShowLocalNewTab(Profile* profile) {
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
return DefaultSearchProviderIsGoogle(profile);
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Used to look up the URL to use for the New Tab page. Also tracks how we
|
||||
// arrived at that URL so it can be logged with UMA.
|
||||
struct NewTabURLDetails {
|
||||
NewTabURLDetails(const GURL& url, NewTabURLState state)
|
||||
: url(url), state(state) {}
|
||||
|
||||
static NewTabURLDetails ForProfile(Profile* profile) {
|
||||
// Incognito and Guest profiles have their own New Tab.
|
||||
// This function may also be called by other off-the-record profiles that
|
||||
// can exceptionally open a browser window.
|
||||
// See OTRProfileID::AllowsBrowserWindows() for more context.
|
||||
if (profile->IsOffTheRecord())
|
||||
return NewTabURLDetails(GURL(), NEW_TAB_URL_INCOGNITO);
|
||||
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
const GURL local_url;
|
||||
#else
|
||||
const GURL local_url(DefaultSearchProviderIsGoogle(profile)
|
||||
? chrome::kChromeUINewTabPageURL
|
||||
: chrome::kChromeUINewTabPageThirdPartyURL);
|
||||
#endif
|
||||
|
||||
if (ShouldShowLocalNewTab(profile))
|
||||
return NewTabURLDetails(local_url, NEW_TAB_URL_VALID);
|
||||
|
||||
const TemplateURL* template_url =
|
||||
GetDefaultSearchProviderTemplateURL(profile);
|
||||
if (!profile || !template_url)
|
||||
return NewTabURLDetails(local_url, NEW_TAB_URL_BAD);
|
||||
|
||||
GURL search_provider_url(template_url->new_tab_url_ref().ReplaceSearchTerms(
|
||||
TemplateURLRef::SearchTermsArgs(std::u16string()),
|
||||
UIThreadSearchTermsData()));
|
||||
|
||||
if (!search_provider_url.is_valid())
|
||||
return NewTabURLDetails(local_url, NEW_TAB_URL_NOT_SET);
|
||||
if (!search_provider_url.SchemeIsCryptographic())
|
||||
return NewTabURLDetails(local_url, NEW_TAB_URL_INSECURE);
|
||||
if (!IsURLAllowedForSupervisedUser(search_provider_url, profile))
|
||||
return NewTabURLDetails(local_url, NEW_TAB_URL_BLOCKED);
|
||||
|
||||
return NewTabURLDetails(search_provider_url, NEW_TAB_URL_VALID);
|
||||
}
|
||||
|
||||
const GURL url;
|
||||
const NewTabURLState state;
|
||||
};
|
||||
|
||||
bool IsRenderedInInstantProcess(content::WebContents* contents,
|
||||
Profile* profile) {
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
return false;
|
||||
#else
|
||||
content::RenderProcessHost* process_host =
|
||||
contents->GetMainFrame()->GetProcess();
|
||||
if (!process_host)
|
||||
return false;
|
||||
|
||||
const InstantService* instant_service =
|
||||
InstantServiceFactory::GetForProfile(profile);
|
||||
if (!instant_service)
|
||||
return false;
|
||||
|
||||
return instant_service->IsInstantProcess(process_host->GetID());
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
bool DefaultSearchProviderIsGoogle(Profile* profile) {
|
||||
return DefaultSearchProviderIsGoogle(
|
||||
TemplateURLServiceFactory::GetForProfile(profile));
|
||||
}
|
||||
|
||||
bool IsNTPOrRelatedURL(const GURL& url, Profile* profile) {
|
||||
if (!url.is_valid())
|
||||
return false;
|
||||
|
||||
if (!IsInstantExtendedAPIEnabled())
|
||||
return url == chrome::kChromeUINewTabURL;
|
||||
|
||||
return profile && IsNTPOrRelatedURLHelper(url, profile);
|
||||
}
|
||||
|
||||
bool IsNTPURL(const GURL& url) {
|
||||
if (url.SchemeIs(chrome::kChromeSearchScheme) &&
|
||||
url.host_piece() == chrome::kChromeSearchRemoteNtpHost) {
|
||||
return true;
|
||||
}
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
return false;
|
||||
#else
|
||||
return NewTabPageUI::IsNewTabPageOrigin(url) ||
|
||||
NewTabPageThirdPartyUI::IsNewTabPageOrigin(url);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool IsInstantNTP(content::WebContents* contents) {
|
||||
if (!contents)
|
||||
return false;
|
||||
|
||||
content::NavigationEntry* entry =
|
||||
contents->GetController().GetLastCommittedEntry();
|
||||
if (!entry)
|
||||
entry = contents->GetController().GetVisibleEntry();
|
||||
return NavEntryIsInstantNTP(contents, entry);
|
||||
}
|
||||
|
||||
bool NavEntryIsInstantNTP(content::WebContents* contents,
|
||||
content::NavigationEntry* entry) {
|
||||
if (!contents || !entry || !IsInstantExtendedAPIEnabled())
|
||||
return false;
|
||||
|
||||
Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
|
||||
if (!IsRenderedInInstantProcess(contents, profile))
|
||||
return false;
|
||||
|
||||
return IsInstantNTPURL(entry->GetURL(), profile);
|
||||
}
|
||||
|
||||
bool IsInstantNTPURL(const GURL& url, Profile* profile) {
|
||||
if (MatchesOrigin(url, GURL(chrome::kChromeUINewTabPageURL)))
|
||||
return true;
|
||||
|
||||
if (!IsInstantExtendedAPIEnabled())
|
||||
return false;
|
||||
|
||||
GURL new_tab_url(GetNewTabPageURL(profile));
|
||||
return new_tab_url.is_valid() && MatchesOriginAndPath(url, new_tab_url);
|
||||
}
|
||||
|
||||
GURL GetNewTabPageURL(Profile* profile) {
|
||||
return NewTabURLDetails::ForProfile(profile).url;
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
bool ShouldAssignURLToInstantRenderer(const GURL& url, Profile* profile) {
|
||||
if (!url.is_valid() || !profile || !IsInstantExtendedAPIEnabled() ||
|
||||
url.SchemeIs(content::kChromeUIScheme)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return IsNTPOrRelatedURLHelper(url, profile) ||
|
||||
url.SchemeIs(chrome::kChromeSearchScheme);
|
||||
}
|
||||
|
||||
bool ShouldUseProcessPerSiteForInstantSiteURL(const GURL& site_url,
|
||||
Profile* profile) {
|
||||
return ShouldAssignURLToInstantRenderer(site_url, profile) &&
|
||||
site_url.host_piece() == chrome::kChromeSearchRemoteNtpHost;
|
||||
}
|
||||
|
||||
GURL GetEffectiveURLForInstant(const GURL& url, Profile* profile) {
|
||||
CHECK(ShouldAssignURLToInstantRenderer(url, profile))
|
||||
<< "Error granting Instant access.";
|
||||
|
||||
if (url.SchemeIs(chrome::kChromeSearchScheme))
|
||||
return url;
|
||||
|
||||
// Replace the scheme with "chrome-search:", and clear the port, since
|
||||
// chrome-search is a scheme without port.
|
||||
GURL::Replacements replacements;
|
||||
replacements.SetSchemeStr(chrome::kChromeSearchScheme);
|
||||
replacements.ClearPort();
|
||||
|
||||
// If this is the URL for a server-provided NTP, replace the host with
|
||||
// "remote-ntp".
|
||||
std::string remote_ntp_host(chrome::kChromeSearchRemoteNtpHost);
|
||||
NewTabURLDetails details = NewTabURLDetails::ForProfile(profile);
|
||||
if (details.state == NEW_TAB_URL_VALID &&
|
||||
(MatchesOriginAndPath(url, details.url) ||
|
||||
IsMatchingServiceWorker(url, details.url))) {
|
||||
replacements.SetHostStr(remote_ntp_host);
|
||||
}
|
||||
|
||||
return url.ReplaceComponents(replacements);
|
||||
}
|
||||
|
||||
bool HandleNewTabURLRewrite(GURL* url,
|
||||
content::BrowserContext* browser_context) {
|
||||
if (!IsInstantExtendedAPIEnabled())
|
||||
return false;
|
||||
|
||||
if (!(url->SchemeIs(content::kChromeUIScheme) &&
|
||||
url->host() == chrome::kChromeUINewTabHost) &&
|
||||
!(url->SchemeIs(chrome::kChromeSearchScheme) &&
|
||||
url->host_piece() == chrome::kChromeSearchLocalNtpHost)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
NewTabURLDetails details(NewTabURLDetails::ForProfile(profile));
|
||||
UMA_HISTOGRAM_ENUMERATION("NewTabPage.URLState",
|
||||
details.state, NEW_TAB_URL_MAX);
|
||||
if (details.url.is_valid()) {
|
||||
*url = details.url;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool HandleNewTabURLReverseRewrite(GURL* url,
|
||||
content::BrowserContext* browser_context) {
|
||||
if (!IsInstantExtendedAPIEnabled())
|
||||
return false;
|
||||
|
||||
// Do nothing in incognito.
|
||||
Profile* profile = Profile::FromBrowserContext(browser_context);
|
||||
DCHECK(profile);
|
||||
if (profile->IsOffTheRecord())
|
||||
return false;
|
||||
|
||||
if (IsInstantNTPURL(*url, profile)) {
|
||||
*url = GURL(chrome::kChromeUINewTabURL);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // !BUILDFLAG(IS_ANDROID)
|
||||
|
||||
} // namespace search
|
168
chrome/browser/ui/browser_ui_prefs.cc
Normal file
|
@ -0,0 +1,168 @@
|
|||
// Copyright (c) 2022 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/ui/browser_ui_prefs.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/upgrade_detector/upgrade_detector.h"
|
||||
#include "chrome/common/buildflags.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/prefs/scoped_user_pref_update.h"
|
||||
#include "components/translate/core/browser/translate_pref_names.h"
|
||||
#include "media/media_buildflags.h"
|
||||
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
|
||||
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
#include "ui/accessibility/accessibility_features.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/win/windows_version.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
uint32_t GetHomeButtonAndHomePageIsNewTabPageFlags() {
|
||||
#if defined(OS_ANDROID)
|
||||
return PrefRegistry::NO_REGISTRATION_FLAGS;
|
||||
#else
|
||||
return user_prefs::PrefRegistrySyncable::SYNCABLE_PREF;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void RegisterBrowserPrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true);
|
||||
|
||||
#if !defined(OS_ANDROID)
|
||||
registry->RegisterIntegerPref(prefs::kRelaunchNotification, 0);
|
||||
registry->RegisterIntegerPref(
|
||||
prefs::kRelaunchNotificationPeriod,
|
||||
base::saturated_cast<int>(
|
||||
UpgradeDetector::GetDefaultHighAnnoyanceThreshold()
|
||||
.InMilliseconds()));
|
||||
registry->RegisterDictionaryPref(prefs::kRelaunchWindow);
|
||||
#endif // !defined(OS_ANDROID)
|
||||
|
||||
#if defined(OS_MAC)
|
||||
registry->RegisterIntegerPref(
|
||||
prefs::kMacRestoreLocationPermissionsExperimentCount, 0);
|
||||
#endif // defined(OS_MAC)
|
||||
}
|
||||
|
||||
void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true,
|
||||
GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
registry->RegisterBooleanPref(prefs::kShowHomeButton, true,
|
||||
GetHomeButtonAndHomePageIsNewTabPageFlags());
|
||||
|
||||
registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
|
||||
bool reset_check_default = false;
|
||||
#if defined(OS_WIN)
|
||||
reset_check_default = base::win::GetVersion() >= base::win::Version::WIN10;
|
||||
#endif
|
||||
registry->RegisterBooleanPref(prefs::kResetCheckDefaultBrowser,
|
||||
reset_check_default);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateOnDesktop, true);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInAppsMenu, true);
|
||||
registry->RegisterBooleanPref(prefs::kWebAppCreateInQuickLaunchBar, true);
|
||||
registry->RegisterBooleanPref(
|
||||
translate::prefs::kOfferTranslateEnabled, true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
|
||||
registry->RegisterBooleanPref(prefs::kCloudPrintProxyEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kCloudPrintSubmitEnabled, true);
|
||||
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement);
|
||||
registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacementPopup);
|
||||
registry->RegisterDictionaryPref(prefs::kAppWindowPlacement);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kEnableDoNotTrack, true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OS_ANDROID)
|
||||
registry->RegisterBooleanPref(prefs::kPrintPreviewUseSystemDefaultPrinter,
|
||||
false);
|
||||
#endif
|
||||
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,
|
||||
blink::kWebRTCIPHandlingDefault);
|
||||
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
|
||||
registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false);
|
||||
registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls);
|
||||
registry->RegisterBooleanPref(prefs::kWebRTCAllowLegacyTLSProtocols, false);
|
||||
|
||||
// Dictionaries to keep track of default tasks in the file browser.
|
||||
registry->RegisterDictionaryPref(
|
||||
prefs::kDefaultTasksByMimeType,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterDictionaryPref(
|
||||
prefs::kDefaultTasksBySuffix,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
|
||||
// We need to register the type of these preferences in order to query
|
||||
// them even though they're only typically controlled via policy.
|
||||
registry->RegisterBooleanPref(prefs::kClearPluginLSODataEnabled, true);
|
||||
registry->RegisterBooleanPref(prefs::kHideWebStoreIcon, false);
|
||||
registry->RegisterBooleanPref(prefs::kSharedClipboardEnabled, true);
|
||||
|
||||
#if BUILDFLAG(ENABLE_CLICK_TO_CALL)
|
||||
registry->RegisterBooleanPref(prefs::kClickToCallEnabled, true);
|
||||
#endif // BUILDFLAG(ENABLE_CLICK_TO_CALL)
|
||||
|
||||
#if defined(OS_MAC)
|
||||
// This really belongs in platform code, but there's no good place to
|
||||
// initialize it between the time when the AppController is created
|
||||
// (where there's no profile) and the time the controller gets another
|
||||
// crack at the start of the main event loop. By that time,
|
||||
// StartupBrowserCreator has already created the browser window, and it's too
|
||||
// late: we need the pref to be already initialized. Doing it here also saves
|
||||
// us from having to hard-code pref registration in the several unit tests
|
||||
// that use this preference.
|
||||
registry->RegisterBooleanPref(prefs::kShowUpdatePromotionInfoBar, true);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kShowFullscreenToolbar, true,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kAllowJavascriptAppleEvents, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
#else
|
||||
registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
registry->RegisterBooleanPref(prefs::kForceMaximizeOnFirstRun, false);
|
||||
#endif
|
||||
|
||||
registry->RegisterBooleanPref(prefs::kEnterpriseHardwarePlatformAPIEnabled,
|
||||
false);
|
||||
registry->RegisterBooleanPref(prefs::kUserFeedbackAllowed, true);
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kExternalProtocolDialogShowAlwaysOpenCheckbox, true);
|
||||
registry->RegisterBooleanPref(prefs::kScreenCaptureAllowed, true);
|
||||
registry->RegisterListPref(prefs::kScreenCaptureAllowedByOrigins);
|
||||
registry->RegisterListPref(prefs::kWindowCaptureAllowedByOrigins);
|
||||
registry->RegisterListPref(prefs::kTabCaptureAllowedByOrigins);
|
||||
registry->RegisterListPref(prefs::kSameOriginTabCaptureAllowedByOrigins);
|
||||
|
||||
#if !defined(OS_ANDROID)
|
||||
registry->RegisterBooleanPref(prefs::kCaretBrowsingEnabled, false);
|
||||
registry->RegisterBooleanPref(prefs::kShowCaretBrowsingDialog, true);
|
||||
#endif
|
||||
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
registry->RegisterBooleanPref(prefs::kAccessibilityFocusHighlightEnabled,
|
||||
false);
|
||||
#endif
|
||||
|
||||
registry->RegisterBooleanPref(
|
||||
prefs::kHttpsOnlyModeEnabled, false,
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright 2013 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "chrome/browser/infobars/confirm_infobar_creator.h"
|
||||
#include "chrome/grit/chromium_strings.h"
|
||||
#include "components/infobars/content/content_infobar_manager.h"
|
||||
#include "components/infobars/core/infobar.h"
|
||||
#include "components/strings/grit/components_strings.h"
|
||||
#include "google_apis/google_api_keys.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
// static
|
||||
void GoogleApiKeysInfoBarDelegate::Create(
|
||||
infobars::ContentInfoBarManager* infobar_manager) {
|
||||
}
|
||||
|
||||
GoogleApiKeysInfoBarDelegate::GoogleApiKeysInfoBarDelegate()
|
||||
: ConfirmInfoBarDelegate() {
|
||||
}
|
||||
|
||||
infobars::InfoBarDelegate::InfoBarIdentifier
|
||||
GoogleApiKeysInfoBarDelegate::GetIdentifier() const {
|
||||
return GOOGLE_API_KEYS_INFOBAR_DELEGATE;
|
||||
}
|
||||
|
||||
std::u16string GoogleApiKeysInfoBarDelegate::GetLinkText() const {
|
||||
return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
|
||||
}
|
||||
|
||||
GURL GoogleApiKeysInfoBarDelegate::GetLinkURL() const {
|
||||
return GURL(google_apis::kAPIKeysDevelopersHowToURL);
|
||||
}
|
||||
|
||||
std::u16string GoogleApiKeysInfoBarDelegate::GetMessageText() const {
|
||||
return l10n_util::GetStringUTF16(IDS_MISSING_GOOGLE_API_KEYS);
|
||||
}
|
||||
|
||||
int GoogleApiKeysInfoBarDelegate::GetButtons() const {
|
||||
return BUTTON_NONE;
|
||||
}
|
132
chrome/browser/ui/startup/infobar_utils.cc
Normal file
|
@ -0,0 +1,132 @@
|
|||
// Copyright 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/ui/startup/infobar_utils.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "build/buildflag.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/obsolete_system/obsolete_system.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "chrome/browser/ui/browser.h"
|
||||
#include "chrome/browser/ui/session_crashed_bubble.h"
|
||||
#include "chrome/browser/ui/startup/automation_infobar_delegate.h"
|
||||
#include "chrome/browser/ui/startup/bad_flags_prompt.h"
|
||||
#include "chrome/browser/ui/startup/default_browser_prompt.h"
|
||||
#include "chrome/browser/ui/startup/google_api_keys_infobar_delegate.h"
|
||||
#include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h"
|
||||
#include "chrome/browser/ui/startup/startup_browser_creator.h"
|
||||
#include "chrome/browser/ui/startup/startup_types.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "components/infobars/content/content_infobar_manager.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "google_apis/google_api_keys.h"
|
||||
|
||||
namespace {
|
||||
bool ShouldShowBadFlagsSecurityWarnings() {
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
PrefService* local_state = g_browser_process->local_state();
|
||||
if (!local_state)
|
||||
return true;
|
||||
|
||||
const auto* pref = local_state->FindPreference(
|
||||
prefs::kCommandLineFlagSecurityWarningsEnabled);
|
||||
DCHECK(pref);
|
||||
|
||||
// The warnings can only be disabled by policy. Default to show warnings.
|
||||
if (pref->IsManaged())
|
||||
return pref->GetValue()->GetBool();
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is a separate function to avoid accidentally reading the switch from
|
||||
// `startup_command_line`.
|
||||
bool IsAutomationEnabled() {
|
||||
return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kEnableAutomation);
|
||||
}
|
||||
|
||||
// This is a separate function to avoid accidentally reading the switch from
|
||||
// `startup_command_line`.
|
||||
bool IsKioskModeEnabled() {
|
||||
return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kKioskMode);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void AddInfoBarsIfNecessary(Browser* browser,
|
||||
Profile* profile,
|
||||
const base::CommandLine& startup_command_line,
|
||||
chrome::startup::IsFirstRun is_first_run,
|
||||
bool is_web_app) {
|
||||
if (!browser || !profile || browser->tab_strip_model()->count() == 0)
|
||||
return;
|
||||
|
||||
// Show the Automation info bar unless it has been disabled by policy.
|
||||
bool show_bad_flags_security_warnings = ShouldShowBadFlagsSecurityWarnings();
|
||||
if (IsAutomationEnabled() && show_bad_flags_security_warnings) {
|
||||
AutomationInfoBarDelegate::Create();
|
||||
}
|
||||
|
||||
// Do not show any other info bars in Kiosk mode, because it's unlikely that
|
||||
// the viewer can act upon or dismiss them.
|
||||
if (IsKioskModeEnabled())
|
||||
return;
|
||||
|
||||
// Web apps should not display the session restore bubble (crbug.com/1264121)
|
||||
if (!is_web_app && HasPendingUncleanExit(browser->profile()))
|
||||
SessionCrashedBubble::ShowIfNotOffTheRecordProfile(
|
||||
browser, /*skip_tab_checking=*/false);
|
||||
|
||||
// These info bars are not shown when the browser is being controlled by
|
||||
// automated tests, so that they don't interfere with tests that assume no
|
||||
// info bars.
|
||||
if (!startup_command_line.HasSwitch(switches::kTestType) &&
|
||||
!IsAutomationEnabled()) {
|
||||
// The below info bars are only added to the first profile which is
|
||||
// launched. Other profiles might be restoring the browsing sessions
|
||||
// asynchronously, so we cannot add the info bars to the focused tabs here.
|
||||
//
|
||||
// We cannot use `chrome::startup::IsProcessStartup` to determine whether
|
||||
// this is the first profile that launched: The browser may be started
|
||||
// without a startup window (`kNoStartupWindow`), or open the profile
|
||||
// picker, which means that `chrome::startup::IsProcessStartup` will already
|
||||
// be `kNo` when the first browser window is opened.
|
||||
static bool infobars_shown = false;
|
||||
if (infobars_shown)
|
||||
return;
|
||||
infobars_shown = true;
|
||||
|
||||
content::WebContents* web_contents =
|
||||
browser->tab_strip_model()->GetActiveWebContents();
|
||||
DCHECK(web_contents);
|
||||
|
||||
if (show_bad_flags_security_warnings)
|
||||
chrome::ShowBadFlagsPrompt(web_contents);
|
||||
|
||||
infobars::ContentInfoBarManager* infobar_manager =
|
||||
infobars::ContentInfoBarManager::FromWebContents(web_contents);
|
||||
|
||||
if (ObsoleteSystem::IsObsoleteNowOrSoon()) {
|
||||
PrefService* local_state = g_browser_process->local_state();
|
||||
if (!local_state ||
|
||||
!local_state->GetBoolean(prefs::kSuppressUnsupportedOSWarning))
|
||||
ObsoleteSystemInfoBarDelegate::Create(infobar_manager);
|
||||
}
|
||||
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
if (!is_web_app &&
|
||||
!startup_command_line.HasSwitch(switches::kNoDefaultBrowserCheck)) {
|
||||
// The default browser prompt should only be shown after the first run.
|
||||
if (is_first_run == chrome::startup::IsFirstRun::kNo)
|
||||
ShowDefaultBrowserPrompt(profile);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
231
chrome/browser/ui/views/toolbar/reload_button.cc
Normal file
|
@ -0,0 +1,231 @@
|
|||
// Copyright 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/ui/views/toolbar/reload_button.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/app/chrome_command_ids.h"
|
||||
#include "chrome/app/vector_icons/vector_icons.h"
|
||||
#include "chrome/browser/command_updater.h"
|
||||
#include "chrome/browser/external_protocol/external_protocol_handler.h"
|
||||
#include "chrome/browser/themes/theme_properties.h"
|
||||
#include "chrome/browser/ui/view_ids.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/vector_icons/vector_icons.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/metadata/metadata_impl_macros.h"
|
||||
#include "ui/base/models/simple_menu_model.h"
|
||||
#include "ui/base/pointer/touch_ui_controller.h"
|
||||
#include "ui/base/theme_provider.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
#include "ui/gfx/color_palette.h"
|
||||
#include "ui/gfx/paint_vector_icon.h"
|
||||
#include "ui/views/metrics.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
// ReloadButton ---------------------------------------------------------------
|
||||
|
||||
ReloadButton::ReloadButton(CommandUpdater* command_updater)
|
||||
: ToolbarButton(base::BindRepeating(&ReloadButton::ButtonPressed,
|
||||
base::Unretained(this)),
|
||||
CreateMenuModel(),
|
||||
nullptr),
|
||||
command_updater_(command_updater),
|
||||
double_click_timer_delay_(
|
||||
base::Milliseconds(views::GetDoubleClickInterval())),
|
||||
mode_switch_timer_delay_(base::Milliseconds(1350)) {
|
||||
SetVisibleMode(Mode::kReload);
|
||||
SetTriggerableEventFlags(ui::EF_LEFT_MOUSE_BUTTON |
|
||||
ui::EF_MIDDLE_MOUSE_BUTTON);
|
||||
SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_RELOAD));
|
||||
SetID(VIEW_ID_RELOAD_BUTTON);
|
||||
}
|
||||
|
||||
ReloadButton::~ReloadButton() {}
|
||||
|
||||
void ReloadButton::ChangeMode(Mode mode, bool force) {
|
||||
intended_mode_ = mode;
|
||||
|
||||
// If the change is forced, or the user isn't hovering the icon, or it's
|
||||
// safe to change it to the other image type, make the change immediately;
|
||||
// otherwise we'll let it happen later.
|
||||
if (force || (!IsMouseHovered() && !testing_mouse_hovered_) ||
|
||||
((mode == Mode::kStop) ? !double_click_timer_.IsRunning()
|
||||
: (visible_mode_ != Mode::kStop))) {
|
||||
double_click_timer_.Stop();
|
||||
mode_switch_timer_.Stop();
|
||||
SetVisibleMode(mode);
|
||||
SetEnabled(true);
|
||||
|
||||
// We want to disable the button if we're preventing a change from stop to
|
||||
// reload due to hovering, but not if we're preventing a change from
|
||||
// reload to stop due to the double-click timer running. (Disabled reload
|
||||
// state is only applicable when instant extended API is enabled and mode
|
||||
// is NTP, which is handled just above.)
|
||||
} else if (visible_mode_ != Mode::kReload) {
|
||||
SetEnabled(false);
|
||||
|
||||
// Go ahead and change to reload after a bit, which allows repeated
|
||||
// reloads without moving the mouse.
|
||||
if (!mode_switch_timer_.IsRunning()) {
|
||||
mode_switch_timer_.Start(FROM_HERE, mode_switch_timer_delay_, this,
|
||||
&ReloadButton::OnStopToReloadTimer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ReloadButton::GetMenuEnabled() const {
|
||||
return menu_enabled_;
|
||||
}
|
||||
|
||||
void ReloadButton::SetMenuEnabled(bool enable) {
|
||||
menu_enabled_ = true;
|
||||
}
|
||||
|
||||
void ReloadButton::OnMouseExited(const ui::MouseEvent& event) {
|
||||
ToolbarButton::OnMouseExited(event);
|
||||
if (!IsMenuShowing())
|
||||
ChangeMode(intended_mode_, true);
|
||||
}
|
||||
|
||||
std::u16string ReloadButton::GetTooltipText(const gfx::Point& p) const {
|
||||
int reload_tooltip = menu_enabled_ ?
|
||||
IDS_TOOLTIP_RELOAD_WITH_MENU : IDS_TOOLTIP_RELOAD;
|
||||
return l10n_util::GetStringUTF16(
|
||||
visible_mode_ == Mode::kReload ? reload_tooltip : IDS_TOOLTIP_STOP);
|
||||
}
|
||||
|
||||
void ReloadButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
if (menu_enabled_)
|
||||
ToolbarButton::GetAccessibleNodeData(node_data);
|
||||
else
|
||||
Button::GetAccessibleNodeData(node_data);
|
||||
}
|
||||
|
||||
bool ReloadButton::ShouldShowMenu() {
|
||||
return menu_enabled_ && (visible_mode_ == Mode::kReload);
|
||||
}
|
||||
|
||||
void ReloadButton::ShowDropDownMenu(ui::MenuSourceType source_type) {
|
||||
ToolbarButton::ShowDropDownMenu(source_type); // Blocks.
|
||||
ChangeMode(intended_mode_, true);
|
||||
}
|
||||
|
||||
bool ReloadButton::IsCommandIdChecked(int command_id) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ReloadButton::IsCommandIdEnabled(int command_id) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReloadButton::IsCommandIdVisible(int command_id) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReloadButton::GetAcceleratorForCommandId(
|
||||
int command_id,
|
||||
ui::Accelerator* accelerator) const {
|
||||
return GetWidget()->GetAccelerator(command_id, accelerator);
|
||||
}
|
||||
|
||||
void ReloadButton::ExecuteCommand(int command_id, int event_flags) {
|
||||
ExecuteBrowserCommand(command_id, event_flags);
|
||||
}
|
||||
|
||||
std::unique_ptr<ui::SimpleMenuModel> ReloadButton::CreateMenuModel() {
|
||||
auto menu_model = std::make_unique<ui::SimpleMenuModel>(this);
|
||||
menu_model->AddItemWithStringId(IDC_RELOAD,
|
||||
IDS_RELOAD_MENU_NORMAL_RELOAD_ITEM);
|
||||
menu_model->AddItemWithStringId(IDC_RELOAD_BYPASSING_CACHE,
|
||||
IDS_RELOAD_MENU_HARD_RELOAD_ITEM);
|
||||
menu_model->AddItemWithStringId(IDC_RELOAD_CLEARING_CACHE,
|
||||
IDS_RELOAD_MENU_EMPTY_AND_HARD_RELOAD_ITEM);
|
||||
return menu_model;
|
||||
}
|
||||
|
||||
void ReloadButton::SetVisibleMode(Mode mode) {
|
||||
visible_mode_ = mode;
|
||||
switch (mode) {
|
||||
case Mode::kReload:
|
||||
SetVectorIcons(vector_icons::kReloadIcon, kReloadTouchIcon);
|
||||
break;
|
||||
case Mode::kStop:
|
||||
SetVectorIcons(kNavigateStopIcon, kNavigateStopTouchIcon);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ReloadButton::ButtonPressed(const ui::Event& event) {
|
||||
// This is called in order to signal that external protocol dialogs are
|
||||
// allowed to show due to a user action, which are likely to happen on the
|
||||
// next page load after the reload button is clicked.
|
||||
// Ideally, the browser UI's event system would notify ExternalProtocolHandler
|
||||
// that a user action occurred and we are OK to open the dialog, but for some
|
||||
// reason that isn't happening every time the reload button is clicked. See
|
||||
// http://crbug.com/1206456
|
||||
ExternalProtocolHandler::PermitLaunchUrl();
|
||||
|
||||
ClearPendingMenu();
|
||||
|
||||
if (visible_mode_ == Mode::kStop) {
|
||||
if (command_updater_) {
|
||||
command_updater_->ExecuteCommandWithDisposition(
|
||||
IDC_STOP, WindowOpenDisposition::CURRENT_TAB);
|
||||
}
|
||||
// The user has clicked, so we can feel free to update the button, even if
|
||||
// the mouse is still hovering.
|
||||
ChangeMode(Mode::kReload, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!double_click_timer_.IsRunning()) {
|
||||
// Shift-clicking or ctrl-clicking the reload button means we should ignore
|
||||
// any cached content.
|
||||
int command;
|
||||
int flags = event.flags();
|
||||
if (event.IsShiftDown() || event.IsControlDown()) {
|
||||
command = IDC_RELOAD_BYPASSING_CACHE;
|
||||
// Mask off Shift and Control so they don't affect the disposition below.
|
||||
flags &= ~(ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN);
|
||||
} else {
|
||||
command = IDC_RELOAD;
|
||||
}
|
||||
|
||||
// Start a timer - while this timer is running, the reload button cannot be
|
||||
// changed to a stop button. We do not set |intended_mode_| to Mode::kStop
|
||||
// here as the browser will do that when it actually starts loading (which
|
||||
// may happen synchronously, thus the need to do this before telling the
|
||||
// browser to execute the reload command).
|
||||
double_click_timer_.Start(FROM_HERE, double_click_timer_delay_, this,
|
||||
&ReloadButton::OnDoubleClickTimer);
|
||||
|
||||
ExecuteBrowserCommand(command, flags);
|
||||
++testing_reload_count_;
|
||||
}
|
||||
}
|
||||
|
||||
void ReloadButton::ExecuteBrowserCommand(int command, int event_flags) {
|
||||
if (!command_updater_)
|
||||
return;
|
||||
command_updater_->ExecuteCommandWithDisposition(
|
||||
command, ui::DispositionFromEventFlags(event_flags));
|
||||
}
|
||||
|
||||
void ReloadButton::OnDoubleClickTimer() {
|
||||
if (!IsMenuShowing())
|
||||
ChangeMode(intended_mode_, false);
|
||||
}
|
||||
|
||||
void ReloadButton::OnStopToReloadTimer() {
|
||||
DCHECK(!IsMenuShowing());
|
||||
ChangeMode(intended_mode_, true);
|
||||
}
|
||||
|
||||
BEGIN_METADATA(ReloadButton, ToolbarButton)
|
||||
ADD_PROPERTY_METADATA(bool, MenuEnabled)
|
||||
END_METADATA
|
194
chrome/common/chrome_constants.cc
Normal file
|
@ -0,0 +1,194 @@
|
|||
// Copyright (c) 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/common/chrome_constants.h"
|
||||
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "chrome/common/chrome_version.h"
|
||||
|
||||
#define FPL FILE_PATH_LITERAL
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
#define PRODUCT_STRING "Google Chrome"
|
||||
#elif BUILDFLAG(CHROMIUM_BRANDING)
|
||||
#define PRODUCT_STRING "Thorium"
|
||||
#else
|
||||
#error Unknown branding
|
||||
#endif
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
namespace chrome {
|
||||
|
||||
const char kChromeVersion[] = CHROME_VERSION_STRING;
|
||||
|
||||
// The following should not be used for UI strings; they are meant
|
||||
// for system strings only. UI changes should be made in the GRD.
|
||||
//
|
||||
// There are four constants used to locate the executable name and path:
|
||||
//
|
||||
// kBrowserProcessExecutableName
|
||||
// kHelperProcessExecutableName
|
||||
// kBrowserProcessExecutablePath
|
||||
// kHelperProcessExecutablePath
|
||||
//
|
||||
// In one condition, our tests will be built using the Chrome branding
|
||||
// though we want to actually execute a Chromium branded application.
|
||||
// This happens for the reference build on Mac. To support that case,
|
||||
// we also include a Chromium version of each of the four constants and
|
||||
// in the UITest class we support switching to that version when told to
|
||||
// do so.
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const base::FilePath::CharType kBrowserProcessExecutableName[] =
|
||||
FPL("chrome.exe");
|
||||
const base::FilePath::CharType kHelperProcessExecutableName[] =
|
||||
FPL("chrome.exe");
|
||||
#elif BUILDFLAG(IS_MAC)
|
||||
const base::FilePath::CharType kBrowserProcessExecutableName[] =
|
||||
FPL(PRODUCT_STRING);
|
||||
const base::FilePath::CharType kHelperProcessExecutableName[] =
|
||||
FPL(PRODUCT_STRING " Helper");
|
||||
#elif BUILDFLAG(IS_ANDROID)
|
||||
// NOTE: Keep it synced with the process names defined in AndroidManifest.xml.
|
||||
const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome");
|
||||
const base::FilePath::CharType kHelperProcessExecutableName[] =
|
||||
FPL("sandboxed_process");
|
||||
#elif BUILDFLAG(IS_POSIX)
|
||||
const base::FilePath::CharType kBrowserProcessExecutableName[] = FPL("chrome");
|
||||
// Helper processes end up with a name of "exe" due to execing via
|
||||
// /proc/self/exe. See bug 22703.
|
||||
const base::FilePath::CharType kHelperProcessExecutableName[] = FPL("exe");
|
||||
#endif // OS_*
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const base::FilePath::CharType kBrowserProcessExecutablePath[] =
|
||||
FPL("chrome.exe");
|
||||
const base::FilePath::CharType kHelperProcessExecutablePath[] =
|
||||
FPL("chrome.exe");
|
||||
#elif BUILDFLAG(IS_MAC)
|
||||
const base::FilePath::CharType kBrowserProcessExecutablePath[] =
|
||||
FPL(PRODUCT_STRING ".app/Contents/MacOS/" PRODUCT_STRING);
|
||||
const base::FilePath::CharType kHelperProcessExecutablePath[] =
|
||||
FPL(PRODUCT_STRING " Helper.app/Contents/MacOS/" PRODUCT_STRING " Helper");
|
||||
#elif BUILDFLAG(IS_ANDROID)
|
||||
const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome");
|
||||
const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome");
|
||||
#elif BUILDFLAG(IS_POSIX)
|
||||
const base::FilePath::CharType kBrowserProcessExecutablePath[] = FPL("chrome");
|
||||
const base::FilePath::CharType kHelperProcessExecutablePath[] = FPL("chrome");
|
||||
#endif // OS_*
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
const base::FilePath::CharType kFrameworkName[] =
|
||||
FPL(PRODUCT_STRING " Framework.framework");
|
||||
const base::FilePath::CharType kFrameworkExecutableName[] =
|
||||
FPL(PRODUCT_STRING " Framework");
|
||||
const char kMacHelperSuffixAlerts[] = " (Alerts)";
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const base::FilePath::CharType kBrowserResourcesDll[] = FPL("chrome.dll");
|
||||
const base::FilePath::CharType kElfDll[] = FPL("chrome_elf.dll");
|
||||
const base::FilePath::CharType kStatusTrayWindowClass[] =
|
||||
FPL("Chrome_StatusTrayWindow");
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
const char kInitialProfile[] = "Default";
|
||||
const char kMultiProfileDirPrefix[] = "Profile ";
|
||||
const base::FilePath::CharType kGuestProfileDir[] = FPL("Guest Profile");
|
||||
const base::FilePath::CharType kSystemProfileDir[] = FPL("System Profile");
|
||||
|
||||
// filenames
|
||||
const base::FilePath::CharType kCacheDirname[] = FPL("Cache");
|
||||
const base::FilePath::CharType kCookieFilename[] = FPL("Cookies");
|
||||
const base::FilePath::CharType kCRLSetFilename[] =
|
||||
FPL("Certificate Revocation Lists");
|
||||
const base::FilePath::CharType kCustomDictionaryFileName[] =
|
||||
FPL("Custom Dictionary.txt");
|
||||
const base::FilePath::CharType kDownloadServiceStorageDirname[] =
|
||||
FPL("Download Service");
|
||||
const base::FilePath::CharType kExtensionActivityLogFilename[] =
|
||||
FPL("Extension Activity");
|
||||
const base::FilePath::CharType kExtensionsCookieFilename[] =
|
||||
FPL("Extension Cookies");
|
||||
const base::FilePath::CharType kFeatureEngagementTrackerStorageDirname[] =
|
||||
FPL("Feature Engagement Tracker");
|
||||
const base::FilePath::CharType kFirstRunSentinel[] = FPL("First Run");
|
||||
const base::FilePath::CharType kGCMStoreDirname[] = FPL("GCM Store");
|
||||
const base::FilePath::CharType kLocalStateFilename[] = FPL("Local State");
|
||||
const base::FilePath::CharType kMediaCacheDirname[] = FPL("Media Cache");
|
||||
const base::FilePath::CharType kNetworkPersistentStateFilename[] =
|
||||
FPL("Network Persistent State");
|
||||
const base::FilePath::CharType kNetworkDataDirname[] = FPL("Network");
|
||||
const base::FilePath::CharType kNotificationSchedulerStorageDirname[] =
|
||||
FPL("Notification Scheduler");
|
||||
const base::FilePath::CharType kOfflinePageArchivesDirname[] =
|
||||
FPL("Offline Pages/archives");
|
||||
const base::FilePath::CharType kOfflinePageMetadataDirname[] =
|
||||
FPL("Offline Pages/metadata");
|
||||
const base::FilePath::CharType kOfflinePagePrefetchStoreDirname[] =
|
||||
FPL("Offline Pages/prefech_store");
|
||||
const base::FilePath::CharType kOfflinePageRequestQueueDirname[] =
|
||||
FPL("Offline Pages/request_queue");
|
||||
const base::FilePath::CharType kPreferencesFilename[] = FPL("Preferences");
|
||||
const base::FilePath::CharType kPreviewsOptOutDBFilename[] =
|
||||
FPL("previews_opt_out.db");
|
||||
const base::FilePath::CharType kQueryTileStorageDirname[] = FPL("Query Tiles");
|
||||
const base::FilePath::CharType kReadmeFilename[] = FPL("README");
|
||||
const base::FilePath::CharType kSCTAuditingPendingReportsFileName[] =
|
||||
FPL("SCT Auditing Pending Reports");
|
||||
const base::FilePath::CharType kSecurePreferencesFilename[] =
|
||||
FPL("Secure Preferences");
|
||||
const base::FilePath::CharType kServiceStateFileName[] = FPL("Service State");
|
||||
const base::FilePath::CharType kSegmentationPlatformStorageDirName[] =
|
||||
FPL("Segmentation Platform");
|
||||
const base::FilePath::CharType kSingletonCookieFilename[] =
|
||||
FPL("SingletonCookie");
|
||||
const base::FilePath::CharType kSingletonLockFilename[] = FPL("SingletonLock");
|
||||
const base::FilePath::CharType kSingletonSocketFilename[] =
|
||||
FPL("SingletonSocket");
|
||||
const base::FilePath::CharType kSupervisedUserSettingsFilename[] =
|
||||
FPL("Managed Mode Settings");
|
||||
const base::FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak");
|
||||
const base::FilePath::CharType kTransportSecurityPersisterFilename[] =
|
||||
FPL("TransportSecurity");
|
||||
const base::FilePath::CharType kTrustTokenFilename[] = FPL("Trust Tokens");
|
||||
const base::FilePath::CharType kVideoTutorialsStorageDirname[] =
|
||||
FPL("Video Tutorials");
|
||||
const base::FilePath::CharType kWebAppDirname[] = FPL("Web Applications");
|
||||
// Only use if the ENABLE_REPORTING build flag is true
|
||||
const base::FilePath::CharType kReportingAndNelStoreFilename[] =
|
||||
FPL("Reporting and NEL");
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const base::FilePath::CharType kJumpListIconDirname[] = FPL("JumpListIcons");
|
||||
#endif
|
||||
|
||||
// directory names
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
const wchar_t kUserDataDirname[] = L"User Data";
|
||||
#endif
|
||||
|
||||
const float kMaxShareOfExtensionProcesses = 0.30f;
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
const char kProfileDirPrefix[] = "u-";
|
||||
const char kLegacyProfileDir[] = "user";
|
||||
const char kTestUserProfileDir[] = "test-user";
|
||||
const char kLockScreenAppProfile[] = "LockScreenAppsProfile";
|
||||
const char kLockScreenProfile[] = "LockScreenProfile";
|
||||
#endif
|
||||
|
||||
// This GUID is associated with any 'don't ask me again' settings that the
|
||||
// user can select for different file types.
|
||||
// {2676A9A2-D919-4FEE-9187-152100393AB2}
|
||||
const char kApplicationClientIDStringForAVScanning[] =
|
||||
"2676A9A2-D919-4FEE-9187-152100393AB2";
|
||||
|
||||
} // namespace chrome
|
||||
|
||||
#undef FPL
|
171
chrome/common/chrome_paths_linux.cc
Normal file
|
@ -0,0 +1,171 @@
|
|||
// Copyright (c) 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/base_paths.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/nix/xdg_util.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "chrome/common/channel_info.h"
|
||||
#include "chrome/common/chrome_paths_internal.h"
|
||||
|
||||
namespace chrome {
|
||||
|
||||
using base::nix::GetXDGDirectory;
|
||||
using base::nix::GetXDGUserDirectory;
|
||||
using base::nix::kDotConfigDir;
|
||||
using base::nix::kXdgConfigHomeEnvVar;
|
||||
|
||||
namespace {
|
||||
|
||||
const char kDownloadsDir[] = "Downloads";
|
||||
const char kMusicDir[] = "Music";
|
||||
const char kPicturesDir[] = "Pictures";
|
||||
const char kVideosDir[] = "Videos";
|
||||
|
||||
// Generic function for GetUser{Music,Pictures,Video}Directory.
|
||||
bool GetUserMediaDirectory(const std::string& xdg_name,
|
||||
const std::string& fallback_name,
|
||||
base::FilePath* result) {
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
// No local media directories on CrOS.
|
||||
return false;
|
||||
#else
|
||||
*result = GetXDGUserDirectory(xdg_name.c_str(), fallback_name.c_str());
|
||||
|
||||
base::FilePath home;
|
||||
base::PathService::Get(base::DIR_HOME, &home);
|
||||
if (*result != home) {
|
||||
base::FilePath desktop;
|
||||
if (!base::PathService::Get(base::DIR_USER_DESKTOP, &desktop))
|
||||
return false;
|
||||
if (*result != desktop) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
*result = home.Append(fallback_name);
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// This returns <config-home>/<product>, where
|
||||
// <config-home> is:
|
||||
// $CHROME_CONFIG_HOME if set
|
||||
// otherwise $XDG_CONFIG_HOME if set
|
||||
// otherwise ~/.config
|
||||
// and <product> is:
|
||||
// "chromium" for Chromium
|
||||
// "google-chrome" for stable channel official build
|
||||
// "google-chrome-beta" for beta channel official build
|
||||
// "google-chrome-unstable" for dev channel official build
|
||||
//
|
||||
// (Note that ChromeMainDelegate will override the value returned by this
|
||||
// function if $CHROME_USER_DATA_DIR or --user-data-dir is set.)
|
||||
//
|
||||
// See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
// for a spec on where config files go. Using ~/.config also helps us sidestep
|
||||
// issues with other apps grabbing ~/.chromium .
|
||||
bool GetDefaultUserDataDirectory(base::FilePath* result) {
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
base::FilePath config_dir;
|
||||
std::string chrome_config_home_str;
|
||||
if (env->GetVar("CHROME_CONFIG_HOME", &chrome_config_home_str) &&
|
||||
base::IsStringUTF8(chrome_config_home_str)) {
|
||||
config_dir = base::FilePath::FromUTF8Unsafe(chrome_config_home_str);
|
||||
} else {
|
||||
config_dir =
|
||||
GetXDGDirectory(env.get(), kXdgConfigHomeEnvVar, kDotConfigDir);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
std::string data_dir_basename = "google-chrome";
|
||||
#else
|
||||
std::string data_dir_basename = "thorium";
|
||||
#endif
|
||||
*result = config_dir.Append(data_dir_basename + GetChannelSuffixForDataDir());
|
||||
return true;
|
||||
}
|
||||
|
||||
void GetUserCacheDirectory(const base::FilePath& profile_dir,
|
||||
base::FilePath* result) {
|
||||
// See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
// for a spec on where cache files go. Our rule is:
|
||||
// - if the user-data-dir in the standard place,
|
||||
// use same subdirectory of the cache directory.
|
||||
// (this maps ~/.config/google-chrome to ~/.cache/google-chrome as well
|
||||
// as the same thing for ~/.config/chromium)
|
||||
// - otherwise, use the profile dir directly.
|
||||
|
||||
// Default value in cases where any of the following fails.
|
||||
*result = profile_dir;
|
||||
|
||||
std::unique_ptr<base::Environment> env(base::Environment::Create());
|
||||
|
||||
base::FilePath cache_dir;
|
||||
if (!base::PathService::Get(base::DIR_CACHE, &cache_dir))
|
||||
return;
|
||||
base::FilePath config_dir(GetXDGDirectory(env.get(),
|
||||
kXdgConfigHomeEnvVar,
|
||||
kDotConfigDir));
|
||||
|
||||
if (!config_dir.AppendRelativePath(profile_dir, &cache_dir))
|
||||
return;
|
||||
|
||||
*result = cache_dir;
|
||||
}
|
||||
|
||||
bool GetUserDocumentsDirectory(base::FilePath* result) {
|
||||
*result = GetXDGUserDirectory("DOCUMENTS", "Documents");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetUserDownloadsDirectorySafe(base::FilePath* result) {
|
||||
base::FilePath home;
|
||||
base::PathService::Get(base::DIR_HOME, &home);
|
||||
*result = home.Append(kDownloadsDir);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetUserDownloadsDirectory(base::FilePath* result) {
|
||||
*result = GetXDGUserDirectory("DOWNLOAD", kDownloadsDir);
|
||||
return true;
|
||||
}
|
||||
|
||||
// We respect the user's preferred pictures location, unless it is
|
||||
// ~ or their desktop directory, in which case we default to ~/Music.
|
||||
bool GetUserMusicDirectory(base::FilePath* result) {
|
||||
return GetUserMediaDirectory("MUSIC", kMusicDir, result);
|
||||
}
|
||||
|
||||
// We respect the user's preferred pictures location, unless it is
|
||||
// ~ or their desktop directory, in which case we default to ~/Pictures.
|
||||
bool GetUserPicturesDirectory(base::FilePath* result) {
|
||||
return GetUserMediaDirectory("PICTURES", kPicturesDir, result);
|
||||
}
|
||||
|
||||
// We respect the user's preferred pictures location, unless it is
|
||||
// ~ or their desktop directory, in which case we default to ~/Videos.
|
||||
bool GetUserVideosDirectory(base::FilePath* result) {
|
||||
return GetUserMediaDirectory("VIDEOS", kVideosDir, result);
|
||||
}
|
||||
|
||||
bool ProcessNeedsProfileDir(const std::string& process_type) {
|
||||
// For now we have no reason to forbid this on Linux as we don't
|
||||
// have the roaming profile troubles there. Moreover the Linux breakpad needs
|
||||
// profile dir access in all process if enabled on Linux.
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace chrome
|
231
chrome/common/chrome_paths_mac.mm
Normal file
|
@ -0,0 +1,231 @@
|
|||
// Copyright (c) 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/base_paths.h"
|
||||
#include "base/check_op.h"
|
||||
#import "base/mac/foundation_util.h"
|
||||
#include "base/memory/free_deleter.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/common/chrome_constants.h"
|
||||
#include "chrome/common/chrome_paths_internal.h"
|
||||
|
||||
namespace {
|
||||
|
||||
// Return a retained (NOT autoreleased) NSBundle* as the internal
|
||||
// implementation of chrome::OuterAppBundle(), which should be the only
|
||||
// caller.
|
||||
NSBundle* OuterAppBundleInternal() {
|
||||
@autoreleasepool {
|
||||
if (!base::mac::AmIBundled()) {
|
||||
// If unbundled (as in a test), there's no app bundle.
|
||||
return nil;
|
||||
}
|
||||
|
||||
if (!base::mac::IsBackgroundOnlyProcess()) {
|
||||
// Shortcut: in the browser process, just return the main app bundle.
|
||||
return [[NSBundle mainBundle] retain];
|
||||
}
|
||||
|
||||
// From C.app/Contents/Frameworks/C.framework/Versions/1.2.3.4, go up five
|
||||
// steps to C.app.
|
||||
base::FilePath framework_path = chrome::GetFrameworkBundlePath();
|
||||
base::FilePath outer_app_dir =
|
||||
framework_path.DirName().DirName().DirName().DirName().DirName();
|
||||
NSString* outer_app_dir_ns = base::SysUTF8ToNSString(outer_app_dir.value());
|
||||
|
||||
return [[NSBundle bundleWithPath:outer_app_dir_ns] retain];
|
||||
}
|
||||
}
|
||||
|
||||
char* ProductDirNameForBundle(NSBundle* chrome_bundle) {
|
||||
@autoreleasepool {
|
||||
const char* product_dir_name = NULL;
|
||||
|
||||
NSString* product_dir_name_ns =
|
||||
[chrome_bundle objectForInfoDictionaryKey:@"CrProductDirName"];
|
||||
product_dir_name = [product_dir_name_ns fileSystemRepresentation];
|
||||
|
||||
if (!product_dir_name) {
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
product_dir_name = "Google/Chrome";
|
||||
#else
|
||||
product_dir_name = "Thorium";
|
||||
#endif
|
||||
}
|
||||
|
||||
// Leaked, but the only caller initializes a static with this result, so it
|
||||
// only happens once, and that's OK.
|
||||
return strdup(product_dir_name);
|
||||
}
|
||||
}
|
||||
|
||||
// ProductDirName returns the name of the directory inside
|
||||
// ~/Library/Application Support that should hold the product application
|
||||
// data. This can be overridden by setting the CrProductDirName key in the
|
||||
// outer browser .app's Info.plist. The default is "Google/Chrome" for
|
||||
// officially-branded builds, and "Chromium" for unbranded builds. For the
|
||||
// official canary channel, the Info.plist will have CrProductDirName set
|
||||
// to "Google/Chrome Canary".
|
||||
std::string ProductDirName() {
|
||||
// Use OuterAppBundle() to get the main app's bundle. This key needs to live
|
||||
// in the main app's bundle because it will be set differently on the canary
|
||||
// channel, and the autoupdate system dictates that there can be no
|
||||
// differences between channels within the versioned directory. This would
|
||||
// normally use base::mac::FrameworkBundle(), but that references the
|
||||
// framework bundle within the versioned directory. Ordinarily, the profile
|
||||
// should not be accessed from non-browser processes, but those processes do
|
||||
// attempt to get the profile directory, so direct them to look in the outer
|
||||
// browser .app's Info.plist for the CrProductDirName key.
|
||||
static const char* product_dir_name =
|
||||
ProductDirNameForBundle(chrome::OuterAppBundle());
|
||||
return std::string(product_dir_name);
|
||||
}
|
||||
|
||||
bool GetDefaultUserDataDirectoryForProduct(const std::string& product_dir,
|
||||
base::FilePath* result) {
|
||||
bool success = false;
|
||||
if (result && base::PathService::Get(base::DIR_APP_DATA, result)) {
|
||||
*result = result->Append(product_dir);
|
||||
success = true;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace chrome {
|
||||
|
||||
bool GetDefaultUserDataDirectory(base::FilePath* result) {
|
||||
return GetDefaultUserDataDirectoryForProduct(ProductDirName(), result);
|
||||
}
|
||||
|
||||
bool GetUserDocumentsDirectory(base::FilePath* result) {
|
||||
return base::mac::GetUserDirectory(NSDocumentDirectory, result);
|
||||
}
|
||||
|
||||
void GetUserCacheDirectory(const base::FilePath& profile_dir,
|
||||
base::FilePath* result) {
|
||||
// If the profile directory is under ~/Library/Application Support,
|
||||
// use a suitable cache directory under ~/Library/Caches. For
|
||||
// example, a profile directory of ~/Library/Application
|
||||
// Support/Google/Chrome/MyProfileName would use the cache directory
|
||||
// ~/Library/Caches/Google/Chrome/MyProfileName.
|
||||
|
||||
// Default value in cases where any of the following fails.
|
||||
*result = profile_dir;
|
||||
|
||||
base::FilePath app_data_dir;
|
||||
if (!base::PathService::Get(base::DIR_APP_DATA, &app_data_dir))
|
||||
return;
|
||||
base::FilePath cache_dir;
|
||||
if (!base::PathService::Get(base::DIR_CACHE, &cache_dir))
|
||||
return;
|
||||
if (!app_data_dir.AppendRelativePath(profile_dir, &cache_dir))
|
||||
return;
|
||||
|
||||
*result = cache_dir;
|
||||
}
|
||||
|
||||
bool GetUserDownloadsDirectory(base::FilePath* result) {
|
||||
return base::mac::GetUserDirectory(NSDownloadsDirectory, result);
|
||||
}
|
||||
|
||||
bool GetUserMusicDirectory(base::FilePath* result) {
|
||||
return base::mac::GetUserDirectory(NSMusicDirectory, result);
|
||||
}
|
||||
|
||||
bool GetUserPicturesDirectory(base::FilePath* result) {
|
||||
return base::mac::GetUserDirectory(NSPicturesDirectory, result);
|
||||
}
|
||||
|
||||
bool GetUserVideosDirectory(base::FilePath* result) {
|
||||
return base::mac::GetUserDirectory(NSMoviesDirectory, result);
|
||||
}
|
||||
|
||||
base::FilePath GetFrameworkBundlePath() {
|
||||
// It's tempting to use +[NSBundle bundleWithIdentifier:], but it's really
|
||||
// slow (about 30ms on 10.5 and 10.6), despite Apple's documentation stating
|
||||
// that it may be more efficient than +bundleForClass:. +bundleForClass:
|
||||
// itself takes 1-2ms. Getting an NSBundle from a path, on the other hand,
|
||||
// essentially takes no time at all, at least when the bundle has already
|
||||
// been loaded as it will have been in this case. The FilePath operations
|
||||
// needed to compute the framework's path are also effectively free, so that
|
||||
// is the approach that is used here. NSBundle is also documented as being
|
||||
// not thread-safe, and thread safety may be a concern here.
|
||||
|
||||
// Start out with the path to the running executable.
|
||||
base::FilePath path;
|
||||
base::PathService::Get(base::FILE_EXE, &path);
|
||||
|
||||
// One step up to MacOS, another to Contents.
|
||||
path = path.DirName().DirName();
|
||||
DCHECK_EQ(path.BaseName().value(), "Contents");
|
||||
|
||||
if (base::mac::IsBackgroundOnlyProcess()) {
|
||||
// |path| is Chromium.app/Contents/Frameworks/Chromium Framework.framework/
|
||||
// Versions/X/Helpers/Chromium Helper.app/Contents. Go up three times to
|
||||
// the versioned framework directory.
|
||||
path = path.DirName().DirName().DirName();
|
||||
} else {
|
||||
// |path| is Chromium.app/Contents, so go down to
|
||||
// Chromium.app/Contents/Frameworks/Chromium Framework.framework/Versions/X.
|
||||
path = path.Append("Frameworks")
|
||||
.Append(kFrameworkName)
|
||||
.Append("Versions")
|
||||
.Append(kChromeVersion);
|
||||
}
|
||||
DCHECK_EQ(path.BaseName().value(), kChromeVersion);
|
||||
DCHECK_EQ(path.DirName().BaseName().value(), "Versions");
|
||||
DCHECK_EQ(path.DirName().DirName().BaseName().value(), kFrameworkName);
|
||||
DCHECK_EQ(path.DirName().DirName().DirName().BaseName().value(),
|
||||
"Frameworks");
|
||||
DCHECK_EQ(path.DirName()
|
||||
.DirName()
|
||||
.DirName()
|
||||
.DirName()
|
||||
.DirName()
|
||||
.BaseName()
|
||||
.Extension(),
|
||||
".app");
|
||||
return path;
|
||||
}
|
||||
|
||||
bool GetLocalLibraryDirectory(base::FilePath* result) {
|
||||
return base::mac::GetLocalDirectory(NSLibraryDirectory, result);
|
||||
}
|
||||
|
||||
bool GetGlobalApplicationSupportDirectory(base::FilePath* result) {
|
||||
return base::mac::GetLocalDirectory(NSApplicationSupportDirectory, result);
|
||||
}
|
||||
|
||||
NSBundle* OuterAppBundle() {
|
||||
// Cache this. Foundation leaks it anyway, and this should be the only call
|
||||
// to OuterAppBundleInternal().
|
||||
static NSBundle* bundle = OuterAppBundleInternal();
|
||||
return bundle;
|
||||
}
|
||||
|
||||
bool GetUserDataDirectoryForBrowserBundle(NSBundle* bundle,
|
||||
base::FilePath* result) {
|
||||
std::unique_ptr<char, base::FreeDeleter> product_dir_name(
|
||||
ProductDirNameForBundle(bundle));
|
||||
return GetDefaultUserDataDirectoryForProduct(product_dir_name.get(), result);
|
||||
}
|
||||
|
||||
bool ProcessNeedsProfileDir(const std::string& process_type) {
|
||||
// For now we have no reason to forbid this on other MacOS as we don't
|
||||
// have the roaming profile troubles there.
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace chrome
|
309
chrome/common/media/cdm_registration.cc
Normal file
|
@ -0,0 +1,309 @@
|
|||
// Copyright 2021 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/common/media/cdm_registration.h"
|
||||
|
||||
#include "base/check.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/path_service.h"
|
||||
#include "build/build_config.h"
|
||||
#include "build/chromeos_buildflags.h"
|
||||
#include "content/public/common/cdm_info.h"
|
||||
#include "media/cdm/cdm_capability.h"
|
||||
#include "media/cdm/cdm_type.h"
|
||||
#include "third_party/widevine/cdm/buildflags.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
#include "base/command_line.h"
|
||||
#include "media/base/media_switches.h"
|
||||
#include "media/cdm/cdm_paths.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_WIDEVINE)
|
||||
#include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
|
||||
#include "base/native_library.h"
|
||||
#include "chrome/common/chrome_paths.h"
|
||||
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_WIN)
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
#include "base/no_destructor.h"
|
||||
#include "components/cdm/common/cdm_manifest.h"
|
||||
#include "media/cdm/supported_audio_codecs.h"
|
||||
// Needed for WIDEVINE_CDM_MIN_GLIBC_VERSION. This file is in
|
||||
// SHARED_INTERMEDIATE_DIR.
|
||||
#include "widevine_cdm_version.h" // nogncheck
|
||||
// The following must be after widevine_cdm_version.h.
|
||||
#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
|
||||
#include <gnu/libc-version.h>
|
||||
#include "base/version.h"
|
||||
#endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
|
||||
#if !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
#include "chrome/common/media/component_widevine_cdm_hint_file_linux.h"
|
||||
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
||||
|
||||
namespace {
|
||||
|
||||
using Robustness = content::CdmInfo::Robustness;
|
||||
|
||||
#if BUILDFLAG(ENABLE_WIDEVINE)
|
||||
#if (BUILDFLAG(BUNDLE_WIDEVINE_CDM) || \
|
||||
BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)) && \
|
||||
(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
|
||||
// Create a CdmInfo for a Widevine CDM, using |version|, |cdm_library_path|, and
|
||||
// |capability|.
|
||||
std::unique_ptr<content::CdmInfo> CreateWidevineCdmInfo(
|
||||
const base::Version& version,
|
||||
const base::FilePath& cdm_library_path,
|
||||
media::CdmCapability capability) {
|
||||
return std::make_unique<content::CdmInfo>(
|
||||
kWidevineKeySystem, Robustness::kSoftwareSecure, std::move(capability),
|
||||
/*supports_sub_key_systems=*/false, kWidevineCdmDisplayName,
|
||||
kWidevineCdmType, version, cdm_library_path);
|
||||
}
|
||||
|
||||
// On desktop Linux and ChromeOS, given |cdm_base_path| that points to a folder
|
||||
// containing the Widevine CDM and associated files, read the manifest included
|
||||
// in that directory and create a CdmInfo. If that is successful, return the
|
||||
// CdmInfo. If not, return nullptr.
|
||||
std::unique_ptr<content::CdmInfo> CreateCdmInfoFromWidevineDirectory(
|
||||
const base::FilePath& cdm_base_path) {
|
||||
// Library should be inside a platform specific directory.
|
||||
auto cdm_library_path =
|
||||
media::GetPlatformSpecificDirectory(cdm_base_path)
|
||||
.Append(base::GetNativeLibraryName(kWidevineCdmLibraryName));
|
||||
if (!base::PathExists(cdm_library_path))
|
||||
return nullptr;
|
||||
|
||||
// Manifest should be at the top level.
|
||||
auto manifest_path = cdm_base_path.Append(FILE_PATH_LITERAL("manifest.json"));
|
||||
base::Version version;
|
||||
media::CdmCapability capability;
|
||||
if (!ParseCdmManifestFromPath(manifest_path, &version, &capability))
|
||||
return nullptr;
|
||||
|
||||
return CreateWidevineCdmInfo(version, cdm_library_path,
|
||||
std::move(capability));
|
||||
}
|
||||
#endif // (BUILDFLAG(BUNDLE_WIDEVINE_CDM) ||
|
||||
// BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)) && (BUILDFLAG(IS_LINUX) ||
|
||||
// BUILDFLAG(IS_CHROMEOS))
|
||||
|
||||
#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) && \
|
||||
(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
|
||||
// On Linux/ChromeOS we have to preload the CDM since it uses the zygote
|
||||
// sandbox. On Windows and Mac, the bundled CDM is handled by the component
|
||||
// updater.
|
||||
|
||||
// This code checks to see if the Widevine CDM was bundled with Chrome. If one
|
||||
// can be found and looks valid, it returns the CdmInfo for the CDM. Otherwise
|
||||
// it returns nullptr.
|
||||
content::CdmInfo* GetBundledWidevine() {
|
||||
// We only want to do this on the first call, as if Widevine wasn't bundled
|
||||
// with Chrome (or it was deleted/removed) it won't be loaded into the zygote.
|
||||
static base::NoDestructor<std::unique_ptr<content::CdmInfo>> s_cdm_info(
|
||||
[]() -> std::unique_ptr<content::CdmInfo> {
|
||||
base::FilePath install_dir;
|
||||
CHECK(base::PathService::Get(chrome::DIR_BUNDLED_WIDEVINE_CDM,
|
||||
&install_dir));
|
||||
return CreateCdmInfoFromWidevineDirectory(install_dir);
|
||||
}());
|
||||
return s_cdm_info->get();
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) && (BUILDFLAG(IS_LINUX) ||
|
||||
// BUILDFLAG(IS_CHROMEOS))
|
||||
|
||||
#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) && \
|
||||
(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
|
||||
// This code checks to see if a component updated Widevine CDM can be found. If
|
||||
// there is one and it looks valid, return the CdmInfo for that CDM. Otherwise
|
||||
// return nullptr.
|
||||
content::CdmInfo* GetComponentUpdatedWidevine() {
|
||||
// We only want to do this on the first call, as the component updater may run
|
||||
// and download a new version once Chrome has been running for a while. Since
|
||||
// the first returned version will be the one loaded into the zygote, we want
|
||||
// to return the same thing on subsequent calls.
|
||||
static base::NoDestructor<std::unique_ptr<content::CdmInfo>> s_cdm_info(
|
||||
[]() -> std::unique_ptr<content::CdmInfo> {
|
||||
auto install_dir = GetLatestComponentUpdatedWidevineCdmDirectory();
|
||||
if (install_dir.empty())
|
||||
return nullptr;
|
||||
|
||||
return CreateCdmInfoFromWidevineDirectory(install_dir);
|
||||
}());
|
||||
return s_cdm_info->get();
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT) && (BUILDFLAG(IS_LINUX) ||
|
||||
// BUILDFLAG(IS_CHROMEOS))
|
||||
|
||||
void AddSoftwareSecureWidevine(std::vector<content::CdmInfo>* cdms) {
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
|
||||
base::Version glibc_version(gnu_get_libc_version());
|
||||
DCHECK(glibc_version.IsValid());
|
||||
if (glibc_version < base::Version(WIDEVINE_CDM_MIN_GLIBC_VERSION)) {
|
||||
LOG(WARNING) << "Widevine not registered because glibc version is too low";
|
||||
return;
|
||||
}
|
||||
#endif // defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
|
||||
|
||||
// The Widevine CDM on Linux needs to be registered (and loaded) before the
|
||||
// zygote is locked down. The CDM can be found from the version bundled with
|
||||
// Chrome (if BUNDLE_WIDEVINE_CDM = true) and/or the version downloaded by
|
||||
// the component updater (if ENABLE_WIDEVINE_CDM_COMPONENT = true). If two
|
||||
// versions exist, take the one with the higher version number.
|
||||
//
|
||||
// Note that the component updater will detect the bundled version, and if
|
||||
// there is no newer version available, select the bundled version. In this
|
||||
// case both versions will be the same and point to the same directory, so
|
||||
// it doesn't matter which one is loaded.
|
||||
content::CdmInfo* bundled_widevine = nullptr;
|
||||
#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
|
||||
bundled_widevine = GetBundledWidevine();
|
||||
#endif
|
||||
|
||||
content::CdmInfo* updated_widevine = nullptr;
|
||||
#if BUILDFLAG(ENABLE_WIDEVINE_CDM_COMPONENT)
|
||||
updated_widevine = GetComponentUpdatedWidevine();
|
||||
#endif
|
||||
|
||||
// If only a bundled version is available, or both are available and the
|
||||
// bundled version is not less than the updated version, register the
|
||||
// bundled version. If only the updated version is available, or both are
|
||||
// available and the updated version is greater, then register the updated
|
||||
// version. If neither are available, then nothing is registered.
|
||||
if (bundled_widevine &&
|
||||
(!updated_widevine ||
|
||||
bundled_widevine->version >= updated_widevine->version)) {
|
||||
VLOG(1) << "Registering bundled Widevine " << bundled_widevine->version;
|
||||
cdms->push_back(*bundled_widevine);
|
||||
} else if (updated_widevine) {
|
||||
VLOG(1) << "Registering component updated Widevine "
|
||||
<< updated_widevine->version;
|
||||
cdms->push_back(*updated_widevine);
|
||||
} else {
|
||||
VLOG(1) << "Widevine enabled but no library found";
|
||||
}
|
||||
#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
|
||||
}
|
||||
|
||||
void AddHardwareSecureWidevine(std::vector<content::CdmInfo>* cdms) {
|
||||
#if BUILDFLAG(USE_CHROMEOS_PROTECTED_MEDIA)
|
||||
#if BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kLacrosUseChromeosProtectedMedia)) {
|
||||
return;
|
||||
}
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
media::CdmCapability capability;
|
||||
|
||||
// The following audio formats are supported for decrypt-only.
|
||||
capability.audio_codecs = media::GetCdmSupportedAudioCodecs();
|
||||
|
||||
// We currently support VP9, H264 and HEVC video formats with
|
||||
// decrypt-and-decode. Not specifying any profiles to indicate that all
|
||||
// relevant profiles should be considered supported.
|
||||
const std::vector<media::VideoCodecProfile> kAllProfiles = {};
|
||||
capability.video_codecs.emplace(media::VideoCodec::kVP9, kAllProfiles);
|
||||
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
|
||||
capability.video_codecs.emplace(media::VideoCodec::kH264, kAllProfiles);
|
||||
#endif
|
||||
#if BUILDFLAG(ENABLE_PLATFORM_HEVC)
|
||||
#if BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kLacrosEnablePlatformHevc)) {
|
||||
capability.video_codecs.emplace(media::VideoCodec::kHEVC, kAllProfiles);
|
||||
}
|
||||
#else
|
||||
capability.video_codecs.emplace(media::VideoCodec::kHEVC, kAllProfiles);
|
||||
#endif // BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
#endif
|
||||
#if BUILDFLAG(USE_CHROMEOS_PROTECTED_AV1)
|
||||
capability.video_codecs.emplace(media::VideoCodec::kAV1, kAllProfiles);
|
||||
#elif BUILDFLAG(IS_CHROMEOS_LACROS)
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
switches::kLacrosUseChromeosProtectedAv1)) {
|
||||
capability.video_codecs.emplace(media::VideoCodec::kAV1, kAllProfiles);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Both encryption schemes are supported on ChromeOS.
|
||||
capability.encryption_schemes.insert(media::EncryptionScheme::kCenc);
|
||||
capability.encryption_schemes.insert(media::EncryptionScheme::kCbcs);
|
||||
|
||||
// Both temporary and persistent sessions are supported on ChromeOS.
|
||||
capability.session_types.insert(media::CdmSessionType::kTemporary);
|
||||
capability.session_types.insert(media::CdmSessionType::kPersistentLicense);
|
||||
|
||||
cdms->push_back(
|
||||
content::CdmInfo(kWidevineKeySystem, Robustness::kHardwareSecure,
|
||||
std::move(capability), content::kChromeOsCdmType));
|
||||
#endif // BUILDFLAG(USE_CHROMEOS_PROTECTED_MEDIA)
|
||||
}
|
||||
|
||||
void AddWidevine(std::vector<content::CdmInfo>* cdms) {
|
||||
AddSoftwareSecureWidevine(cdms);
|
||||
AddHardwareSecureWidevine(cdms);
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
||||
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
void AddExternalClearKey(std::vector<content::CdmInfo>* cdms) {
|
||||
// Register Clear Key CDM if specified in command line.
|
||||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
||||
base::FilePath clear_key_cdm_path =
|
||||
command_line->GetSwitchValuePath(switches::kClearKeyCdmPathForTesting);
|
||||
if (clear_key_cdm_path.empty() || !base::PathExists(clear_key_cdm_path))
|
||||
return;
|
||||
|
||||
// TODO(crbug.com/764480): Remove these after we have a central place for
|
||||
// External Clear Key (ECK) related information.
|
||||
// Normal External Clear Key key system.
|
||||
const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey";
|
||||
// A variant of ECK key system that has a different CDM type.
|
||||
const char kkExternalClearKeyDifferentCdmTypeTestKeySystem[] =
|
||||
"org.chromium.externalclearkey.differentcdmtype";
|
||||
|
||||
// Supported codecs are hard-coded in ExternalClearKeyProperties.
|
||||
media::CdmCapability capability(
|
||||
{}, {}, {media::EncryptionScheme::kCenc, media::EncryptionScheme::kCbcs},
|
||||
{media::CdmSessionType::kTemporary,
|
||||
media::CdmSessionType::kPersistentLicense});
|
||||
|
||||
// Register kkExternalClearKeyDifferentCdmTypeTestKeySystem first separately.
|
||||
// Otherwise, it'll be treated as a sub-key-system of normal
|
||||
// kExternalClearKeyKeySystem. See MultipleCdmTypes test in
|
||||
// ECKEncryptedMediaTest.
|
||||
cdms->push_back(content::CdmInfo(
|
||||
kkExternalClearKeyDifferentCdmTypeTestKeySystem,
|
||||
Robustness::kSoftwareSecure, capability,
|
||||
/*supports_sub_key_systems=*/false, media::kClearKeyCdmDisplayName,
|
||||
media::kClearKeyCdmDifferentCdmType, base::Version("0.1.0.0"),
|
||||
clear_key_cdm_path));
|
||||
|
||||
cdms->push_back(content::CdmInfo(
|
||||
kExternalClearKeyKeySystem, Robustness::kSoftwareSecure, capability,
|
||||
/*supports_sub_key_systems=*/true, media::kClearKeyCdmDisplayName,
|
||||
media::kClearKeyCdmType, base::Version("0.1.0.0"), clear_key_cdm_path));
|
||||
}
|
||||
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
|
||||
} // namespace
|
||||
|
||||
void RegisterCdmInfo(std::vector<content::CdmInfo>* cdms) {
|
||||
DVLOG(1) << __func__;
|
||||
DCHECK(cdms);
|
||||
DCHECK(cdms->empty());
|
||||
|
||||
#if BUILDFLAG(ENABLE_WIDEVINE)
|
||||
AddWidevine(cdms);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
|
||||
AddExternalClearKey(cdms);
|
||||
#endif
|
||||
}
|
73
chrome/install_static/chromium_install_modes.cc
Normal file
|
@ -0,0 +1,73 @@
|
|||
// Copyright 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Brand-specific constants and install modes for Chromium.
|
||||
|
||||
#include "chrome/install_static/chromium_install_modes.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "chrome/app/chrome_dll_resource.h"
|
||||
#include "chrome/common/chrome_icon_resources_win.h"
|
||||
#include "chrome/install_static/install_modes.h"
|
||||
|
||||
namespace install_static {
|
||||
|
||||
const wchar_t kCompanyPathName[] = L"";
|
||||
|
||||
const wchar_t kProductPathName[] = L"Thorium";
|
||||
|
||||
const size_t kProductPathNameLength = _countof(kProductPathName) - 1;
|
||||
|
||||
const char kSafeBrowsingName[] = "thorium";
|
||||
|
||||
const char kDeviceManagementServerHostName[] = "";
|
||||
|
||||
const InstallConstants kInstallModes[] = {
|
||||
// The primary (and only) install mode for Chromium.
|
||||
{
|
||||
sizeof(kInstallModes[0]),
|
||||
CHROMIUM_INDEX, // The one and only mode for Chromium.
|
||||
"", // No install switch for the primary install mode.
|
||||
L"", // Empty install_suffix for the primary install mode.
|
||||
L"", // No logo suffix for the primary install mode.
|
||||
L"", // Empty app_guid since no integraion with Google Update.
|
||||
L"Thorium", // A distinct base_app_name.
|
||||
L"Thorium", // A distinct base_app_id.
|
||||
L"ThoriumHTM", // ProgID prefix.
|
||||
L"Thorium HTML Document", // ProgID description.
|
||||
L"{7D2B3E1D-D096-4594-9D8F-A6667F12E0AC}", // Active Setup GUID.
|
||||
L"{A2DF06F9-A21A-44A8-8A99-8B9C84F29160}", // CommandExecuteImpl CLSID.
|
||||
{0x635EFA6F,
|
||||
0x08D6,
|
||||
0x4EC9,
|
||||
{0xBD, 0x14, 0x8A, 0x0F, 0xDE, 0x97, 0x51,
|
||||
0x59}}, // Toast Activator CLSID.
|
||||
{0xD133B120,
|
||||
0x6DB4,
|
||||
0x4D6B,
|
||||
{0x8B, 0xFE, 0x83, 0xBF, 0x8C, 0xA1, 0xB1, 0xB0}}, // Elevator CLSID.
|
||||
|
||||
{0xb88c45b9,
|
||||
0x8825,
|
||||
0x4629,
|
||||
{0xb8, 0x3e, 0x77, 0xcc, 0x67, 0xd9, 0xce,
|
||||
0xed}}, // IElevator IID and TypeLib
|
||||
// {B88C45B9-8825-4629-B83E-77CC67D9CEED}.
|
||||
L"", // Empty default channel name since no update integration.
|
||||
ChannelStrategy::UNSUPPORTED,
|
||||
true, // Supports system-level installs.
|
||||
true, // Supports in-product set as default browser UX.
|
||||
false, // Does not support retention experiments.
|
||||
icon_resources::kApplicationIndex, // App icon resource index.
|
||||
IDR_MAINFRAME, // App icon resource id.
|
||||
L"S-1-15-2-3251537155-1984446955-2931258699-841473695-1938553385-"
|
||||
L"924012148-", // App container sid prefix for sandbox.
|
||||
},
|
||||
};
|
||||
|
||||
static_assert(_countof(kInstallModes) == NUM_INSTALL_MODES,
|
||||
"Imbalance between kInstallModes and InstallConstantIndex");
|
||||
|
||||
} // namespace install_static
|
166
chrome/install_static/user_data_dir_win_unittest.cc
Normal file
|
@ -0,0 +1,166 @@
|
|||
// Copyright 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "base/test/test_reg_util_win.h"
|
||||
#include "build/branding_buildflags.h"
|
||||
#include "chrome/chrome_elf/nt_registry/nt_registry.h"
|
||||
#include "chrome/install_static/install_details.h"
|
||||
#include "chrome/install_static/user_data_dir.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace install_static {
|
||||
namespace {
|
||||
|
||||
inline bool EndsWith(const std::wstring& value, const std::wstring& ending) {
|
||||
if (ending.size() > value.size())
|
||||
return false;
|
||||
return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
|
||||
}
|
||||
|
||||
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
const wchar_t kPolicyRegistryKey[] = L"SOFTWARE\\Policies\\Google\\Chrome";
|
||||
const wchar_t kUserDataDirNameSuffix[] = L"\\Google\\Chrome\\User Data";
|
||||
#else
|
||||
const wchar_t kPolicyRegistryKey[] = L"SOFTWARE\\Policies\\Chromium";
|
||||
const wchar_t kUserDataDirNameSuffix[] = L"\\Thorium\\User Data";
|
||||
#endif
|
||||
|
||||
const wchar_t kUserDataDirRegistryKey[] = L"UserDataDir";
|
||||
|
||||
const InstallConstants kFakeInstallConstants = {
|
||||
sizeof(InstallConstants), 0, "", L"", L"", L"", L""};
|
||||
|
||||
class ScopedNTRegistryTestingOverride {
|
||||
public:
|
||||
ScopedNTRegistryTestingOverride(nt::ROOT_KEY root, const std::wstring& path)
|
||||
: root_(root) {
|
||||
EXPECT_TRUE(nt::SetTestingOverride(root_, path));
|
||||
}
|
||||
~ScopedNTRegistryTestingOverride() {
|
||||
nt::SetTestingOverride(root_, std::wstring());
|
||||
}
|
||||
|
||||
private:
|
||||
nt::ROOT_KEY root_;
|
||||
};
|
||||
|
||||
TEST(UserDataDir, EmptyResultsInDefault) {
|
||||
std::wstring result, invalid;
|
||||
|
||||
install_static::GetUserDataDirectoryImpl(L"", kFakeInstallConstants, &result,
|
||||
&invalid);
|
||||
EXPECT_TRUE(EndsWith(result, kUserDataDirNameSuffix));
|
||||
EXPECT_EQ(std::wstring(), invalid);
|
||||
}
|
||||
|
||||
TEST(UserDataDir, InvalidResultsInDefault) {
|
||||
std::wstring result, invalid;
|
||||
|
||||
install_static::GetUserDataDirectoryImpl(L"<>|:", kFakeInstallConstants,
|
||||
&result, &invalid);
|
||||
EXPECT_TRUE(EndsWith(result, kUserDataDirNameSuffix));
|
||||
EXPECT_EQ(L"<>|:", invalid);
|
||||
}
|
||||
|
||||
TEST(UserDataDir, RegistrySettingsInHKLMOverrides) {
|
||||
std::wstring result, invalid;
|
||||
|
||||
// Override the registry to say one value in HKLM, and confirm it takes
|
||||
// precedence over the command line in both implementations.
|
||||
registry_util::RegistryOverrideManager override_manager;
|
||||
std::wstring temp;
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE, &temp));
|
||||
ScopedNTRegistryTestingOverride nt_override(nt::HKLM, temp);
|
||||
|
||||
base::win::RegKey key(HKEY_LOCAL_MACHINE, kPolicyRegistryKey, KEY_WRITE);
|
||||
LONG rv = key.WriteValue(kUserDataDirRegistryKey, L"yyy");
|
||||
ASSERT_EQ(rv, ERROR_SUCCESS);
|
||||
|
||||
install_static::GetUserDataDirectoryImpl(L"xxx", kFakeInstallConstants,
|
||||
&result, &invalid);
|
||||
|
||||
EXPECT_TRUE(EndsWith(result, L"\\yyy"));
|
||||
EXPECT_EQ(std::wstring(), invalid);
|
||||
}
|
||||
|
||||
TEST(UserDataDir, RegistrySettingsInHKCUOverrides) {
|
||||
std::wstring result, invalid;
|
||||
|
||||
// Override the registry to say one value in HKCU, and confirm it takes
|
||||
// precedence over the command line in both implementations.
|
||||
registry_util::RegistryOverrideManager override_manager;
|
||||
std::wstring temp;
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
override_manager.OverrideRegistry(HKEY_CURRENT_USER, &temp));
|
||||
ScopedNTRegistryTestingOverride nt_override(nt::HKCU, temp);
|
||||
|
||||
base::win::RegKey key(HKEY_CURRENT_USER, kPolicyRegistryKey, KEY_WRITE);
|
||||
LONG rv = key.WriteValue(kUserDataDirRegistryKey, L"yyy");
|
||||
ASSERT_EQ(rv, ERROR_SUCCESS);
|
||||
|
||||
install_static::GetUserDataDirectoryImpl(L"xxx", kFakeInstallConstants,
|
||||
&result, &invalid);
|
||||
|
||||
EXPECT_TRUE(EndsWith(result, L"\\yyy"));
|
||||
EXPECT_EQ(std::wstring(), invalid);
|
||||
}
|
||||
|
||||
TEST(UserDataDir, RegistrySettingsInHKLMTakesPrecedenceOverHKCU) {
|
||||
std::wstring result, invalid;
|
||||
|
||||
// Override the registry in both HKLM and HKCU, and confirm HKLM takes
|
||||
// precedence.
|
||||
registry_util::RegistryOverrideManager override_manager;
|
||||
std::wstring temp;
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE, &temp));
|
||||
ScopedNTRegistryTestingOverride nt_override(nt::HKLM, temp);
|
||||
LONG rv;
|
||||
base::win::RegKey key1(HKEY_LOCAL_MACHINE, kPolicyRegistryKey, KEY_WRITE);
|
||||
rv = key1.WriteValue(kUserDataDirRegistryKey, L"111");
|
||||
ASSERT_EQ(rv, ERROR_SUCCESS);
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
override_manager.OverrideRegistry(HKEY_CURRENT_USER, &temp));
|
||||
ScopedNTRegistryTestingOverride nt_override2(nt::HKCU, temp);
|
||||
base::win::RegKey key2(HKEY_CURRENT_USER, kPolicyRegistryKey, KEY_WRITE);
|
||||
rv = key2.WriteValue(kUserDataDirRegistryKey, L"222");
|
||||
ASSERT_EQ(rv, ERROR_SUCCESS);
|
||||
|
||||
install_static::GetUserDataDirectoryImpl(L"xxx", kFakeInstallConstants,
|
||||
&result, &invalid);
|
||||
|
||||
EXPECT_TRUE(EndsWith(result, L"\\111"));
|
||||
EXPECT_EQ(std::wstring(), invalid);
|
||||
}
|
||||
|
||||
TEST(UserDataDir, RegistrySettingWithPathExpansionHKCU) {
|
||||
std::wstring result, invalid;
|
||||
|
||||
registry_util::RegistryOverrideManager override_manager;
|
||||
std::wstring temp;
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
override_manager.OverrideRegistry(HKEY_CURRENT_USER, &temp));
|
||||
ScopedNTRegistryTestingOverride nt_override(nt::HKCU, temp);
|
||||
base::win::RegKey key(HKEY_CURRENT_USER, kPolicyRegistryKey, KEY_WRITE);
|
||||
LONG rv = key.WriteValue(kUserDataDirRegistryKey, L"${windows}");
|
||||
ASSERT_EQ(rv, ERROR_SUCCESS);
|
||||
|
||||
install_static::GetUserDataDirectoryImpl(L"xxx", kFakeInstallConstants,
|
||||
&result, &invalid);
|
||||
|
||||
EXPECT_EQ(strlen("X:\\WINDOWS"), result.size());
|
||||
EXPECT_EQ(std::wstring::npos, result.find(L"${windows}"));
|
||||
std::wstring upper;
|
||||
std::transform(result.begin(), result.end(), std::back_inserter(upper),
|
||||
toupper);
|
||||
EXPECT_TRUE(EndsWith(upper, L"\\WINDOWS"));
|
||||
EXPECT_EQ(std::wstring(), invalid);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace install_static
|
221
chrome/installer/linux/common/apt.include
Normal file
|
@ -0,0 +1,221 @@
|
|||
@@include@@repo_variables.include
|
||||
|
||||
# Copyright (c) 2022 Alex313031.
|
||||
|
||||
APT_GET="`command -v apt-get 2> /dev/null`"
|
||||
APT_CONFIG="`command -v apt-config 2> /dev/null`"
|
||||
|
||||
SOURCES_PREAMBLE="### THIS FILE IS AUTOMATICALLY CONFIGURED ###
|
||||
# You may comment out this entry, but any other modifications may be lost.\n"
|
||||
|
||||
# Set variables for the locations of the apt trusted keyrings.
|
||||
find_apt_trusted() {
|
||||
eval $("$APT_CONFIG" shell APT_TRUSTEDDIR 'Dir::Etc::trustedparts/d')
|
||||
}
|
||||
|
||||
# Install the repository/package signing keys.
|
||||
# (see also: https://www.google.com/linuxrepositories/)
|
||||
install_key() {
|
||||
find_apt_trusted
|
||||
# ASCII-armored keyrings are only supported in apt 1.4 and later, but we must
|
||||
# continue supporting Trusty and Xenial which have older versions of apt, so
|
||||
# the keyring is installed as a binary blob. base64 is used to decode the
|
||||
# ASCII keyring, which should always be available since it comes from the
|
||||
# coreutils.
|
||||
(base64 -d > "$APT_TRUSTEDDIR/@@PACKAGE@@.gpg") <<KEYDATA
|
||||
mQINBFcMjNMBEAC6Wr5QuLIFgz1V1EFPlg8ty2TsjQEl4VWftUAqWlMevJFWvYEx
|
||||
BOsOZ6kNFfBfjAxgJNWTkxZrHzDl74R7KW/nUx6X57bpFjUyRaB8F3/NpWKSeIGS
|
||||
pJT+0m2SgUNhLAn1WY/iNJGNaMl7lgUnaP+/ZsSNT9hyTBiH3Ev5VvAtMGhVI/u8
|
||||
P0EtTjXp4o2U+VqFTBGmZ6PJVhCFjZUeRByloHw8dGOshfXKgriebpioHvU8iQ2U
|
||||
GV3WNIirB2Rq1wkKxXJ/9Iw+4l5m4GmXMs7n3XaYQoBj28H86YA1cYWSm5LR5iU2
|
||||
TneI1fJ3vwF2vpSXVBUUDk67PZhg6ZwGRT7GFWskC0z8PsWd5jwK20mA8EVKq0vN
|
||||
BFmMK6i4fJU+ux17Rgvnc9tDSCzFZ1/4f43EZ41uTmmNXIDsaPCqwjvSS5ICadt2
|
||||
xeqTWDlzONUpOs5yBjF1cfJ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+h6/B5wM/Yng9BjT+OrNvkfmqK2cs
|
||||
pBXwYedOrC4uWcUmueEVrv5P4FF36wJ+ejvPS6vdTxVTdLXjouUHwTQQZVlNjWY3
|
||||
cIyj03nZ19c+b30+2FzG/uSnb/ePWsRLY7Iyz4ygr8etweBPnEIvjwpAZxOu
|
||||
KEYDATA
|
||||
}
|
||||
|
||||
uninstall_key() {
|
||||
find_apt_trusted
|
||||
rm -f "$APT_TRUSTEDDIR/@@PACKAGE@@.gpg"
|
||||
}
|
||||
|
||||
# Set variables for the locations of the apt sources lists.
|
||||
find_apt_sources() {
|
||||
eval $("$APT_CONFIG" shell APT_SOURCESDIR 'Dir::Etc::sourceparts/d')
|
||||
}
|
||||
|
||||
DEFAULT_ARCH="@@ARCHITECTURE@@"
|
||||
|
||||
get_lib_dir() {
|
||||
if [ "$DEFAULT_ARCH" = "i386" ]; then
|
||||
LIBDIR=lib/i386-linux-gnu
|
||||
elif [ "$DEFAULT_ARCH" = "amd64" ]; then
|
||||
LIBDIR=lib/x86_64-linux-gnu
|
||||
elif [ "$DEFAULT_ARCH" = "armhf" ]; then
|
||||
LIBDIR=lib/arm-linux-gnueabihf
|
||||
elif [ "$DEFAULT_ARCH" = "arm64" ]; then
|
||||
LIBDIR=lib/aarch64-linux-gnu
|
||||
elif [ "$DEFAULT_ARCH" = "mipsel" ]; then
|
||||
LIBDIR=lib/mipsel-linux-gnu
|
||||
elif [ "$DEFAULT_ARCH" = "mips64el" ]; then
|
||||
LIBDIR=lib/mips64el-linux-gnuabi64
|
||||
else
|
||||
echo Unknown CPU Architecture: "$DEFAULT_ARCH"
|
||||
exit 1
|
||||
fi
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
<!-- Copyright 2021 The Chromium Authors and Alex313031 -->
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>thorium-browser.desktop</id>
|
||||
<update_contact>alex313031@gmail.com</update_contact>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>BSD-3-Clause and LGPL-2.1+ and Apache-2.0 and IJG and MIT and GPL-2.0+ and ISC and OpenSSL and (MPL-1.1 or GPL-2.0 or LGPL-2.0)</project_license>
|
||||
<name>Thorium Web Browser</name>
|
||||
<summary>The web browser from the Alex313031</summary>
|
||||
<description>
|
||||
<p>
|
||||
Thorium is an open-source browser project that aims to build a safer, faster,
|
||||
and more stable way to experience the web.
|
||||
</p>
|
||||
<p>
|
||||
We invite you to join our effort to build a powerful platform for developing a
|
||||
new generation of web applications.
|
||||
</p>
|
||||
<p>
|
||||
Thorium supports Vorbis, Theora, WebM, AAC, H.264, MP3, and HTML5 audio and video standards.
|
||||
</p>
|
||||
</description>
|
||||
<url type="homepage">https://github.com/Alex313031/Thorium</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://www.gstatic.com/chrome/appstream/chrome-2.png</image>
|
||||
<caption/>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<translation/>
|
||||
<developer_name>The Chromium Authors and Alex313031</developer_name>
|
||||
<url type="bugtracker">https://www.chromium.org/for-testers/bug-reporting-guidelines</url>
|
||||
<url type="help">https://chromium.googlesource.com/chromium/src/+/main/docs/linux/debugging.md</url>
|
||||
</component>
|
|
@ -0,0 +1,36 @@
|
|||
# Copyright (c) 2022 The Chromium Authors and Alex313031. 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 provides common configuration information for building
|
||||
# chromium-browser packages for various platforms.
|
||||
|
||||
# Base name of the package.
|
||||
PACKAGE="thorium-browser"
|
||||
|
||||
# Base name of the snap package
|
||||
SNAPNAME="thorium"
|
||||
|
||||
# Filename of the main executable (for generating launcher scripts, etc.)
|
||||
PROGNAME=chrome
|
||||
|
||||
# Base directory for package installation.
|
||||
INSTALLDIR=/opt/chromium.org/thorium
|
||||
|
||||
# Directory for device policy enrollments.
|
||||
ENROLLMENTDIR=/etc/chromium/policies/enrollment
|
||||
|
||||
# Display string for desktop menu/icon.
|
||||
MENUNAME="Thorium Web Browser"
|
||||
|
||||
# Brief package description.
|
||||
SHORTDESC="The web browser from Chromium.org and The Thorium Authors"
|
||||
|
||||
# Detailed package description.
|
||||
FULLDESC="Thorium is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier."
|
||||
|
||||
# Package maintainer information.
|
||||
# TODO(mmoss) Setup a mailbox for this address
|
||||
MAINTNAME="Thorium Linux Maintainers"
|
||||
MAINTMAIL="alex313031@gmail.com"
|
||||
PRODUCTURL="http://www.chromium.org/"
|
229
chrome/installer/linux/common/desktop.template
Normal file
|
@ -0,0 +1,229 @@
|
|||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=Thorium Browser
|
||||
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
|
||||
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
|
||||
GenericName=Web Browser
|
||||
GenericName[ar]=متصفح الشبكة
|
||||
GenericName[bg]=Уеб браузър
|
||||
GenericName[ca]=Navegador web
|
||||
GenericName[cs]=WWW prohlížeč
|
||||
GenericName[da]=Browser
|
||||
GenericName[de]=Web-Browser
|
||||
GenericName[el]=Περιηγητής ιστού
|
||||
GenericName[en_GB]=Web Browser
|
||||
GenericName[es]=Navegador web
|
||||
GenericName[et]=Veebibrauser
|
||||
GenericName[fi]=WWW-selain
|
||||
GenericName[fr]=Navigateur Web
|
||||
GenericName[gu]=વેબ બ્રાઉઝર
|
||||
GenericName[he]=דפדפן אינטרנט
|
||||
GenericName[hi]=वेब ब्राउज़र
|
||||
GenericName[hu]=Webböngésző
|
||||
GenericName[it]=Browser Web
|
||||
GenericName[ja]=ウェブブラウザ
|
||||
GenericName[kn]=ಜಾಲ ವೀಕ್ಷಕ
|
||||
GenericName[ko]=웹 브라우저
|
||||
GenericName[lt]=Žiniatinklio naršyklė
|
||||
GenericName[lv]=Tīmekļa pārlūks
|
||||
GenericName[ml]=വെബ് ബ്രൌസര്
|
||||
GenericName[mr]=वेब ब्राऊजर
|
||||
GenericName[nb]=Nettleser
|
||||
GenericName[nl]=Webbrowser
|
||||
GenericName[pl]=Przeglądarka WWW
|
||||
GenericName[pt]=Navegador Web
|
||||
GenericName[pt_BR]=Navegador da Internet
|
||||
GenericName[ro]=Navigator de Internet
|
||||
GenericName[ru]=Веб-браузер
|
||||
GenericName[sl]=Spletni brskalnik
|
||||
GenericName[sv]=Webbläsare
|
||||
GenericName[ta]=இணைய உலாவி
|
||||
GenericName[th]=เว็บเบราว์เซอร์
|
||||
GenericName[tr]=Web Tarayıcı
|
||||
GenericName[uk]=Навігатор Тенет
|
||||
GenericName[zh_CN]=网页浏览器
|
||||
GenericName[zh_HK]=網頁瀏覽器
|
||||
GenericName[zh_TW]=網頁瀏覽器
|
||||
# Not translated in KDE, from Epiphany 2.26.1-0ubuntu1.
|
||||
GenericName[bn]=ওয়েব ব্রাউজার
|
||||
GenericName[fil]=Web Browser
|
||||
GenericName[hr]=Web preglednik
|
||||
GenericName[id]=Browser Web
|
||||
GenericName[or]=ଓ୍ବେବ ବ୍ରାଉଜର
|
||||
GenericName[sk]=WWW prehliadač
|
||||
GenericName[sr]=Интернет прегледник
|
||||
GenericName[te]=మహాతల అన్వేషి
|
||||
GenericName[vi]=Bộ duyệt Web
|
||||
# Gnome and KDE 3 uses Comment.
|
||||
Comment=Access the Internet
|
||||
Comment[ar]=الدخول إلى الإنترنت
|
||||
Comment[bg]=Достъп до интернет
|
||||
Comment[bn]=ইন্টারনেটটি অ্যাক্সেস করুন
|
||||
Comment[ca]=Accedeix a Internet
|
||||
Comment[cs]=Přístup k internetu
|
||||
Comment[da]=Få adgang til internettet
|
||||
Comment[de]=Internetzugriff
|
||||
Comment[el]=Πρόσβαση στο Διαδίκτυο
|
||||
Comment[en_GB]=Access the Internet
|
||||
Comment[es]=Accede a Internet.
|
||||
Comment[et]=Pääs Internetti
|
||||
Comment[fi]=Käytä internetiä
|
||||
Comment[fil]=I-access ang Internet
|
||||
Comment[fr]=Accéder à Internet
|
||||
Comment[gu]=ઇંટરનેટ ઍક્સેસ કરો
|
||||
Comment[he]=גישה אל האינטרנט
|
||||
Comment[hi]=इंटरनेट तक पहुंच स्थापित करें
|
||||
Comment[hr]=Pristup Internetu
|
||||
Comment[hu]=Internetelérés
|
||||
Comment[id]=Akses Internet
|
||||
Comment[it]=Accesso a Internet
|
||||
Comment[ja]=インターネットにアクセス
|
||||
Comment[kn]=ಇಂಟರ್ನೆಟ್ ಅನ್ನು ಪ್ರವೇಶಿಸಿ
|
||||
Comment[ko]=인터넷 연결
|
||||
Comment[lt]=Interneto prieiga
|
||||
Comment[lv]=Piekļūt internetam
|
||||
Comment[ml]=ഇന്റര്നെറ്റ് ആക്സസ് ചെയ്യുക
|
||||
Comment[mr]=इंटरनेटमध्ये प्रवेश करा
|
||||
Comment[nb]=Gå til Internett
|
||||
Comment[nl]=Verbinding maken met internet
|
||||
Comment[or]=ଇଣ୍ଟର୍ନେଟ୍ ପ୍ରବେଶ କରନ୍ତୁ
|
||||
Comment[pl]=Skorzystaj z internetu
|
||||
Comment[pt]=Aceder à Internet
|
||||
Comment[pt_BR]=Acessar a internet
|
||||
Comment[ro]=Accesaţi Internetul
|
||||
Comment[ru]=Доступ в Интернет
|
||||
Comment[sk]=Prístup do siete Internet
|
||||
Comment[sl]=Dostop do interneta
|
||||
Comment[sr]=Приступите Интернету
|
||||
Comment[sv]=Gå ut på Internet
|
||||
Comment[ta]=இணையத்தை அணுகுதல்
|
||||
Comment[te]=ఇంటర్నెట్ను ఆక్సెస్ చెయ్యండి
|
||||
Comment[th]=เข้าถึงอินเทอร์เน็ต
|
||||
Comment[tr]=İnternet'e erişin
|
||||
Comment[uk]=Доступ до Інтернету
|
||||
Comment[vi]=Truy cập Internet
|
||||
Comment[zh_CN]=访问互联网
|
||||
Comment[zh_HK]=連線到網際網路
|
||||
Comment[zh_TW]=連線到網際網路
|
||||
Exec=/usr/bin/@@USR_BIN_SYMLINK_NAME@@ --no-default-browser-check --use-gl=desktop --enable-experimental-web-platform-features --new-canvas-2d-api --show-component-extension-options --autoplay-policy=user-gesture-required --enable-features=VaapiVideoDecoder,PageInfoAboutThisSite,ParallelDownloading %U
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Icon=@@PACKAGE@@
|
||||
Type=Application
|
||||
Categories=Network;WebBrowser;
|
||||
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
|
||||
Actions=new-window;new-private-window;content-shell;safe-mode;
|
||||
|
||||
[Desktop Action new-window]
|
||||
Name=New Window
|
||||
Name[am]=አዲስ መስኮት
|
||||
Name[ar]=نافذة جديدة
|
||||
Name[bg]=Нов прозорец
|
||||
Name[bn]=নতুন উইন্ডো
|
||||
Name[ca]=Finestra nova
|
||||
Name[cs]=Nové okno
|
||||
Name[da]=Nyt vindue
|
||||
Name[de]=Neues Fenster
|
||||
Name[el]=Νέο Παράθυρο
|
||||
Name[en_GB]=New Window
|
||||
Name[es]=Nueva ventana
|
||||
Name[et]=Uus aken
|
||||
Name[fa]=پنجره جدید
|
||||
Name[fi]=Uusi ikkuna
|
||||
Name[fil]=New Window
|
||||
Name[fr]=Nouvelle fenêtre
|
||||
Name[gu]=નવી વિંડો
|
||||
Name[hi]=नई विंडो
|
||||
Name[hr]=Novi prozor
|
||||
Name[hu]=Új ablak
|
||||
Name[id]=Jendela Baru
|
||||
Name[it]=Nuova finestra
|
||||
Name[iw]=חלון חדש
|
||||
Name[ja]=新規ウインドウ
|
||||
Name[kn]=ಹೊಸ ವಿಂಡೊ
|
||||
Name[ko]=새 창
|
||||
Name[lt]=Naujas langas
|
||||
Name[lv]=Jauns logs
|
||||
Name[ml]=പുതിയ വിന്ഡോ
|
||||
Name[mr]=नवीन विंडो
|
||||
Name[nl]=Nieuw venster
|
||||
Name[no]=Nytt vindu
|
||||
Name[pl]=Nowe okno
|
||||
Name[pt]=Nova janela
|
||||
Name[pt_BR]=Nova janela
|
||||
Name[ro]=Fereastră nouă
|
||||
Name[ru]=Новое окно
|
||||
Name[sk]=Nové okno
|
||||
Name[sl]=Novo okno
|
||||
Name[sr]=Нови прозор
|
||||
Name[sv]=Nytt fönster
|
||||
Name[sw]=Dirisha Jipya
|
||||
Name[ta]=புதிய சாளரம்
|
||||
Name[te]=క్రొత్త విండో
|
||||
Name[th]=หน้าต่างใหม่
|
||||
Name[tr]=Yeni Pencere
|
||||
Name[uk]=Нове вікно
|
||||
Name[vi]=Cửa sổ Mới
|
||||
Name[zh_CN]=新建窗口
|
||||
Name[zh_TW]=開新視窗
|
||||
Exec=/usr/bin/@@USR_BIN_SYMLINK_NAME@@ --no-default-browser-check --use-gl=desktop --enable-experimental-web-platform-features --new-canvas-2d-api --show-component-extension-options --autoplay-policy=user-gesture-required --enable-features=VaapiVideoDecoder,PageInfoAboutThisSite,ParallelDownloading
|
||||
|
||||
[Desktop Action content-shell]
|
||||
Name=Open Content Shell
|
||||
Exec=/usr/bin/thorium-shell --no-default-browser-check --use-gl=desktop --enable-experimental-web-platform-features --new-canvas-2d-api --show-component-extension-options --autoplay-policy=user-gesture-required --enable-clear-hevc-for-testing --enable-features=VaapiVideoDecoder,PageInfoAboutThisSite,ParallelDownloading
|
||||
|
||||
[Desktop Action safe-mode]
|
||||
Name=Open in Safe Mode
|
||||
Exec=/usr/bin/@@USR_BIN_SYMLINK_NAME@@ --no-default-browser-check --show-component-extension-options --no-experiments %U
|
||||
|
||||
[Desktop Action new-private-window]
|
||||
Name=New Incognito Window
|
||||
Name[ar]=نافذة جديدة للتصفح المتخفي
|
||||
Name[bg]=Нов прозорец „инкогнито“
|
||||
Name[bn]=নতুন ছদ্মবেশী উইন্ডো
|
||||
Name[ca]=Finestra d'incògnit nova
|
||||
Name[cs]=Nové anonymní okno
|
||||
Name[da]=Nyt inkognitovindue
|
||||
Name[de]=Neues Inkognito-Fenster
|
||||
Name[el]=Νέο παράθυρο για ανώνυμη περιήγηση
|
||||
Name[en_GB]=New Incognito window
|
||||
Name[es]=Nueva ventana de incógnito
|
||||
Name[et]=Uus inkognito aken
|
||||
Name[fa]=پنجره جدید حالت ناشناس
|
||||
Name[fi]=Uusi incognito-ikkuna
|
||||
Name[fil]=Bagong Incognito window
|
||||
Name[fr]=Nouvelle fenêtre de navigation privée
|
||||
Name[gu]=નવી છુપી વિંડો
|
||||
Name[hi]=नई गुप्त विंडो
|
||||
Name[hr]=Novi anoniman prozor
|
||||
Name[hu]=Új Inkognitóablak
|
||||
Name[id]=Jendela Penyamaran baru
|
||||
Name[it]=Nuova finestra di navigazione in incognito
|
||||
Name[iw]=חלון חדש לגלישה בסתר
|
||||
Name[ja]=新しいシークレット ウィンドウ
|
||||
Name[kn]=ಹೊಸ ಅಜ್ಞಾತ ವಿಂಡೋ
|
||||
Name[ko]=새 시크릿 창
|
||||
Name[lt]=Naujas inkognito langas
|
||||
Name[lv]=Jauns inkognito režīma logs
|
||||
Name[ml]=പുതിയ വേഷ പ്രച്ഛന്ന വിന്ഡോ
|
||||
Name[mr]=नवीन गुप्त विंडो
|
||||
Name[nl]=Nieuw incognitovenster
|
||||
Name[no]=Nytt inkognitovindu
|
||||
Name[pl]=Nowe okno incognito
|
||||
Name[pt]=Nova janela de navegação anónima
|
||||
Name[pt_BR]=Nova janela anônima
|
||||
Name[ro]=Fereastră nouă incognito
|
||||
Name[ru]=Новое окно в режиме инкогнито
|
||||
Name[sk]=Nové okno inkognito
|
||||
Name[sl]=Novo okno brez beleženja zgodovine
|
||||
Name[sr]=Нови прозор за прегледање без архивирања
|
||||
Name[sv]=Nytt inkognitofönster
|
||||
Name[ta]=புதிய மறைநிலைச் சாளரம்
|
||||
Name[te]=క్రొత్త అజ్ఞాత విండో
|
||||
Name[th]=หน้าต่างใหม่ที่ไม่ระบุตัวตน
|
||||
Name[tr]=Yeni Gizli pencere
|
||||
Name[uk]=Нове вікно в режимі анонімного перегляду
|
||||
Name[vi]=Cửa sổ ẩn danh mới
|
||||
Name[zh_CN]=新建隐身窗口
|
||||
Name[zh_TW]=新增無痕式視窗
|
||||
Exec=/usr/bin/@@USR_BIN_SYMLINK_NAME@@ --incognito --no-default-browser-check --use-gl=desktop --enable-experimental-web-platform-features --new-canvas-2d-api --show-component-extension-options --autoplay-policy=user-gesture-required --enable-features=VaapiVideoDecoder,PageInfoAboutThisSite,ParallelDownloading
|
443
chrome/installer/linux/common/installer.include
Normal file
|
@ -0,0 +1,443 @@
|
|||
# Copyright (c) 2022 Alex313031
|
||||
# Shows the output of a given command only on failure, or when VERBOSE is set.
|
||||
log_cmd() {
|
||||
if [ "${VERBOSE:-}" ]; then
|
||||
"$@"
|
||||
else
|
||||
# Record $- into a separate variable because it gets reset in the subshell.
|
||||
FORWARD_SHELL_OPTS=$-
|
||||
ERREXIT=$(echo ${FORWARD_SHELL_OPTS} | grep -o e || true)
|
||||
set +${ERREXIT}
|
||||
CMD_OUTPUT=$("$@" 2>&1)
|
||||
ERRCODE=$?
|
||||
set -${ERREXIT}
|
||||
if [ ${ERRCODE} -ne 0 ]; then
|
||||
echo "$@"
|
||||
echo "${CMD_OUTPUT}"
|
||||
if [ ${ERREXIT} ]; then
|
||||
exit ${ERRCODE}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Recursively replace @@include@@ template variables with the referenced file,
|
||||
# and write the resulting text to stdout.
|
||||
process_template_includes() {
|
||||
INCSTACK+="$1->"
|
||||
# Includes are relative to the file that does the include.
|
||||
INCDIR=$(dirname $1)
|
||||
# Clear IFS so 'read' doesn't trim whitespace
|
||||
local OLDIFS="$IFS"
|
||||
IFS=''
|
||||
while read -r LINE
|
||||
do
|
||||
INCLINE=$(sed -e '/^[[:space:]]*@@include@@/!d' <<<$LINE)
|
||||
if [ -n "$INCLINE" ]; then
|
||||
INCFILE=$(echo $INCLINE | sed -e "s#@@include@@\(.*\)#\1#")
|
||||
# Simple filename match to detect cyclic includes.
|
||||
CYCLE=$(sed -e "\#$INCFILE#"'!d' <<<$INCSTACK)
|
||||
if [ "$CYCLE" ]; then
|
||||
echo "ERROR: Possible cyclic include detected." 1>&2
|
||||
echo "$INCSTACK$INCFILE" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -r "$INCDIR/$INCFILE" ]; then
|
||||
echo "ERROR: Couldn't read include file: $INCDIR/$INCFILE" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
process_template_includes "$INCDIR/$INCFILE"
|
||||
else
|
||||
echo "$LINE"
|
||||
fi
|
||||
done < "$1"
|
||||
IFS="$OLDIFS"
|
||||
INCSTACK=${INCSTACK%"$1->"}
|
||||
}
|
||||
|
||||
# Replace template variables (@@VARNAME@@) in the given template file. If a
|
||||
# second argument is given, save the processed text to that filename, otherwise
|
||||
# modify the template file in place.
|
||||
process_template() (
|
||||
# Don't worry if some of these substitution variables aren't set.
|
||||
# Note that this function is run in a sub-shell so we don't leak this
|
||||
# setting, since we still want unbound variables to be an error elsewhere.
|
||||
set +u
|
||||
|
||||
local TMPLIN="$1"
|
||||
if [ -z "$2" ]; then
|
||||
local TMPLOUT="$TMPLIN"
|
||||
else
|
||||
local TMPLOUT="$2"
|
||||
fi
|
||||
# Process includes first so included text also gets substitutions.
|
||||
TMPLINCL="$(process_template_includes "$TMPLIN")"
|
||||
sed \
|
||||
-e "s#@@PACKAGE@@#${PACKAGE}#g" \
|
||||
-e "s#@@PACKAGE_ORIG@@#${PACKAGE_ORIG}#g" \
|
||||
-e "s#@@PACKAGE_FILENAME@@#${PACKAGE_FILENAME}#g" \
|
||||
-e "s#@@SNAPNAME@@#${SNAPNAME}#g" \
|
||||
-e "s#@@PROGNAME@@#${PROGNAME}#g" \
|
||||
-e "s#@@CHANNEL@@#${CHANNEL}#g" \
|
||||
-e "s#@@COMPANY_FULLNAME@@#${COMPANY_FULLNAME}#g" \
|
||||
-e "s#@@VERSION@@#${VERSION}#g" \
|
||||
-e "s#@@PACKAGE_RELEASE@@#${PACKAGE_RELEASE}#g" \
|
||||
-e "s#@@VERSIONFULL@@#${VERSIONFULL}#g" \
|
||||
-e "s#@@INSTALLDIR@@#${INSTALLDIR}#g" \
|
||||
-e "s#@@BUILDDIR@@#${OUTPUTDIR}#g" \
|
||||
-e "s#@@STAGEDIR@@#${STAGEDIR}#g" \
|
||||
-e "s#@@SCRIPTDIR@@#${SCRIPTDIR}#g" \
|
||||
-e "s#@@ENROLLMENTDIR@@#${ENROLLMENTDIR}#g" \
|
||||
-e "s#@@MENUNAME@@#${MENUNAME}#g" \
|
||||
-e "s#@@PRODUCTURL@@#${PRODUCTURL}#g" \
|
||||
-e "s#@@PREDEPENDS@@#${PREDEPENDS}#g" \
|
||||
-e "s#@@DEPENDS@@#${DEPENDS}#g" \
|
||||
-e "s#@@RECOMMENDS@@#${RECOMMENDS}#g" \
|
||||
-e "s#@@PROVIDES@@#${PROVIDES}#g" \
|
||||
-e "s#@@ARCHITECTURE@@#${ARCHITECTURE}#g" \
|
||||
-e "s#@@MAINTNAME@@#${MAINTNAME}#g" \
|
||||
-e "s#@@MAINTMAIL@@#${MAINTMAIL}#g" \
|
||||
-e "s#@@REPOCONFIG@@#${REPOCONFIG}#g" \
|
||||
-e "s#@@REPOCONFIGREGEX@@#${REPOCONFIGREGEX}#g" \
|
||||
-e "s#@@SHORTDESC@@#${SHORTDESC}#g" \
|
||||
-e "s#@@FULLDESC@@#${FULLDESC}#g" \
|
||||
-e "s#@@USR_BIN_SYMLINK_NAME@@#${USR_BIN_SYMLINK_NAME:-}#g" \
|
||||
-e "s#@@LOGO_RESOURCES_PNG@@#${LOGO_RESOURCES_PNG}#g" \
|
||||
-e "s#@@LOGO_RESOURCE_XPM@@#${LOGO_RESOURCE_XPM}#g" \
|
||||
-e "s#@@DATE_RFC5322@@#$(date --rfc-email)#g" \
|
||||
> "$TMPLOUT" <<< "$TMPLINCL"
|
||||
)
|
||||
|
||||
# Setup the installation directory hierarchy in the package staging area.
|
||||
prep_staging_common() {
|
||||
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}" \
|
||||
"${STAGEDIR}/usr/bin" \
|
||||
"${STAGEDIR}/usr/share/applications" \
|
||||
"${STAGEDIR}/usr/share/appdata" \
|
||||
"${STAGEDIR}/usr/share/gnome-control-center/default-apps" \
|
||||
"${STAGEDIR}/usr/share/man/man1"
|
||||
}
|
||||
|
||||
get_version_info() {
|
||||
source "${OUTPUTDIR}/installer/version.txt"
|
||||
VERSION="${MAJOR}.${MINOR}.${BUILD}.${PATCH}"
|
||||
# TODO(phajdan.jr): Provide a mechanism to pass a different package
|
||||
# release number if needed. The meaning of it is to bump it for
|
||||
# packaging-only changes while the underlying software has the same version.
|
||||
# This corresponds to the Release field in RPM spec files and debian_revision
|
||||
# component of the Version field for DEB control file.
|
||||
# Generally with Chrome's fast release cycle it'd be more hassle to try
|
||||
# to bump this number between releases.
|
||||
PACKAGE_RELEASE="1"
|
||||
}
|
||||
|
||||
stage_install_common() {
|
||||
log_cmd echo "Staging common install files in '${STAGEDIR}'..."
|
||||
|
||||
# Note: Changes here may also need to be applied to ChromeOS's
|
||||
# chromite/lib/chrome_util.py.
|
||||
|
||||
# Note: This only supports static binaries and does not work when the GN
|
||||
# is_component_build flag is true.
|
||||
|
||||
# app
|
||||
STRIPPEDFILE="${OUTPUTDIR}/${PROGNAME}.stripped"
|
||||
install -m 755 "${STRIPPEDFILE}" "${STAGEDIR}/${INSTALLDIR}/${PROGNAME}"
|
||||
|
||||
# crashpad
|
||||
strippedfile="${OUTPUTDIR}/chrome_crashpad_handler.stripped"
|
||||
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/chrome_crashpad_handler"
|
||||
|
||||
# Final permissions for the chrome-management-service will be set in
|
||||
# postinst chrome_management_service_setup().
|
||||
strippedfile="${OUTPUTDIR}/chrome_management_service.stripped"
|
||||
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/chrome-management-service"
|
||||
|
||||
# resources
|
||||
install -m 644 "${OUTPUTDIR}/resources.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
# TODO(mmoss): This has broken a couple times on adding new .pak files. Maybe
|
||||
# we should flag all installer files in FILES.cfg and get them from there, so
|
||||
# there's only one place people need to keep track of such things (and in
|
||||
# only the public repository).
|
||||
if [ -r "${OUTPUTDIR}/chrome_100_percent.pak" ]; then
|
||||
install -m 644 "${OUTPUTDIR}/chrome_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/chrome_200_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/content_shell.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/shell_resources.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/ui_resources_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 755 "${OUTPUTDIR}/content_shell" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/libffmpeg.so" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/thorium-devtools.png" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/thorium-shell.desktop" "${STAGEDIR}/usr/share/applications/"
|
||||
install -m 755 "${OUTPUTDIR}/thorium-shell" "${STAGEDIR}/usr/bin/"
|
||||
install -m 755 "${OUTPUTDIR}/chromedriver" "${STAGEDIR}/usr/bin/"
|
||||
install -m 755 "${OUTPUTDIR}/pak" "${STAGEDIR}/usr/bin/"
|
||||
else
|
||||
install -m 644 "${OUTPUTDIR}/theme_resources_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
install -m 644 "${OUTPUTDIR}/ui_resources_100_percent.pak" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
fi
|
||||
|
||||
# ICU data file; Necessary when the GN icu_use_data_file flag is true.
|
||||
install -m 644 "${OUTPUTDIR}/icudtl.dat" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
|
||||
# V8 snapshot files; Necessary when the GN v8_use_external_startup_data flag
|
||||
# is true.
|
||||
# Use v8_context_snapshot.bin instead of snapshot_blob.bin if it is available.
|
||||
# TODO(crbug.com/764576): Unship snapshot_blob.bin on ChromeOS and drop this branch
|
||||
if [ -f "${OUTPUTDIR}/v8_context_snapshot.bin" ]; then
|
||||
install -m 644 "${OUTPUTDIR}/v8_context_snapshot.bin" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
else
|
||||
install -m 644 "${OUTPUTDIR}/snapshot_blob.bin" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
fi
|
||||
|
||||
# sandbox
|
||||
# Rename sandbox binary with hyphen instead of underscore because that's what
|
||||
# the code looks for. Originally, the SCons build system may have had a bug
|
||||
# where it did not support hyphens, so this is stuck as is to avoid breaking
|
||||
# anyone who expects the build artifact to have the underscore.
|
||||
# the code looks for, but the build targets can't use hyphens (scons bug?)
|
||||
strippedfile="${OUTPUTDIR}/${PROGNAME}_sandbox.stripped"
|
||||
install -m 4755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/chrome-sandbox"
|
||||
|
||||
# l10n paks
|
||||
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/locales/"
|
||||
find "${OUTPUTDIR}/locales" -type f -name '*.pak' -exec \
|
||||
cp -a '{}' "${STAGEDIR}/${INSTALLDIR}/locales/" \;
|
||||
find "${STAGEDIR}/${INSTALLDIR}/locales" -type f -exec chmod 644 '{}' \;
|
||||
|
||||
# TODO(https://crbug.com/1077934): The below conditions check for the
|
||||
# existence of files to determine if they should be copied to the staging
|
||||
# directory. However, these may be stale if the build config no longer
|
||||
# builds these files. The build config should be obtained from gn rather than
|
||||
# guessed based on the presence of files.
|
||||
|
||||
# MEI Preload
|
||||
if [ -f "${OUTPUTDIR}/MEIPreload/manifest.json" ]; then
|
||||
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/MEIPreload/"
|
||||
install -m 644 "${OUTPUTDIR}/MEIPreload/manifest.json" "${STAGEDIR}/${INSTALLDIR}/MEIPreload/"
|
||||
install -m 644 "${OUTPUTDIR}/MEIPreload/preloaded_data.pb" "${STAGEDIR}/${INSTALLDIR}/MEIPreload/"
|
||||
fi
|
||||
|
||||
# Widevine CDM.
|
||||
if [ -d "${OUTPUTDIR}/WidevineCdm" ]; then
|
||||
# No need to strip; libwidevinecdm.so starts out stripped.
|
||||
cp -a "${OUTPUTDIR}/WidevineCdm" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
find "${STAGEDIR}/${INSTALLDIR}/WidevineCdm" -type d -exec chmod 755 '{}' \;
|
||||
find "${STAGEDIR}/${INSTALLDIR}/WidevineCdm" -type f -exec chmod 644 '{}' \;
|
||||
find "${STAGEDIR}/${INSTALLDIR}/WidevineCdm" -name libwidevinecdm.so \
|
||||
-exec chmod ${SHLIB_PERMS} '{}' \;
|
||||
fi
|
||||
|
||||
# ANGLE
|
||||
if [ -f "${OUTPUTDIR}/libEGL.so" ]; then
|
||||
for file in libEGL.so libGLESv2.so; do
|
||||
strippedfile="${OUTPUTDIR}/${file}.stripped"
|
||||
install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
|
||||
done
|
||||
fi
|
||||
|
||||
# ANGLE's libvulkan library
|
||||
if [ -f "${OUTPUTDIR}/libvulkan.so.1" ]; then
|
||||
file="libvulkan.so.1"
|
||||
strippedfile="${OUTPUTDIR}/${file}.stripped"
|
||||
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
|
||||
fi
|
||||
|
||||
# SwiftShader VK
|
||||
if [ -f "${OUTPUTDIR}/libvk_swiftshader.so" ]; then
|
||||
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/"
|
||||
file="libvk_swiftshader.so"
|
||||
strippedfile="${OUTPUTDIR}/${file}.stripped"
|
||||
install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
|
||||
# Install the ICD json file to point ANGLE to libvk_swiftshader.so
|
||||
install -m 644 "${OUTPUTDIR}/vk_swiftshader_icd.json" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
fi
|
||||
|
||||
# Optimization Guide Internal
|
||||
if [ -f "${OUTPUTDIR}/liboptimization_guide_internal.so" ]; then
|
||||
file="liboptimization_guide_internal.so"
|
||||
strippedfile="${OUTPUTDIR}/${file}.stripped"
|
||||
install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
|
||||
fi
|
||||
|
||||
# libc++
|
||||
if [ -f "${OUTPUTDIR}/lib/libc++.so" ]; then
|
||||
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/lib/"
|
||||
install -m ${SHLIB_PERMS} -s "${OUTPUTDIR}/lib/libc++.so" "${STAGEDIR}/${INSTALLDIR}/lib/"
|
||||
fi
|
||||
|
||||
# nacl_helper and nacl_helper_bootstrap
|
||||
# Don't use "-s" (strip) because this runs binutils "strip", which
|
||||
# mangles the special ELF program headers of nacl_helper_bootstrap.
|
||||
# Explicitly use eu-strip instead, because it doesn't have that problem.
|
||||
for file in nacl_helper nacl_helper_bootstrap; do
|
||||
buildfile="${OUTPUTDIR}/${file}"
|
||||
if [ -f "${buildfile}" ]; then
|
||||
strippedfile="${buildfile}.stripped"
|
||||
install -m 755 "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/${file}"
|
||||
fi
|
||||
done
|
||||
# Don't use "-s" (strip) because this would use the Linux toolchain to
|
||||
# strip the NaCl binary, which has the potential to break it. It
|
||||
# certainly resets the OSABI and ABIVERSION fields to non-NaCl values,
|
||||
# although the NaCl IRT loader doesn't care about these fields. In any
|
||||
# case, the IRT binaries are already stripped by NaCl's build process.
|
||||
for filename in ${OUTPUTDIR}/nacl_irt_*.nexe; do
|
||||
# Re-check the filename in case globbing matched nothing.
|
||||
if [ -f "$filename" ]; then
|
||||
install -m 644 "$filename" "${STAGEDIR}/${INSTALLDIR}/`basename "$filename"`"
|
||||
fi
|
||||
done
|
||||
|
||||
# default apps
|
||||
if [ -d "${OUTPUTDIR}/default_apps" ]; then
|
||||
cp -a "${OUTPUTDIR}/default_apps" "${STAGEDIR}/${INSTALLDIR}/"
|
||||
find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type d -exec chmod 755 '{}' \;
|
||||
find "${STAGEDIR}/${INSTALLDIR}/default_apps" -type f -exec chmod 644 '{}' \;
|
||||
fi
|
||||
|
||||
# launcher script and symlink
|
||||
process_template "${OUTPUTDIR}/installer/common/wrapper" \
|
||||
"${STAGEDIR}/${INSTALLDIR}/${PACKAGE}"
|
||||
chmod 755 "${STAGEDIR}/${INSTALLDIR}/${PACKAGE}"
|
||||
if [ ! -z "${PACKAGE_ORIG}" ]; then
|
||||
if [ ! -f "${STAGEDIR}/${INSTALLDIR}/${PACKAGE_ORIG}" ]; then
|
||||
ln -sn "${INSTALLDIR}/${PACKAGE}" \
|
||||
"${STAGEDIR}/${INSTALLDIR}/${PACKAGE_ORIG}"
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "${USR_BIN_SYMLINK_NAME}" ]; then
|
||||
ln -snf "${INSTALLDIR}/${PACKAGE}" \
|
||||
"${STAGEDIR}/usr/bin/${USR_BIN_SYMLINK_NAME}"
|
||||
fi
|
||||
|
||||
# app icons
|
||||
local icon_regex=".*product_logo_[0-9]\+\."
|
||||
if [ "$BRANDING" = "google_chrome" ]; then
|
||||
if [ "$CHANNEL" = "beta" ]; then
|
||||
icon_regex=".*product_logo_[0-9]\+_beta\."
|
||||
elif [ "$CHANNEL" = "unstable" ]; then
|
||||
icon_regex=".*product_logo_[0-9]\+_dev\."
|
||||
fi
|
||||
fi
|
||||
LOGO_RESOURCES_PNG=$(find "${OUTPUTDIR}/installer/theme/" \
|
||||
-regextype sed -regex "${icon_regex}png" -printf "%f ")
|
||||
LOGO_RESOURCE_XPM=$(find "${OUTPUTDIR}/installer/theme/" \
|
||||
-regextype sed -regex "${icon_regex}xpm" -printf "%f")
|
||||
for logo in ${LOGO_RESOURCES_PNG} ${LOGO_RESOURCE_XPM}; do
|
||||
install -m 644 \
|
||||
"${OUTPUTDIR}/installer/theme/${logo}" \
|
||||
"${STAGEDIR}/${INSTALLDIR}/"
|
||||
done
|
||||
|
||||
# desktop integration
|
||||
install -m 755 "${OUTPUTDIR}/xdg-mime" "${STAGEDIR}${INSTALLDIR}/"
|
||||
install -m 755 "${OUTPUTDIR}/xdg-settings" "${STAGEDIR}${INSTALLDIR}/"
|
||||
|
||||
if [ ${PACKAGE:0:6} = google ]; then
|
||||
process_template "${OUTPUTDIR}/installer/common/google-chrome.appdata.xml.template" \
|
||||
"${STAGEDIR}/usr/share/appdata/${PACKAGE}.appdata.xml"
|
||||
chmod 644 "${STAGEDIR}/usr/share/appdata/${PACKAGE}.appdata.xml"
|
||||
else
|
||||
install -m 644 "${OUTPUTDIR}/installer/common/chromium-browser.appdata.xml" \
|
||||
"${STAGEDIR}/usr/share/appdata/${PACKAGE}.appdata.xml"
|
||||
fi
|
||||
|
||||
process_template "${OUTPUTDIR}/installer/common/desktop.template" \
|
||||
"${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop"
|
||||
chmod 644 "${STAGEDIR}/usr/share/applications/${PACKAGE}.desktop"
|
||||
process_template "${OUTPUTDIR}/installer/common/default-app.template" \
|
||||
"${STAGEDIR}/usr/share/gnome-control-center/default-apps/${PACKAGE}.xml"
|
||||
chmod 644 "${STAGEDIR}/usr/share/gnome-control-center/default-apps/${PACKAGE}.xml"
|
||||
process_template "${OUTPUTDIR}/installer/common/default-app-block.template" \
|
||||
"${STAGEDIR}${INSTALLDIR}/default-app-block"
|
||||
chmod 644 "${STAGEDIR}${INSTALLDIR}/default-app-block"
|
||||
|
||||
# documentation
|
||||
process_template "${OUTPUTDIR}/installer/common/manpage.1.in" \
|
||||
"${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1"
|
||||
gzip -9n "${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1"
|
||||
chmod 644 "${STAGEDIR}/usr/share/man/man1/${USR_BIN_SYMLINK_NAME}.1.gz"
|
||||
# The stable channel allows launching the app without the "-stable"
|
||||
# suffix like the other channels. Create a linked man page for the
|
||||
# app-without-the-channel case.
|
||||
if [ ! -f "${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1.gz" ]; then
|
||||
ln -s "${USR_BIN_SYMLINK_NAME}.1.gz" \
|
||||
"${STAGEDIR}/usr/share/man/man1/${PACKAGE}.1.gz"
|
||||
fi
|
||||
|
||||
# Check to make sure all the ELF binaries are stripped.
|
||||
UNSTRIPPED=$(find "${STAGEDIR}/${INSTALLDIR}/" -type f | xargs file |
|
||||
grep ELF | grep -c "not stripped" || true)
|
||||
if [ "${UNSTRIPPED}" != "0" ]; then
|
||||
echo "NOTICE: Found ${UNSTRIPPED} unstripped ELF files." 1>&2
|
||||
fi
|
||||
|
||||
# Check to make sure no ELF binaries set RPATH.
|
||||
if [ "${TARGET_OS}" != "chromeos" ]; then
|
||||
RPATH_BINS=
|
||||
for elf in $(find "${STAGEDIR}/${INSTALLDIR}/" -type f | xargs file |
|
||||
grep ELF | awk '{print $1;}' | sed 's/:$//'); do
|
||||
if readelf -d ${elf} | grep "(RPATH)" >/dev/null; then
|
||||
RPATH_BINS="${RPATH_BINS} $(basename ${elf})"
|
||||
fi
|
||||
done
|
||||
if [ -n "${RPATH_BINS}" ]; then
|
||||
echo "NOTICE: Found binaries with RPATH set:${RPATH_BINS}" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make sure ELF binaries live in INSTALLDIR exclusively.
|
||||
ELF_OUTSIDE_INSTALLDIR=$(find "${STAGEDIR}/" -not -path \
|
||||
"${STAGEDIR}${INSTALLDIR}/*" -type f | xargs file -b |
|
||||
grep -ce "^ELF" || true)
|
||||
if [ "${ELF_OUTSIDE_INSTALLDIR}" -ne 0 ]; then
|
||||
echo "NOTICE: Found ${ELF_OUTSIDE_INSTALLDIR} ELF binaries" \
|
||||
"outside of ${INSTALLDIR}" 1>&2
|
||||
fi
|
||||
|
||||
# Verify file permissions.
|
||||
for file in $(find "${STAGEDIR}" -mindepth 1); do
|
||||
local actual_perms=$(stat -c "%a" "${file}")
|
||||
local file_type="$(file -b "${file}")"
|
||||
local base_name=$(basename "${file}")
|
||||
if [[ "${file_type}" = "directory"* ]]; then
|
||||
local expected_perms=755
|
||||
elif [[ "${file_type}" = *"symbolic link"* ]]; then
|
||||
if [[ "$(readlink ${file})" = "/"* ]]; then
|
||||
# Absolute symlink.
|
||||
local expect_exists="${STAGEDIR}/$(readlink "${file}")"
|
||||
else
|
||||
# Relative symlink.
|
||||
local expect_exists="$(dirname "${file}")/$(readlink "${file}")"
|
||||
fi
|
||||
if [ ! -f "${expect_exists}" ]; then
|
||||
echo "Broken symlink: ${file}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
local expected_perms=777
|
||||
elif [ "${base_name}" = "chrome-management-service" ]; then
|
||||
local expected_perms=755
|
||||
elif [ "${base_name}" = "chrome-sandbox" ]; then
|
||||
local expected_perms=4755
|
||||
elif [[ "${base_name}" = "nacl_irt_"*".nexe" ]]; then
|
||||
local expected_perms=644
|
||||
elif [[ "${file_type}" = *"shell script"* ]]; then
|
||||
local expected_perms=755
|
||||
elif [[ "${file_type}" = ELF* ]]; then
|
||||
if [[ "${base_name}" = *".so" ]]; then
|
||||
local expected_perms=${SHLIB_PERMS}
|
||||
else
|
||||
local expected_perms=755
|
||||
fi
|
||||
else
|
||||
# Regular data file.
|
||||
local expected_perms=644
|
||||
fi
|
||||
if [ ${expected_perms} -ne ${actual_perms} ]; then
|
||||
echo Expected permissions on ${base_name} to be \
|
||||
${expected_perms}, but they were ${actual_perms} 1>&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
}
|
49
chrome/installer/linux/common/wrapper
Normal file
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
# Let the wrapped binary know that it has been run through the wrapper.
|
||||
export CHROME_WRAPPER="`readlink -f "$0"`"
|
||||
|
||||
HERE="`dirname "$CHROME_WRAPPER"`"
|
||||
|
||||
# We include some xdg utilities next to the binary, and we want to prefer them
|
||||
# over the system versions when we know the system versions are very old. We
|
||||
# detect whether the system xdg utilities are sufficiently new to be likely to
|
||||
# work for us by looking for xdg-settings. If we find it, we leave $PATH alone,
|
||||
# so that the system xdg utilities (including any distro patches) will be used.
|
||||
if ! command -v xdg-settings &> /dev/null; then
|
||||
# Old xdg utilities. Prepend $HERE to $PATH to use ours instead.
|
||||
export PATH="$HERE:$PATH"
|
||||
else
|
||||
# Use system xdg utilities. But first create mimeapps.list if it doesn't
|
||||
# exist; some systems have bugs in xdg-mime that make it fail without it.
|
||||
xdg_app_dir="${XDG_DATA_HOME:-$HOME/.local/share/applications}"
|
||||
mkdir -p "$xdg_app_dir"
|
||||
[ -f "$xdg_app_dir/mimeapps.list" ] || touch "$xdg_app_dir/mimeapps.list"
|
||||
fi
|
||||
|
||||
# Always use our versions of ffmpeg libs.
|
||||
# This also makes RPMs find the compatibly-named library symlinks.
|
||||
if [[ -n "$LD_LIBRARY_PATH" ]]; then
|
||||
LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH"
|
||||
else
|
||||
LD_LIBRARY_PATH="$HERE:$HERE/lib"
|
||||
fi
|
||||
export LD_LIBRARY_PATH
|
||||
|
||||
export CHROME_VERSION_EXTRA="@@CHANNEL@@"
|
||||
|
||||
# We don't want bug-buddy intercepting our crashes. http://crbug.com/24120
|
||||
export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
|
||||
|
||||
# Sanitize std{in,out,err} because they'll be shared with untrusted child
|
||||
# processes (http://crbug.com/376567).
|
||||
exec < /dev/null
|
||||
exec > >(exec cat)
|
||||
exec 2> >(exec cat >&2)
|
||||
|
||||
# Note: exec -a below is a bashism.
|
||||
exec -a "$0" "$HERE/@@PROGNAME@@" --no-default-browser-check --use-gl=desktop --enable-experimental-web-platform-features --new-canvas-2d-api --show-component-extension-options --autoplay-policy=user-gesture-required --enable-features=VaapiVideoDecoder,PageInfoAboutThisSite,ParallelDownloading "$@"
|
6
chrome/installer/linux/debian/debian.menu
Normal file
|
@ -0,0 +1,6 @@
|
|||
?package(@@USR_BIN_SYMLINK_NAME@@):needs="x11" \
|
||||
section="Applications/Network/Web Browsing" \
|
||||
hints="Web browsers" \
|
||||
title="Thorium Browser" \
|
||||
icon="@@INSTALLDIR@@/product_logo_32.png" \
|
||||
command="@@INSTALLDIR@@/@@PACKAGE@@"
|
21
chrome/installer/linux/debian/manual_recommends
Normal file
|
@ -0,0 +1,21 @@
|
|||
# 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.
|
||||
#
|
||||
# Recommended dependencies not in the dpkg-shlibdeps output.
|
||||
|
||||
# u2f udev rules have moved from being installed by default by systemd on Debian
|
||||
# systems to a separate package called libu2f-udev. Pull it in manually so that
|
||||
# u2f keys will work. TODO(https://crbug.com/784010): Move this to "Depends"
|
||||
# once support for Jessie, Stretch, Trusty, and Xenial are dropped.
|
||||
libu2f-udev
|
||||
|
||||
# Try to use Vulkan when possible. libvulkan1 is not available on Ubuntu Trusty
|
||||
# or Debian Jessie, so it is added to "Recommends" instead of "Depends".
|
||||
# TODO(https://crbug.com/784010): Move this to "Depends" once support for
|
||||
# Trusty and Jessie are dropped. Note that the dependency must still be manually
|
||||
# added since the library is dlopen()'ed.
|
||||
libvulkan1
|
||||
|
||||
#Add unrar for unrar support
|
||||
unrar
|
70
chrome/installer/linux/debian/postinst
Normal file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
set -e
|
||||
|
||||
@@include@@../common/variables.include
|
||||
|
||||
@@include@@../common/postinst.include
|
||||
|
||||
# Add to the alternatives system
|
||||
#
|
||||
# On Ubuntu 12.04, we have the following priorities
|
||||
# (which can be obtain be installing browsers and running
|
||||
# update-alternatives --query x-www-browser):
|
||||
#
|
||||
# /usr/bin/epiphany-browser 85
|
||||
# /usr/bin/firefox 40
|
||||
# /usr/bin/konqueror 30
|
||||
#
|
||||
# While we would expect these values to be keyed off the most popular
|
||||
# browser (Firefox), in practice, we treat Epiphany as the lower bound,
|
||||
# resulting in the following scheme:
|
||||
|
||||
CHANNEL=@@CHANNEL@@
|
||||
case $CHANNEL in
|
||||
stable )
|
||||
# Good enough to be the default.
|
||||
PRIORITY=200
|
||||
;;
|
||||
beta )
|
||||
# Almost good enough to be the default. (Firefox stable should arguably be
|
||||
# higher than this, but since that's below the "Epiphany threshold", we're
|
||||
# not setting our priority below it. Anyone want to poke Firefox to raise
|
||||
# their priority?)
|
||||
PRIORITY=150
|
||||
;;
|
||||
unstable )
|
||||
# Unstable, give it the "lowest" priority.
|
||||
PRIORITY=150
|
||||
;;
|
||||
* )
|
||||
PRIORITY=150
|
||||
;;
|
||||
esac
|
||||
|
||||
update-alternatives --install /usr/bin/x-www-browser x-www-browser \
|
||||
/usr/bin/@@USR_BIN_SYMLINK_NAME@@ $PRIORITY
|
||||
update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser \
|
||||
/usr/bin/@@USR_BIN_SYMLINK_NAME@@ $PRIORITY
|
||||
|
||||
update-alternatives --install /usr/bin/@@PACKAGE_ORIG@@ @@PACKAGE_ORIG@@ \
|
||||
/usr/bin/@@USR_BIN_SYMLINK_NAME@@ $PRIORITY
|
||||
|
||||
@@include@@../common/apt.include
|
||||
|
||||
@@include@@../common/symlinks.include
|
||||
|
||||
remove_udev_symlinks
|
||||
|
||||
## MAIN ##
|
||||
if [ ! -e "$DEFAULTS_FILE" ]; then
|
||||
echo 'repo_add_once="true"' > "$DEFAULTS_FILE"
|
||||
echo 'repo_reenable_on_distupgrade="true"' >> "$DEFAULTS_FILE"
|
||||
fi
|
||||
|
||||
# Run the cron job immediately to perform repository configuration.
|
||||
nohup sh /etc/cron.daily/@@PACKAGE@@ > /dev/null 2>&1 &
|
35
chrome/installer/linux/debian/postrm
Normal file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
set -e
|
||||
|
||||
action="$1"
|
||||
|
||||
# Only do complete clean-up on purge.
|
||||
if [ "$action" != "purge" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@include@@../common/variables.include
|
||||
|
||||
@@include@@../common/apt.include
|
||||
|
||||
@@include@@../common/symlinks.include
|
||||
|
||||
remove_udev_symlinks
|
||||
|
||||
# Only remove the defaults file if it is not empty. An empty file was probably
|
||||
# put there by the sysadmin to disable automatic repository configuration, as
|
||||
# per the instructions on the package download page.
|
||||
if [ -s "$DEFAULTS_FILE" ]; then
|
||||
# Make sure the package defaults are removed before the repository config,
|
||||
# otherwise it could result in the repository config being removed, but the
|
||||
# package defaults remain and are set to not recreate the repository config.
|
||||
# In that case, future installs won't recreate it and won't get auto-updated.
|
||||
rm "$DEFAULTS_FILE" || exit 1
|
||||
fi
|
||||
# Remove any Google repository added by the package.
|
||||
uninstall_key
|
121
chrome/installer/mini_installer/chrome.release
Normal file
|
@ -0,0 +1,121 @@
|
|||
# Copyright (c) 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
[GENERAL]
|
||||
#
|
||||
# Chrome Application dir entries, sorted alphabetically.
|
||||
#
|
||||
chrome.exe: %(ChromeDir)s\
|
||||
chrome_proxy.exe: %(ChromeDir)s\
|
||||
#
|
||||
# Chrome version dir assembly manifest.
|
||||
# The name of this file must match the name of the version dir, so we cannot
|
||||
# hard-code it.
|
||||
# // TODO(caitkp): Find a way to do this without wildcards.
|
||||
#
|
||||
*.*.*.*.manifest: %(VersionDir)s\
|
||||
#
|
||||
# Chrome version dir entries, sorted alphabetically.
|
||||
#
|
||||
chrome.dll: %(VersionDir)s\
|
||||
chrome_100_percent.pak: %(VersionDir)s\
|
||||
thorium-devtools.png: %(VersionDir)s\
|
||||
thorium-devtools.ico: %(VersionDir)s\
|
||||
chromedriver.exe: %(VersionDir)s\
|
||||
chromedriver.lib: %(VersionDir)s\
|
||||
chrome_child.dll: %(VersionDir)s\
|
||||
chrome_elf.dll: %(VersionDir)s\
|
||||
chrome_pwa_launcher.exe: %(VersionDir)s\
|
||||
content_shell.exe: %(VersionDir)s\
|
||||
content_shell.pak: %(VersionDir)s\
|
||||
d3dcompiler_47.dll: %(VersionDir)s\
|
||||
eventlog_provider.dll: %(VersionDir)s\
|
||||
icudtl.dat: %(VersionDir)s\
|
||||
libEGL.dll: %(VersionDir)s\
|
||||
libGLESv2.dll: %(VersionDir)s\
|
||||
mojo_core.dll: %(VersionDir)s\
|
||||
nacl64.exe: %(VersionDir)s\
|
||||
nacl_irt_x86_32.nexe: %(VersionDir)s\
|
||||
nacl_irt_x86_64.nexe: %(VersionDir)s\
|
||||
notification_helper.exe: %(VersionDir)s\
|
||||
optimization_guide_internal.dll: %(VersionDir)s\
|
||||
resources.pak: %(VersionDir)s\
|
||||
shell_resources.pak: %(VersionDir)s\
|
||||
ui_resources_100_percent.pak: %(VersionDir)s\
|
||||
vk_swiftshader.dll: %(VersionDir)s\
|
||||
vk_swiftshader_icd.json: %(VersionDir)s\
|
||||
vulkan-1.dll: %(VersionDir)s\
|
||||
v8_context_snapshot.bin: %(VersionDir)s\
|
||||
#
|
||||
# Add pak to Thorium.
|
||||
#
|
||||
pack.bat: %(VersionDir)s\
|
||||
unpack.bat: %(VersionDir)s\
|
||||
pak_mingw32.exe: %(VersionDir)s\
|
||||
pak_mingw64.exe: %(VersionDir)s\
|
||||
#
|
||||
# Sub directories living in the version dir
|
||||
#
|
||||
Extensions\*.*: %(VersionDir)s\Extensions\
|
||||
locales\*.pak: %(VersionDir)s\Locales
|
||||
|
||||
#
|
||||
# VisualElements sub-dir.
|
||||
#
|
||||
# All or none of the *Logo*.png files need to be present as the creation of
|
||||
# VisualElementsManifest.xml is based on the existence of
|
||||
# %(VersionDir)\VisualElements.
|
||||
Logo.png: %(VersionDir)s\VisualElements\
|
||||
SmallLogo.png: %(VersionDir)s\VisualElements\
|
||||
|
||||
#
|
||||
# MEI Preload sub dir
|
||||
#
|
||||
MEIPreload\manifest.json: %(VersionDir)s\MEIPreload\
|
||||
MEIPreload\preloaded_data.pb: %(VersionDir)s\MEIPreload\
|
||||
|
||||
[HIDPI]
|
||||
chrome_200_percent.pak: %(VersionDir)s\
|
||||
Logo.png: %(VersionDir)s\
|
||||
|
||||
[FFMPEG]
|
||||
ffmpeg.dll: %(VersionDir)s\
|
||||
|
||||
[TOUCH]
|
||||
|
||||
[GOOGLE_CHROME]
|
||||
# The elevation service is only installed for Google Chrome builds.
|
||||
elevation_service.exe: %(VersionDir)s\
|
||||
|
||||
#
|
||||
# Sub directories living in the version dir
|
||||
#
|
||||
default_apps\*.crx: %(VersionDir)s\default_apps\
|
||||
default_apps\external_extensions.json: %(VersionDir)s\default_apps\
|
||||
|
||||
#
|
||||
# VisualElements sub-dir.
|
||||
#
|
||||
LogoBeta.png: %(VersionDir)s\VisualElements\
|
||||
LogoCanary.png: %(VersionDir)s\VisualElements\
|
||||
LogoDev.png: %(VersionDir)s\VisualElements\
|
||||
SmallLogoBeta.png: %(VersionDir)s\VisualElements\
|
||||
SmallLogoCanary.png: %(VersionDir)s\VisualElements\
|
||||
SmallLogoDev.png: %(VersionDir)s\VisualElements\
|
||||
|
||||
#
|
||||
# Widevine CDM sub-dir
|
||||
#
|
||||
WidevineCdm\manifest.json: %(VersionDir)s\WidevineCdm\
|
||||
WidevineCdm\LICENSE: %(VersionDir)s\WidevineCdm\
|
||||
WidevineCdm\_platform_specific\win_x86\widevinecdm.dll: %(VersionDir)s\WidevineCdm\_platform_specific\win_x86\
|
||||
WidevineCdm\_platform_specific\win_x86\widevinecdm.dll.sig: %(VersionDir)s\WidevineCdm\_platform_specific\win_x86\
|
||||
WidevineCdm\_platform_specific\win_x64\widevinecdm.dll: %(VersionDir)s\WidevineCdm\_platform_specific\win_x64\
|
||||
WidevineCdm\_platform_specific\win_x64\widevinecdm.dll.sig: %(VersionDir)s\WidevineCdm\_platform_specific\win_x64\
|
||||
|
||||
[SNAPSHOTBLOB]
|
||||
# The snapshot_blob.bin V8 snapshot is needed in builds that don't use
|
||||
# v8_context_snapshot.bin, such as Linux-Windows cross-builds.
|
||||
# It has its own section here so that it's only included when necessary.
|
||||
snapshot_blob.bin: %(VersionDir)s\
|
72
chrome/installer/mini_installer/mini_installer_exe_main.cc
Normal file
|
@ -0,0 +1,72 @@
|
|||
// Copyright 2021 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "base/clang_profiling_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "chrome/installer/mini_installer/mini_installer.h"
|
||||
|
||||
// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
extern "C" int __stdcall MainEntryPoint() {
|
||||
mini_installer::ProcessExitResult result =
|
||||
mini_installer::WMain(reinterpret_cast<HMODULE>(&__ImageBase));
|
||||
::ExitProcess(result.exit_code);
|
||||
}
|
||||
|
||||
#if defined(ADDRESS_SANITIZER) || BUILDFLAG(CLANG_PROFILING)
|
||||
// Executables instrumented with ASAN need CRT functions. We do not use
|
||||
// the /ENTRY switch for ASAN instrumented executable and a "main" function
|
||||
// is required.
|
||||
extern "C" int WINAPI wWinMain(HINSTANCE /* instance */,
|
||||
HINSTANCE /* previous_instance */,
|
||||
LPWSTR /* command_line */,
|
||||
int /* command_show */) {
|
||||
return MainEntryPoint();
|
||||
}
|
||||
#endif
|
||||
|
||||
// We don't link with the CRT (this is enforced through use of the /ENTRY linker
|
||||
// flag) so we have to implement CRT functions that the compiler generates calls
|
||||
// to.
|
||||
|
||||
// VC Express editions don't come with the memset CRT obj file and linking to
|
||||
// the obj files between versions becomes a bit problematic. Therefore,
|
||||
// simply implement memset.
|
||||
//
|
||||
// This also avoids having to explicitly set the __sse2_available hack when
|
||||
// linking with both the x64 and x86 obj files which is required when not
|
||||
// linking with the std C lib in certain instances (including Chromium) with
|
||||
// MSVC. __sse2_available determines whether to use SSE2 instructions with
|
||||
// std C lib routines, and is set by MSVC's std C lib implementation normally.
|
||||
extern "C" {
|
||||
// Marking memset as used is necessary in order to link with LLVM link-time
|
||||
// optimization (LTO). It prevents LTO from discarding the memset symbol,
|
||||
// allowing for compiler-generated references to memset to be satisfied.
|
||||
__attribute__((used))
|
||||
void* memset(void* dest, int c, size_t count) {
|
||||
uint8_t* scan = reinterpret_cast<uint8_t*>(dest);
|
||||
while (count--)
|
||||
*scan++ = static_cast<uint8_t>(c);
|
||||
return dest;
|
||||
}
|
||||
|
||||
// #if defined(_DEBUG) && defined(ARCH_CPU_ARM64)
|
||||
// The compiler generates calls to memcpy for ARM64 debug builds so we need to
|
||||
// supply a memcpy implementation in that configuration.
|
||||
// See comments above for why we do this incantation.
|
||||
// SET BY ALEX313031 FOR ALL BUILDS BECAUSE IT CAUSES ERRORS
|
||||
// DURING CROSS-BUILDING IF UNSET.
|
||||
__attribute__((used))
|
||||
void* memcpy(void* destination, const void* source, size_t count) {
|
||||
auto* dst = reinterpret_cast<uint8_t*>(destination);
|
||||
auto* src = reinterpret_cast<const uint8_t*>(source);
|
||||
while (count--)
|
||||
*dst++ = *src++;
|
||||
return destination;
|
||||
}
|
||||
// #endif
|
||||
} // extern "C"
|