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

Unified Diff: content/browser/webui/web_ui.cc

Issue 9188056: Start splitting out WebUI into an implementation class and an interface that each page implements... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' 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
« no previous file with comments | « content/browser/webui/web_ui.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/web_ui.cc
===================================================================
--- content/browser/webui/web_ui.cc (revision 117388)
+++ content/browser/webui/web_ui.cc (working copy)
@@ -16,10 +16,12 @@
#include "content/browser/tab_contents/tab_contents_view.h"
#include "content/browser/webui/generic_handler.h"
#include "content/common/view_messages.h"
+#include "content/public/browser/web_ui_controller.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/content_switches.h"
using content::WebContents;
+using content::WebUIController;
using content::WebUIMessageHandler;
// static
@@ -39,14 +41,16 @@
char16('(') + parameters + char16(')') + char16(';');
}
-WebUI::WebUI(WebContents* contents)
+WebUI::WebUI(WebContents* contents,
+ WebUIController* controller)
: hide_favicon_(false),
focus_location_bar_by_default_(false),
should_hide_url_(false),
link_transition_type_(content::PAGE_TRANSITION_LINK),
bindings_(content::BINDINGS_POLICY_WEB_UI),
register_callback_overwrites_(false),
- web_contents_(contents) {
+ web_contents_(contents),
+ controller_(controller) {
DCHECK(contents);
AddMessageHandler(new GenericHandler());
}
@@ -77,6 +81,9 @@
return;
}
+ if (controller_->OverrideHandleWebUIMessage(source_url, message,args))
+ return;
+
// Look up the callback for this message.
MessageCallbackMap::const_iterator callback =
message_callbacks_.find(message);
@@ -87,6 +94,8 @@
}
void WebUI::RenderViewCreated(RenderViewHost* render_view_host) {
+ controller_->RenderViewCreated(render_view_host);
+
// Do not attempt to set the toolkit property if WebUI is not enabled, e.g.,
// the bookmarks manager page.
if (!(bindings_ & content::BINDINGS_POLICY_WEB_UI))
« no previous file with comments | « content/browser/webui/web_ui.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698