Reupload chrome dir for windows icon fix.

This commit is contained in:
Alexander David Frick 2022-03-03 07:05:26 -06:00 committed by GitHub
parent 7776217609
commit 8034b7d296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 10866 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,250 @@
<?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">
<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">
<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">
<message name="IDS_SETTINGS_ABOUT_OS" desc="Menu title for the About Chromium OS page.">
About Thorium OS
</message>
<message name="IDS_OS_SETTINGS_TAG_OS_VERSION" desc="Text for search result item which, when clicked, navigates the user to about Chrome OS settings, which gives information about the current Chrome OS version.">
Thorium OS 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 Chromium OS settings.">
To see if your device is up to date, go to <ph name="LINK_BEGIN">&lt;a href="chrome://os-settings/help"&gt;</ph>Thorium OS Settings<ph name="LINK_END">&lt;/a&gt;</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 Thorium OS
</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">&lt;a href="$1" target="_blank"&gt;</ph>check passwords in your Google Account<ph name="END_LINK">&lt;/a&gt;</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">&lt;a target='_blank' href='$1'&gt;</ph>sign in to Thorium<ph name="END_LINK">&lt;/a&gt;</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">&lt;a target='_blank' href='$1'&gt;</ph>sign in to Thorium<ph name="END_LINK">&lt;/a&gt;</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">&lt;a target='_blank' href='$1'&gt;</ph>create and remember strong passwords for you<ph name="END_LINK">&lt;/a&gt;</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">
<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">&lt;a href="$1<ex>https://google.com/</ex>"&gt;</ph>
Thorium OS settings<ph name="LINK_END">&lt;/a&gt;</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 and not 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">&lt;b&gt;</ph>signed out of most sites<ph name="END_BOLD">&lt;/b&gt;</ph> when you close Thorium. If sync is off, you will also be <ph name="BEGIN_BOLD">&lt;b&gt;</ph>signed out of Google services and Thorium<ph name="END_BOLD">&lt;/b&gt;</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>
<!-- 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">&lt;a target="_blank" href="$1"&gt;</ph>Fix Thorium update problems and failed updates.<ph name="END_LINK">&lt;/a&gt;</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">
<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">
<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">&lt;a&gt;</ph>Learn more<ph name="LINK_END">&lt;/a&gt;</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">
<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">&lt;a is="action-link" target="_blank"&gt;</ph>current settings<ph name="END_LINK">&lt;/a&gt;</ph>
</message>
</grit-part>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,52 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Presubmit script for Chromium theme resources.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools, and see
https://chromium.googlesource.com/chromium/src/+/main/styleguide/web/web.md
for the rules we're checking against here.
"""
# http://crbug.com/1296727 - ico_files has not yet been converted to Python 3.
USE_PYTHON3 = True
def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return _CommonChecks(input_api, output_api)
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
resources = input_api.os_path.join(input_api.PresubmitLocalPath(),
'../../../ui/resources')
# List of paths with their associated scale factor. This is used to verify
# that the images modified in one are the correct scale of the other.
path_scales = [
[(100, 'default_100_percent/'), (200, 'default_200_percent/')],
]
import sys
old_path = sys.path
try:
sys.path = [resources] + old_path
from resource_check import resource_scale_factors, ico_files
for paths in path_scales:
results.extend(resource_scale_factors.ResourceScaleFactors(
input_api, output_api, paths).RunChecks())
results.extend(ico_files.IcoFiles(input_api, output_api).RunChecks())
finally:
sys.path = old_path
return results

View 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=

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -0,0 +1,101 @@
/* XPM */
static char * product_logo_32_xpm[] = {
"32 32 66 1",
" c None",
". c #1967D2",
"+ c #2F71D8",
"@ c #1865CE",
"# c #1458B5",
"$ c #1251A7",
"% c #436DBC",
"& c #6F94DE",
"* c #7499E3",
"= c #80A3E7",
"- c #568FEB",
"; c #0E4591",
"> c #01112D",
", c #000000",
"' c #232B37",
") c #788CAE",
"! c #ABC7F6",
"~ c #AECBFA",
"{ c #669DF6",
"] c #3877DB",
"^ c #1761C6",
"/ c #04285A",
"( c #011432",
"_ c #0E4EA1",
": c #176AD7",
"< c #1A73E8",
"[ c #4A576D",
"} c #A4C0EC",
"| c #5E96F1",
"1 c #062A5B",
"2 c #042758",
"3 c #186CDB",
"4 c #4580E1",
"5 c #629AF3",
"6 c #266DD5",
"7 c #4F89E7",
"8 c #1859B6",
"9 c #9AB4DD",
"0 c #3072D8",
"a c #8AA1C7",
"b c #5890ED",
"c c #3A6EC3",
"d c #96AFD8",
"e c #5E95EE",
"f c #101F36",
"g c #446BAB",
"h c #649AF2",
"i c #29426B",
"j c #3B4D6C",
"k c #6094E9",
"l c #28426B",
"m c #2A436B",
"n c #93B3EB",
"o c #77A5F2",
"p c #5787D5",
"q c #507CC4",
"r c #5988D6",
"s c #A0C1F9",
"t c #86AFF7",
"u c #6A9FF6",
"v c #A7C6FA",
"w c #8EB5F8",
"x c #72A3F6",
"y c #ACC9FA",
"z c #99BCF9",
"A c #7CAAF7",
" ",
" ...... ",
" ............ ",
" ................ ",
" .................. ",
" .................... ",
" ...................... ",
" ........................ ",
" +.........@#$$%&*********= ",
" -.......@;>,,,,')!~~~~~~~~ ",
" {{].....^/(_:<<:_([}~~~~~~~~ ",
" {{|....@123<<<<<<32[!~~~~~~~ ",
" {{{4...;(3<<<<<<<<3()~~~~~~~ ",
" {{{{56.@>_<<<<<<<<<<_'!~~~~~~~ ",
" {{{{{7.8,:<<<<<<<<<<:,9~~~~~~~ ",
" {{{{{{0$,<<<<<<<<<<<<,a~~~~~~~ ",
" {{{{{{b$,<<<<<<<<<<<<,a~~~~~~~ ",
" {{{{{{{c,:<<<<<<<<<<:,d~~~~~~~ ",
" {{{{{{{ef_<<<<<<<<<<_'!~~~~~~~ ",
" {{{{{{{g(3<<<<<<<<3()~~~~~~~ ",
" {{{{{{{hi23<<<<<<32j!~~~~~~~ ",
" {{{{{{{{kl(_:<<:_(mn~~~~~~~~ ",
" {{{{{{{{hgf,,,,fgo~~~~~~~~ ",
" {{{{{{{{{{hpqqrh{s~~~~~~~~ ",
" {{{{{{{{{{{{{{{t~~~~~~~~ ",
" {{{{{{{{{{{{{uv~~~~~~~ ",
" {{{{{{{{{{{{w~~~~~~~ ",
" {{{{{{{{{{xy~~~~~~ ",
" {{{{{{{{{z~~~~~~ ",
" {{{{{{A~~~~~ ",
" {{{s~~ ",
" "};

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

File diff suppressed because it is too large Load diff

View 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

File diff suppressed because it is too large Load diff

View 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"
#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

View 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);
}

View file

@ -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;
}

View 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
}
}

View 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

View 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

View file

@ -0,0 +1,219 @@
@@include@@variables.include
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
TneI1fJ3vwF2vpSXVBUUDk67PZhg6ZwGRT7GFWskC0z8PsWd5jwK20mA8EV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BTdoQYg
pyTr84nQyscWAUFTRbmHvtjCCfLdvU8wM7ubAQ5Dwi1pABRttRAMuPA94HzaBF5y
XkghxHpnW0IcXGiwgch9LQyaO9VSRhiPH6r5Zuk7KvGhHph7SC5JgUn9vJmmp1zc
d0mXQ2Zh8M81J3Ri3iGPHM2CqplAxXNbIrnztbEJhN2I+77m73Z4d+K1ivg6xQht
eSZhwhx7/Z3Tl+U2jYOEFIn/UFmV3UxRSJa/jQRcjvMKprSp4tAZ2yJI3babjRbi
xgUEtlK105/JepxcAdw9vosxO/rR7VqCzu0copdxC0GAH8og+A9/3LPhlRGy3Qhf
zjy9JHWHj4EIsol02BS8+dWvAoYerkve9O9+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
}

View file

@ -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>

View file

@ -0,0 +1,33 @@
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This file 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
# 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/"

View 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@@ --user-data-dir=.config/thorium --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@@ --user-data-dir=.config/thorium --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@@ --user-data-dir=.config/thorium --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 --user-data-dir=.config/thorium --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

View file

@ -0,0 +1,445 @@
# 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#@@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"
# 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}/chrome-devtools.svg" "${STAGEDIR}/${INSTALLDIR}/"
install -m 644 "${OUTPUTDIR}/chrome-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 ES
if [ -f "${OUTPUTDIR}/swiftshader/libEGL.so" ]; then
install -m 755 -d "${STAGEDIR}/${INSTALLDIR}/swiftshader/"
for file in libEGL.so libGLESv2.so; do
strippedfile="${OUTPUTDIR}/swiftshader/${file}.stripped"
install -m ${SHLIB_PERMS} "${strippedfile}" "${STAGEDIR}/${INSTALLDIR}/swiftshader/${file}"
done
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-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
}

View 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@@" --user-data-dir=.config/thorium --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 "$@"

View 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@@"

View 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

View file

@ -0,0 +1,68 @@
#!/bin/sh
#
# Copyright (c) 2009 The Chromium Authors. 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/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 &

View file

@ -0,0 +1,33 @@
#!/bin/sh
#
# Copyright (c) 2009 The Chromium Authors. 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/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

View file

@ -0,0 +1,127 @@
# 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\
chrome-devtools.png: %(VersionDir)s\
chrome-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\
#
# SwiftShader sub-dir
#
swiftshader\libEGL.dll: %(VersionDir)s\swiftshader\
swiftshader\libGLESv2.dll: %(VersionDir)s\swiftshader\
#
# 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\

View file

@ -0,0 +1,70 @@
// 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.
__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"