| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/modal_html_dialog_delegate.h" | 5 #include "chrome/browser/modal_html_dialog_delegate.h" |
| 6 | 6 |
| 7 #include <string> |
| 8 |
| 7 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
| 8 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 11 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/common/notification_service.h" | 12 #include "chrome/common/notification_source.h" |
| 11 #include "gfx/size.h" | 13 #include "gfx/size.h" |
| 12 | 14 |
| 13 ModalHtmlDialogDelegate::ModalHtmlDialogDelegate( | 15 ModalHtmlDialogDelegate::ModalHtmlDialogDelegate( |
| 14 const GURL& url, int width, int height, const std::string& json_arguments, | 16 const GURL& url, int width, int height, const std::string& json_arguments, |
| 15 IPC::Message* sync_result, TabContents* contents) | 17 IPC::Message* sync_result, TabContents* contents) |
| 16 : contents_(contents), | 18 : contents_(contents), |
| 17 sync_response_(sync_result) { | 19 sync_response_(sync_result) { |
| 18 // Listen for when the TabContents or its renderer dies. | 20 // Listen for when the TabContents or its renderer dies. |
| 19 registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED, | 21 registrar_.Add(this, NotificationType::TAB_CONTENTS_DISCONNECTED, |
| 20 Source<TabContents>(contents_)); | 22 Source<TabContents>(contents_)); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void ModalHtmlDialogDelegate::OnDialogClosed(const std::string& json_retval) { | 64 void ModalHtmlDialogDelegate::OnDialogClosed(const std::string& json_retval) { |
| 63 // Our TabContents may have died before this point. | 65 // Our TabContents may have died before this point. |
| 64 if (contents_ && contents_->render_view_host()) { | 66 if (contents_ && contents_->render_view_host()) { |
| 65 contents_->render_view_host()->ModalHTMLDialogClosed(sync_response_, | 67 contents_->render_view_host()->ModalHTMLDialogClosed(sync_response_, |
| 66 json_retval); | 68 json_retval); |
| 67 } | 69 } |
| 68 | 70 |
| 69 // We are done with this request, so delete us. | 71 // We are done with this request, so delete us. |
| 70 delete this; | 72 delete this; |
| 71 } | 73 } |
| OLD | NEW |