Skip to content

Commit

Permalink
Uplift of #26561 (squashed) to beta
Browse files Browse the repository at this point in the history
  • Loading branch information
brave-builds committed Nov 19, 2024
1 parent 8e0c4f6 commit 711d159
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/certificate_manager.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_V2_CRS_CERTIFICATES_DESCRIPTION" desc="Description of the Brave Root Store certificates section of cert manager.">
The Brave Root Store contains certificates from Certificate Authorities trusted by the
Brave Root Program, and is continually reviewed on an ongoing basis.
Chrome Root Program, and is continually reviewed on an ongoing basis.
</message>
<message name="IDS_SETTINGS_CERTIFICATE_MANAGER_V2_CRS_LEARN_MORE_LINK" desc="Link to learning more about the Brave Root Store.">
Learn more
Expand Down
2 changes: 2 additions & 0 deletions browser/resources/bookmarks/brave_overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
// 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 '//resources/brave/br_elements/br_toolbar/br_toolbar.js'

import './folder_node.js'
2 changes: 1 addition & 1 deletion browser/resources/downloads/brave_overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
// 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 'chrome://resources/brave/br_elements/br_toolbar/br_toolbar.js'
import '//resources/brave/br_elements/br_toolbar/br_toolbar.js'

import './item.js'
2 changes: 2 additions & 0 deletions browser/resources/extensions/brave_overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// 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 '//resources/brave/br_elements/br_toolbar/br_toolbar.js'

import './extensions_detail_view.js'
import './extensions_toolbar.js'
import './side_bar.js'
2 changes: 2 additions & 0 deletions browser/resources/history/brave_overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// 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 '//resources/brave/br_elements/br_toolbar/br_toolbar.js'

import './app.js'
import './history_item.js'
import './side_bar.js'
2 changes: 2 additions & 0 deletions browser/resources/password_manager/brave_overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
// 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 '//resources/brave/br_elements/br_toolbar/br_toolbar.js'

import './side_bar.js'
2 changes: 2 additions & 0 deletions browser/resources/settings/brave_overrides/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
// where it is not consistant due to "network" responses) and
// optimized (rollup controls the order in which modules are executed).

import '//resources/brave/br_elements/br_toolbar/br_toolbar.js'

import './config.js'
import { ContentSettingsTypes } from '../site_settings/constants.js'
import './all_sites.js'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Copyright (c) 2024 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 https://mozilla.org/MPL/2.0/. */

#include "chrome/browser/ui/webui/certificate_manager/certificate_manager_ui.h"

#include "content/public/browser/web_ui_data_source.h"

namespace {

const char kBraveCRSLearnMoreLink[] =
"https://github.com/brave/brave-browser/wiki/TLS-Policy#root-store";

} // namespace

// Decay arrays to pointers for == comparison.
#define AddString(NAME, VALUE) \
AddString(NAME, +VALUE == +kCRSLearnMoreLink ? kBraveCRSLearnMoreLink : VALUE)

