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 "chrome/browser/ui/cocoa/external_protocol_dialog.h" | 5 #import "chrome/browser/ui/cocoa/external_protocol_dialog.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 9 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
10 #include "chrome/browser/shell_integration.h" | 10 #include "chrome/browser/shell_integration.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 alert_ = [[NSAlert alloc] init]; | 60 alert_ = [[NSAlert alloc] init]; |
61 | 61 |
62 [alert_ setMessageText: | 62 [alert_ setMessageText: |
63 l10n_util::GetNSStringFWithFixup(IDS_EXTERNAL_PROTOCOL_TITLE, appName)]; | 63 l10n_util::GetNSStringFWithFixup(IDS_EXTERNAL_PROTOCOL_TITLE, appName)]; |
64 | 64 |
65 NSButton* allowButton = [alert_ | 65 NSButton* allowButton = [alert_ |
66 addButtonWithTitle:l10n_util::GetNSStringFWithFixup( | 66 addButtonWithTitle:l10n_util::GetNSStringFWithFixup( |
67 IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT, appName)]; | 67 IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT, appName)]; |
68 [allowButton setKeyEquivalent:@""]; // disallow as default | 68 [allowButton setKeyEquivalent:@""]; // disallow as default |
69 [alert_ addButtonWithTitle:l10n_util::GetNSStringWithFixup(IDS_CANCEL)]; | 69 [alert_ addButtonWithTitle: |
| 70 l10n_util::GetNSStringWithFixup( |
| 71 IDS_EXTERNAL_PROTOCOL_CANCEL_BUTTON_TEXT)]; |
70 | 72 |
71 [alert_ setShowsSuppressionButton:YES]; | 73 [alert_ setShowsSuppressionButton:YES]; |
72 [[alert_ suppressionButton] | 74 [[alert_ suppressionButton] |
73 setTitle:l10n_util::GetNSStringFWithFixup( | 75 setTitle:l10n_util::GetNSStringFWithFixup( |
74 IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT, appName)]; | 76 IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT, appName)]; |
75 | 77 |
76 [alert_ beginSheetModalForWindow:nil // nil here makes it app-modal | 78 [alert_ beginSheetModalForWindow:nil // nil here makes it app-modal |
77 modalDelegate:self | 79 modalDelegate:self |
78 didEndSelector:@selector(alertEnded:returnCode:contextInfo:) | 80 didEndSelector:@selector(alertEnded:returnCode:contextInfo:) |
79 contextInfo:nil]; | 81 contextInfo:nil]; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 base::Time::Now() - creation_time_); | 118 base::Time::Now() - creation_time_); |
117 | 119 |
118 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck( | 120 ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck( |
119 url_, render_process_host_id_, routing_id_); | 121 url_, render_process_host_id_, routing_id_); |
120 } | 122 } |
121 | 123 |
122 [self autorelease]; | 124 [self autorelease]; |
123 } | 125 } |
124 | 126 |
125 @end | 127 @end |
OLD | NEW |