| 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/tab_modal_confirm_dialog_mac.h" | 5 #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h" |
| 6 | 6 |
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "chrome/browser/ui/browser_dialogs.h" | 8 #include "chrome/browser/ui/browser_dialogs.h" |
| 9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" | 9 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" |
| 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" | 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sh
eet.h" |
| 11 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" | 11 #import "chrome/browser/ui/cocoa/key_equivalent_constants.h" |
| 12 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" | 12 #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" |
| 13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 14 #include "ui/base/cocoa/cocoa_event_utils.h" | 14 #include "ui/base/cocoa/cocoa_base_utils.h" |
| 15 #include "ui/base/l10n/l10n_util_mac.h" | 15 #include "ui/base/l10n/l10n_util_mac.h" |
| 16 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 TabModalConfirmDialog* TabModalConfirmDialog::Create( | 19 TabModalConfirmDialog* TabModalConfirmDialog::Create( |
| 20 TabModalConfirmDialogDelegate* delegate, | 20 TabModalConfirmDialogDelegate* delegate, |
| 21 content::WebContents* web_contents) { | 21 content::WebContents* web_contents) { |
| 22 // Deletes itself when closed. | 22 // Deletes itself when closed. |
| 23 return new TabModalConfirmDialogMac(delegate, web_contents); | 23 return new TabModalConfirmDialogMac(delegate, web_contents); |
| 24 } | 24 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // If this method should mistakenly be called during Delegate::Close(), | 115 // If this method should mistakenly be called during Delegate::Close(), |
| 116 // prevent a double-delete by moving delegate_ to a stack variable. | 116 // prevent a double-delete by moving delegate_ to a stack variable. |
| 117 if (!delegate_) | 117 if (!delegate_) |
| 118 return; | 118 return; |
| 119 scoped_ptr<TabModalConfirmDialogDelegate> delegate(delegate_.Pass()); | 119 scoped_ptr<TabModalConfirmDialogDelegate> delegate(delegate_.Pass()); |
| 120 // Provide a disposition in case the dialog was closed without accepting or | 120 // Provide a disposition in case the dialog was closed without accepting or |
| 121 // cancelling. | 121 // cancelling. |
| 122 delegate->Close(); | 122 delegate->Close(); |
| 123 delete this; | 123 delete this; |
| 124 } | 124 } |
| OLD | NEW |