blob: bb56ae9b4ce4ae43788cf19c4542288ea083c1bf [file] [log] [blame]
[email protected]f6e5d8c2012-01-04 21:25:361// 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"
fdoraybd6c0982016-06-11 00:23:058#include "base/location.h"
9#include "base/single_thread_task_runner.h"
[email protected]774cc3c2013-06-07 20:26:4510#include "base/strings/utf_string_conversions.h"
fdoraybd6c0982016-06-11 00:23:0511#include "base/threading/thread_task_runner_handle.h"
[email protected]2e6389f2012-05-18 19:41:2512#include "chrome/browser/lifetime/application_lifetime.h"
[email protected]f6e5d8c2012-01-04 21:25:3613#include "chrome/browser/ui/browser.h"
[email protected]52877dbc62012-06-29 22:22:0314#include "chrome/browser/ui/browser_dialogs.h"
[email protected]47ae23372013-01-29 01:50:4815#include "chrome/browser/ui/tabs/tab_strip_model.h"
[email protected]ec35112f2013-08-01 05:46:1816#include "content/public/browser/page_navigator.h"
17#include "content/public/browser/web_contents.h"
thestigaf7f4152014-10-31 23:19:1518#include "content/public/test/test_utils.h"
[email protected]f6e5d8c2012-01-04 21:25:3619#include "testing/gtest/include/gtest/gtest.h"
[email protected]ec35112f2013-08-01 05:46:1820#include "ui/base/window_open_disposition.h"
[email protected]f6e5d8c2012-01-04 21:25:3621
[email protected]3cac87232012-11-20 01:48:2722MockTabModalConfirmDialogDelegate::MockTabModalConfirmDialogDelegate(
[email protected]fa6b2462013-07-30 22:37:0023 content::WebContents* web_contents,
[email protected]3cac87232012-11-20 01:48:2724 Delegate* delegate)
Aran Gilmand217b5b2019-04-11 17:45:4325 : TabModalConfirmDialogDelegate(web_contents), delegate_(delegate) {}
[email protected]f6e5d8c2012-01-04 21:25:3626
Aran Gilmand217b5b2019-04-11 17:45:4327MockTabModalConfirmDialogDelegate::~MockTabModalConfirmDialogDelegate() {}
[email protected]f6e5d8c2012-01-04 21:25:3628
[email protected]6a72a632013-12-12 22:22:0029base::string16 MockTabModalConfirmDialogDelegate::GetTitle() {
[email protected]dcd0249872013-12-06 23:58:4530 return base::string16();
[email protected]3cac87232012-11-20 01:48:2731}
[email protected]f6e5d8c2012-01-04 21:25:3632
[email protected]53fcb0562014-02-05 21:27:1033base::string16 MockTabModalConfirmDialogDelegate::GetDialogMessage() {
[email protected]dcd0249872013-12-06 23:58:4534 return base::string16();
[email protected]3cac87232012-11-20 01:48:2735}
36
37void MockTabModalConfirmDialogDelegate::OnAccepted() {
38 if (delegate_)
39 delegate_->OnAccepted();
40}
41
42void MockTabModalConfirmDialogDelegate::OnCanceled() {
43 if (delegate_)
44 delegate_->OnCanceled();
45}
[email protected]f6e5d8c2012-01-04 21:25:3646
[email protected]ec35112f2013-08-01 05:46:1847void MockTabModalConfirmDialogDelegate::OnClosed() {
48 if (delegate_)
49 delegate_->OnClosed();
50}
51
[email protected]f6e5d8c2012-01-04 21:25:36