| 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/tab_modal_confirm_dialog_browsertest.h" | 5 #include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h" | 7 #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 TabModalConfirmDialog* TabModalConfirmDialogTest::CreateTestDialog( | 10 TabModalConfirmDialog* TabModalConfirmDialogTest::CreateTestDialog( |
| 11 TabModalConfirmDialogDelegate* delegate, TabContentsWrapper* wrapper) { | 11 TabModalConfirmDialogDelegate* delegate, TabContents* tab_contents) { |
| 12 return new TabModalConfirmDialogMac(delegate, wrapper); | 12 return new TabModalConfirmDialogMac(delegate, tab_contents); |
| 13 } | 13 } |
| 14 | 14 |
| 15 void TabModalConfirmDialogTest::CloseDialog(bool accept) { | 15 void TabModalConfirmDialogTest::CloseDialog(bool accept) { |
| 16 NSWindow* window = [(NSAlert*)dialog_->sheet() window]; | 16 NSWindow* window = [(NSAlert*)dialog_->sheet() window]; |
| 17 ASSERT_TRUE(window); | 17 ASSERT_TRUE(window); |
| 18 ASSERT_TRUE(dialog_->is_sheet_open()); | 18 ASSERT_TRUE(dialog_->is_sheet_open()); |
| 19 [NSApp endSheet:window | 19 [NSApp endSheet:window |
| 20 returnCode:accept ? NSAlertFirstButtonReturn : | 20 returnCode:accept ? NSAlertFirstButtonReturn : |
| 21 NSAlertSecondButtonReturn]; | 21 NSAlertSecondButtonReturn]; |
| 22 } | 22 } |
| OLD | NEW |