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

Side by Side 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: Send notification if user cancels the "restart" alert 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 #import <PreferencePanes/PreferencePanes.h> 6 #import <PreferencePanes/PreferencePanes.h>
7 #import <SecurityInterface/SFAuthorizationView.h> 7 #import <SecurityInterface/SFAuthorizationView.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // update...Status methods. 58 // update...Status methods.
59 BOOL is_service_running_; 59 BOOL is_service_running_;
60 BOOL is_pane_unlocked_; 60 BOOL is_pane_unlocked_;
61 61
62 // True if a new proposed config file has been loaded into memory. 62 // True if a new proposed config file has been loaded into memory.
63 BOOL have_new_config_; 63 BOOL have_new_config_;
64 64
65 // True if launchd has been instructed to stop the service and we are waiting 65 // True if launchd has been instructed to stop the service and we are waiting
66 // for the operation to complete. 66 // for the operation to complete.
67 BOOL awaiting_service_stop_; 67 BOOL awaiting_service_stop_;
68
69 // True if a version-mismatch has been detected and the whole pane has to be
70 // disabled.
71 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.
68 } 72 }
69 73
70 - (void)mainViewDidLoad; 74 - (void)mainViewDidLoad;
71 - (void)willSelect; 75 - (void)willSelect;
76 - (void)didSelect;
72 - (void)willUnselect; 77 - (void)willUnselect;
73 - (void)onDisable:(id)sender; 78 - (void)onDisable:(id)sender;
74 - (void)applyConfiguration:(id)sender 79 - (void)applyConfiguration:(id)sender
75 pin:(NSString*)pin; 80 pin:(NSString*)pin;
76 - (void)onNewConfigFile:(NSNotification*)notification; 81 - (void)onNewConfigFile:(NSNotification*)notification;
77 - (void)refreshServiceStatus:(NSTimer*)timer; 82 - (void)refreshServiceStatus:(NSTimer*)timer;
78 - (void)authorizationViewDidAuthorize:(SFAuthorizationView*)view; 83 - (void)authorizationViewDidAuthorize:(SFAuthorizationView*)view;
79 - (void)authorizationViewDidDeauthorize:(SFAuthorizationView*)view; 84 - (void)authorizationViewDidDeauthorize:(SFAuthorizationView*)view;
80 - (void)updateServiceStatus; 85 - (void)updateServiceStatus;
81 - (void)updateAuthorizationStatus; 86 - (void)updateAuthorizationStatus;
82 87
83 // Read any new config file if present. If a config file is successfully read, 88 // Read any new config file if present. If a config file is successfully read,
84 // this deletes the file and keeps the config data loaded in memory. If this 89 // this deletes the file and keeps the config data loaded in memory. If this
85 // method is called a second time (when the file has been deleted), the current 90 // method is called a second time (when the file has been deleted), the current
86 // config is remembered, so this method acts as a latch: it can change 91 // config is remembered, so this method acts as a latch: it can change
87 // |have_new_config_| from NO to YES, but never from YES to NO. 92 // |have_new_config_| from NO to YES, but never from YES to NO.
88 // 93 //
89 // This scheme means that this method can delete the file immediately (to avoid 94 // This scheme means that this method can delete the file immediately (to avoid
90 // leaving a stale file around in case of a crash), but this method can safely 95 // leaving a stale file around in case of a crash), but this method can safely
91 // be called multiple times without forgetting the loaded config. To explicitly 96 // be called multiple times without forgetting the loaded config. To explicitly
92 // forget the current config, set |have_new_config_| to NO. 97 // forget the current config, set |have_new_config_| to NO.
98 //
99 // This method first checks that the pane has not been disabled due to a
100 // pending restart. If |is_pane_disabled_| is YES, this method does nothing,
101 // 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.
93 - (void)readNewConfig; 102 - (void)readNewConfig;
94 103
95 // Update all UI controls according to any stored flags and loaded config. 104 // Update all UI controls according to any stored flags and loaded config.
96 // This should be called after any sequence of operations that might change the 105 // This should be called after any sequence of operations that might change the
97 // UI state. 106 // UI state.
98 - (void)updateUI; 107 - (void)updateUI;
99 108
100 // Alert the user to a generic error condition. 109 // Alert the user to a generic error condition.
101 - (void)showError; 110 - (void)showError;
102 111
103 // Alert the user that the typed PIN is incorrect. 112 // Alert the user that the typed PIN is incorrect.
104 - (void)showIncorrectPinMessage; 113 - (void)showIncorrectPinMessage;
105 114
106 // Save the new config to the system, and either start the service or inform 115 // Save the new config to the system, and either start the service or inform
107 // the currently-running service of the new config. 116 // the currently-running service of the new config.
108 - (void)applyNewServiceConfig; 117 - (void)applyNewServiceConfig;
109 118
110 - (BOOL)runHelperAsRootWithCommand:(const char*)command 119 - (BOOL)runHelperAsRootWithCommand:(const char*)command
111 inputData:(const std::string&)input_data; 120 inputData:(const std::string&)input_data;
112 - (BOOL)sendJobControlMessage:(const char*)launch_key; 121 - (BOOL)sendJobControlMessage:(const char*)launch_key;
113 122
114 // Compare the version of the running pref-pane against the installed version. 123 // Compare the version of the running pref-pane against the installed version.
115 // If the versions are mismatched, return YES and restart the System 124 // If the versions are mismatched and the pref-pane is visible, disable the
116 // Preferences application, so the correct version of this pref-pane is loaded. 125 // pane to prevent interaction, and prompt the user to restart System
117 - (BOOL)restartPanelIfDifferentVersionInstalled; 126 // Preferences.
127 //
128 // This should be called on notification of a new config, and also in
129 // |didShow| when the pane becomes visible. The pane needs to be visible so
130 // that the alert appears as a sheet over the pane (instead of a detached
131 // window), which gives the user an appropriate context for the alert.
132 //
133 // In the case of a version-mismatch, the new config file should not be deleted
134 // until System Preferences is restarted. This method sets the
135 // |is_pane_disabled_| flag on version-mismatch, which is checked by
136 // |readNewConfig|.
137 - (void)checkInstalledVersion;
138
139 - (void)mismatchAlertDidEnd:(NSAlert*)alert
140 returnCode:(NSInteger)returnCode
141 contextInfo:(void*)contextInfo;
142
143 // Called when the user chooses OK when prompted to restart System Preferences.
144 - (void)restartSystemPreferences;
118 145
119 @end 146 @end
OLDNEW
« no previous file with comments | « no previous file | remoting/host/me2me_preference_pane.mm » ('j') | remoting/host/me2me_preference_pane.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698