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

Uplift Disable opening Tor options in guest window to 1.3.x #4187

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
04d3667
Uplift of #3879 (squashed) to dev
brave-browser-releases Nov 5, 2019
9b75b3c
Merge pull request #3887 from brave/pr3879_remove-outdated-license-no…
bsclifton Nov 5, 2019
655344e
Uplift of #3819 (squashed) to dev
brave-browser-releases Nov 6, 2019
55b6e6a
Merge pull request #3849 from brave/fix-6604
ryanml Nov 7, 2019
1337599
Merge pull request #3876 from brave/no-ads-ntp
ryanml Nov 7, 2019
c1e71cc
Uplift of #3898 (squashed) to dev
brave-browser-releases Nov 7, 2019
4db7c21
Uplift of #3797 (squashed) to dev
brave-browser-releases Nov 8, 2019
3f6bdc8
0.73.63
brave-browser-releases Nov 8, 2019
dab97d0
Uplift of #3915 (squashed) to dev
brave-browser-releases Nov 8, 2019
2bb6247
Merge pull request #3894 from brave/pr3819_issue-6545-left-sig-right-…
bsclifton Nov 8, 2019
e28ec9f
Merge pull request #3911 from brave/uplift-6604-73
bsclifton Nov 8, 2019
23297a3
Merge pull request #3897 from brave/welcome-points
ryanml Nov 8, 2019
ad6c537
Uplift of #3917 (squashed) to dev
brave-browser-releases Nov 8, 2019
0b15d51
Merge pull request #3916 from brave/ca-6746
cezaraugusto Nov 8, 2019
c1bfef5
Merge pull request #3893 from brave/78.0.3904.97
bsclifton Nov 8, 2019
41901e8
Uplift of #3820 (squashed) to dev
brave-browser-releases Nov 8, 2019
2f7371e
Add licensing terms for background photos
fmarier Nov 1, 2019
835c691
Note that TheSkyfolk images are used with permission
fmarier Nov 5, 2019
1d93df8
Add licensing info for the zxing library on Android
fmarier Nov 1, 2019
6a39cbf
Add font licenses
fmarier Nov 1, 2019
cc71959
Add PROCHLO license
fmarier Nov 1, 2019
17a9b9d
Update brave-intl dependencies to pull in LICENSE files
fmarier Nov 4, 2019
c589f4c
Add license notice for the brave-sync extension
fmarier Nov 4, 2019
5201a1f
Add Tor and Chromium license notices
fmarier Nov 5, 2019
0845501
Add license notices for the lists used in Shields
fmarier Nov 5, 2019
0d7e2bb
Add adblock_bg license after confirming with author by email
fmarier Nov 6, 2019
76935f6
Add license notices for node modules
fmarier Nov 6, 2019
ff95e00
Remove unnecessary copies of the MPL-2.0
fmarier Nov 7, 2019
8b73568
Add missing third-party code to brave://credits (fixes brave/brave-br…
fmarier Nov 1, 2019
b0e8df3
Improve licensing notice (fixes brave/brave-browser#6605)
fmarier Oct 23, 2019
8ea49ee
Link to release notes from brave://settings/help (fixes brave/brave-b…
fmarier Oct 30, 2019
b8c7d7a
0.73.64
brave-browser-releases Nov 9, 2019
83b2b17
Merge pull request #3947 from brave/pr3820_issue-6607-ballots-assigne…
kjozwiak Nov 10, 2019
47252a6
Merge pull request #3953 from brave/francois-add-missing-licenses-680…
kjozwiak Nov 10, 2019
58a217c
Merge pull request #3927 from brave/pr3915_ac-check_0.73.x
kjozwiak Nov 10, 2019
e3f0b4e
Merge pull request #3956 from brave/francois-improve-copyright-statem…
kjozwiak Nov 10, 2019
60aa025
Merge pull request #3932 from brave/uplift-3897-73
kjozwiak Nov 10, 2019
690a079
Merge pull request #3941 from brave/ca-6746-73
kjozwiak Nov 10, 2019
1ab6a05
Merge pull request #3935 from brave/pr3917_issue-6745-transactions-re…
kjozwiak Nov 10, 2019
3451750
Merge pull request #3900 from brave/no-ads-ntp-73
kjozwiak Nov 10, 2019
0287273
Merge pull request #3912 from brave/pr3898_rewards-stub-dismiss-badge…
kjozwiak Nov 10, 2019
86c5c7b
Merge pull request #3924 from brave/pr3797_prepare_1_0_version_0.73.x
kjozwiak Nov 11, 2019
8d24f00
0.73.65
brave-browser-releases Nov 11, 2019
172d0eb
Uplift of #3961 (squashed) to dev
brave-browser-releases Nov 11, 2019
ad7ab7f
Merge pull request #3965 from brave/pr3961_issue_6873_0.73.x
bsclifton Nov 11, 2019
b0834d5
Merge pull request #3949 from brave/78.0.3904.97-0.73.x
bsclifton Nov 11, 2019
d4ba23b
0.73.66
brave-browser-releases Nov 12, 2019
61dd975
Fixes ads disappearing after ~5s instead of the expected ~2mins using…
tmancey Nov 11, 2019
3e10586
Merge pull request #3974 from brave/issues/6876-0.73
tmancey Nov 12, 2019
90992e5
Merge pull request #4155 from brave/disable_tor_options_in_guest
yrliou Dec 9, 2019
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
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ if (is_mac) {
"--brave_product_dir_name=" + brave_product_dir_name,
"--brave_feed_url=" + brave_feed_url,
"--brave_dsa_file=" + brave_dsa_file,
"--brave_version=" + brave_version,
]

deps = [
Expand Down
6 changes: 3 additions & 3 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ deps = {
"vendor/bat-native-rapidjson": "https://github.com/brave-intl/bat-native-rapidjson.git@86aafe2ef89835ae71c9ed7c2527e3bb3000930e",
"vendor/bip39wally-core-native": "https://github.com/brave-intl/bip39wally-core-native.git@13bb40a215248cfbdd87d0a6b425c8397402e9e6",
"vendor/bat-native-anonize": "https://github.com/brave-intl/bat-native-anonize.git@e3742ba3e8942eea9e4755d91532491871bd3116",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@dd0c535898a645b84d6f3372b393bdad6746108c",
"vendor/bat-native-tweetnacl": "https://github.com/brave-intl/bat-native-tweetnacl.git@800f9d40b7409239ff192e0be634764e747c7a75",
"components/brave_sync/extension/brave-sync": "https://github.com/brave/sync.git@8a9f4fefe42c25b5359c402f97f454fa333c8d48",
"vendor/bat-native-usermodel": "https://github.com/brave-intl/bat-native-usermodel.git@a82acda22d8cb255d86ee28734efb8ad886e9a49",
"vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@f88d942ddfaf61a4a6703355a77c4ef71bc95c35",
"vendor/bat-native-usermodel": "https://github.com/brave-intl/bat-native-usermodel.git@45e32155af9897dbe1d5534dd36697ec4728bb75",
"vendor/challenge_bypass_ristretto_ffi": "https://github.com/brave-intl/challenge-bypass-ristretto-ffi.git@c396fb4eb9e9bf63b89ae5a0ec0b5f201d43c7c5",
}

hooks = [
Expand Down
27 changes: 3 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
LICENSES FOR INCORPORATED CODEBASES
===================================

Incorporating code from Privacy Badger Chrome,
https://github.com/EFForg/privacybadger
Copyright © 2015 Electronic Frontier Foundation and other contributors
Licensed GPL v3

Incorporating code from HTTPS Everywhere,
Copyright © 2010-2017 Electronic Frontier Foundation and others
Licensed GPL v2+

Incorporating code from Chameleon,
https://github.com/ghostwords/chameleon
Copyright © 2015 ghostwords
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/.
Alternatively, this code may be distributed or
otherwise used under the terms of GPL v3

Text of Mozilla Public License Version 2.0
==========================================
Mozilla Public License Version 2.0
==================================

1. Definitions
--------------
Expand Down Expand Up @@ -378,7 +357,7 @@ Exhibit A - Source Code Form License Notice

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/.
file, You can obtain one at https://mozilla.org/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
Expand Down
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
19 changes: 19 additions & 0 deletions browser/extensions/api/brave_rewards_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1084,5 +1084,24 @@ void BraveRewardsGetWalletExistsFunction::OnGetWalletExists(
Respond(OneArgument(std::make_unique<base::Value>(exists)));
}

BraveRewardsGetAdsSupportedFunction::
~BraveRewardsGetAdsSupportedFunction() {
}

ExtensionFunction::ResponseAction
BraveRewardsGetAdsSupportedFunction::Run() {
Profile* profile = Profile::FromBrowserContext(browser_context());
AdsService* ads_service_ =
AdsServiceFactory::GetForProfile(profile);

if (!ads_service_) {
return RespondNow(Error("Ads service is not initialized"));
}

const bool supported = ads_service_->IsSupportedLocale();
return RespondNow(
OneArgument(std::make_unique<base::Value>(supported)));
}

} // namespace api
} // namespace extensions
10 changes: 10 additions & 0 deletions browser/extensions/api/brave_rewards_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,16 @@ class BraveRewardsGetWalletExistsFunction
void OnGetWalletExists(const bool exists);
};

