|
|
Chromium Code Reviews|
Created:
3 years, 10 months ago by tommycli Modified:
3 years, 10 months ago CC:
chromium-reviews, extensions-reviews_chromium.org, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, arv+watch_chromium.org, chromium-apps-reviews_chromium.org, dbeam+watch-settings_chromium.org, srahim+watch_chromium.org, stevenjb+watch-md-settings_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMD Settings: Update Protected Content for redesign
1. Preserves settings.privacy.drm_enabled to toggle unique identifiers.
2. Adds webkit.webprefs.encrypted_media_enabled above to toggle EME.
3. Hides the exception list if prefs.settings.privacy.drm_enabled is
disabled.
BUG=687783
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Review-Url: https://codereview.chromium.org/2688793002
Cr-Commit-Position: refs/heads/master@{#449744}
Committed: https://chromium.googlesource.com/chromium/src/+/595de1b5cec1ba648843e33d2ee01957b4f5966c
Patch Set 1 : Originally reviewed patch #
Total comments: 7
Patch Set 2 : String changes without reformatting #Patch Set 3 : PS2 + reformat = PS3 = PS1 #
Total comments: 4
Patch Set 4 : Convert to doing i18n in JS #Patch Set 5 : fix closure issues #
Messages
Total messages: 52 (32 generated)
Description was changed from
==========
MD Settings: Update Protected Content for redesign
1. Preserves settings.privacy.drm_enabled to toggle unique identifiers.
2. Adds webkit.webprefs.encrypted_media_enabled above to toggle EME.
3. Hides the exception list if prefs.settings.privacy.drm_enabled is
disabled.
BUG=687783
==========
to
==========
MD Settings: Update Protected Content for redesign
1. Preserves settings.privacy.drm_enabled to toggle unique identifiers.
2. Adds webkit.webprefs.encrypted_media_enabled above to toggle EME.
3. Hides the exception list if prefs.settings.privacy.drm_enabled is
disabled.
BUG=687783
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
The CQ bit was checked by tommycli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
tommycli@chromium.org changed reviewers: + stevenjb@chromium.org
stevenjb: PTAL, Thanks! https://codereview.chromium.org/2688793002/diff/1/chrome/browser/ui/webui/set... File chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc (right): https://codereview.chromium.org/2688793002/diff/1/chrome/browser/ui/webui/set... chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc:1590: #endif Wow the diff looks awful. But the only changes are the above two entries and adding an #if defined preprocessor exclusion. git cl upload requested that I use git cl format before uploading.
https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> Just FMI, any particular reason to do this in the HTML instead of using i18n() in the JS? I realize it's minutely more efficient this way, but seems a little less readable than something like: [[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] https://codereview.chromium.org/2688793002/diff/1/chrome/browser/ui/webui/set... File chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc (right): https://codereview.chromium.org/2688793002/diff/1/chrome/browser/ui/webui/set... chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc:1590: #endif On 2017/02/10 00:22:23, tommycli wrote: > Wow the diff looks awful. But the only changes are the above two entries and > adding an #if defined preprocessor exclusion. > > git cl upload requested that I use git cl format before uploading. Might be worth uploading a formatting only CL, you can RS l-g-t-m it.
https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> On 2017/02/10 00:32:31, stevenjb wrote: > Just FMI, any particular reason to do this in the HTML instead of using i18n() > in the JS? I realize it's minutely more efficient this way, but seems a little > less readable than something like: > [[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] > Ask dschuyler for details, but the plan is to eventually eliminate all of the JavaScript i18n. As I understand it, if we remove all JavaScript i18n, the difference is not minute.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by tommycli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm (trusting that the md_settings_localized_strings_provider.cc change is correct, it would be better as a separate formatting CL). https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> On 2017/02/10 00:51:37, tommycli wrote: > On 2017/02/10 00:32:31, stevenjb wrote: > > Just FMI, any particular reason to do this in the HTML instead of using i18n() > > in the JS? I realize it's minutely more efficient this way, but seems a little > > less readable than something like: > > > [[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] > > > > Ask dschuyler for details, but the plan is to eventually eliminate all of the > JavaScript i18n. As I understand it, if we remove all JavaScript i18n, the > difference is not minute. Hmm, I am unconvinced that is achievable, but if it is a non minute improvement in general, this is fine.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Hey Steven, thanks! I will send in the formatting change as a separate TBR CL. No problem :D https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> On 2017/02/10 01:12:47, stevenjb wrote: > On 2017/02/10 00:51:37, tommycli wrote: > > On 2017/02/10 00:32:31, stevenjb wrote: > > > Just FMI, any particular reason to do this in the HTML instead of using > i18n() > > > in the JS? I realize it's minutely more efficient this way, but seems a > little > > > less readable than something like: > > > > > > [[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] > > > > > > > Ask dschuyler for details, but the plan is to eventually eliminate all of the > > JavaScript i18n. As I understand it, if we remove all JavaScript i18n, the > > difference is not minute. > > Hmm, I am unconvinced that is achievable, but if it is a non minute improvement > in general, this is fine. Hey - I should be more specific... if we can remove all the i18n-content attributes within the HTML, we will be able to skip the step where we parse the HTML in JavaScript modifying the DOM. That was the part that was non-minute.
Patchset #2 (id:20001) has been deleted
The CQ bit was checked by tommycli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/02/10 16:58:42, tommycli wrote: > Hey Steven, thanks! I will send in the formatting change as a separate TBR CL. > No problem :D > > https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... > File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): > > https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... > chrome/browser/resources/settings/privacy_page/privacy_page.html:428: > '$i18n{siteSettingsBlocked}')]]"> > On 2017/02/10 01:12:47, stevenjb wrote: > > On 2017/02/10 00:51:37, tommycli wrote: > > > On 2017/02/10 00:32:31, stevenjb wrote: > > > > Just FMI, any particular reason to do this in the HTML instead of using > > i18n() > > > > in the JS? I realize it's minutely more efficient this way, but seems a > > little > > > > less readable than something like: > > > > > > > > > > [[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] > > > > > > > > > > Ask dschuyler for details, but the plan is to eventually eliminate all of > the > > > JavaScript i18n. As I understand it, if we remove all JavaScript i18n, the > > > difference is not minute. > > > > Hmm, I am unconvinced that is achievable, but if it is a non minute > improvement > > in general, this is fine. > > Hey - I should be more specific... if we can remove all the i18n-content > attributes within the HTML, we will be able to skip the step where we parse the > HTML in JavaScript modifying the DOM. That was the part that was non-minute. Hey Steven, it's not possible to submit a reformat-only CL, since git cl format only prefers the two-space indent when there is an #if defined statement. In other words, it only wants to reformat if I make the changes in this CL. As a substitute, I have uploaded PS2 which is the string-only changes without reformatting, and then PS3, which is just a reformat of PS2, which is equal to PS1, the originally reviewed patch. I should have done that in the first place. As for git cl format's weird behavior, I will submit a question / bug to the clang-format group. Thanks!
The CQ bit was unchecked by tommycli@chromium.org
The CQ bit was checked by tommycli@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from stevenjb@chromium.org Link to the patchset: https://codereview.chromium.org/2688793002/#ps60001 (title: "PS2 + reformat = PS3 = PS1")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> On 2017/02/10 16:58:42, tommycli wrote: > On 2017/02/10 01:12:47, stevenjb wrote: > > On 2017/02/10 00:51:37, tommycli wrote: > > > On 2017/02/10 00:32:31, stevenjb wrote: > > > > Just FMI, any particular reason to do this in the HTML instead of using > > i18n() > > > > in the JS? I realize it's minutely more efficient this way, but seems a > > little > > > > less readable than something like: > > > > > > > > > > [[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] > > > > > > > > > > Ask dschuyler for details, but the plan is to eventually eliminate all of > the > > > JavaScript i18n. As I understand it, if we remove all JavaScript i18n, the > > > difference is not minute. > > > > Hmm, I am unconvinced that is achievable, but if it is a non minute > improvement > > in general, this is fine. > > Hey - I should be more specific... if we can remove all the i18n-content > attributes within the HTML, we will be able to skip the step where we parse the > HTML in JavaScript modifying the DOM. That was the part that was non-minute. OK, that makes sense. I was actually suggesting: label=[[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] Then in JS: getProtectedContentLabel_: function() { return this.prefs.webkit.webprefs.encrypted_media_enabled.value ? this.i18n(siteSettingsProtectedContentEnable) : this.i18n(siteSettingsBlocked); } Only because I find the HTML is kind of hard to read, but I noticed that the pattern / function you used already exists below, so I guess this is fine.
On 2017/02/10 17:16:09, tommycli wrote: > On 2017/02/10 16:58:42, tommycli wrote: > > Hey Steven, thanks! I will send in the formatting change as a separate TBR CL. > > No problem :D > > > > > https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... > > File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): > > > > > https://codereview.chromium.org/2688793002/diff/1/chrome/browser/resources/se... > > chrome/browser/resources/settings/privacy_page/privacy_page.html:428: > > '$i18n{siteSettingsBlocked}')]]"> > > On 2017/02/10 01:12:47, stevenjb wrote: > > > On 2017/02/10 00:51:37, tommycli wrote: > > > > On 2017/02/10 00:32:31, stevenjb wrote: > > > > > Just FMI, any particular reason to do this in the HTML instead of using > > > i18n() > > > > > in the JS? I realize it's minutely more efficient this way, but seems a > > > little > > > > > less readable than something like: > > > > > > > > > > > > > > > [[getProtectedContentLabel_(prefs.webkit.webprefs.encrypted_media_enabled.value)]] > > > > > > > > > > > > > Ask dschuyler for details, but the plan is to eventually eliminate all of > > the > > > > JavaScript i18n. As I understand it, if we remove all JavaScript i18n, the > > > > difference is not minute. > > > > > > Hmm, I am unconvinced that is achievable, but if it is a non minute > > improvement > > > in general, this is fine. > > > > Hey - I should be more specific... if we can remove all the i18n-content > > attributes within the HTML, we will be able to skip the step where we parse > the > > HTML in JavaScript modifying the DOM. That was the part that was non-minute. > > Hey Steven, it's not possible to submit a reformat-only CL, since git cl format > only prefers the two-space indent when there is an #if defined statement. In > other words, it only wants to reformat if I make the changes in this CL. As a > substitute, I have uploaded PS2 which is the string-only changes without > reformatting, and then PS3, which is just a reformat of PS2, which is equal to > PS1, the originally reviewed patch. I should have done that in the first place. > > As for git cl format's weird behavior, I will submit a question / bug to the > clang-format group. Thanks! it's already been discussed on chromium-dev@ and filed on upstream clang-format
dbeam@chromium.org changed reviewers: + dbeam@chromium.org
https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> this will break on '
The CQ bit was unchecked by dbeam@chromium.org
tommycli@chromium.org changed reviewers: + dschuyler@chromium.org
dschuyler/dbeam: https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> On 2017/02/10 17:23:53, Dan Beam wrote: > this will break on ' +dschuyler Indeed this does break on '. I thought we escaped that, but we only escape double-quotes. Does it seem worth it to additionally escape this in i18n_source_stream? If not, we probably need to abandon all usages of this pattern in Settings. (There are many in site_settings_page.)
https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> On 2017/02/10 18:46:31, tommycli wrote: > On 2017/02/10 17:23:53, Dan Beam wrote: > > this will break on ' > > +dschuyler > > Indeed this does break on '. I thought we escaped that, but we only escape > double-quotes. Does it seem worth it to additionally escape this in > i18n_source_stream? If not, we probably need to abandon all usages of this > pattern in Settings. (There are many in site_settings_page.) A CL to fix it is here: https://codereview.chromium.org/2681623002/ And a doc discussing it further is here: https://docs.google.com/document/d/1qWU0tJfLbmE0clsCdLUy7etk3Of8hUb8qG87tYKM6...
The CQ bit was checked by tommycli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
stevenjb: Thanks! I converted to the JS i18n you suggested earlier. PTAL again https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... File chrome/browser/resources/settings/privacy_page/privacy_page.html (right): https://codereview.chromium.org/2688793002/diff/60001/chrome/browser/resource... chrome/browser/resources/settings/privacy_page/privacy_page.html:428: '$i18n{siteSettingsBlocked}')]]"> On 2017/02/10 19:07:58, dschuyler wrote: > On 2017/02/10 18:46:31, tommycli wrote: > > On 2017/02/10 17:23:53, Dan Beam wrote: > > > this will break on ' > > > > +dschuyler > > > > Indeed this does break on '. I thought we escaped that, but we only escape > > double-quotes. Does it seem worth it to additionally escape this in > > i18n_source_stream? If not, we probably need to abandon all usages of this > > pattern in Settings. (There are many in site_settings_page.) > > A CL to fix it is here: https://codereview.chromium.org/2681623002/ > And a doc discussing it further is here: > https://docs.google.com/document/d/1qWU0tJfLbmE0clsCdLUy7etk3Of8hUb8qG87tYKM6... Hey thanks, that explains things. In PS4, I've converted the code to use JavaScript i18n as stevenjb recommended earlier. This should allow us to get unblocked and fix the protected content. We can convert back to the ternary expression later once i18nStr is landed.
LGTM FWIW I do find this more readable.
On 2017/02/10 19:37:49, stevenjb wrote: > LGTM > FWIW I do find this more readable. alrighty thanks!
The CQ bit was unchecked by tommycli@chromium.org
The CQ bit was checked by tommycli@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: closure_compilation on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/closure_compila...)
The CQ bit was checked by tommycli@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by tommycli@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from stevenjb@chromium.org Link to the patchset: https://codereview.chromium.org/2688793002/#ps100001 (title: "fix closure issues")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 100001, "attempt_start_ts": 1486762680086200,
"parent_rev": "70adf8ced0a1e191f0dabdec73b568c26f1ca2d2", "commit_rev":
"595de1b5cec1ba648843e33d2ee01957b4f5966c"}
Message was sent while issue was closed.
Description was changed from
==========
MD Settings: Update Protected Content for redesign
1. Preserves settings.privacy.drm_enabled to toggle unique identifiers.
2. Adds webkit.webprefs.encrypted_media_enabled above to toggle EME.
3. Hides the exception list if prefs.settings.privacy.drm_enabled is
disabled.
BUG=687783
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
==========
to
==========
MD Settings: Update Protected Content for redesign
1. Preserves settings.privacy.drm_enabled to toggle unique identifiers.
2. Adds webkit.webprefs.encrypted_media_enabled above to toggle EME.
3. Hides the exception list if prefs.settings.privacy.drm_enabled is
disabled.
BUG=687783
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation
Review-Url: https://codereview.chromium.org/2688793002
Cr-Commit-Position: refs/heads/master@{#449744}
Committed:
https://chromium.googlesource.com/chromium/src/+/595de1b5cec1ba648843e33d2ee0...
==========
Message was sent while issue was closed.
Committed patchset #5 (id:100001) as https://chromium.googlesource.com/chromium/src/+/595de1b5cec1ba648843e33d2ee0... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
