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

Unified Diff: remoting/host/me2me_preference_pane.mm

Issue 10566013: Detect if user closes the pref-pane without disabling Chromoting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/plugin/daemon_controller_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/me2me_preference_pane.mm
diff --git a/remoting/host/me2me_preference_pane.mm b/remoting/host/me2me_preference_pane.mm
index ac33b13eb329ad3a275c923e5725bf0d183b85ce..5d8cec82c44c75928aab6beae1307590948e8b59 100644
--- a/remoting/host/me2me_preference_pane.mm
+++ b/remoting/host/me2me_preference_pane.mm
@@ -35,6 +35,18 @@ namespace {
#define kUpdateSucceededNotificationName kServiceName ".update_succeeded"
#define kUpdateFailedNotificationName kServiceName ".update_failed"
+// This notification (or the UpdateFailed notification) is sent whenever the
+// pref-pane is deselected. This is analogous to the user canceling the
+// confirm-PIN dialog (or UAC prompt) on Windows.
+// If the plugin is expecting an action to occur (such as the user disabling
+// the Host service), it should treat this as a signal to stop waiting, and
+// assume the action has been canceled by the user.
+// Otherwise, the plugin should ignore this notification. The pref-pane does
+// not know whether it was launched by the plugin or by the user (in the case
+// of disabling remote connections), so it has to send this notification
+// regardless.
+#define kUserCanceledNotificationName kServiceName ".user_canceled"
Jamie 2012/06/15 22:34:56 Can we call this update_canceled for consistency w
+
#define kConfigDir "/Library/PrivilegedHelperTools/"
// This helper script is executed as root. It is passed a command-line option
@@ -329,6 +341,8 @@ std::string JsonHostConfig::GetSerializedData() const {
service_status_timer_ = nil;
if (have_new_config_)
[self notifyPlugin:kUpdateFailedNotificationName];
+ else
+ [self notifyPlugin:kUserCanceledNotificationName];
Jamie 2012/06/15 22:34:56 This feels inconsistent. Why send a failed notific
}
- (void)applyConfiguration:(id)sender
@@ -753,11 +767,12 @@ std::string JsonHostConfig::GetSerializedData() const {
NSLog(@"Failed to get path of configuration data.");
return;
}
- if (access(file.c_str(), F_OK) != 0)
- return;
-
- remove(file.c_str());
- [self notifyPlugin:kUpdateFailedNotificationName];
+ if (access(file.c_str(), F_OK) != 0) {
+ [self notifyPlugin:kUserCanceledNotificationName];
Jamie 2012/06/15 22:34:56 Under what circumstances can this happen? Would it
+ } else {
+ remove(file.c_str());
+ [self notifyPlugin:kUpdateFailedNotificationName];
+ }
}
}
« no previous file with comments | « no previous file | remoting/host/plugin/daemon_controller_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698