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

Add Brave WebUI about:payments and brave-extension loading #15

Merged
merged 15 commits into from
Jan 6, 2018
Merged

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Dec 30, 2017

@bbondy bbondy changed the title WIP: Web ui Add Brave WebUI handling and about:payments placeholder Dec 31, 2017
@bbondy bbondy force-pushed the web-ui branch 5 times, most recently from 7756c23 to b6dce28 Compare December 31, 2017 04:33
@bbondy bbondy requested a review from bridiver December 31, 2017 04:34
@bbondy bbondy changed the title Add Brave WebUI handling and about:payments placeholder Add Brave WebUI about:payments and extension loading Jan 1, 2018
@bbondy bbondy changed the title Add Brave WebUI about:payments and extension loading Add Brave WebUI about:payments and brave-extension loading Jan 1, 2018
std::string ComponentLoader::Add(int manifest_resource_id,
const base::FilePath& root_directory) {
if (!ignore_whitelist_for_testing_ &&
- !IsComponentExtensionWhitelisted(manifest_resource_id))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't it be easier to patch IsComponentExtensionWhitelisted instead of changing all the calls to it? If new calls to IsComponentExtensionWhitelisted show up in the code they might also get missed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK that sounds good.

return base::mac::PathForFrameworkBundleResource(
CFSTR("brave_resources.pak"));
#else
base::FilePath extensions_shell_and_test_pak_path;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extensions_shell_and_test_pak_path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, the function was copied / modified from somewhere else.

@@ -50,3 +51,10 @@ BraveBrowserProcessImpl::https_everywhere_service() {
brave_shields::HTTPSEverywhereServiceFactory();
return https_everywhere_service_.get();
}

void BraveBrowserProcessImpl::PreMainMessageLoopRun() {
Copy link
Collaborator

@bridiver bridiver Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can override CreateBrowserMainParts in BraveContentBrowserClient and add our own Parts* classes with AddParts

</outputs>
<release seq="1">
<includes>
<include name="IDR_BRAVE_EXTENSON_INJECT_HTML" file="build/inject.html" type="BINDATA" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these files seem like they're missing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they're from src/brave/vendor/brave-extension
You'll need to run yarn install && yarn build to get them from within that dir.
There's a PR on brave/brave which has build config for that.

@@ -0,0 +1,4 @@
#include "brave/common/url_constants.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be webui_url_constants like in chrome?

Copy link
Member Author

@bbondy bbondy Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not webui_url_constants in chrome, it's chrome/common/url_constants.h

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I was looking at 64, but might as well do the same now?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do this in a follow up as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this when I landed it.

@bbondy bbondy force-pushed the web-ui branch 2 times, most recently from 59a722b to c175206 Compare January 3, 2018 14:17
content::WebUIDataSource::Create(kPaymentsHost);

if (name == kPaymentsHost) {
source->AddResourcePath(kPaymentsJS, IDR_BRAVE_PAYMENTS_JS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we could pass these in as params in brave_web_ui_controller_factory.h

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do this in the new tab page PR once I work on that.

extension_misc::kZIPUnpackerExtensionId,
extension_misc::kZipArchiverExtensionId,
#endif
+ "mnojpmjdmbbfmejpflffifhffcmidifd"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we would patch in a method call to add as may as we wanted, but we can do that in a follow up

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do this once we need to add a second one.

switch (manifest_resource_id) {
// Please keep the list in alphabetical order.
case IDR_BOOKMARKS_MANIFEST:
+ case IDR_BRAVE_EXTENSON:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto my above comment.

"//brave/vendor/brave-extension",
]

output_dir = "$root_gen_dir/brave"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to use target_gen_dir here instead of root_gen_dir/brave

@bbondy bbondy force-pushed the web-ui branch 2 times, most recently from ae48d15 to f937a93 Compare January 6, 2018 17:39
@bbondy
Copy link
Member Author

bbondy commented Jan 6, 2018

script moved to brave-extensions and renamed to webui_url_constants.*, so landing.

@bbondy bbondy merged commit 46ea972 into master Jan 6, 2018
NejcZdovc pushed a commit that referenced this pull request Dec 10, 2018
bbondy pushed a commit that referenced this pull request Feb 18, 2019
3rd party fingerprinting protection
antonok-edm pushed a commit that referenced this pull request Mar 10, 2021
Update adblock dep to latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants