Chromium Code Reviews| Index: remoting/host/me2me_preference_pane.h |
| diff --git a/remoting/host/me2me_preference_pane.h b/remoting/host/me2me_preference_pane.h |
| index 8ddf0b2424214530db4496b5b64901ffab80a61b..668d8764bbab53c1eb87595a294c6d9bed9063cb 100644 |
| --- a/remoting/host/me2me_preference_pane.h |
| +++ b/remoting/host/me2me_preference_pane.h |
| @@ -65,10 +65,15 @@ class JsonHostConfig { |
| // True if launchd has been instructed to stop the service and we are waiting |
| // for the operation to complete. |
| BOOL awaiting_service_stop_; |
| + |
| + // True if a version-mismatch has been detected and the whole pane has to be |
| + // disabled. |
| + BOOL is_pane_disabled_; |
|
Jamie
2012/06/06 16:26:49
Now that I understand better what's going on here,
Lambros
2012/06/07 00:25:28
Done.
|
| } |
| - (void)mainViewDidLoad; |
| - (void)willSelect; |
| +- (void)didSelect; |
| - (void)willUnselect; |
| - (void)onDisable:(id)sender; |
| - (void)applyConfiguration:(id)sender |
| @@ -90,6 +95,10 @@ class JsonHostConfig { |
| // leaving a stale file around in case of a crash), but this method can safely |
| // be called multiple times without forgetting the loaded config. To explicitly |
| // forget the current config, set |have_new_config_| to NO. |
| +// |
| +// This method first checks that the pane has not been disabled due to a |
| +// pending restart. If |is_pane_disabled_| is YES, this method does nothing, |
| +// leaving the config file untouched. |
|
Jamie
2012/06/01 18:53:26
Is this second sentence still correct? Since cance
Lambros
2012/06/05 17:57:39
Yes. Cancelling the "please restart" prompt now s
Jamie
2012/06/06 16:26:49
Perhaps it would be better not to call this method
Lambros
2012/06/07 00:25:28
Done.
|
| - (void)readNewConfig; |
| // Update all UI controls according to any stored flags and loaded config. |
| @@ -112,8 +121,26 @@ class JsonHostConfig { |
| - (BOOL)sendJobControlMessage:(const char*)launch_key; |
| // Compare the version of the running pref-pane against the installed version. |
| -// If the versions are mismatched, return YES and restart the System |
| -// Preferences application, so the correct version of this pref-pane is loaded. |
| -- (BOOL)restartPanelIfDifferentVersionInstalled; |
| +// If the versions are mismatched and the pref-pane is visible, disable the |
| +// pane to prevent interaction, and prompt the user to restart System |
| +// Preferences. |
| +// |
| +// This should be called on notification of a new config, and also in |
| +// |didShow| when the pane becomes visible. The pane needs to be visible so |
| +// that the alert appears as a sheet over the pane (instead of a detached |
| +// window), which gives the user an appropriate context for the alert. |
| +// |
| +// In the case of a version-mismatch, the new config file should not be deleted |
| +// until System Preferences is restarted. This method sets the |
| +// |is_pane_disabled_| flag on version-mismatch, which is checked by |
| +// |readNewConfig|. |
| +- (void)checkInstalledVersion; |
| + |
| +- (void)mismatchAlertDidEnd:(NSAlert*)alert |
| + returnCode:(NSInteger)returnCode |
| + contextInfo:(void*)contextInfo; |
| + |
| +// Called when the user chooses OK when prompted to restart System Preferences. |
| +- (void)restartSystemPreferences; |
| @end |