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

Side by Side Diff: chrome/browser/cocoa/applescript/error_applescript.mm

Issue 3046042: Added AppleScript support (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/cocoa/applescript/error_applescript.h"
6
7 #import "app/l10n_util_mac.h"
8 #include "base/logging.h"
9 #include "grit/generated_resources.h"
10
11 void AppleScript::SetError(AppleScript::ErrorCode errorCode) {
12 using namespace l10n_util;
13 NSScriptCommand* current_command = [NSScriptCommand currentCommand];
14 [current_command setScriptErrorNumber:(int)errorCode];
15 NSString* error_string = @"";
16 switch (errorCode) {
17 case errGetProfile:
18 error_string = GetNSString(IDS_GET_PROFILE_ERROR_APPLESCRIPT_MAC);
19 break;
20 case errBookmarkModelLoad:
21 error_string = GetNSString(IDS_BOOKMARK_MODEL_LOAD_ERROR_APPLESCRIPT_MAC);
22 break;
23 case errCreateBookmarkFolder:
24 error_string =
25 GetNSString(IDS_CREATE_BOOKMARK_FOLDER_ERROR_APPLESCRIPT_MAC);
26 break;
27 case errCreateBookmarkItem:
28 error_string =
29 GetNSString(IDS_CREATE_BOOKMARK_ITEM_ERROR_APPLESCRIPT_MAC);
30 break;
31 case errInvalidURL:
32 error_string = GetNSString(IDS_INVALID_URL_APPLESCRIPT_MAC);
33 break;
34 case errInitiatePrinting:
35 error_string = GetNSString(IDS_INITIATE_PRINTING_ERROR_APPLESCRIPT_MAC);
36 break;
37 case errInvalidSaveType:
38 error_string = GetNSString(IDS_INVALID_SAVE_TYPE_ERROR_APPLESCRIPT_MAC);
39 break;
40 case errInvalidMode:
41 error_string = GetNSString(IDS_INVALID_MODE_ERROR_APPLESCRIPT_MAC);
42 break;
43 case errInvalidTabIndex:
44 error_string = GetNSString(IDS_INVALID_TAB_INDEX_APPLESCRIPT_MAC);
45 break;
46 case errSetMode:
47 error_string = GetNSString(IDS_SET_MODE_APPLESCRIPT_MAC);
48 break;
49 case errWrongIndex:
50 error_string = GetNSString(IDS_WRONG_INDEX_ERROR_APPLESCRIPT_MAC);
51 break;
52 default:
53 NOTREACHED();
54 }
55 [current_command setScriptErrorString:error_string];
56 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/applescript/error_applescript.h ('k') | chrome/browser/cocoa/applescript/scripting.sdef » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698