| OLD | NEW |
| 1 // Copyright (c) 2010 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 #include "chrome/browser/ui/cocoa/js_modal_dialog_cocoa.h" | 5 #include "chrome/browser/ui/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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 @implementation JavaScriptAppModalDialogHelper | 35 @implementation JavaScriptAppModalDialogHelper |
| 36 | 36 |
| 37 - (NSAlert*)alert { | 37 - (NSAlert*)alert { |
| 38 alert_ = [[NSAlert alloc] init]; | 38 alert_ = [[NSAlert alloc] init]; |
| 39 return alert_; | 39 return alert_; |
| 40 } | 40 } |
| 41 | 41 |
| 42 - (NSTextField*)textField { | 42 - (NSTextField*)textField { |
| 43 textField_ = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 22)]; | 43 textField_ = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 22)]; |
| 44 [[textField_ cell] setLineBreakMode:NSLineBreakByTruncatingTail]; |
| 44 [alert_ setAccessoryView:textField_]; | 45 [alert_ setAccessoryView:textField_]; |
| 45 [textField_ release]; | 46 [textField_ release]; |
| 46 | 47 |
| 47 return textField_; | 48 return textField_; |
| 48 } | 49 } |
| 49 | 50 |
| 50 - (void)dealloc { | 51 - (void)dealloc { |
| 51 [alert_ release]; | 52 [alert_ release]; |
| 52 [super dealloc]; | 53 [super dealloc]; |
| 53 } | 54 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 211 |
| 211 //////////////////////////////////////////////////////////////////////////////// | 212 //////////////////////////////////////////////////////////////////////////////// |
| 212 // NativeAppModalDialog, public: | 213 // NativeAppModalDialog, public: |
| 213 | 214 |
| 214 // static | 215 // static |
| 215 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( | 216 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( |
| 216 JavaScriptAppModalDialog* dialog, | 217 JavaScriptAppModalDialog* dialog, |
| 217 gfx::NativeWindow parent_window) { | 218 gfx::NativeWindow parent_window) { |
| 218 return new JSModalDialogCocoa(dialog); | 219 return new JSModalDialogCocoa(dialog); |
| 219 } | 220 } |
| OLD | NEW |