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

Side by Side Diff: chrome/browser/cocoa/js_modal_dialog_cocoa.mm

Issue 3555021: Make JavaScript alert and confirm dialog boxes driveable by keyboard (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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
« 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) 2010 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/cocoa/js_modal_dialog_cocoa.h" 5 #include "chrome/browser/cocoa/js_modal_dialog_cocoa.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "app/message_box_flags.h" 10 #include "app/message_box_flags.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 176 }
177 } 177 }
178 178
179 void JSModalDialogCocoa::ShowAppModalDialog() { 179 void JSModalDialogCocoa::ShowAppModalDialog() {
180 [alert_ 180 [alert_
181 beginSheetModalForWindow:nil // nil here makes it app-modal 181 beginSheetModalForWindow:nil // nil here makes it app-modal
182 modalDelegate:helper_.get() 182 modalDelegate:helper_.get()
183 didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) 183 didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
184 contextInfo:this]; 184 contextInfo:this];
185 185
186 if ([helper_ textField]) 186 if ([alert_ accessoryView])
187 [[alert_ window] makeFirstResponder:[helper_ textField]]; 187 [[alert_ window] makeFirstResponder:[alert_ accessoryView]];
188 } 188 }
189 189
190 void JSModalDialogCocoa::ActivateAppModalDialog() { 190 void JSModalDialogCocoa::ActivateAppModalDialog() {
191 } 191 }
192 192
193 void JSModalDialogCocoa::CloseAppModalDialog() { 193 void JSModalDialogCocoa::CloseAppModalDialog() {
194 DCHECK([alert_ isKindOfClass:[NSAlert class]]); 194 DCHECK([alert_ isKindOfClass:[NSAlert class]]);
195 [NSApp endSheet:[alert_ window]]; 195 [NSApp endSheet:[alert_ window]];
196 alert_ = NULL; 196 alert_ = NULL;
197 } 197 }
(...skipping 11 matching lines...) Expand all
209 209
210 //////////////////////////////////////////////////////////////////////////////// 210 ////////////////////////////////////////////////////////////////////////////////
211 // NativeAppModalDialog, public: 211 // NativeAppModalDialog, public:
212 212
213 // static 213 // static
214 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( 214 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt(
215 JavaScriptAppModalDialog* dialog, 215 JavaScriptAppModalDialog* dialog,
216 gfx::NativeWindow parent_window) { 216 gfx::NativeWindow parent_window) {
217 return new JSModalDialogCocoa(dialog); 217 return new JSModalDialogCocoa(dialog);
218 } 218 }
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