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

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

Issue 2836063006: Update the "Execute Javascript" AppleScript error (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/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 namespace {
12 NSString* kJavaScriptUnsupportedUrlString =
13 @"\n\nhttps://support.google.com/chrome/?p=applescript";
14 }
15
11 void AppleScript::SetError(AppleScript::ErrorCode errorCode) { 16 void AppleScript::SetError(AppleScript::ErrorCode errorCode) {
12 using l10n_util::GetNSString; 17 using l10n_util::GetNSString;
13 NSScriptCommand* current_command = [NSScriptCommand currentCommand]; 18 NSScriptCommand* current_command = [NSScriptCommand currentCommand];
14 [current_command setScriptErrorNumber:(int)errorCode]; 19 [current_command setScriptErrorNumber:(int)errorCode];
15 NSString* error_string = @""; 20 NSString* error_string = @"";
16 switch (errorCode) { 21 switch (errorCode) {
17 case errGetProfile: 22 case errGetProfile:
18 error_string = GetNSString(IDS_GET_PROFILE_ERROR_APPLESCRIPT_MAC); 23 error_string = GetNSString(IDS_GET_PROFILE_ERROR_APPLESCRIPT_MAC);
19 break; 24 break;
20 case errBookmarkModelLoad: 25 case errBookmarkModelLoad:
(...skipping 24 matching lines...) Expand all
45 break; 50 break;
46 case errSetMode: 51 case errSetMode:
47 error_string = GetNSString(IDS_SET_MODE_APPLESCRIPT_MAC); 52 error_string = GetNSString(IDS_SET_MODE_APPLESCRIPT_MAC);
48 break; 53 break;
49 case errWrongIndex: 54 case errWrongIndex:
50 error_string = GetNSString(IDS_WRONG_INDEX_ERROR_APPLESCRIPT_MAC); 55 error_string = GetNSString(IDS_WRONG_INDEX_ERROR_APPLESCRIPT_MAC);
51 break; 56 break;
52 case errJavaScriptUnsupported: 57 case errJavaScriptUnsupported:
53 error_string = 58 error_string =
54 GetNSString(IDS_JAVASCRIPT_UNSUPPORTED_ERROR_APPLESCRIPT_MAC); 59 GetNSString(IDS_JAVASCRIPT_UNSUPPORTED_ERROR_APPLESCRIPT_MAC);
60 error_string = [error_string
61 stringByAppendingString:kJavaScriptUnsupportedUrlString];
55 break; 62 break;
56 default: 63 default:
57 NOTREACHED(); 64 NOTREACHED();
58 } 65 }
59 [current_command setScriptErrorString:error_string]; 66 [current_command setScriptErrorString:error_string];
60 } 67 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698