| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/shell/browser/shell_javascript_dialog.h" | 5 #include "content/shell/browser/shell_javascript_dialog.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 namespace content { | 87 namespace content { |
| 88 | 88 |
| 89 ShellJavaScriptDialog::ShellJavaScriptDialog( | 89 ShellJavaScriptDialog::ShellJavaScriptDialog( |
| 90 ShellJavaScriptDialogManager* manager, | 90 ShellJavaScriptDialogManager* manager, |
| 91 gfx::NativeWindow parent_window, | 91 gfx::NativeWindow parent_window, |
| 92 JavaScriptMessageType message_type, | 92 JavaScriptMessageType message_type, |
| 93 const base::string16& message_text, | 93 const base::string16& message_text, |
| 94 const base::string16& default_prompt_text, | 94 const base::string16& default_prompt_text, |
| 95 const JavaScriptDialogManager::DialogClosedCallback& callback) | 95 const JavaScriptDialogManager::DialogClosedCallback& callback) |
| 96 : manager_(manager), | 96 : callback_(callback) { |
| 97 callback_(callback) { | |
| 98 bool text_field = message_type == JAVASCRIPT_MESSAGE_TYPE_PROMPT; | 97 bool text_field = message_type == JAVASCRIPT_MESSAGE_TYPE_PROMPT; |
| 99 bool one_button = message_type == JAVASCRIPT_MESSAGE_TYPE_ALERT; | 98 bool one_button = message_type == JAVASCRIPT_MESSAGE_TYPE_ALERT; |
| 100 | 99 |
| 101 helper_ = | 100 helper_ = |
| 102 [[ShellJavaScriptDialogHelper alloc] initHelperWithManager:manager | 101 [[ShellJavaScriptDialogHelper alloc] initHelperWithManager:manager |
| 103 andCallback:callback]; | 102 andCallback:callback]; |
| 104 | 103 |
| 105 // Show the modal dialog. | 104 // Show the modal dialog. |
| 106 NSAlert* alert = [helper_ alert]; | 105 NSAlert* alert = [helper_ alert]; |
| 107 NSTextField* field = nil; | 106 NSTextField* field = nil; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 127 | 126 |
| 128 ShellJavaScriptDialog::~ShellJavaScriptDialog() { | 127 ShellJavaScriptDialog::~ShellJavaScriptDialog() { |
| 129 [helper_ release]; | 128 [helper_ release]; |
| 130 } | 129 } |
| 131 | 130 |
| 132 void ShellJavaScriptDialog::Cancel() { | 131 void ShellJavaScriptDialog::Cancel() { |
| 133 [helper_ cancel]; | 132 [helper_ cancel]; |
| 134 } | 133 } |
| 135 | 134 |
| 136 } // namespace content | 135 } // namespace content |
| OLD | NEW |