| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/cocoa/applescript/error_applescript.h" | 5 #import "chrome/browser/ui/cocoa/applescript/error_applescript.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util_mac.h" | 9 #include "ui/base/l10n/l10n_util_mac.h" |
| 10 | 10 |
| 11 void AppleScript::SetError(AppleScript::ErrorCode errorCode) { | 11 void AppleScript::SetError(AppleScript::ErrorCode errorCode) { |
| 12 using l10n_util::GetNSString; | 12 using l10n_util::GetNSString; |
| 13 NSScriptCommand* current_command = [NSScriptCommand currentCommand]; | 13 NSScriptCommand* current_command = [NSScriptCommand currentCommand]; |
| 14 [current_command setScriptErrorNumber:(int)errorCode]; | 14 [current_command setScriptErrorNumber:(int)errorCode]; |
| 15 NSString* error_string = @""; | 15 NSString* error_string = @""; |
| 16 switch (errorCode) { | 16 switch (errorCode) { |
| 17 case errGetProfile: | 17 case errGetProfile: |
| 18 error_string = GetNSString(IDS_GET_PROFILE_ERROR_APPLESCRIPT_MAC); | 18 error_string = GetNSString(IDS_GET_PROFILE_ERROR_APPLESCRIPT_MAC); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 47 error_string = GetNSString(IDS_SET_MODE_APPLESCRIPT_MAC); | 47 error_string = GetNSString(IDS_SET_MODE_APPLESCRIPT_MAC); |
| 48 break; | 48 break; |
| 49 case errWrongIndex: | 49 case errWrongIndex: |
| 50 error_string = GetNSString(IDS_WRONG_INDEX_ERROR_APPLESCRIPT_MAC); | 50 error_string = GetNSString(IDS_WRONG_INDEX_ERROR_APPLESCRIPT_MAC); |
| 51 break; | 51 break; |
| 52 default: | 52 default: |
| 53 NOTREACHED(); | 53 NOTREACHED(); |
| 54 } | 54 } |
| 55 [current_command setScriptErrorString:error_string]; | 55 [current_command setScriptErrorString:error_string]; |
| 56 } | 56 } |
| OLD | NEW |