Skip to content

Commit

Permalink
Merge pull request #3958 from brave/francois-improve-copyright-statem…
Browse files Browse the repository at this point in the history
…ent-3828-0.71.x

Improve copyright statement (uplift to 0.71.x)
  • Loading branch information
bsclifton committed Nov 9, 2019
2 parents 7e5f3c6 + 8873f2e commit 02f76b7
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,11 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U
Avatar Bonbon Ninja
</message>
</if>
<!-- 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 @@ -63,6 +63,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 @@ -179,7 +181,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

0 comments on commit 02f76b7

Please sign in to comment.