| Index: chrome/browser/views/html_dialog_view.cc
|
| ===================================================================
|
| --- chrome/browser/views/html_dialog_view.cc (revision 26676)
|
| +++ chrome/browser/views/html_dialog_view.cc (working copy)
|
| @@ -12,7 +12,7 @@
|
|
|
| namespace browser {
|
|
|
| -// Declared in browser_dialogs.h so that others don't need to depend on our .h.
|
| +// Declared in browser_dialogs.h so that others don't need to depend on our .h.
|
| void ShowHtmlDialogView(gfx::NativeWindow parent, Browser* browser,
|
| HtmlDialogUIDelegate* delegate) {
|
| HtmlDialogView* html_view = new HtmlDialogView(browser, delegate);
|
| @@ -43,7 +43,8 @@
|
|
|
| gfx::Size HtmlDialogView::GetPreferredSize() {
|
| gfx::Size out;
|
| - delegate_->GetDialogSize(&out);
|
| + if (delegate_)
|
| + delegate_->GetDialogSize(&out);
|
| return out;
|
| }
|
|
|
| @@ -55,11 +56,17 @@
|
| }
|
|
|
| bool HtmlDialogView::IsModal() const {
|
| - return delegate_->IsDialogModal();
|
| + if (delegate_)
|
| + return delegate_->IsDialogModal();
|
| + else
|
| + return false;
|
| }
|
|
|
| std::wstring HtmlDialogView::GetWindowTitle() const {
|
| - return delegate_->GetDialogTitle();
|
| + if (delegate_)
|
| + return delegate_->GetDialogTitle();
|
| + else
|
| + return std::wstring();
|
| }
|
|
|
| void HtmlDialogView::WindowClosing() {
|
| @@ -90,25 +97,34 @@
|
| }
|
|
|
| GURL HtmlDialogView::GetDialogContentURL() const {
|
| - return delegate_->GetDialogContentURL();
|
| + if (delegate_)
|
| + return delegate_->GetDialogContentURL();
|
| + else
|
| + return GURL();
|
| }
|
|
|
| void HtmlDialogView::GetDOMMessageHandlers(
|
| std::vector<DOMMessageHandler*>* handlers) const {
|
| - delegate_->GetDOMMessageHandlers(handlers);
|
| + if (delegate_)
|
| + delegate_->GetDOMMessageHandlers(handlers);
|
| }
|
|
|
| void HtmlDialogView::GetDialogSize(gfx::Size* size) const {
|
| - delegate_->GetDialogSize(size);
|
| + if (delegate_)
|
| + delegate_->GetDialogSize(size);
|
| }
|
|
|
| std::string HtmlDialogView::GetDialogArgs() const {
|
| - return delegate_->GetDialogArgs();
|
| + if (delegate_)
|
| + return delegate_->GetDialogArgs();
|
| + else
|
| + return std::string();
|
| }
|
|
|
| void HtmlDialogView::OnDialogClosed(const std::string& json_retval) {
|
| - delegate_->OnDialogClosed(json_retval);
|
| + HtmlDialogUIDelegate* dialog_delegate = delegate_;
|
| delegate_ = NULL; // We will not communicate further with the delegate.
|
| + dialog_delegate->OnDialogClosed(json_retval);
|
| window()->Close();
|
| }
|
|
|
|
|