diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 01:18:57 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-24 01:18:57 +0000 |
commit | b0c6e5d820fb2da79f9f36e449f66caec1389bfd (patch) | |
tree | a4fd0622c4a0b58f01fd88811bca411f4c048137 /chrome/browser/views | |
parent | 991fee4eda6561e606f780030af1bfbaba732a10 (diff) | |
download | chromium_src-b0c6e5d820fb2da79f9f36e449f66caec1389bfd.zip chromium_src-b0c6e5d820fb2da79f9f36e449f66caec1389bfd.tar.gz chromium_src-b0c6e5d820fb2da79f9f36e449f66caec1389bfd.tar.bz2 |
HtmlDialogContentsDelegate should not subclass views::WindowDelegate, for portability reasons (views isn't used on Mac or Linux).
Instead, add modal/title getting methods to HtmlDialogContentsDelegate directly, and have the UI (HtmlDialogView) call to these in the Modal/ModelessHtmlDialogDelegate in its implementation of views::WindowDelegate instead.
TEST=open any page and test that Page->Create application shortcuts still works. visit any site that uses Gears and make sure the Gears Allow/Deny dialog still comes up.
Review URL: http://codereview.chromium.org/27074
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/html_dialog_view.cc | 12 | ||||
-rw-r--r-- | chrome/browser/views/html_dialog_view.h | 10 |
2 files changed, 17 insertions, 5 deletions
diff --git a/chrome/browser/views/html_dialog_view.cc b/chrome/browser/views/html_dialog_view.cc index 2ff93b7..0ef3b9e 100644 --- a/chrome/browser/views/html_dialog_view.cc +++ b/chrome/browser/views/html_dialog_view.cc @@ -42,11 +42,11 @@ bool HtmlDialogView::CanResize() const { } bool HtmlDialogView::IsModal() const { - return delegate_->IsModal(); + return delegate_->IsDialogModal(); } std::wstring HtmlDialogView::GetWindowTitle() const { - return delegate_->GetWindowTitle(); + return delegate_->GetDialogTitle(); } void HtmlDialogView::WindowClosing() { @@ -68,6 +68,14 @@ views::View* HtmlDialogView::GetInitiallyFocusedView() { //////////////////////////////////////////////////////////////////////////////// // HtmlDialogContentsDelegate implementation: +bool HtmlDialogView::IsDialogModal() const { + return IsModal(); +} + +std::wstring HtmlDialogView::GetDialogTitle() const { + return GetWindowTitle(); +} + GURL HtmlDialogView::GetDialogContentURL() const { return delegate_->GetDialogContentURL(); } diff --git a/chrome/browser/views/html_dialog_view.h b/chrome/browser/views/html_dialog_view.h index 0b3946c..6a4e144 100644 --- a/chrome/browser/views/html_dialog_view.h +++ b/chrome/browser/views/html_dialog_view.h @@ -10,6 +10,7 @@ #include "chrome/browser/dom_ui/html_dialog_contents.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/browser/views/dom_view.h" +#include "chrome/views/window_delegate.h" class Browser; namespace views { @@ -26,9 +27,10 @@ class Window; // //////////////////////////////////////////////////////////////////////////////// class HtmlDialogView - : public DOMView, - public HtmlDialogContentsDelegate, - public TabContentsDelegate { + : public DOMView, + public TabContentsDelegate, + public HtmlDialogContentsDelegate, + public views::WindowDelegate { public: HtmlDialogView(Browser* parent_browser, Profile* profile, @@ -50,6 +52,8 @@ class HtmlDialogView virtual views::View* GetInitiallyFocusedView(); // Overridden from HtmlDialogContentsDelegate: + virtual bool IsDialogModal() const; + virtual std::wstring GetDialogTitle() const; virtual GURL GetDialogContentURL() const; virtual void GetDialogSize(CSize* size) const; virtual std::string GetDialogArgs() const; |