summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/ui/cocoa/constrained_window_mac.h4
-rw-r--r--chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h4
-rw-r--r--chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc104
-rw-r--r--chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h54
-rw-r--r--chrome/browser/ui/tab_modal_confirm_dialog_browsertest_mac.mm22
-rw-r--r--chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc10
-rw-r--r--chrome/browser/ui/tab_modal_confirm_dialog_delegate.h11
-rw-r--r--chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc140
-rw-r--r--chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h42
-rw-r--r--chrome/chrome_tests.gypi3
10 files changed, 100 insertions, 294 deletions
diff --git a/chrome/browser/ui/cocoa/constrained_window_mac.h b/chrome/browser/ui/cocoa/constrained_window_mac.h
index 9e062d3..ca28fda 100644
--- a/chrome/browser/ui/cocoa/constrained_window_mac.h
+++ b/chrome/browser/ui/cocoa/constrained_window_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -68,8 +68,6 @@ class ConstrainedWindowMacDelegateSystemSheet
virtual NSArray* GetSheetParameters(id delegate, SEL didEndSelector);
private:
- friend class TabModalConfirmDialogTest;
-
virtual void RunSheet(GTMWindowSheetController* sheetController,
NSView* view) OVERRIDE;
scoped_nsobject<id> systemSheet_;
diff --git a/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h b/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h
index f8c4ed5..632d9a7 100644
--- a/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h
+++ b/chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -32,8 +32,6 @@ class TabModalConfirmDialogGtk : public ConstrainedWindowGtkDelegate {
virtual void DeleteDelegate() OVERRIDE;
private:
- friend class TabModalConfirmDialogTest;
-
virtual ~TabModalConfirmDialogGtk();
// Callbacks
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc
deleted file mode 100644
index 704664f..0000000
--- a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h"
-
-#include "base/bind.h"
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/ui/browser_dialogs.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "content/browser/tab_contents/test_tab_contents.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-class MockTabModalConfirmDialogDelegate : public TabModalConfirmDialogDelegate {
- public:
- explicit MockTabModalConfirmDialogDelegate(TabContents* tab_contents)
- : TabModalConfirmDialogDelegate(tab_contents) {}
-
- virtual string16 GetTitle() OVERRIDE {
- return ASCIIToUTF16("");
- }
- virtual string16 GetMessage() OVERRIDE {
- return ASCIIToUTF16("");
- }
-
- MOCK_METHOD0(OnAccepted, void());
- MOCK_METHOD0(OnCanceled, void());
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockTabModalConfirmDialogDelegate);
-};
-
-TabModalConfirmDialogTest::TabModalConfirmDialogTest()
- : delegate_(NULL),
- dialog_(NULL) {}
-
-void TabModalConfirmDialogTest::SetUpOnMainThread() {
- delegate_ = new MockTabModalConfirmDialogDelegate(
- browser()->GetSelectedTabContents());
- dialog_ = CreateTestDialog(delegate_,
- browser()->GetSelectedTabContentsWrapper());
- ui_test_utils::RunAllPendingInMessageLoop();
-}
-
-void TabModalConfirmDialogTest::CleanUpOnMainThread() {
- ui_test_utils::RunAllPendingInMessageLoop();
- ::testing::Mock::VerifyAndClearExpectations(delegate_);
-}
-
-// On Mac OS, these methods need to be compiled as Objective-C++, so they're in
-// a separate file.
-#if !defined(OS_MACOSX)
-TabModalConfirmDialog* TabModalConfirmDialogTest::CreateTestDialog(
- TabModalConfirmDialogDelegate* delegate, TabContentsWrapper* wrapper) {
- return new TabModalConfirmDialog(delegate, wrapper);
-}
-
-void TabModalConfirmDialogTest::CloseDialog(bool accept) {
-#if defined(TOOLKIT_GTK)
- if (accept)
- dialog_->OnAccept(NULL);
- else
- dialog_->OnCancel(NULL);
-#elif defined(OS_CHROMEOS) || defined(USE_AURA)
- // |dialog_| deletes itself in |OnDialogClosed()|, so we need to save its
- // ConstrainedHTMLUIDelegate before that.
- ConstrainedHtmlUIDelegate* constrained_html_ui_delegate =
- dialog_->constrained_html_ui_delegate();
- dialog_->OnDialogClosed(accept ? "true" : "false");
- constrained_html_ui_delegate->OnDialogCloseFromWebUI();
-#elif defined(OS_WIN)
- if (accept)
- dialog_->GetDialogClientView()->AcceptWindow();
- else
- dialog_->GetDialogClientView()->CancelWindow();
-#endif
-}
-#endif // !defined(OS_MACOSX)
-
-IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Accept) {
- EXPECT_CALL(*delegate_, OnAccepted());
- CloseDialog(true);
-}
-
-IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Cancel) {
- EXPECT_CALL(*delegate_, OnCanceled());
- CloseDialog(false);
-}
-
-IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, CancelSelf) {
- EXPECT_CALL(*delegate_, OnCanceled());
- delegate_->Cancel();
-}
-
-IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Quit) {
- EXPECT_CALL(*delegate_, OnCanceled());
- MessageLoopForUI::current()->PostTask(FROM_HERE,
- base::Bind(&BrowserList::AttemptExit));
- ui_test_utils::RunMessageLoop();
-}
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h
deleted file mode 100644
index 7bce236..0000000
--- a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_
-#define CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_
-#pragma once
-
-#include "chrome/test/base/in_process_browser_test.h"
-#include "content/test/test_browser_thread.h"
-
-#if defined(OS_MACOSX)
-class TabModalConfirmDialogMac;
-typedef TabModalConfirmDialogMac TabModalConfirmDialog;
-#elif defined(TOOLKIT_GTK)
-#include "chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h"
-typedef TabModalConfirmDialogGtk TabModalConfirmDialog;
-#elif defined(OS_CHROMEOS) || defined(USE_AURA)
-#include "chrome/browser/ui/webui/constrained_html_ui.h"
-#include "chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h"
-typedef TabModalConfirmDialogWebUI TabModalConfirmDialog;
-#elif defined(OS_WIN)
-#include "chrome/browser/ui/views/tab_modal_confirm_dialog_views.h"
-typedef TabModalConfirmDialogViews TabModalConfirmDialog;
-#endif
-
-class MockTabModalConfirmDialogDelegate;
-class TabContentsWrapper;
-class TabModalConfirmDialogDelegate;
-
-class TabModalConfirmDialogTest : public InProcessBrowserTest {
- public:
- TabModalConfirmDialogTest();
-
- virtual void SetUpOnMainThread() OVERRIDE;
- virtual void CleanUpOnMainThread() OVERRIDE;
-
- protected:
- void CloseDialog(bool accept);
-
- // Owned by |dialog_|.
- MockTabModalConfirmDialogDelegate* delegate_;
-
- private:
- TabModalConfirmDialog* CreateTestDialog(
- TabModalConfirmDialogDelegate* delegate, TabContentsWrapper* wrapper);
-
- // Deletes itself.
- TabModalConfirmDialog* dialog_;
-
- DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogTest);
-};
-
-#endif // CHROME_BROWSER_UI_TAB_MODAL_CONFIRM_DIALOG_BROWSERTEST_H_
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest_mac.mm b/chrome/browser/ui/tab_modal_confirm_dialog_browsertest_mac.mm
deleted file mode 100644
index 20046a0..0000000
--- a/chrome/browser/ui/tab_modal_confirm_dialog_browsertest_mac.mm
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h"
-
-#include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TabModalConfirmDialog* TabModalConfirmDialogTest::CreateTestDialog(
- TabModalConfirmDialogDelegate* delegate, TabContentsWrapper* wrapper) {
- return new TabModalConfirmDialogMac(delegate, wrapper);
-}
-
-void TabModalConfirmDialogTest::CloseDialog(bool accept) {
- NSWindow* window = [(NSAlert*)dialog_->sheet() window];
- ASSERT_TRUE(window);
- ASSERT_TRUE(dialog_->is_sheet_open());
- [NSApp endSheet:window
- returnCode:accept ? NSAlertFirstButtonReturn :
- NSAlertSecondButtonReturn];
-}
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
index 905d063..8562be2 100644
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -35,9 +35,6 @@ TabModalConfirmDialogDelegate::~TabModalConfirmDialogDelegate() {
void TabModalConfirmDialogDelegate::Cancel() {
if (closing_)
return;
- // Make sure we won't do anything when |Cancel()| or |Accept()| is called
- // again.
- closing_ = true;
OnCanceled();
CloseDialog();
}
@@ -45,9 +42,6 @@ void TabModalConfirmDialogDelegate::Cancel() {
void TabModalConfirmDialogDelegate::Accept() {
if (closing_)
return;
- // Make sure we won't do anything when |Cancel()| or |Accept()| is called
- // again.
- closing_ = true;
OnAccepted();
CloseDialog();
}
@@ -94,6 +88,8 @@ void TabModalConfirmDialogDelegate::OnCanceled() {
}
void TabModalConfirmDialogDelegate::CloseDialog() {
+ // Make sure we won't do anything when |Cancel()| is called again.
+ closing_ = true;
if (window_)
window_->CloseConstrainedWindow();
}
diff --git a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
index 3b3e416..3e105dc 100644
--- a/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
+++ b/chrome/browser/ui/tab_modal_confirm_dialog_delegate.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -31,16 +31,7 @@ class TabModalConfirmDialogDelegate : public content::NotificationObserver {
void set_window(ConstrainedWindow* window) { window_ = window; }
- // Accepts the confirmation prompt and calls |OnAccepted|.
- // This method is safe to call even from an |OnAccepted| or |OnCanceled|
- // callback. It is guaranteed that exactly one of |OnAccepted| or |OnCanceled|
- // is eventually called.
void Accept();
-
- // Cancels the confirmation prompt and calls |OnCanceled|.
- // This method is safe to call even from an |OnAccepted| or |OnCanceled|
- // callback. It is guaranteed that exactly one of |OnAccepted| or |OnCanceled|
- // is eventually called.
void Cancel();
// The title of the dialog. Note that the title is not shown on all platforms.
diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc
index f748f1a..38deeb9 100644
--- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc
+++ b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
#include "chrome/browser/ui/webui/constrained_html_ui.h"
+#include "chrome/browser/ui/webui/html_dialog_ui.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/url_constants.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -36,15 +37,84 @@ namespace browser {
// Declared in browser_dialogs.h so others don't have to depend on our header.
void ShowTabModalConfirmDialog(TabModalConfirmDialogDelegate* delegate,
TabContentsWrapper* wrapper) {
- new TabModalConfirmDialogWebUI(delegate, wrapper);
+ new TabModalConfirmDialogUI(delegate, wrapper);
}
} // namespace browser
-const int kDialogWidth = 400;
-const int kDialogHeight = 120;
+class TabModalConfirmDialogHtmlDelegate : public HtmlDialogUIDelegate {
+ public:
+ TabModalConfirmDialogHtmlDelegate(
+ TabModalConfirmDialogUI* ui,
+ TabModalConfirmDialogDelegate* dialog_delegate)
+ : ui_(ui),
+ dialog_delegate_(dialog_delegate) {}
-TabModalConfirmDialogWebUI::TabModalConfirmDialogWebUI(
+ virtual ~TabModalConfirmDialogHtmlDelegate() {}
+
+ // HtmlDialogUIDelegate implementation.
+ virtual bool IsDialogModal() const OVERRIDE {
+ return true;
+ }
+
+ virtual string16 GetDialogTitle() const OVERRIDE {
+ return dialog_delegate_->GetTitle();
+ }
+
+ virtual GURL GetDialogContentURL() const OVERRIDE {
+ return GURL(chrome::kChromeUITabModalConfirmDialogURL);
+ }
+
+ virtual void GetWebUIMessageHandlers(
+ std::vector<WebUIMessageHandler*>* handlers) const OVERRIDE {}
+
+ virtual void GetDialogSize(gfx::Size* size) const OVERRIDE {
+ size->SetSize(kDialogWidth, kDialogHeight);
+ }
+
+ virtual std::string GetDialogArgs() const OVERRIDE {
+ DictionaryValue dict;
+ dict.SetString("message", dialog_delegate_->GetMessage());
+ dict.SetString("accept", dialog_delegate_->GetAcceptButtonTitle());
+ dict.SetString("cancel", dialog_delegate_->GetCancelButtonTitle());
+ ChromeWebUIDataSource::SetFontAndTextDirection(&dict);
+ std::string json;
+ base::JSONWriter::Write(&dict, false, &json);
+ return json;
+ }
+
+ virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE {
+ bool accepted = false;
+ if (!json_retval.empty()) {
+ base::JSONReader reader;
+ scoped_ptr<Value> value(reader.JsonToValue(json_retval, false, false));
+ DCHECK(value.get() && value->GetAsBoolean(&accepted))
+ << "Missing or unreadable response from dialog";
+ }
+
+ ui_->OnDialogClosed(accepted);
+ delete this;
+ }
+
+ virtual void OnCloseContents(WebContents* source,
+ bool* out_close_dialog) OVERRIDE {}
+
+ virtual bool ShouldShowDialogTitle() const OVERRIDE {
+ return true;
+ }
+
+ private:
+ static const int kDialogWidth = 400;
+ static const int kDialogHeight = 120;
+
+ scoped_ptr<TabModalConfirmDialogUI> ui_;
+ // Owned by TabModalConfirmDialogUI, which we own.
+ TabModalConfirmDialogDelegate* dialog_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogHtmlDelegate);
+};
+
+TabModalConfirmDialogUI::TabModalConfirmDialogUI(
TabModalConfirmDialogDelegate* delegate,
TabContentsWrapper* wrapper)
: delegate_(delegate) {
@@ -54,64 +124,20 @@ TabModalConfirmDialogWebUI::TabModalConfirmDialogWebUI(
data_source->set_default_resource(IDR_TAB_MODAL_CONFIRM_DIALOG_HTML);
profile->GetChromeURLDataManager()->AddDataSource(data_source);
- constrained_html_ui_delegate_ =
- ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile, this, wrapper);
- delegate_->set_window(constrained_html_ui_delegate_->window());
-}
-
-TabModalConfirmDialogWebUI::~TabModalConfirmDialogWebUI() {}
-
-bool TabModalConfirmDialogWebUI::IsDialogModal() const {
- return true;
-}
-
-string16 TabModalConfirmDialogWebUI::GetDialogTitle() const {
- return delegate_->GetTitle();
-}
-
-GURL TabModalConfirmDialogWebUI::GetDialogContentURL() const {
- return GURL(chrome::kChromeUITabModalConfirmDialogURL);
+ TabModalConfirmDialogHtmlDelegate* html_delegate =
+ new TabModalConfirmDialogHtmlDelegate(this, delegate);
+ ConstrainedHtmlUIDelegate* dialog_delegate =
+ ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile, html_delegate,
+ wrapper);
+ delegate_->set_window(dialog_delegate->window());
}
-void TabModalConfirmDialogWebUI::GetWebUIMessageHandlers(
- std::vector<WebUIMessageHandler*>* handlers) const {}
-
-void TabModalConfirmDialogWebUI::GetDialogSize(gfx::Size* size) const {
- size->SetSize(kDialogWidth, kDialogHeight);
-}
-
-std::string TabModalConfirmDialogWebUI::GetDialogArgs() const {
- DictionaryValue dict;
- dict.SetString("message", delegate_->GetMessage());
- dict.SetString("accept", delegate_->GetAcceptButtonTitle());
- dict.SetString("cancel", delegate_->GetCancelButtonTitle());
- ChromeWebUIDataSource::SetFontAndTextDirection(&dict);
- std::string json;
- base::JSONWriter::Write(&dict, false, &json);
- return json;
-}
-
-void TabModalConfirmDialogWebUI::OnDialogClosed(
- const std::string& json_retval) {
- bool accepted = false;
- if (!json_retval.empty()) {
- base::JSONReader reader;
- scoped_ptr<Value> value(reader.JsonToValue(json_retval, false, false));
- DCHECK(value.get() && value->GetAsBoolean(&accepted))
- << "Missing or unreadable response from dialog";
- }
+TabModalConfirmDialogUI::~TabModalConfirmDialogUI() {}
+void TabModalConfirmDialogUI::OnDialogClosed(bool accepted) {
delegate_->set_window(NULL);
if (accepted)
delegate_->Accept();
else
delegate_->Cancel();
- delete this;
-}
-
-void TabModalConfirmDialogWebUI::OnCloseContents(WebContents* source,
- bool* out_close_dialog) {}
-
-bool TabModalConfirmDialogWebUI::ShouldShowDialogTitle() const {
- return true;
}
diff --git a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
index 53488b6..edcb7b7 100644
--- a/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
+++ b/chrome/browser/ui/webui/tab_modal_confirm_dialog_webui.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -6,15 +6,13 @@
#define CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_
#pragma once
-#if !(defined(USE_AURA) || defined(OS_CHROMEOS))
+#if !(defined(USE_AURA) || defined(TOOLKIT_VIEWS))
#error Tab-modal confirm dialog should be shown with native UI.
#endif
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/ui/webui/html_dialog_ui.h"
-class ConstrainedHtmlUIDelegate;
class TabContentsWrapper;
class TabModalConfirmDialogDelegate;
@@ -23,38 +21,20 @@ class TabModalConfirmDialogDelegate;
// To display the dialog, allocate this object on the heap. It will open the
// dialog from its constructor and then delete itself when the user dismisses
// the dialog.
-class TabModalConfirmDialogWebUI : public HtmlDialogUIDelegate {
+class TabModalConfirmDialogUI {
public:
- TabModalConfirmDialogWebUI(
- TabModalConfirmDialogDelegate* dialog_delegate,
- TabContentsWrapper* wrapper);
-
- // HtmlDialogUIDelegate implementation.
- virtual bool IsDialogModal() const OVERRIDE;
- virtual string16 GetDialogTitle() const OVERRIDE;
- virtual GURL GetDialogContentURL() const OVERRIDE;
- virtual void GetWebUIMessageHandlers(
- std::vector<WebUIMessageHandler*>* handlers) const OVERRIDE;
- virtual void GetDialogSize(gfx::Size* size) const OVERRIDE;
- virtual std::string GetDialogArgs() const OVERRIDE;
- virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE;
- virtual void OnCloseContents(TabContents* source,
- bool* out_close_dialog) OVERRIDE;
- virtual bool ShouldShowDialogTitle() const OVERRIDE;
-
- ConstrainedHtmlUIDelegate* constrained_html_ui_delegate() {
- return constrained_html_ui_delegate_;
- }
+ TabModalConfirmDialogUI(TabModalConfirmDialogDelegate* delegate,
+ TabContentsWrapper* wrapper);
+ ~TabModalConfirmDialogUI();
- private:
- virtual ~TabModalConfirmDialogWebUI();
+ // Invoked when the dialog is closed. Notifies the controller of the user's
+ // response.
+ void OnDialogClosed(bool accept);
+ private:
scoped_ptr<TabModalConfirmDialogDelegate> delegate_;
- // Deletes itself.
- ConstrainedHtmlUIDelegate* constrained_html_ui_delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogWebUI);
+ DISALLOW_COPY_AND_ASSIGN(TabModalConfirmDialogUI);
};
#endif // CHROME_BROWSER_UI_WEBUI_TAB_MODAL_CONFIRM_DIALOG_WEBUI_H_
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 98dcf10..04b5feb 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -2674,9 +2674,6 @@
'browser/ui/panels/panel_app_browsertest.cc',
'browser/ui/panels/panel_browser_view_browsertest.cc',
'browser/ui/prefs/prefs_tab_helper_browsertest.cc',
- 'browser/ui/tab_modal_confirm_dialog_browsertest_mac.mm',
- 'browser/ui/tab_modal_confirm_dialog_browsertest.cc',
- 'browser/ui/tab_modal_confirm_dialog_browsertest.h',
'browser/ui/views/browser_actions_container_browsertest.cc',
'browser/ui/views/dom_view_browsertest.cc',
'browser/ui/views/html_dialog_view_browsertest.cc',