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

Side by Side Diff: chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.mm

Issue 2252913003: Force recalc of the keyloop for alerts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« 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) 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 #include "chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.h" 5 #include "chrome/browser/ui/cocoa/javascript_app_modal_dialog_cocoa.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 NOTREACHED(); 133 NOTREACHED();
134 } 134 }
135 } 135 }
136 } 136 }
137 137
138 - (void)showAlert { 138 - (void)showAlert {
139 DCHECK(nativeDialog_); 139 DCHECK(nativeDialog_);
140 DCHECK(!alertShown_); 140 DCHECK(!alertShown_);
141 alertShown_ = YES; 141 alertShown_ = YES;
142 NSAlert* alert = [self alert]; 142 NSAlert* alert = [self alert];
143
144 [alert layout];
145 [[alert window] recalculateKeyViewLoop];
146
143 [alert beginSheetModalForWindow:nil // nil here makes it app-modal 147 [alert beginSheetModalForWindow:nil // nil here makes it app-modal
144 modalDelegate:self 148 modalDelegate:self
145 didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) 149 didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
146 contextInfo:NULL]; 150 contextInfo:NULL];
147 } 151 }
148 152
149 - (void)acceptAlert { 153 - (void)acceptAlert {
150 DCHECK(nativeDialog_); 154 DCHECK(nativeDialog_);
151 if (!alertShown_) { 155 if (!alertShown_) {
152 [self sendAcceptToNativeDialog]; 156 [self sendAcceptToNativeDialog];
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 472
469 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptNativeDialogCocoaFactory); 473 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptNativeDialogCocoaFactory);
470 }; 474 };
471 475
472 } // namespace 476 } // namespace
473 477
474 void InstallChromeJavaScriptNativeDialogFactory() { 478 void InstallChromeJavaScriptNativeDialogFactory() {
475 app_modal::JavaScriptDialogManager::GetInstance()->SetNativeDialogFactory( 479 app_modal::JavaScriptDialogManager::GetInstance()->SetNativeDialogFactory(
476 base::WrapUnique(new ChromeJavaScriptNativeDialogCocoaFactory)); 480 base::WrapUnique(new ChromeJavaScriptNativeDialogCocoaFactory));
477 } 481 }
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