diff --git a/app/brave_command_ids.h b/app/brave_command_ids.h index a8d6c73a92b3..a834f531ea9c 100644 --- a/app/brave_command_ids.h +++ b/app/brave_command_ids.h @@ -141,6 +141,9 @@ #define IDC_SHOW_APPS_PAGE 56352 +#define IDC_SHOW_EMAIL_ALIASES 56353 +#define IDC_NEW_EMAIL_ALIAS 56354 + #define IDC_BRAVE_COMMANDS_LAST 57000 #endif // BRAVE_APP_BRAVE_COMMAND_IDS_H_ diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index ac2d7bdc94a4..101bd5b2781a 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -263,6 +263,9 @@ Or change later at $2brave://settings/ext $1google.com is asking you to + + Email Aliases + @@ -351,6 +354,11 @@ Or change later at $2brave://settings/ext Block elements + + + New Email Alias + + .onion diff --git a/app/brave_settings_strings.grdp b/app/brave_settings_strings.grdp index 1661b8ebb0f0..123b92feef14 100644 --- a/app/brave_settings_strings.grdp +++ b/app/brave_settings_strings.grdp @@ -326,6 +326,9 @@ + + Email Aliases + Allow auto-fill in private windows @@ -333,6 +336,107 @@ Info from regular windows can be read/auto-filled in private windows + + + Keep your personal email address private + + + Create unique, random addresses that forward to your Brave account email and can be deleted at any time. Keep your actual email address from being disclosed or used by advertisers. + + + Learn more + + + Sign out + + + Sign out of Email Aliases + + + Connecting to Brave Account... + + + Brave Account + + + Copied to clipboard + + + Click to copy alias + + + Used by $1example.com, example.org + + + Edit + + + Delete + + + Create up to 5 free email aliases to protect your real email address. + + + Your email aliases + + + Create a new alias email + + + New alias + + + Suggest another email alias + + + Note + + + Enter a note for your address (optional) + + + Cancel + + + Email alias + + + Emails will be forwarded to $1address@example.com + + + Edit email alias + + + Create + + + Save + + + To get started, sign in or create a Brave account + + + Enter your email address to get a secure login link sent to your email. Clicking this link will either create or access a Brave Account and let you use the free Email Aliases service. + + + Get login link + + + Email address + + + A login email is on the way to $1address@example.com + + + Click on the secure login link in the email to access your account. + + + Don't see the email? Check your spam folder or + + + try again. + + New Tab Page diff --git a/app/generate_command_metadata.py b/app/generate_command_metadata.py index 826f54159539..945f39cb38d7 100644 --- a/app/generate_command_metadata.py +++ b/app/generate_command_metadata.py @@ -224,6 +224,7 @@ "IDC_NEW_TOR_CONNECTION_FOR_SITE": "IDS_NEW_TOR_CONNECTION_FOR_SITE", "IDC_NEW_OFFTHERECORD_WINDOW_TOR": "IDS_NEW_OFFTHERECORD_WINDOW_TOR", "IDC_SHOW_BRAVE_SYNC": "IDS_SHOW_BRAVE_SYNC", + "IDC_SHOW_EMAIL_ALIASES": "IDS_SHOW_EMAIL_ALIASES", "IDC_SHOW_BRAVE_WALLET": "IDS_SHOW_BRAVE_WALLET", "IDC_SHOW_BRAVE_WEBCOMPAT_REPORTER": "IDS_SHOW_BRAVE_WEBCOMPAT_REPORTER", "IDC_WINDOW_CLOSE_TABS_TO_LEFT": "IDS_TAB_CXMENU_CLOSETABSTOLEFT", diff --git a/browser/about_flags.cc b/browser/about_flags.cc index ecb7abbe79e6..0d2d0b491109 100644 --- a/browser/about_flags.cc +++ b/browser/about_flags.cc @@ -1001,6 +1001,14 @@ "corners, padding, and a drop shadow", \ kOsWin | kOsLinux | kOsMac, \ FEATURE_VALUE_TYPE(features::kBraveWebViewRoundedCorners), \ + }, \ + { \ + "brave-email-aliases", \ + "Enable Email Aliases", \ + "Enables the Email Aliases feature, which allows you to hide your " \ + "real email address behind an alias email address.", \ + kOsWin | kOsLinux | kOsMac, \ + FEATURE_VALUE_TYPE(features::kBraveEmailAliases), \ }) \ BRAVE_NATIVE_WALLET_FEATURE_ENTRIES \ BRAVE_NEWS_FEATURE_ENTRIES \ diff --git a/browser/brave_browser_features.cc b/browser/brave_browser_features.cc index 85c244faad08..4507798c587e 100644 --- a/browser/brave_browser_features.cc +++ b/browser/brave_browser_features.cc @@ -53,6 +53,10 @@ BASE_FEATURE(kNewAndroidOnboarding, base::FEATURE_DISABLED_BY_DEFAULT); #endif // BUILDFLAG(IS_ANDROID) +BASE_FEATURE(kBraveEmailAliases, + "BraveEmailAliases", + base::FEATURE_DISABLED_BY_DEFAULT); + // The variant of the "day zero" experiment. i.e. A, B, C, D, etc. const base::FeatureParam kBraveDayZeroExperimentVariant{ &kBraveDayZeroExperiment, diff --git a/browser/brave_browser_features.h b/browser/brave_browser_features.h index ad30895a251e..2e5f471fa2ab 100644 --- a/browser/brave_browser_features.h +++ b/browser/brave_browser_features.h @@ -22,6 +22,7 @@ BASE_DECLARE_FEATURE(kBraveDayZeroExperiment); #if BUILDFLAG(IS_ANDROID) BASE_DECLARE_FEATURE(kNewAndroidOnboarding); #endif // BUILDFLAG(IS_ANDROID) +BASE_DECLARE_FEATURE(kBraveEmailAliases); extern const base::FeatureParam kBraveDayZeroExperimentVariant; diff --git a/browser/brave_local_state_prefs.cc b/browser/brave_local_state_prefs.cc index d8dc3b39a3e6..06f2984fec0b 100644 --- a/browser/brave_local_state_prefs.cc +++ b/browser/brave_local_state_prefs.cc @@ -27,6 +27,7 @@ #include "brave/components/brave_wallet/browser/brave_wallet_prefs.h" #include "brave/components/constants/pref_names.h" #include "brave/components/decentralized_dns/core/utils.h" +#include "brave/components/email_aliases/browser/email_aliases_prefs.h" #include "brave/components/l10n/common/prefs.h" #include "brave/components/misc_metrics/general_browser_usage.h" #include "brave/components/misc_metrics/page_metrics.h" diff --git a/browser/brave_profile_prefs.cc b/browser/brave_profile_prefs.cc index 81a45ec7ee39..6c294da1693f 100644 --- a/browser/brave_profile_prefs.cc +++ b/browser/brave_profile_prefs.cc @@ -44,6 +44,7 @@ #include "brave/components/constants/pref_names.h" #include "brave/components/de_amp/common/pref_names.h" #include "brave/components/debounce/core/browser/debounce_service.h" +#include "brave/components/email_aliases/browser/email_aliases_prefs.h" #include "brave/components/ipfs/ipfs_prefs.h" #include "brave/components/ntp_background_images/browser/view_counter_service.h" #include "brave/components/ntp_background_images/buildflags/buildflags.h" @@ -493,6 +494,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { base::Value(false)); webcompat_reporter::prefs::RegisterProfilePrefs(registry); + + email_aliases::RegisterProfilePrefs(registry); } } // namespace brave diff --git a/browser/resources/settings/brave_autofill_page/brave_autofill_page.ts b/browser/resources/settings/brave_autofill_page/brave_autofill_page.ts index fe643069173f..e4ee2bc5e850 100644 --- a/browser/resources/settings/brave_autofill_page/brave_autofill_page.ts +++ b/browser/resources/settings/brave_autofill_page/brave_autofill_page.ts @@ -22,4 +22,9 @@ export class BraveSettingsAutofillPageElement extends RouteObserverMixin(BaseEle override currentRouteChanged(newRoute: Route) { this.isAutofillPage_ = newRoute == Router.getInstance().getRoutes().AUTOFILL } + + private onEmailAliasesClicked_() { + const router = Router.getInstance() + router.navigateTo((router.getRoutes() as any).EMAIL_ALIASES) + } } diff --git a/browser/resources/settings/brave_overrides/autofill_page.ts b/browser/resources/settings/brave_overrides/autofill_page.ts index c8131750d7a3..4f3f5adb0da4 100644 --- a/browser/resources/settings/brave_overrides/autofill_page.ts +++ b/browser/resources/settings/brave_overrides/autofill_page.ts @@ -3,16 +3,34 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. -import {html, RegisterPolymerTemplateModifications, RegisterPolymerComponentReplacement} from 'chrome://resources/brave/polymer_overriding.js' -import {BraveSettingsAutofillPageElement} from '../brave_autofill_page/brave_autofill_page.js' -import {loadTimeData} from '../i18n_setup.js' +import { + html, + RegisterPolymerTemplateModifications, + RegisterPolymerComponentReplacement, +} from 'chrome://resources/brave/polymer_overriding.js' +import { BraveSettingsAutofillPageElement } from '../brave_autofill_page/brave_autofill_page.js' +import { loadTimeData } from '../i18n_setup.js' + +import '../email_aliases_page/email_aliases_page.js' RegisterPolymerComponentReplacement( 'settings-autofill-page', BraveSettingsAutofillPageElement ) + RegisterPolymerTemplateModifications({ 'settings-autofill-page': (templateContent) => { + const isEmailAliasesFeatureEnabled = loadTimeData.getBoolean('isEmailAliasesFeatureEnabled') + if (isEmailAliasesFeatureEnabled) { + const parentManagerButton = templateContent.getElementById('paymentManagerButton') + parentManagerButton.parentNode.insertBefore(html` + + `, parentManagerButton) + } templateContent.appendChild(html`