OLD | NEW |
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 #include "remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.h" | 5 #include "remoting/host/installer/mac/uninstaller/remoting_uninstaller_app.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/mac/scoped_cftyperef.h" | 9 #include "base/mac/scoped_cftyperef.h" |
10 #include "remoting/host/installer/mac/uninstaller/remoting_uninstaller.h" | 10 #include "remoting/host/installer/mac/uninstaller/remoting_uninstaller.h" |
11 | 11 |
12 @implementation RemotingUninstallerAppDelegate | 12 @implementation RemotingUninstallerAppDelegate |
13 | 13 |
14 - (void)dealloc { | 14 - (void)dealloc { |
15 [super dealloc]; | 15 [super dealloc]; |
16 } | 16 } |
17 | 17 |
18 - (void)applicationDidFinishLaunching:(NSNotification*)aNotification { | 18 - (void)applicationDidFinishLaunching:(NSNotification*)aNotification { |
19 } | 19 } |
20 | 20 |
21 - (void)showSuccess:(bool)success withMessage:(NSString*) message { | 21 - (void)showSuccess:(bool)success withMessage:(NSString*) message { |
22 NSString* summary = success ? @"Uninstall succeeded" : @"Uninstall failed"; | 22 NSString* summary = success ? @"Uninstall succeeded" : @"Uninstall failed"; |
23 NSAlert* alert = [NSAlert alertWithMessageText:summary | 23 NSAlert* alert = [NSAlert alertWithMessageText:summary |
24 defaultButton:@"OK" | 24 defaultButton:@"OK" |
25 alternateButton:nil | 25 alternateButton:nil |
26 otherButton:nil | 26 otherButton:nil |
27 informativeTextWithFormat:message]; | 27 informativeTextWithFormat:@"%@", message]; |
28 [alert runModal]; | 28 [alert runModal]; |
29 } | 29 } |
30 | 30 |
31 - (IBAction)uninstall:(NSButton*)sender { | 31 - (IBAction)uninstall:(NSButton*)sender { |
32 @try { | 32 @try { |
33 NSLog(@"Chrome Remote Desktop uninstall starting."); | 33 NSLog(@"Chrome Remote Desktop uninstall starting."); |
34 | 34 |
35 RemotingUninstaller* uninstaller = | 35 RemotingUninstaller* uninstaller = |
36 [[[RemotingUninstaller alloc] init] autorelease]; | 36 [[[RemotingUninstaller alloc] init] autorelease]; |
37 OSStatus status = [uninstaller remotingUninstall]; | 37 OSStatus status = [uninstaller remotingUninstall]; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 NSLog(@"Chrome Remote Desktop Host uninstall complete."); | 93 NSLog(@"Chrome Remote Desktop Host uninstall complete."); |
94 NSLog(@"Status = %ld", status); | 94 NSLog(@"Status = %ld", status); |
95 return status != errAuthorizationSuccess; | 95 return status != errAuthorizationSuccess; |
96 } | 96 } |
97 } else { | 97 } else { |
98 return NSApplicationMain(argc, (const char**)argv); | 98 return NSApplicationMain(argc, (const char**)argv); |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
OLD | NEW |