-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Rewards settings to brave://settings
- Loading branch information
Showing
27 changed files
with
722 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright (c) 2021 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/. | ||
|
||
import("//tools/polymer/html_to_js.gni") | ||
import("//ui/webui/resources/tools/js_modulizer.gni") | ||
import("../settings.gni") | ||
|
||
# ES Module conversion from HTML Imports code | ||
|
||
group("web_modules") { | ||
public_deps = [ | ||
":modules", | ||
":templatize", | ||
] | ||
} | ||
|
||
html_to_js("templatize") { | ||
js_files = [ "brave_rewards_page.js" ] | ||
} | ||
|
||
js_modulizer("modules") { | ||
input_files = [ "brave_rewards_browser_proxy.js" ] | ||
namespace_rewrites = settings_namespace_rewrites | ||
} |
1 change: 1 addition & 0 deletions
1
browser/resources/settings/brave_rewards_page/brave_rewards_browser_proxy.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<script src="brave_rewards_browser_proxy.js"></script> |
36 changes: 36 additions & 0 deletions
36
browser/resources/settings/brave_rewards_page/brave_rewards_browser_proxy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* Copyright (c) 2021 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/. */ | ||
|
||
import {addSingletonGetter} from 'chrome://resources/js/cr.m.js'; | ||
|
||
/** @interface */ | ||
export class BraveRewardsBrowserProxy { | ||
getLocale() { /* Intentionally empty */ } | ||
getRewardsEnabled() { /* Intentionally empty */ } | ||
getRewardsParameters() { /* Intentionally empty */ } | ||
} | ||
|
||
/** | ||
* @implements {settings.BraveRewardsBrowserProxy} | ||
*/ | ||
export class BraveRewardsBrowserProxyImpl { | ||
/** @override */ | ||
getLocale () { | ||
return new Promise((resolve) => chrome.braveRewards.getLocale( | ||
(locale) => { resolve(locale) })) | ||
} | ||
/** @override */ | ||
getRewardsEnabled () { | ||
return new Promise((resolve) => chrome.braveRewards.getRewardsEnabled( | ||
(enabled) => { resolve(enabled) })) | ||
} | ||
/** @override */ | ||
getRewardsParameters () { | ||
return new Promise((resolve) => chrome.braveRewards.getRewardsParameters( | ||
(parameters) => { resolve(parameters) })) | ||
} | ||
} | ||
|
||
addSingletonGetter(BraveRewardsBrowserProxyImpl) |
Oops, something went wrong.