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

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

Issue 9224002: Make WebUI objects not derive from WebUI. WebUI objects own the controller. This is the ownership... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to head to clear linux_chromeos browsertest failures Created 8 years, 11 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
Index: chrome/browser/ui/webui/constrained_html_ui.cc
===================================================================
--- chrome/browser/ui/webui/constrained_html_ui.cc (revision 117871)
+++ chrome/browser/ui/webui/constrained_html_ui.cc (working copy)
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/webui/html_dialog_ui.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_view_host.h"
+#include "content/browser/webui/web_ui.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_contents.h"
@@ -24,8 +25,8 @@
static base::LazyInstance<base::PropertyAccessor<ConstrainedHtmlUIDelegate*> >
g_constrained_html_ui_property_accessor = LAZY_INSTANCE_INITIALIZER;
-ConstrainedHtmlUI::ConstrainedHtmlUI(WebContents* contents)
- : WebUI(contents, this) {
+ConstrainedHtmlUI::ConstrainedHtmlUI(WebUI* web_ui)
+ : WebUIController(web_ui) {
}
ConstrainedHtmlUI::~ConstrainedHtmlUI() {
@@ -43,17 +44,17 @@
dialog_delegate->GetDialogArgs());
for (std::vector<WebUIMessageHandler*>::iterator it = handlers.begin();
it != handlers.end(); ++it) {
- AddMessageHandler(*it);
+ web_ui()->AddMessageHandler(*it);
}
// Add a "DialogClose" callback which matches HTMLDialogUI behavior.
- RegisterMessageCallback("DialogClose",
+ web_ui()->RegisterMessageCallback("DialogClose",
base::Bind(&ConstrainedHtmlUI::OnDialogCloseMessage,
base::Unretained(this)));
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_HTML_DIALOG_SHOWN,
- content::Source<WebUI>(this),
+ content::Source<WebUI>(web_ui()),
content::Details<RenderViewHost>(render_view_host));
}
@@ -70,8 +71,8 @@
}
ConstrainedHtmlUIDelegate* ConstrainedHtmlUI::GetConstrainedDelegate() {
- ConstrainedHtmlUIDelegate** property =
- GetPropertyAccessor().GetProperty(web_contents()->GetPropertyBag());
+ ConstrainedHtmlUIDelegate** property = GetPropertyAccessor().GetProperty(
+ web_ui()->web_contents()->GetPropertyBag());
return property ? *property : NULL;
}

Powered by Google App Engine
This is Rietveld 408576698