| OLD | NEW |
| 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/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 "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/mac/cocoa_protocols.h" | 10 #import "base/mac/cocoa_protocols.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // If the user wants to stay on this page, stop quitting (if a quit is in | 69 // If the user wants to stay on this page, stop quitting (if a quit is in |
| 70 // progress). | 70 // progress). |
| 71 if (native_dialog->dialog()->is_before_unload_dialog()) | 71 if (native_dialog->dialog()->is_before_unload_dialog()) |
| 72 chrome_browser_application_mac::CancelTerminate(); | 72 chrome_browser_application_mac::CancelTerminate(); |
| 73 native_dialog->dialog()->OnCancel(shouldSuppress); | 73 native_dialog->dialog()->OnCancel(shouldSuppress); |
| 74 break; | 74 break; |
| 75 } | 75 } |
| 76 case NSRunStoppedResponse: { // Window was closed underneath us | 76 case NSRunStoppedResponse: { // Window was closed underneath us |
| 77 // Need to call OnCancel() because there is some cleanup that needs | 77 // Need to call OnCancel() because there is some cleanup that needs |
| 78 // to be done. It won't call back to the javascript since the | 78 // to be done. It won't call back to the javascript since the |
| 79 // JavaScriptAppModalDialog knows that the TabContents was destroyed. | 79 // JavaScriptAppModalDialog knows that the WebContents was destroyed. |
| 80 native_dialog->dialog()->OnCancel(shouldSuppress); | 80 native_dialog->dialog()->OnCancel(shouldSuppress); |
| 81 break; | 81 break; |
| 82 } | 82 } |
| 83 default: { | 83 default: { |
| 84 NOTREACHED(); | 84 NOTREACHED(); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 @end | 89 @end |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 //////////////////////////////////////////////////////////////////////////////// | 214 //////////////////////////////////////////////////////////////////////////////// |
| 215 // NativeAppModalDialog, public: | 215 // NativeAppModalDialog, public: |
| 216 | 216 |
| 217 // static | 217 // static |
| 218 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( | 218 NativeAppModalDialog* NativeAppModalDialog::CreateNativeJavaScriptPrompt( |
| 219 JavaScriptAppModalDialog* dialog, | 219 JavaScriptAppModalDialog* dialog, |
| 220 gfx::NativeWindow parent_window) { | 220 gfx::NativeWindow parent_window) { |
| 221 return new JSModalDialogCocoa(dialog); | 221 return new JSModalDialogCocoa(dialog); |
| 222 } | 222 } |
| OLD | NEW |