| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/dom_ui/html_dialog_ui.h" | 5 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/dom_ui/web_ui_util.h" | 10 #include "chrome/browser/dom_ui/web_ui_util.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 std::string dialog_args; | 47 std::string dialog_args; |
| 48 std::vector<WebUIMessageHandler*> handlers; | 48 std::vector<WebUIMessageHandler*> handlers; |
| 49 HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty( | 49 HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty( |
| 50 tab_contents()->property_bag()); | 50 tab_contents()->property_bag()); |
| 51 if (delegate) { | 51 if (delegate) { |
| 52 dialog_args = (*delegate)->GetDialogArgs(); | 52 dialog_args = (*delegate)->GetDialogArgs(); |
| 53 (*delegate)->GetWebUIMessageHandlers(&handlers); | 53 (*delegate)->GetWebUIMessageHandlers(&handlers); |
| 54 } | 54 } |
| 55 | 55 |
| 56 if (0 != (bindings_ & BindingsPolicy::DOM_UI)) | 56 if (0 != (bindings_ & BindingsPolicy::DOM_UI)) |
| 57 render_view_host->SetDOMUIProperty("dialogArguments", dialog_args); | 57 render_view_host->SetWebUIProperty("dialogArguments", dialog_args); |
| 58 for (std::vector<WebUIMessageHandler*>::iterator it = handlers.begin(); | 58 for (std::vector<WebUIMessageHandler*>::iterator it = handlers.begin(); |
| 59 it != handlers.end(); ++it) { | 59 it != handlers.end(); ++it) { |
| 60 (*it)->Attach(this); | 60 (*it)->Attach(this); |
| 61 AddMessageHandler(*it); | 61 AddMessageHandler(*it); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 void HtmlDialogUI::OnDialogClosed(const ListValue* args) { | 65 void HtmlDialogUI::OnDialogClosed(const ListValue* args) { |
| 66 HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty( | 66 HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty( |
| 67 tab_contents()->property_bag()); | 67 tab_contents()->property_bag()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 79 // that are scoped in duration to the dialogs existence. | 79 // that are scoped in duration to the dialogs existence. |
| 80 bindings_ &= ~BindingsPolicy::DOM_UI; | 80 bindings_ &= ~BindingsPolicy::DOM_UI; |
| 81 } | 81 } |
| 82 | 82 |
| 83 ExternalHtmlDialogUI::~ExternalHtmlDialogUI() { | 83 ExternalHtmlDialogUI::~ExternalHtmlDialogUI() { |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool HtmlDialogUIDelegate::HandleContextMenu(const ContextMenuParams& params) { | 86 bool HtmlDialogUIDelegate::HandleContextMenu(const ContextMenuParams& params) { |
| 87 return false; | 87 return false; |
| 88 } | 88 } |
| OLD | NEW |