Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2234)

Unified Diff: remoting/host/me2me_preference_pane.h

Issue 10446091: Prompt user before restarting System Preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix if.. brace style Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/me2me_preference_pane.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d3cfb06d3f3e5918f446743ba0a578e53c23eb37 100644
--- a/remoting/host/me2me_preference_pane.h
+++ b/remoting/host/me2me_preference_pane.h
@@ -65,10 +65,16 @@ 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. If true, this causes all
+ // controls to be greyed out, and also prevents any config file from being
+ // deleted, pending a restart of the preference pane.
+ BOOL restart_pending_or_canceled_;
}
- (void)mainViewDidLoad;
- (void)willSelect;
+- (void)didSelect;
- (void)willUnselect;
- (void)onDisable:(id)sender;
- (void)applyConfiguration:(id)sender
@@ -90,6 +96,9 @@ 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 should not be called if |restart_pending_or_canceled_| is YES,
+// since this would delete any config file.
- (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
+// |didSelect| 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 be kept until
+// System Preferences is restarted, or thrown away when the user cancels the
+// alert. This method sets the |restart_pending_or_canceled_| flag on
+// detecting version-mismatch.
+- (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
« no previous file with comments | « no previous file | remoting/host/me2me_preference_pane.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698