class BraveRewardsGetAdsSupportedFunction : public ExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("braveRewards.getAdsSupported", UNKNOWN)

protected:
~BraveRewardsGetAdsSupportedFunction() override;

ResponseAction Run() override;
};

} // namespace api
} // namespace extensions

Expand Down
8 changes: 8 additions & 0 deletions browser/profiles/profile_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ bool IsGuestProfile(content::BrowserContext* context) {
->IsGuestSession();
}

bool IsTorDisabledForProfile(Profile* profile) {
#if BUILDFLAG(ENABLE_TOR)
return profile->IsGuestSession();
#else
return true;
#endif
}

} // namespace brave

namespace chrome {
Expand Down
2 changes: 2 additions & 0 deletions browser/profiles/profile_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Profile* GetParentProfile(const base::FilePath& path);
// the guest profile by calling IsGuestSession and have to use this function.
bool IsGuestProfile(content::BrowserContext* profile);

bool IsTorDisabledForProfile(Profile* profile);

} // namespace brave

namespace chrome {
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
6 changes: 4 additions & 2 deletions browser/ui/brave_browser_command_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ void BraveBrowserCommandController::UpdateCommandForBraveAdblock() {
}

void BraveBrowserCommandController::UpdateCommandForTor() {
UpdateCommandEnabled(IDC_NEW_TOR_CONNECTION_FOR_SITE, true);
UpdateCommandEnabled(IDC_NEW_OFFTHERECORD_WINDOW_TOR, true);
const bool is_tor_enabled =
!brave::IsTorDisabledForProfile(browser_->profile());
UpdateCommandEnabled(IDC_NEW_TOR_CONNECTION_FOR_SITE, is_tor_enabled);
UpdateCommandEnabled(IDC_NEW_OFFTHERECORD_WINDOW_TOR, is_tor_enabled);
}

void BraveBrowserCommandController::UpdateCommandForBraveSync() {
Expand Down
3 changes: 2 additions & 1 deletion browser/ui/views/brave_actions/brave_actions_container.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ void BraveActionsContainer::AddActionStubForRewards() {
return;
}
#if BUILDFLAG(BRAVE_REWARDS_ENABLED)
actions_[id].view_ = std::make_unique<BraveRewardsActionStubView>(this);
actions_[id].view_ = std::make_unique<BraveRewardsActionStubView>(
browser_->profile(), this);
AttachAction(actions_[id]);
#endif
}
Expand Down
23 changes: 20 additions & 3 deletions browser/ui/views/brave_actions/brave_rewards_action_stub_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@

#include "brave/browser/ui/brave_actions/brave_action_icon_with_badge_image_source.h" // NOLINT
#include "brave/browser/ui/brave_actions/constants.h"
#include "brave/components/brave_rewards/common/pref_names.h"
#include "brave/components/brave_rewards/resources/extension/grit/brave_rewards_extension_resources.h" // NOLINT
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/toolbar/toolbar_action_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_ink_drop_util.h"
#include "components/prefs/pref_service.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/geometry/rect.h"
Expand All @@ -29,12 +32,12 @@

namespace {
constexpr SkColor kRewardsBadgeBg = SkColorSetRGB(0xfb, 0x54, 0x2b);
const std::string kRewardsInitialBadgeText = "1";
}

BraveRewardsActionStubView::BraveRewardsActionStubView(
BraveRewardsActionStubView::BraveRewardsActionStubView(Profile* profile,
BraveRewardsActionStubView::Delegate* delegate)
: LabelButton(this, base::string16()),
profile_(profile),
delegate_(delegate) {
SetInkDropMode(InkDropMode::ON);
set_has_ink_drop_action_on_click(true);
Expand All @@ -55,8 +58,13 @@ BraveRewardsActionStubView::BraveRewardsActionStubView(
image_source->SetIcon(gfx::Image(image));
// Set text on badge
std::unique_ptr<IconWithBadgeImageSource::Badge> badge;
// TODO(petemill): Provide an observer if this value is expected to change
// during runtime. At time of implementation, this would only be different
// after a restart.
badge_text_pref_.Init(
brave_rewards::prefs::kRewardsBadgeText, profile->GetPrefs());
badge.reset(new IconWithBadgeImageSource::Badge(
kRewardsInitialBadgeText,
badge_text_pref_.GetValue(),
SK_ColorWHITE,
kRewardsBadgeBg));
image_source->SetBadge(std::move(badge));
Expand Down Expand Up @@ -85,6 +93,15 @@ BraveRewardsActionStubView::~BraveRewardsActionStubView() {}

void BraveRewardsActionStubView::ButtonPressed(
Button* sender, const ui::Event& event) {
// We only show the default badge text once, so once the button
// is clicked then change it back. We consider pressing the button
// as an action to 'dismiss' the badge notification.
// This cannot be done from the rewards service since it is not
// involved in showing the pre-opt-in panel.
if (badge_text_pref_.GetValue() != "") {
profile_->GetPrefs()->SetString(brave_rewards::prefs::kRewardsBadgeText,
"");
}
delegate_->OnRewardsStubButtonClicked();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

#include <memory>

#include "components/prefs/pref_member.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/view.h"

class Profile;

// A button to take the place of an extension that will be loaded in the future.
// Call SetImage with the BraveActionIconWithBadgeImageSource
// Call highlight etc from ToolbarActionView
Expand All @@ -25,7 +28,7 @@ class BraveRewardsActionStubView : public views::LabelButton,
~Delegate() {}
};

explicit BraveRewardsActionStubView(Delegate* delegate);
explicit BraveRewardsActionStubView(Profile* profile, Delegate* delegate);
~BraveRewardsActionStubView() override;

// views::ButtonListener
Expand All @@ -41,6 +44,8 @@ class BraveRewardsActionStubView : public views::LabelButton,
private:
gfx::Size CalculatePreferredSize() const override;

StringPrefMember badge_text_pref_;
Profile* profile_;
Delegate* delegate_;

DISALLOW_COPY_AND_ASSIGN(BraveRewardsActionStubView);
Expand Down
4 changes: 4 additions & 0 deletions browser/ui/webui/brave_webui_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "rewardsWidgetEnableTitle", IDS_REWARDS_WIDGET_ENABLE_TITLE },
{ "rewardsWidgetReEnableSubTitle", IDS_REWARDS_WIDGET_REENABLE_SUBTITLE }, // NOLINT
{ "rewardsWidgetEnableSubTitle", IDS_REWARDS_WIDGET_ENABLE_SUBTITLE }, // NOLINT
{ "rewardsWidgetAdsNotSupported", IDS_BRAVE_REWARDS_LOCAL_ADS_NOT_SUPPORTED }, // NOLINT
{ "rewardsWidgetNotificationTitle", IDS_REWARDS_WIDGET_NOTIFICATION_TITLE }, // NOLINT
{ "rewardsWidgetNotificationTextAds", IDS_REWARDS_WIDGET_NOTIFICATION_TEXT_ADS }, // NOLINT
{ "rewardsWidgetNotificationTextUGP", IDS_REWARDS_WIDGET_NOTIFICATION_TEXT_UGP } // NOLINT
Expand Down Expand Up @@ -357,6 +358,7 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "amount", IDS_BRAVE_UI_AMOUNT },
{ "backup", IDS_BRAVE_UI_BACKUP },
{ "braveAdsDesc", IDS_BRAVE_UI_BRAVE_ADS_DESC },
{ "braveAdsDescPoints", IDS_BRAVE_UI_BRAVE_ADS_DESC_POINTS },
{ "braveAdsLaunchMsg", IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_MSG },
{ "braveAdsLaunchTitle", IDS_BRAVE_UI_BRAVE_ADS_LAUNCH_TITLE },
{ "braveAdsTitle", IDS_BRAVE_UI_BRAVE_ADS_TITLE },
Expand Down Expand Up @@ -506,11 +508,13 @@ void CustomizeWebUIHTMLSource(const std::string &name,
{ "rewardsOffText2", IDS_BRAVE_UI_REWARDS_OFF_TEXT2 },
{ "rewardsOffText3", IDS_BRAVE_UI_REWARDS_OFF_TEXT3 },
{ "rewardsOffText4", IDS_BRAVE_UI_REWARDS_OFF_TEXT4 },
{ "rewardsPanelEmptyTextPoints", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT_POINTS }, // NOLINT
{ "rewardsPanelEmptyText1", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT1 },
{ "rewardsPanelEmptyText2", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT2 },
{ "rewardsPanelEmptyText3", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT3 },
{ "rewardsPanelEmptyText4", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT4 },
{ "rewardsPanelEmptyText5", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT5 },
{ "rewardsPanelEmptyText6", IDS_BRAVE_UI_REWARDS_PANEL_EMPTY_TEXT6 },
{ "rewardsPanelOffText1", IDS_BRAVE_UI_REWARDS_PANEL_OFF_TEXT1 },
{ "rewardsPanelOffText2", IDS_BRAVE_UI_REWARDS_PANEL_OFF_TEXT2 },
{ "rewardsPanelText1", IDS_BRAVE_UI_REWARDS_PANEL_TEXT1 },
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_
Loading