| 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::kXmppLoginConfigPath, &email); | 471 bool result = config_->GetString(remoting::kHostOwnerConfigPath, &email); |
| 472 if (!result) { |
| 473 result = config_->GetString(remoting::kXmppLoginConfigPath, &email); |
| 472 | 474 |
| 473 // The config has already been checked by |IsConfigValid|. | 475 // The config has already been checked by |IsConfigValid|. |
| 474 if (!result) { | 476 if (!result) { |
| 475 [self showError]; | 477 [self showError]; |
| 476 return; | 478 return; |
| 479 } |
| 477 } | 480 } |
| 478 } | 481 } |
| 479 [disable_view_ setEnabled:(is_pane_unlocked_ && is_service_running_ && | 482 [disable_view_ setEnabled:(is_pane_unlocked_ && is_service_running_ && |
| 480 !restart_pending_or_canceled_)]; | 483 !restart_pending_or_canceled_)]; |
| 481 [confirm_pin_view_ setEnabled:(is_pane_unlocked_ && | 484 [confirm_pin_view_ setEnabled:(is_pane_unlocked_ && |
| 482 !restart_pending_or_canceled_)]; | 485 !restart_pending_or_canceled_)]; |
| 483 [confirm_pin_view_ setEmail:[NSString stringWithUTF8String:email.c_str()]]; | 486 [confirm_pin_view_ setEmail:[NSString stringWithUTF8String:email.c_str()]]; |
| 484 NSString* applyButtonText = is_service_running_ ? @"Confirm" : @"Enable"; | 487 NSString* applyButtonText = is_service_running_ ? @"Confirm" : @"Enable"; |
| 485 [confirm_pin_view_ setButtonText:applyButtonText]; | 488 [confirm_pin_view_ setButtonText:applyButtonText]; |
| 486 | 489 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 NSArray* arguments = [NSArray arrayWithObjects:@"--relaunch-prefpane", nil]; | 749 NSArray* arguments = [NSArray arrayWithObjects:@"--relaunch-prefpane", nil]; |
| 747 [task setLaunchPath:command]; | 750 [task setLaunchPath:command]; |
| 748 [task setArguments:arguments]; | 751 [task setArguments:arguments]; |
| 749 [task setStandardInput:[NSPipe pipe]]; | 752 [task setStandardInput:[NSPipe pipe]]; |
| 750 [task launch]; | 753 [task launch]; |
| 751 [task release]; | 754 [task release]; |
| 752 [NSApp terminate:nil]; | 755 [NSApp terminate:nil]; |
| 753 } | 756 } |
| 754 | 757 |
| 755 @end | 758 @end |
| OLD | NEW |