| 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 #ifndef CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_ |
| 6 #define CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 #include "content/public/test/test_browser_thread.h" | 10 #include "content/public/test/test_browser_thread.h" |
| 11 | 11 |
| 12 #if defined(OS_MACOSX) | 12 #if defined(OS_MACOSX) |
| 13 class TabModalConfirmDialogMac; | 13 class TabModalConfirmDialogMac; |
| 14 typedef TabModalConfirmDialogMac TabModalConfirmDialog; | 14 typedef TabModalConfirmDialogMac TabModalConfirmDialog; |
| 15 #elif defined(TOOLKIT_GTK) | 15 #elif defined(TOOLKIT_GTK) |
| 16 #include "chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h" | 16 #include "chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h" |
| 17 typedef TabModalConfirmDialogGtk TabModalConfirmDialog; | 17 typedef TabModalConfirmDialogGtk TabModalConfirmDialog; |
| 18 #else | 18 #else |
| 19 #include "chrome/browser/ui/views/tab_modal_confirm_dialog_views.h" | 19 #include "chrome/browser/ui/views/tab_modal_confirm_dialog_views.h" |
| 20 typedef TabModalConfirmDialogViews TabModalConfirmDialog; | 20 typedef TabModalConfirmDialogViews TabModalConfirmDialog; |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 class MockTabModalConfirmDialogDelegate; | 23 class MockTabModalConfirmDialogDelegate; |
| 24 class TabContents; | 24 class TabContents; |
| 25 typedef TabContents TabContentsWrapper; | |
| 26 class TabModalConfirmDialogDelegate; | 25 class TabModalConfirmDialogDelegate; |
| 27 | 26 |
| 28 class TabModalConfirmDialogTest : public InProcessBrowserTest { | 27 class TabModalConfirmDialogTest : public InProcessBrowserTest { |
| 29 public: | 28 public: |
| 30 TabModalConfirmDialogTest(); | 29 TabModalConfirmDialogTest(); |
| 31 | 30 |
| 32 virtual void SetUpOnMainThread() OVERRIDE; | 31 virtual void SetUpOnMainThread() OVERRIDE; |
| 33 virtual void CleanUpOnMainThread() OVERRIDE; | 32 virtual void CleanUpOnMainThread() OVERRIDE; |
| 34 | 33 |
| 35 protected: | 34 protected: |
| 36 void CloseDialog(bool accept); | 35 void CloseDialog(bool accept); |
| 37 | 36 |
| 38 // Owned by |dialog_|. | 37 // Owned by |dialog_|. |
| 39 MockTabModalConfirmDialogDelegate* delegate_; | 38 MockTabModalConfirmDialogDelegate* delegate_; |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 TabModalConfirmDialog* CreateTestDialog( | 41 TabModalConfirmDialog* CreateTestDialog( |
| 43 TabModalConfirmDialogDelegate* delegate, TabContentsWrapper* wrapper); | 42 TabModalConfirmDialogDelegate* delegate, TabContents* tab_contents); |
| 44 | 43 |
| 45 // Deletes itself. | 44 // Deletes itself. |
| 46 TabModalConfirmDialog* dialog_; | 45 TabModalConfirmDialog* dialog_; |
| 47 | 46 |
| 48 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogTest); | 47 DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogTest); |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 #endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_ | 50 #endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_ |
| OLD | NEW |