| 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 #import "remoting/host/mac/me2me_preference_pane.h" | 5 #import "remoting/host/mac/me2me_preference_pane.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 #include <CommonCrypto/CommonHMAC.h> | 8 #include <CommonCrypto/CommonHMAC.h> |
| 9 #include <errno.h> | 9 #include <errno.h> |
| 10 #include <launch.h> | 10 #include <launch.h> |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 message = @"Remote connections to this computer are disabled. To enable " | 461 message = @"Remote connections to this computer are disabled. To enable " |
| 462 "remote connections you must confirm your PIN."; | 462 "remote connections you must confirm your PIN."; |
| 463 } else { | 463 } else { |
| 464 message = @"Remote connections to this computer are disabled."; | 464 message = @"Remote connections to this computer are disabled."; |
| 465 } | 465 } |
| 466 } | 466 } |
| 467 [status_message_ setStringValue:message]; | 467 [status_message_ setStringValue:message]; |
| 468 | 468 |
| 469 std::string email; | 469 std::string email; |
| 470 if (config_.get()) { | 470 if (config_.get()) { |
| 471 bool result = config_->GetString(remoting::kHostOwnerConfigPath, &email); | 471 bool result = |
| 472 config_->GetString(remoting::kHostOwnerEmailConfigPath, &email); |
| 472 if (!result) { | 473 if (!result) { |
| 473 result = config_->GetString(remoting::kXmppLoginConfigPath, &email); | 474 result = config_->GetString(remoting::kHostOwnerConfigPath, &email); |
| 475 if (!result) { |
| 476 result = config_->GetString(remoting::kXmppLoginConfigPath, &email); |
| 474 | 477 |
| 475 // The config has already been checked by |IsConfigValid|. | 478 // The config has already been checked by |IsConfigValid|. |
| 476 if (!result) { | 479 if (!result) { |
| 477 [self showError]; | 480 [self showError]; |
| 478 return; | 481 return; |
| 482 } |
| 479 } | 483 } |
| 480 } | 484 } |
| 481 } | 485 } |
| 482 [disable_view_ setEnabled:(is_pane_unlocked_ && is_service_running_ && | 486 [disable_view_ setEnabled:(is_pane_unlocked_ && is_service_running_ && |
| 483 !restart_pending_or_canceled_)]; | 487 !restart_pending_or_canceled_)]; |
| 484 [confirm_pin_view_ setEnabled:(is_pane_unlocked_ && | 488 [confirm_pin_view_ setEnabled:(is_pane_unlocked_ && |
| 485 !restart_pending_or_canceled_)]; | 489 !restart_pending_or_canceled_)]; |
| 486 [confirm_pin_view_ setEmail:[NSString stringWithUTF8String:email.c_str()]]; | 490 [confirm_pin_view_ setEmail:[NSString stringWithUTF8String:email.c_str()]]; |
| 487 NSString* applyButtonText = is_service_running_ ? @"Confirm" : @"Enable"; | 491 NSString* applyButtonText = is_service_running_ ? @"Confirm" : @"Enable"; |
| 488 [confirm_pin_view_ setButtonText:applyButtonText]; | 492 [confirm_pin_view_ setButtonText:applyButtonText]; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 NSArray* arguments = [NSArray arrayWithObjects:@"--relaunch-prefpane", nil]; | 753 NSArray* arguments = [NSArray arrayWithObjects:@"--relaunch-prefpane", nil]; |
| 750 [task setLaunchPath:command]; | 754 [task setLaunchPath:command]; |
| 751 [task setArguments:arguments]; | 755 [task setArguments:arguments]; |
| 752 [task setStandardInput:[NSPipe pipe]]; | 756 [task setStandardInput:[NSPipe pipe]]; |
| 753 [task launch]; | 757 [task launch]; |
| 754 [task release]; | 758 [task release]; |
| 755 [NSApp terminate:nil]; | 759 [NSApp terminate:nil]; |
| 756 } | 760 } |
| 757 | 761 |
| 758 @end | 762 @end |
| OLD | NEW |