|
|
Chromium Code Reviews|
Created:
5 years, 10 months ago by Alexander Alekseev Modified:
5 years, 9 months ago CC:
chromium-reviews, dbeam+watch-options_chromium.org, michaelpg+watch-options_chromium.org, stevenjb+watch_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionChromeOS: Update browser option UI for automatic timezone detection.
Update chrome://settings for "automatic timezone detection" option after UI
review.
BUG=461953
TEST=manual
Committed: https://crrev.com/787f34332bc57394f5fde94cabf1676ad801fdea
Cr-Commit-Position: refs/heads/master@{#318753}
Patch Set 1 #
Total comments: 11
Patch Set 2 : Fixed SharedOptionsTest. #
Messages
Total messages: 27 (8 generated)
alemate@chromium.org changed reviewers: + stevenjb@chromium.org
1) This Cl moves checkbox "Set time zone automatically using your location" closer to "Select your timezone" dropbox. 2) Removes "Date and time are set automatically." placeholder (refer to jennschen@ and barbm@ for details). 3) Fixes setSystemTimezoneManaged() JS method : it should be callable from C++ now. 4) Properly disables "Select timezone" dropbox if timezone is resolved automatically. Please review.
stevenjb@chromium.org changed reviewers: + michaelpg@chromium.org
+michaelpg@ Who is more familiar with this bit of settings UI.
https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... File chrome/browser/resources/options/browser_options.js (right): https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:408: $('timezone-value-select').disabled = loadTimeData.getBoolean( Do we re-enable this dropdown if I uncheck the resolve-timezone-by-geolocation input?
https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... File chrome/browser/resources/options/browser_options.js (right): https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:408: $('timezone-value-select').disabled = loadTimeData.getBoolean( On 2015/02/19 22:38:36, michaelpg wrote: > Do we re-enable this dropdown if I uncheck the resolve-timezone-by-geolocation > input? Yes. See setSystemTimezoneManaged() code.
https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... File chrome/browser/resources/options/browser_options.js (right): https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:408: $('timezone-value-select').disabled = loadTimeData.getBoolean( On 2015/02/19 22:41:55, Alexander Alekseev wrote: > On 2015/02/19 22:38:36, michaelpg wrote: > > Do we re-enable this dropdown if I uncheck the resolve-timezone-by-geolocation > > input? > > Yes. See setSystemTimezoneManaged() code. Sorry, I'm confused. Assuming no enterprise policy, if resolve-timezone-by-geolocation is initially checked, how does $('timezone-value-select') get enabled if I uncheck resolve-timezone-by-geolocation?
https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... File chrome/browser/resources/options/browser_options.js (right): https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:408: $('timezone-value-select').disabled = loadTimeData.getBoolean( On 2015/02/24 06:38:06, michaelpg wrote: > On 2015/02/19 22:41:55, Alexander Alekseev wrote: > > On 2015/02/19 22:38:36, michaelpg wrote: > > > Do we re-enable this dropdown if I uncheck the > resolve-timezone-by-geolocation > > > input? > > > > Yes. See setSystemTimezoneManaged() code. > > Sorry, I'm confused. Assuming no enterprise policy, if > resolve-timezone-by-geolocation is initially checked, how does > $('timezone-value-select') get enabled if I uncheck > resolve-timezone-by-geolocation? setSystemTimezoneManaged() creates onclick handler: $('resolve-timezone-by-geolocation').onclick = function(event) { $('timezone-value-select').disabled = event.currentTarget.checked; };
https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... File chrome/browser/resources/options/browser_options.js (right): https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:401: if ($('set-time-button')) by the way, this check is redundant now https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:408: $('timezone-value-select').disabled = loadTimeData.getBoolean( On 2015/02/24 12:18:30, Alexander Alekseev wrote: > On 2015/02/24 06:38:06, michaelpg wrote: > > On 2015/02/19 22:41:55, Alexander Alekseev wrote: > > > On 2015/02/19 22:38:36, michaelpg wrote: > > > > Do we re-enable this dropdown if I uncheck the > > resolve-timezone-by-geolocation > > > > input? > > > > > > Yes. See setSystemTimezoneManaged() code. > > > > Sorry, I'm confused. Assuming no enterprise policy, if > > resolve-timezone-by-geolocation is initially checked, how does > > $('timezone-value-select') get enabled if I uncheck > > resolve-timezone-by-geolocation? > > setSystemTimezoneManaged() creates onclick handler: > > $('resolve-timezone-by-geolocation').onclick = function(event) { > > $('timezone-value-select').disabled = event.currentTarget.checked; > > }; Ah, I see. It's kind of unintuitive that we rely on that function for this functionality. I'd suggest moving that click handler logic to a separate function which we can use both here and in setSystemTimezoneManaged_. https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:2179: 'setSystemTimezoneManaged', so this is an existing bug, since the function is already being called by the C++?
nkostylev@chromium.org changed reviewers: + nkostylev@chromium.org
Per offline discussion please use different BUG
https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... File chrome/browser/resources/options/browser_options.js (right): https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:401: if ($('set-time-button')) On 2015/02/24 13:04:39, michaelpg wrote: > by the way, this check is redundant now Why? It seems I haven't changed its behavior. https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:408: $('timezone-value-select').disabled = loadTimeData.getBoolean( On 2015/02/24 13:04:39, michaelpg wrote: > On 2015/02/24 12:18:30, Alexander Alekseev wrote: > > On 2015/02/24 06:38:06, michaelpg wrote: > > > On 2015/02/19 22:41:55, Alexander Alekseev wrote: > > > > On 2015/02/19 22:38:36, michaelpg wrote: > > > > > Do we re-enable this dropdown if I uncheck the > > > resolve-timezone-by-geolocation > > > > > input? > > > > > > > > Yes. See setSystemTimezoneManaged() code. > > > > > > Sorry, I'm confused. Assuming no enterprise policy, if > > > resolve-timezone-by-geolocation is initially checked, how does > > > $('timezone-value-select') get enabled if I uncheck > > > resolve-timezone-by-geolocation? > > > > setSystemTimezoneManaged() creates onclick handler: > > > > $('resolve-timezone-by-geolocation').onclick = function(event) { > > > > > $('timezone-value-select').disabled = event.currentTarget.checked; > > > > > }; > > Ah, I see. It's kind of unintuitive that we rely on that function for this > functionality. I'd suggest moving that click handler logic to a separate > function which we can use both here and in setSystemTimezoneManaged_. This would lead to duplicate call to this new function on initialization, because enableTimeZoneTrackingOption actually means that system time zone is not managed: --- chrome/browser/ui/webui/options/browser_options_handler.cc --- 678 values->SetBoolean("enableTimeZoneTrackingOption", 679 !have_disable_time_zone_tracking_option_switch && 680 !chromeos::system::HasSystemTimezonePolicy()); ------------------------------------------------------------------ https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:2179: 'setSystemTimezoneManaged', On 2015/02/24 13:04:39, michaelpg wrote: > so this is an existing bug, since the function is already being called by the > C++? Yes.
Ping? On 2015/02/25 20:39:42, Alexander Alekseev wrote: > https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... > File chrome/browser/resources/options/browser_options.js (right): > > https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... > chrome/browser/resources/options/browser_options.js:401: if > ($('set-time-button')) > On 2015/02/24 13:04:39, michaelpg wrote: > > by the way, this check is redundant now > > Why? It seems I haven't changed its behavior. > > https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... > chrome/browser/resources/options/browser_options.js:408: > $('timezone-value-select').disabled = loadTimeData.getBoolean( > On 2015/02/24 13:04:39, michaelpg wrote: > > On 2015/02/24 12:18:30, Alexander Alekseev wrote: > > > On 2015/02/24 06:38:06, michaelpg wrote: > > > > On 2015/02/19 22:41:55, Alexander Alekseev wrote: > > > > > On 2015/02/19 22:38:36, michaelpg wrote: > > > > > > Do we re-enable this dropdown if I uncheck the > > > > resolve-timezone-by-geolocation > > > > > > input? > > > > > > > > > > Yes. See setSystemTimezoneManaged() code. > > > > > > > > Sorry, I'm confused. Assuming no enterprise policy, if > > > > resolve-timezone-by-geolocation is initially checked, how does > > > > $('timezone-value-select') get enabled if I uncheck > > > > resolve-timezone-by-geolocation? > > > > > > setSystemTimezoneManaged() creates onclick handler: > > > > > > $('resolve-timezone-by-geolocation').onclick = function(event) { > > > > > > > > > $('timezone-value-select').disabled = event.currentTarget.checked; > > > > > > > > > }; > > > > Ah, I see. It's kind of unintuitive that we rely on that function for this > > functionality. I'd suggest moving that click handler logic to a separate > > function which we can use both here and in setSystemTimezoneManaged_. > > > This would lead to duplicate call to this new function on initialization, > because enableTimeZoneTrackingOption actually means that system time zone is not > managed: > > --- chrome/browser/ui/webui/options/browser_options_handler.cc --- > > 678 values->SetBoolean("enableTimeZoneTrackingOption", > 679 !have_disable_time_zone_tracking_option_switch && > 680 !chromeos::system::HasSystemTimezonePolicy()); > > ------------------------------------------------------------------ > > https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... > chrome/browser/resources/options/browser_options.js:2179: > 'setSystemTimezoneManaged', > On 2015/02/24 13:04:39, michaelpg wrote: > > so this is an existing bug, since the function is already being called by the > > C++? > > Yes.
lgtm
lgtm https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... File chrome/browser/resources/options/browser_options.js (right): https://codereview.chromium.org/944593002/diff/1/chrome/browser/resources/opt... chrome/browser/resources/options/browser_options.js:401: if ($('set-time-button')) On 2015/02/25 20:39:41, Alexander Alekseev wrote: > On 2015/02/24 13:04:39, michaelpg wrote: > > by the way, this check is redundant now > > Why? It seems I haven't changed its behavior. True, I think the outer if statement had been added in the lady change. The button appears if and only if we're on chrome os, so now that we're checking cr.isChromeOs, the button will always exist.
owner lgtm
The CQ bit was checked by alemate@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/944593002/1
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by alemate@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/944593002/1
The CQ bit was checked by alemate@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from stevenjb@chromium.org, nkostylev@chromium.org, michaelpg@chromium.org Link to the patchset: https://codereview.chromium.org/944593002/#ps20001 (title: "Fixed SharedOptionsTest.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/944593002/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/787f34332bc57394f5fde94cabf1676ad801fdea Cr-Commit-Position: refs/heads/master@{#318753} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
