Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve copyright statement (uplift to 0.73.x) #3956

Merged
merged 2 commits into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
<message name="IDS_BRAVE_CRYPTO_WALLETS_SETUP" desc="Use Crypto Wallets">
SETUP
</message>
<!-- Brave's copyright statement -->
<message name="IDS_BRAVE_VERSION_UI_LICENSE" desc="The label below the copyright message, containing the URLs.">
Brave is made available to you under the <ph name="BEGIN_LINK_MPL">&lt;a target="_blank" href="$1"&gt;</ph>Mozilla Public License 2.0<ph name="END_LINK_MPL">&lt;/a&gt;</ph> (MPL) and includes <ph name="BEGIN_LINK_OSS">&lt;a target="_blank" href="$2"&gt;</ph>open source software<ph name="END_LINK_OSS">&lt;/a&gt;</ph> under a variety of other licenses.
You can read <ph name="BEGIN_LINK_BUILD_INSTRUCTIONS">&lt;a target="_blank" href="$3"&gt;</ph>instructions on how to download and build for yourself<ph name="END_LINK_BUILD_INSTRUCTIONS">&lt;/a&gt;</ph> the specific <ph name="BEGIN_LINK_SOURCE_CODE">&lt;a target="_blank" href="$4"&gt;</ph>source code used to create this copy<ph name="END_LINK_SOURCE_CODE">&lt;/a&gt;</ph>.
</message>
</messages>
<includes>
<include name="IDR_BRAVE_GOOGLE_ANALYTICS_POLYFILL" file="resources/js/google_analytics_polyfill.js" type="BINDATA" />
Expand Down
12 changes: 11 additions & 1 deletion browser/resources/settings/brave_settings_overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,17 @@ BravePatching.RegisterPolymerTemplateModifications({
console.error('[Brave Settings Overrides] Could not find manage payments link')
}
manageLink.remove()
}
},
'settings-about-page': (templateContent) => {
const section = getSectionElement(templateContent, 'about')
if (!section.querySelector('a#release-notes')) {
const version = section.querySelector('#updateStatusMessage ~ .secondary')
if (!version) {
console.error('[Brave Settings Overrides] Could not find version div')
}
version.innerHTML = '<a id="release-notes" target="_blank" href="https://brave.com/latest/">' + version.innerHTML + '</a>'
}
},
})

// Icons
Expand Down
7 changes: 6 additions & 1 deletion browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ source_set("ui") {
"webui/brave_settings_ui.h",
"webui/navigation_bar_data_provider.cc",
"webui/navigation_bar_data_provider.h",
"webui/settings/brave_about_handler.cc",
"webui/settings/brave_about_handler.h",
"webui/settings/brave_privacy_handler.cc",
"webui/settings/brave_privacy_handler.h",
"webui/settings/default_brave_shields_handler.cc",
Expand Down Expand Up @@ -184,7 +186,10 @@ source_set("ui") {
}

if (!is_android) {
deps += [ "//brave/app:brave_generated_resources_grit" ]
deps += [
"//brave/app:brave_generated_resources_grit",
"//brave/browser:version_info",
]
}

if (enable_extensions && toolkit_views) {
Expand Down
43 changes: 43 additions & 0 deletions browser/ui/webui/settings/brave_about_handler.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* 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 https://mozilla.org/MPL/2.0/. */

#include "brave/browser/ui/webui/settings/brave_about_handler.h"

#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "brave/browser/version_info.h"
#include "brave/grit/brave_generated_resources.h"
#include "chrome/browser/ui/webui/settings/about_handler.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_ui_data_source.h"
#include "ui/base/l10n/l10n_util.h"

namespace {

const char kBraveBuildInstructionsUrl[] =
"https://github.com/brave/brave-browser/wiki";
const char kBraveLicenseUrl[] = "https://mozilla.org/MPL/2.0/";
const char kBraveReleaseTagPrefix[] =
"https://github.com/brave/brave-browser/releases/tag/v";

} // namespace

namespace settings {

AboutHandler* BraveAboutHandler::Create(content::WebUIDataSource* html_source,
Profile* profile) {
AboutHandler* handler = AboutHandler::Create(html_source, profile);
base::string16 license = l10n_util::GetStringFUTF16(
IDS_BRAVE_VERSION_UI_LICENSE, base::ASCIIToUTF16(kBraveLicenseUrl),
base::ASCIIToUTF16(chrome::kChromeUICreditsURL),
base::ASCIIToUTF16(kBraveBuildInstructionsUrl),
base::ASCIIToUTF16(kBraveReleaseTagPrefix) +
base::UTF8ToUTF16(
version_info::GetBraveVersionWithoutChromiumMajorVersion()));
html_source->AddString("aboutProductLicense", license);
return handler;
}

} // namespace settings
27 changes: 27 additions & 0 deletions browser/ui/webui/settings/brave_about_handler.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* 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 https://mozilla.org/MPL/2.0/. */

#ifndef BRAVE_BROWSER_UI_WEBUI_SETTINGS_BRAVE_ABOUT_HANDLER_H_
#define BRAVE_BROWSER_UI_WEBUI_SETTINGS_BRAVE_ABOUT_HANDLER_H_

class Profile;

namespace content {
class WebUIDataSource;
}

namespace settings {

class AboutHandler;

class BraveAboutHandler {
public:
static AboutHandler* Create(content::WebUIDataSource* html_source,
Profile* profile);
};

} // namespace settings

#endif // BRAVE_BROWSER_UI_WEBUI_SETTINGS_BRAVE_ABOUT_HANDLER_H_
11 changes: 11 additions & 0 deletions chromium_src/chrome/browser/ui/webui/settings/settings_ui.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* 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 https://mozilla.org/MPL/2.0/. */

#include "brave/browser/ui/webui/settings/brave_about_handler.h"
#include "chrome/browser/ui/webui/settings/about_handler.h"

#define AboutHandler BraveAboutHandler
#include "../../../../../../../chrome/browser/ui/webui/settings/settings_ui.cc"
#undef AboutHandler