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

Fix widevine install prompt is shown after using new profiles #3959

Merged
merged 4 commits into from
Nov 19, 2019

Commits on Nov 18, 2019

  1. Fix widevine install prompt is shown after using new profiles

    Install prompt is displayed if widevine is opt opted in by user and user
    doesn't choose don't ask option of it.
    
    Widevine cdm lib is loaded into cdm utility process after it installed.
    And it is browser widely used not just for specific profile.
    However, Brave has prompted widevine permission prompt when user loads
    contents site(ex, netflix) in newly created profile.
    If Widevine cdm lib is already installed by any profile, Brave should not
    display it again because cdm lib is already used.
    
    To fix this, two kWidevineOptedIn/kWidevineInstalledVersion are migrated
    from profile prefs to local state.
    When migration is needed, firstly active profile is used to get existing
    pref values.
    
    There is one more Widevine related pref. It's kAskWidevineInstall.
    It would be good to migrate to local prefs also. but left as-is in profile
    prefs also seems fine. After Widevine is installed that prefs doesn't have
    much meaning and if not just click once to dont ask is sufficient. Also, it
    is convinient to implement settings option with profile prefs.
    simonhong committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    0b748d9 View commit details
    Browse the repository at this point in the history
  2. Cleanup Widevine build flag usages and add some migration tests

    Add WidevinePrefsMigrationTest.PrefMigrationTest for prefs migration
    test.
    simonhong committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    dec8edf View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2019

  1. Configuration menu
    Copy the full SHA
    d82b60e View commit details
    Browse the repository at this point in the history
  2. Modify WidevinePrefsMigrationTest

    local state is persisted but not persisted after clearing prefs in the
    spanning test.
    At second test, local state has the value before the clearing.
    I expected it has default value because ClearePref() is called
    but it's not default value at second test.
    So, testing is done by explicitly calling MigrateWidevinePrefs() instead of
    spanning test.
    simonhong committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    1188431 View commit details
    Browse the repository at this point in the history