| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/views/html_dialog_view.h" | 5 #include "chrome/browser/views/html_dialog_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/views/root_view.h" | 8 #include "chrome/views/root_view.h" |
| 9 #include "chrome/views/window.h" | 9 #include "chrome/views/window.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 DCHECK(profile); | 22 DCHECK(profile); |
| 23 } | 23 } |
| 24 | 24 |
| 25 HtmlDialogView::~HtmlDialogView() { | 25 HtmlDialogView::~HtmlDialogView() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 //////////////////////////////////////////////////////////////////////////////// | 28 //////////////////////////////////////////////////////////////////////////////// |
| 29 // HtmlDialogView, views::View implementation: | 29 // HtmlDialogView, views::View implementation: |
| 30 | 30 |
| 31 gfx::Size HtmlDialogView::GetPreferredSize() { | 31 gfx::Size HtmlDialogView::GetPreferredSize() { |
| 32 CSize out; | 32 gfx::Size out; |
| 33 delegate_->GetDialogSize(&out); | 33 delegate_->GetDialogSize(&out); |
| 34 return gfx::Size(out.cx, out.cy); | 34 return out; |
| 35 } | 35 } |
| 36 | 36 |
| 37 //////////////////////////////////////////////////////////////////////////////// | 37 //////////////////////////////////////////////////////////////////////////////// |
| 38 // HtmlDialogView, views::WindowDelegate implementation: | 38 // HtmlDialogView, views::WindowDelegate implementation: |
| 39 | 39 |
| 40 bool HtmlDialogView::CanResize() const { | 40 bool HtmlDialogView::CanResize() const { |
| 41 return true; | 41 return true; |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool HtmlDialogView::IsModal() const { | 44 bool HtmlDialogView::IsModal() const { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 73 } | 73 } |
| 74 | 74 |
| 75 std::wstring HtmlDialogView::GetDialogTitle() const { | 75 std::wstring HtmlDialogView::GetDialogTitle() const { |
| 76 return GetWindowTitle(); | 76 return GetWindowTitle(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 GURL HtmlDialogView::GetDialogContentURL() const { | 79 GURL HtmlDialogView::GetDialogContentURL() const { |
| 80 return delegate_->GetDialogContentURL(); | 80 return delegate_->GetDialogContentURL(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void HtmlDialogView::GetDialogSize(CSize* size) const { | 83 void HtmlDialogView::GetDialogSize(gfx::Size* size) const { |
| 84 return delegate_->GetDialogSize(size); | 84 delegate_->GetDialogSize(size); |
| 85 } | 85 } |
| 86 | 86 |
| 87 std::string HtmlDialogView::GetDialogArgs() const { | 87 std::string HtmlDialogView::GetDialogArgs() const { |
| 88 return delegate_->GetDialogArgs(); | 88 return delegate_->GetDialogArgs(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void HtmlDialogView::OnDialogClosed(const std::string& json_retval) { | 91 void HtmlDialogView::OnDialogClosed(const std::string& json_retval) { |
| 92 delegate_->OnDialogClosed(json_retval); | 92 delegate_->OnDialogClosed(json_retval); |
| 93 delegate_ = NULL; // We will not communicate further with the delegate. | 93 delegate_ = NULL; // We will not communicate further with the delegate. |
| 94 window()->Close(); | 94 window()->Close(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // Now Init the DOMView. This view runs in its own process to render the html. | 176 // Now Init the DOMView. This view runs in its own process to render the html. |
| 177 DOMView::Init(profile_, NULL); | 177 DOMView::Init(profile_, NULL); |
| 178 | 178 |
| 179 // Make sure this new TabContents we just created in Init() knows about us. | 179 // Make sure this new TabContents we just created in Init() knows about us. |
| 180 DCHECK(host_->type() == TAB_CONTENTS_HTML_DIALOG); | 180 DCHECK(host_->type() == TAB_CONTENTS_HTML_DIALOG); |
| 181 HtmlDialogContents* host = static_cast<HtmlDialogContents*>(host_); | 181 HtmlDialogContents* host = static_cast<HtmlDialogContents*>(host_); |
| 182 host->Init(this); | 182 host->Init(this); |
| 183 host->set_delegate(this); | 183 host->set_delegate(this); |
| 184 } | 184 } |
| 185 | 185 |
| OLD | NEW |