From 849c9631a51adf7ce6b591b6e57b5b45fee472c2 Mon Sep 17 00:00:00 2001 From: "sreeram@chromium.org" Date: Tue, 26 Jul 2011 01:06:57 +0000 Subject: Refactor Instant web UI (chrome://settings page). Currently, the web UI directly sets two Instant prefs (instant.enabled and instant.confirm_dialog_shown), but doesn't call InstantController's Enable() or Disable(). Those methods set some additional prefs, so this refactoring calls those instead. This will also be helpful in a later CL where we enable Instant by default in a field trial. There are two behavioural changes: + The kInstantEnabledOnce pref is set, even for a disable (@sky approves). + The first time the user enables Instant, the old behaviour used to be that the checkbox would get cleared, then the confirm dialog would be shown. I found that this was slightly janky, so we now leave the checkbox enabled when showing the confirm dialog. After the user clicks OK or Cancel, the checkbox acquires the expected state (as before). BUG=none TEST=Enabled/disabled checkbox, and saw no regression in behaviour. Review URL: http://codereview.chromium.org/7396025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94005 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/instant/instant_controller.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'chrome/browser/instant') diff --git a/chrome/browser/instant/instant_controller.cc b/chrome/browser/instant/instant_controller.cc index c25f62c..4e99b3d 100644 --- a/chrome/browser/instant/instant_controller.cc +++ b/chrome/browser/instant/instant_controller.cc @@ -135,6 +135,7 @@ void InstantController::Disable(Profile* profile) { delta.InMinutes(), 1, 60 * 24 * 10, 50); } + service->SetBoolean(prefs::kInstantEnabledOnce, true); service->SetBoolean(prefs::kInstantEnabled, false); } -- cgit v1.1