diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index a5cad9294da1..6c79e189d79d 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -224,6 +224,10 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U Brave has not reviewed this extension for security and safety. Only install this extension if you trust the developer. + + + Profile name and icon + Brave colors diff --git a/browser/resources/settings/brave_settings_overrides.html b/browser/resources/settings/brave_settings_overrides.html index 342bdfa16cec..c8f2e42383e0 100644 --- a/browser/resources/settings/brave_settings_overrides.html +++ b/browser/resources/settings/brave_settings_overrides.html @@ -16,12 +16,16 @@ - -
$i18n{onStartup}
-
- - -
+ +
+ +
$i18n{onStartup}
+
+ + +
+
+
diff --git a/browser/resources/settings/brave_settings_overrides.js b/browser/resources/settings/brave_settings_overrides.js index 5dff57659638..cf7cabe4c464 100644 --- a/browser/resources/settings/brave_settings_overrides.js +++ b/browser/resources/settings/brave_settings_overrides.js @@ -200,6 +200,8 @@ BravePatching.RegisterPolymerTemplateModifications({ console.error('[Brave Settings Overrides] Routes: could not find BASIC page') } r.GET_STARTED = r.BASIC.createSection('/getStarted', 'getStarted') + // bring back people's /manageProfile (now in getStarted) + r.MANAGE_PROFILE = r.GET_STARTED.createChild('/manageProfile'); r.SHIELDS = r.BASIC.createSection('/shields', 'shields') r.SOCIAL_BLOCKING = r.BASIC.createSection('/socialBlocking', 'socialBlocking') r.EXTENSIONS = r.BASIC.createSection('/extensions', 'extensions') @@ -325,12 +327,27 @@ BravePatching.RegisterPolymerTemplateModifications({ } }, 'settings-people-page': (templateContent) => { - // Import item needs to know it's the first in the section - const importItem = templateContent.querySelector('#importDataDialogTrigger[on-click="onImportDataTap_"]') - if (!importItem) { - console.error('[Brave Settings Overrides] Could not find import item in people_page') + // People page needs to think it's in the getStarted section, since it is + // (we remove the People section as a separate section). + const page = templateContent.querySelector('settings-animated-pages[section=people]') + page.setAttribute('section', 'getStarted') + const profileTemplate = templateContent.querySelector('template[is="dom-if"][if="[[diceEnabled_]]"]') + // In chromium, the whole 'manage profile' section is only + // displayed if dice is enabled. + // Instead, always show it, but remove the google account specific entry. + profileTemplate.setAttribute('if', 'true') + const manageGoogleAccount = profileTemplate.content.querySelector('#manage-google-account') + if (!manageGoogleAccount) { + console.error('[Brave Settings Overrides] Could not find the google account settings item') } - importItem.classList.add('first') + manageGoogleAccount.remove() + // Edit profile item needs to know it's the first in the section + const firstItem = profileTemplate.content.querySelector('#edit-profile') + if (!firstItem) { + console.error('[Brave Settings Overrides] Could not find #edit-profile item in people_page') + return + } + firstItem.classList.add('first') }, 'settings-payments-section': (templateContent) => { const manageLink = templateContent.querySelector('#manageLink') diff --git a/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc b/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc index 8f836538976a..5e953ad4cd50 100644 --- a/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc +++ b/chromium_src/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc @@ -9,11 +9,20 @@ namespace settings { void BraveAddLocalizedStrings(content::WebUIDataSource*, Profile*); } // namespace settings -#include "../../../../../../chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc" // NOLINT -#include "brave/browser/ui/webui/brave_settings_ui.h" +// Override some chromium strings #include "brave/grit/brave_generated_resources.h" +#include "chrome/grit/chromium_strings.h" +#include "chrome/grit/generated_resources.h" + +#undef IDS_SETTINGS_EDIT_PERSON +#define IDS_SETTINGS_EDIT_PERSON IDS_SETTINGS_BRAVE_EDIT_PROFILE +#undef IDS_SETTINGS_PROFILE_NAME_AND_PICTURE +#define IDS_SETTINGS_PROFILE_NAME_AND_PICTURE IDS_SETTINGS_BRAVE_EDIT_PROFILE +#include "../../../../../../chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc" // NOLINT + +#include "brave/browser/ui/webui/brave_settings_ui.h" namespace settings { void BraveAddImportDataStrings(content::WebUIDataSource* html_source) { diff --git a/chromium_src/chrome/grit/generated_resources.h b/chromium_src/chrome/grit/generated_resources.h index 3eeb240d0ed1..5758eb2e90a8 100644 --- a/chromium_src/chrome/grit/generated_resources.h +++ b/chromium_src/chrome/grit/generated_resources.h @@ -1,2 +1,12 @@ +// Copyright (c) 2019 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef BRAVE_CHROMIUM_SRC_CHROME_GRIT_GENERATED_RESOURCES_H_ +#define BRAVE_CHROMIUM_SRC_CHROME_GRIT_GENERATED_RESOURCES_H_ + #include "brave/grit/brave_generated_resources.h" #include "../gen/chrome/grit/generated_resources.h" + +#endif // BRAVE_CHROMIUM_SRC_CHROME_GRIT_GENERATED_RESOURCES_H_