| 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" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 target:bridge_ | 81 target:bridge_ |
| 82 action:@selector(onCancelButton:)]; | 82 action:@selector(onCancelButton:)]; |
| 83 [[alert_ closeButton] setTarget:bridge_]; | 83 [[alert_ closeButton] setTarget:bridge_]; |
| 84 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; | 84 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; |
| 85 [alert_ layout]; | 85 [alert_ layout]; |
| 86 | 86 |
| 87 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 87 base::scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
| 88 [[CustomConstrainedWindowSheet alloc] | 88 [[CustomConstrainedWindowSheet alloc] |
| 89 initWithCustomWindow:[alert_ window]]); | 89 initWithCustomWindow:[alert_ window]]); |
| 90 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); | 90 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); |
| 91 delegate_->set_close_delegate(this); | 91 delegate_->set_operations_delegate(this); |
| 92 } | 92 } |
| 93 | 93 |
| 94 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() { | 94 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() { |
| 95 } | 95 } |
| 96 | 96 |
| 97 void TabModalConfirmDialogMac::AcceptTabModalDialog() { | 97 void TabModalConfirmDialogMac::AcceptTabModalDialog() { |
| 98 delegate_->Accept(); | 98 delegate_->Accept(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void TabModalConfirmDialogMac::CancelTabModalDialog() { | 101 void TabModalConfirmDialogMac::CancelTabModalDialog() { |
| 102 delegate_->Cancel(); | 102 delegate_->Cancel(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void TabModalConfirmDialogMac::CloseDialog() { | 105 void TabModalConfirmDialogMac::CloseDialog() { |
| 106 window_->CloseWebContentsModalDialog(); | 106 window_->CloseWebContentsModalDialog(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void TabModalConfirmDialogMac::SetInhibitCloseOnLoadStart(bool inhibit) { |
| 110 window_->SetInhibitCloseOnLoadStart(inhibit); |
| 111 } |
| 112 |
| 109 void TabModalConfirmDialogMac::OnConstrainedWindowClosed( | 113 void TabModalConfirmDialogMac::OnConstrainedWindowClosed( |
| 110 ConstrainedWindowMac* window) { | 114 ConstrainedWindowMac* window) { |
| 111 delete this; | 115 delete this; |
| 112 } | 116 } |
| OLD | NEW |