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

Support Widevine and 2 component updaters #189

Merged
merged 9 commits into from
Jun 27, 2018
Merged

Support Widevine and 2 component updaters #189

merged 9 commits into from
Jun 27, 2018

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Jun 22, 2018

Fix brave/brave-browser#31

Summary

  • This PR is easiest to review 1 commit at a time
  • There are now 2 component updaters, brave server (which is used for all by default), google server (which is used for widevine)
  • Since the brave component update server is used by default, we don't need the URL rewriting code for now.
  • There is UI w/ animation in the URL bar when widevine is not installed. This is currently a global setting, but we will probably make it a per origin setting later on. Animation exists for the URL bar icon to say Widevine is not installed.
  • You can click on the URL bar plugin icon to Install and run Widevine.

What is looks like

This slides in and then back out collapsing to a normal icon:

screen shot 2018-06-26 at 2 28 16 pm

screen shot 2018-06-26 at 2 26 56 pm

After clicking it looks like this:

screen shot 2018-06-26 at 2 27 02 pm

Clicking on the ? loads this page: https://policies.google.com/terms

Clicking on install and run hides the url bar icon and the bubble and installs it. Future starts will always register the widevine plugin so if it failed to install, the next startup would try it.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions

@bbondy bbondy force-pushed the widevine branch 4 times, most recently from acd439d to 7e74428 Compare June 25, 2018 02:11
@bbondy bbondy self-assigned this Jun 25, 2018
@bbondy bbondy changed the title WIP: Support Widevine Support Widevine Jun 26, 2018
@bbondy bbondy force-pushed the widevine branch 4 times, most recently from ed94d9f to 74ab2cb Compare June 26, 2018 15:00
-
+#if defined(BRAVE_CHROMIUM_BUILD)
+ BraveGenerateContentSettingImageModels(result);
+#endif
Copy link
Member Author

Choose a reason for hiding this comment

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

The above function is static so this seemed like the most minimally invasive way to hook the list of content setting image models.

@bbondy bbondy requested a review from emerick June 26, 2018 18:25
@bbondy bbondy changed the title Support Widevine Support Widevine and 2 component updaters Jun 26, 2018
emerick
emerick previously approved these changes Jun 26, 2018
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM, just had a few minor comments.

<message name="IDS_WIDEVINE_NOT_INSTALLED_MESSAGE" desc="Tooltip on the icon when Wideivne is not installed. 'Widevine' is the name of a plugin and should not be translated.">
Widevine is not installed.
</message>
<message name="IDS_INSTALL_AND_RUN_WIDEVINE" desc="Button to install register Widevine with the component updater. 'Widevine' is the name of a plugin and should not be translated.">
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like a word is missing in the description "Button to install register Widevine [...]"

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, "and" thx.

// ContentSettingSubresourceFilterImageModel - deceptive content
// ContentSettingFramebustBlockImageModel - blocked framebust

+
Copy link
Contributor

Choose a reason for hiding this comment

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

I seem to remember comments that we should try to avoid adding/removing whitespace in patch files, but maybe it doesn't matter for simple cases like this? Anyway, just pointing it out!

Copy link
Member Author

Choose a reason for hiding this comment

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

my bad, will fix.

content::WebContents* web_contents,
Profile* profile);
BraveBrowserContentSettingBubbleModelDelegate* brave_content_settings_delegate() const {
return (BraveBrowserContentSettingBubbleModelDelegate*)
Copy link
Contributor

Choose a reason for hiding this comment

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

The cast on the return value is necessary here?

Copy link
Member Author

Choose a reason for hiding this comment

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

seems not anymore, left over from a previous refactoring. Will fix.

emerick
emerick previously approved these changes Jun 26, 2018
Copy link
Contributor

@emerick emerick left a comment

Choose a reason for hiding this comment

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

LGTM

#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/browser_process.h"
@@ -737,6 +738,9 @@ ContentSettingImageModel::GenerateContentSettingImageModels() {
std::vector<std::unique_ptr<ContentSettingImageModel>> result;
Copy link
Collaborator

Choose a reason for hiding this comment

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

couldn't this be done with an override like RegisterWidevineCdmComponent?

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 don't think so because I'd have to patch the header file to add another definition.

This patches to generate Brave content setting image models for the navigation URL bar
…omponent_installer.cc

This overrides the RegisterWidevineCdmComponent to first check if Widevine has been opted in before proceeding
The pref is a boolean pref by the name: brave.widevine_opted_in
Because there are 2 different component updatears now, and each has its
own configuration.
@George9000
Copy link

Using Brave Beta, 0.56.6 Chromium: 70.0.3538.67 on MacOS 10.14.1
The URL prompt to install Widevine should also appear when attempting to play Amazon videos. It does not. Amazon gives an error message about going to chrome://components to install Widevine. There is no such component listed. After reading about the URL bar component for Spotify, I went to Spotify, got the prompt, and installed Widevine. I use neither Spotify nor Netflix. Others who likewise only use Amazon will be stuck unless they find the workaround. Install on Muon Brave was straightforward.

@bbondy
Copy link
Member Author

bbondy commented Nov 6, 2018

Thanks for the feedback @George9000
We're tracking the better detection mechanism here:
brave/brave-browser#1985

The current URL based method isn't enough.

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.

4 participants