#include "src/chrome/browser/ui/webui/certificate_manager/certificate_manager_ui.cc"
#undef AddString
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/ui/webui/resources/cr_components/certificate_manager/BUILD.gn b/ui/webui/resources/cr_components/certificate_manager/BUILD.gn
index c7fbec010504b332d55068c1bd051f55d0115e06..9c0e5cbb73817f12fed96ffae95ea58d947f598f 100644
--- a/ui/webui/resources/cr_components/certificate_manager/BUILD.gn
+++ b/ui/webui/resources/cr_components/certificate_manager/BUILD.gn
@@ -110,4 +110,5 @@ build_webui("build") {
webui_context_type = "relative"
generate_grdp = true
grd_resource_path_prefix = rebase_path(".", "//ui/webui/resources")
+ import("//brave/ui/webui/resources/cr_components/certificate_manager/sources.gni") non_web_component_files += brave_certificate_manager_non_web_component_files exclude_ts_preprocess_files = brave_certificate_manager_ts_local_files preprocess_deps = brave_certificate_manager_preprocess_extra_deps
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/ui/webui/resources/cr_components/certificate_manager/certificate_manager_v2.ts b/ui/webui/resources/cr_components/certificate_manager/certificate_manager_v2.ts
index 2d6af36e0ab618de12fe85a72bc5f8fb7471c83e..fac186bd91c1349633a3c3889d24eb1ff2661bea 100644
--- a/ui/webui/resources/cr_components/certificate_manager/certificate_manager_v2.ts
+++ b/ui/webui/resources/cr_components/certificate_manager/certificate_manager_v2.ts
@@ -8,6 +8,7 @@
* and Chrome Cert Management Enterprise policies launch.
*/

+import './brave_overrides/index.js';
import './certificate_list_v2.js';
import './certificate_confirmation_dialog.js';
import './certificate_info_dialog.js';
1 change: 1 addition & 0 deletions script/lib/l10n/grd_string_replacements.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
(r'Brave Pay', r'Google Pay'),
(r'Brave Photos', r'Google Photos'),
(r'Brave Projects', r'Chromium Projects'),
(r'Brave Root Program', r'Chrome Root Program'),
(r'BraveVox', r'ChromeVox'),
(r'powered by Brave AI', r'powered by Google AI'),
(r'Invite profiles', r'Invite people'),
Expand Down
17 changes: 17 additions & 0 deletions ui/webui/resources/cr_components/certificate_manager/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2024 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 https://mozilla.org/MPL/2.0/.

import("//tools/grit/preprocess_if_expr.gni")
import("sources.gni")

# Move brave files to the place where chromium certificate manager page is
# compiled from. It should be the same directory that build_webui.gni uses
# after it performs its own preprocess_if_expr. Once chromium and brave frontend
# files are all in the same place, build_webui.gni will continue its typescript
# and rollup compile (etc.) from that directory.
preprocess_if_expr("preprocess") {
out_folder = "$root_gen_dir/ui/webui/resources/cr_components/certificate_manager/preprocessed"
in_files = brave_certificate_manager_ts_local_files
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright (c) 2024 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 https://mozilla.org/MPL/2.0/.

// @ts-nocheck TODO(petemill): Define types and remove ts-nocheck

import {RegisterStyleOverride} from '//resources/brave/polymer_overriding.js'
import {html} from '//resources/polymer/v3_0/polymer/polymer_bundled.min.js'

RegisterStyleOverride(
'certificate-manager-v2',
html`
<style>
.cr-nav-menu-item {
min-height: 20px !important;
border-end-end-radius: 0px !important;
border-start-end-radius: 0px !important;
box-sizing: content-box !important;
}
.cr-nav-menu-item:hover {
background: transparent !important;
}
.cr-nav-menu-item[selected] {
--iron-icon-fill-color: var(--cr-link-color) !important;
color: var(--cr-link-color) !important;
background: transparent !important;
}
.cr-nav-menu-item cr-icon {
display: none !important;
}
.cr-nav-menu-item cr-ripple {
display: none !important;
}
</style>
`
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) 2024 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 https://mozilla.org/MPL/2.0/.

import './certificate_manager_v2.js'
16 changes: 16 additions & 0 deletions ui/webui/resources/cr_components/certificate_manager/sources.gni
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2024 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 https://mozilla.org/MPL/2.0/.

brave_certificate_manager_non_web_component_files = [
"brave_overrides/certificate_manager_v2.ts",
"brave_overrides/index.ts",
]

brave_certificate_manager_preprocess_extra_deps = [
"//brave/ui/webui/resources/cr_components/certificate_manager:preprocess",
]

brave_certificate_manager_ts_local_files =
brave_certificate_manager_non_web_component_files
1 change: 0 additions & 1 deletion ui/webui/resources/polymer_overriding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// @ts-nocheck TODO(petemill): Define types

// Global overrides
import './br_elements/br_toolbar/br_toolbar.js'
import './br_elements/br_shared_style.css.js'

import { html as polymerHtml, mixinBehaviors, Polymer, PolymerElement } from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
Expand Down

0 comments on commit 711d159

Please sign in to comment.