| Index: chrome/browser/ui/webui/web_dialog_ui.cc
|
| ===================================================================
|
| --- chrome/browser/ui/webui/web_dialog_ui.cc (revision 133680)
|
| +++ chrome/browser/ui/webui/web_dialog_ui.cc (working copy)
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/ui/webui/html_dialog_ui.h"
|
| +#include "chrome/browser/ui/webui/web_dialog_ui.h"
|
|
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| @@ -20,14 +20,14 @@
|
| using content::RenderViewHost;
|
| using content::WebUIMessageHandler;
|
|
|
| -static base::LazyInstance<base::PropertyAccessor<HtmlDialogUIDelegate*> >
|
| - g_html_dialog_ui_property_accessor = LAZY_INSTANCE_INITIALIZER;
|
| +static base::LazyInstance<base::PropertyAccessor<WebDialogDelegate*> >
|
| + g_web_dialog_ui_property_accessor = LAZY_INSTANCE_INITIALIZER;
|
|
|
| -HtmlDialogUI::HtmlDialogUI(content::WebUI* web_ui)
|
| +WebDialogUI::WebDialogUI(content::WebUI* web_ui)
|
| : WebUIController(web_ui) {
|
| }
|
|
|
| -HtmlDialogUI::~HtmlDialogUI() {
|
| +WebDialogUI::~WebDialogUI() {
|
| // Don't unregister our property. During the teardown of the WebContents,
|
| // this will be deleted, but the WebContents will already be destroyed.
|
| //
|
| @@ -38,29 +38,28 @@
|
| // and the HTML dialogs won't swap WebUIs anyway since they don't navigate.
|
| }
|
|
|
| -void HtmlDialogUI::CloseDialog(const base::ListValue* args) {
|
| +void WebDialogUI::CloseDialog(const base::ListValue* args) {
|
| OnDialogClosed(args);
|
| }
|
|
|
| // static
|
| -base::PropertyAccessor<HtmlDialogUIDelegate*>&
|
| - HtmlDialogUI::GetPropertyAccessor() {
|
| - return g_html_dialog_ui_property_accessor.Get();
|
| +base::PropertyAccessor<WebDialogDelegate*>& WebDialogUI::GetPropertyAccessor() {
|
| + return g_web_dialog_ui_property_accessor.Get();
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // Private:
|
|
|
| -void HtmlDialogUI::RenderViewCreated(RenderViewHost* render_view_host) {
|
| +void WebDialogUI::RenderViewCreated(RenderViewHost* render_view_host) {
|
| // Hook up the javascript function calls, also known as chrome.send("foo")
|
| // calls in the HTML, to the actual C++ functions.
|
| web_ui()->RegisterMessageCallback("DialogClose",
|
| - base::Bind(&HtmlDialogUI::OnDialogClosed, base::Unretained(this)));
|
| + base::Bind(&WebDialogUI::OnDialogClosed, base::Unretained(this)));
|
|
|
| // Pass the arguments to the renderer supplied by the delegate.
|
| std::string dialog_args;
|
| std::vector<WebUIMessageHandler*> handlers;
|
| - HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty(
|
| + WebDialogDelegate** delegate = GetPropertyAccessor().GetProperty(
|
| web_ui()->GetWebContents()->GetPropertyBag());
|
| if (delegate) {
|
| dialog_args = (*delegate)->GetDialogArgs();
|
| @@ -80,8 +79,8 @@
|
| content::Details<RenderViewHost>(render_view_host));
|
| }
|
|
|
| -void HtmlDialogUI::OnDialogClosed(const ListValue* args) {
|
| - HtmlDialogUIDelegate** delegate = GetPropertyAccessor().GetProperty(
|
| +void WebDialogUI::OnDialogClosed(const ListValue* args) {
|
| + WebDialogDelegate** delegate = GetPropertyAccessor().GetProperty(
|
| web_ui()->GetWebContents()->GetPropertyBag());
|
| if (delegate) {
|
| std::string json_retval;
|
| @@ -92,8 +91,8 @@
|
| }
|
| }
|
|
|
| -ExternalHtmlDialogUI::ExternalHtmlDialogUI(content::WebUI* web_ui)
|
| - : HtmlDialogUI(web_ui) {
|
| +ExternalWebDialogUI::ExternalWebDialogUI(content::WebUI* web_ui)
|
| + : WebDialogUI(web_ui) {
|
| // Non-file based UI needs to not have access to the Web UI bindings
|
| // for security reasons. The code hosting the dialog should provide
|
| // dialog specific functionality through other bindings and methods
|
| @@ -101,30 +100,30 @@
|
| web_ui->SetBindings(web_ui->GetBindings() & ~content::BINDINGS_POLICY_WEB_UI);
|
| }
|
|
|
| -ExternalHtmlDialogUI::~ExternalHtmlDialogUI() {
|
| +ExternalWebDialogUI::~ExternalWebDialogUI() {
|
| }
|
|
|
| -std::string HtmlDialogUIDelegate::GetDialogName() const {
|
| +std::string WebDialogDelegate::GetDialogName() const {
|
| return std::string();
|
| }
|
|
|
| -void HtmlDialogUIDelegate::GetMinimumDialogSize(gfx::Size* size) const {
|
| +void WebDialogDelegate::GetMinimumDialogSize(gfx::Size* size) const {
|
| GetDialogSize(size);
|
| }
|
|
|
| -bool HtmlDialogUIDelegate::HandleContextMenu(
|
| +bool WebDialogDelegate::HandleContextMenu(
|
| const content::ContextMenuParams& params) {
|
| return false;
|
| }
|
|
|
| -bool HtmlDialogUIDelegate::HandleOpenURLFromTab(
|
| +bool WebDialogDelegate::HandleOpenURLFromTab(
|
| content::WebContents* source,
|
| const content::OpenURLParams& params,
|
| content::WebContents** out_new_contents) {
|
| return false;
|
| }
|
|
|
| -bool HtmlDialogUIDelegate::HandleAddNewContents(
|
| +bool WebDialogDelegate::HandleAddNewContents(
|
| content::WebContents* source,
|
| content::WebContents* new_contents,
|
| WindowOpenDisposition disposition,
|
|
|