| 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/memory/scoped_nsobject.h" | 7 #include "base/memory/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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 target:bridge_ | 70 target:bridge_ |
| 71 action:@selector(onCancelButton:)]; | 71 action:@selector(onCancelButton:)]; |
| 72 [[alert_ closeButton] setTarget:bridge_]; | 72 [[alert_ closeButton] setTarget:bridge_]; |
| 73 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; | 73 [[alert_ closeButton] setAction:@selector(onCancelButton:)]; |
| 74 [alert_ layout]; | 74 [alert_ layout]; |
| 75 | 75 |
| 76 scoped_nsobject<CustomConstrainedWindowSheet> sheet( | 76 scoped_nsobject<CustomConstrainedWindowSheet> sheet( |
| 77 [[CustomConstrainedWindowSheet alloc] | 77 [[CustomConstrainedWindowSheet alloc] |
| 78 initWithCustomWindow:[alert_ window]]); | 78 initWithCustomWindow:[alert_ window]]); |
| 79 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); | 79 window_.reset(new ConstrainedWindowMac(this, web_contents, sheet)); |
| 80 delegate->set_window(window_.get()); | 80 delegate_->set_close_delegate(this); |
| 81 } | 81 } |
| 82 | 82 |
| 83 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() { | 83 TabModalConfirmDialogMac::~TabModalConfirmDialogMac() { |
| 84 } | 84 } |
| 85 | 85 |
| 86 void TabModalConfirmDialogMac::AcceptTabModalDialog() { | 86 void TabModalConfirmDialogMac::AcceptTabModalDialog() { |
| 87 delegate_->Accept(); | 87 delegate_->Accept(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void TabModalConfirmDialogMac::CancelTabModalDialog() { | 90 void TabModalConfirmDialogMac::CancelTabModalDialog() { |
| 91 delegate_->Cancel(); | 91 delegate_->Cancel(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void TabModalConfirmDialogMac::CloseDialog() { |
| 95 window_->CloseWebContentsModalDialog(); |
| 96 } |
| 97 |
| 94 void TabModalConfirmDialogMac::OnConstrainedWindowClosed( | 98 void TabModalConfirmDialogMac::OnConstrainedWindowClosed( |
| 95 ConstrainedWindowMac* window) { | 99 ConstrainedWindowMac* window) { |
| 96 delete this; | 100 delete this; |
| 97 } | 101 } |
| OLD | NEW |