Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2216)

Unified Diff: chrome/browser/ui/webui/web_dialog_ui.cc

Issue 10214001: WebDialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/web_dialog_ui.h ('k') | chrome/browser/ui/webui/web_dialog_web_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/browser/ui/webui/web_dialog_ui.h ('k') | chrome/browser/ui/webui/web_dialog_web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698