OLD | NEW |
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/js_modal_dialog.h" | 5 #include "chrome/browser/js_modal_dialog.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" |
11 #import "base/cocoa_protocols_mac.h" | 11 #import "base/cocoa_protocols_mac.h" |
| 12 #include "base/logging.h" |
12 #include "base/sys_string_conversions.h" | 13 #include "base/sys_string_conversions.h" |
13 #import "chrome/browser/chrome_browser_application_mac.h" | 14 #import "chrome/browser/chrome_browser_application_mac.h" |
14 #include "grit/app_strings.h" | 15 #include "grit/app_strings.h" |
15 #include "grit/generated_resources.h" | 16 #include "grit/generated_resources.h" |
16 | 17 |
17 // Helper object that receives the notification that the dialog/sheet is | 18 // Helper object that receives the notification that the dialog/sheet is |
18 // going away. Is responsible for cleaning itself up. | 19 // going away. Is responsible for cleaning itself up. |
19 @interface JavaScriptAppModalDialogHelper : NSObject<NSAlertDelegate> { | 20 @interface JavaScriptAppModalDialogHelper : NSObject<NSAlertDelegate> { |
20 @private | 21 @private |
21 NSAlert* alert_; | 22 NSAlert* alert_; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 NOTIMPLEMENTED(); | 194 NOTIMPLEMENTED(); |
194 return nil; | 195 return nil; |
195 } | 196 } |
196 | 197 |
197 void JavaScriptAppModalDialog::CloseModalDialog() { | 198 void JavaScriptAppModalDialog::CloseModalDialog() { |
198 NSAlert* alert = dialog_; | 199 NSAlert* alert = dialog_; |
199 DCHECK([alert isKindOfClass:[NSAlert class]]); | 200 DCHECK([alert isKindOfClass:[NSAlert class]]); |
200 [NSApp endSheet:[alert window]]; | 201 [NSApp endSheet:[alert window]]; |
201 dialog_ = nil; | 202 dialog_ = nil; |
202 } | 203 } |
OLD | NEW |