[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h" | ||||
6 | |||||
7 | #include "base/bind.h" | ||||
fdoray | bd6c098 | 2016-06-11 00:23:05 | [diff] [blame] | 8 | #include "base/location.h" |
9 | #include "base/single_thread_task_runner.h" | ||||
[email protected] | 774cc3c | 2013-06-07 20:26:45 | [diff] [blame] | 10 | #include "base/strings/utf_string_conversions.h" |
fdoray | bd6c098 | 2016-06-11 00:23:05 | [diff] [blame] | 11 | #include "base/threading/thread_task_runner_handle.h" |
[email protected] | 2e6389f | 2012-05-18 19:41:25 | [diff] [blame] | 12 | #include "chrome/browser/lifetime/application_lifetime.h" |
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 13 | #include "chrome/browser/ui/browser.h" |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 14 | #include "chrome/browser/ui/browser_dialogs.h" |
[email protected] | 47ae2337 | 2013-01-29 01:50:48 | [diff] [blame] | 15 | #include "chrome/browser/ui/tabs/tab_strip_model.h" |
[email protected] | ec35112f | 2013-08-01 05:46:18 | [diff] [blame] | 16 | #include "content/public/browser/page_navigator.h" |
17 | #include "content/public/browser/web_contents.h" | ||||
thestig | af7f415 | 2014-10-31 23:19:15 | [diff] [blame] | 18 | #include "content/public/test/test_utils.h" |
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 19 | #include "testing/gtest/include/gtest/gtest.h" |
[email protected] | ec35112f | 2013-08-01 05:46:18 | [diff] [blame] | 20 | #include "ui/base/window_open_disposition.h" |
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 21 | |
[email protected] | 3cac8723 | 2012-11-20 01:48:27 | [diff] [blame] | 22 | MockTabModalConfirmDialogDelegate::MockTabModalConfirmDialogDelegate( |
[email protected] | fa6b246 | 2013-07-30 22:37:00 | [diff] [blame] | 23 | content::WebContents* web_contents, |
[email protected] | 3cac8723 | 2012-11-20 01:48:27 | [diff] [blame] | 24 | Delegate* delegate) |
Aran Gilman | d217b5b | 2019-04-11 17:45:43 | [diff] [blame^] | 25 | : TabModalConfirmDialogDelegate(web_contents), delegate_(delegate) {} |
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 26 | |
Aran Gilman | d217b5b | 2019-04-11 17:45:43 | [diff] [blame^] | 27 | MockTabModalConfirmDialogDelegate::~MockTabModalConfirmDialogDelegate() {} |
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 28 | |
[email protected] | 6a72a63 | 2013-12-12 22:22:00 | [diff] [blame] | 29 | base::string16 MockTabModalConfirmDialogDelegate::GetTitle() { |
[email protected] | dcd024987 | 2013-12-06 23:58:45 | [diff] [blame] | 30 | return base::string16(); |
[email protected] | 3cac8723 | 2012-11-20 01:48:27 | [diff] [blame] | 31 | } |
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 32 | |
[email protected] | 53fcb056 | 2014-02-05 21:27:10 | [diff] [blame] | 33 | base::string16 MockTabModalConfirmDialogDelegate::GetDialogMessage() { |
[email protected] | dcd024987 | 2013-12-06 23:58:45 | [diff] [blame] | 34 | return base::string16(); |
[email protected] | 3cac8723 | 2012-11-20 01:48:27 | [diff] [blame] | 35 | } |
36 | |||||
37 | void MockTabModalConfirmDialogDelegate::OnAccepted() { | ||||
38 | if (delegate_) | ||||
39 | delegate_->OnAccepted(); | ||||
40 | } | ||||
41 | |||||
42 | void MockTabModalConfirmDialogDelegate::OnCanceled() { | ||||
43 | if (delegate_) | ||||
44 | delegate_->OnCanceled(); | ||||
45 | } | ||||
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] | 46 | |
[email protected] | ec35112f | 2013-08-01 05:46:18 | [diff] [blame] | 47 | void MockTabModalConfirmDialogDelegate::OnClosed() { |
48 | if (delegate_) | ||||
49 | delegate_->OnClosed(); | ||||
50 | } | ||||
51 | |||||
[email protected] | f6e5d8c | 2012-01-04 21:25:36 | [diff] [blame] |