| Index: content/browser/tab_contents/tab_contents.cc
|
| diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
|
| index 61bae0cda15cbf01438a213fa451efabce823c05..70494f38b567dd03c7dfb51bff6eafaf8123be67 100644
|
| --- a/content/browser/tab_contents/tab_contents.cc
|
| +++ b/content/browser/tab_contents/tab_contents.cc
|
| @@ -82,7 +82,8 @@
|
| #include "content/browser/tab_contents/tab_contents_delegate.h"
|
| #include "content/browser/tab_contents/tab_contents_observer.h"
|
| #include "content/browser/tab_contents/tab_contents_view.h"
|
| -#include "content/browser/webui/web_ui.h"
|
| +#include "content/browser/webui/content_web_ui_client.h"
|
| +#include "content/common/content_client.h"
|
| #include "content/common/navigation_types.h"
|
| #include "content/common/notification_service.h"
|
| #include "content/common/view_messages.h"
|
| @@ -253,7 +254,7 @@ TabContents::TabContents(Profile* profile,
|
| #endif
|
| suppress_javascript_messages_(false),
|
| is_showing_before_unload_dialog_(false),
|
| - opener_web_ui_type_(WebUIFactory::kNoWebUI),
|
| + opener_web_ui_type_(WebUI::kNoWebUI),
|
| language_state_(&controller_),
|
| closed_by_user_gesture_(false),
|
| minimum_zoom_percent_(
|
| @@ -554,8 +555,10 @@ bool TabContents::ShouldDisplayURL() {
|
| }
|
|
|
| // We always display the URL for non-WebUI URLs to prevent spoofing.
|
| - if (entry && !WebUIFactory::HasWebUIScheme(entry->url()))
|
| + if (entry && !content::GetContentClient()->web_ui()->
|
| + HasWebUIScheme(entry->url())) {
|
| return true;
|
| + }
|
|
|
| WebUI* web_ui = GetWebUIForCurrentState();
|
| if (web_ui)
|
| @@ -730,8 +733,8 @@ bool TabContents::NavigateToEntry(
|
| // For security, we should never send non-Web-UI URLs to a Web UI renderer.
|
| // Double check that here.
|
| int enabled_bindings = dest_render_view_host->enabled_bindings();
|
| - bool is_allowed_in_web_ui_renderer =
|
| - WebUIFactory::IsURLAcceptableForWebUI(profile(), entry.url());
|
| + bool is_allowed_in_web_ui_renderer = content::GetContentClient()->
|
| + web_ui()->IsURLAcceptableForWebUI(profile(), entry.url());
|
| CHECK(!BindingsPolicy::is_web_ui_enabled(enabled_bindings) ||
|
| is_allowed_in_web_ui_renderer);
|
|
|
| @@ -1607,23 +1610,28 @@ WebUI* TabContents::GetWebUIForCurrentState() {
|
| return render_manager_.web_ui();
|
| }
|
|
|
| +WebUI::WebUITypeID TabContents::GetWebUITypeForCurrentState() {
|
| + return content::GetContentClient()->web_ui()->GetWebUIType(profile(),
|
| + GetURL());
|
| +}
|
| +
|
| void TabContents::DidNavigateMainFramePostCommit(
|
| const NavigationController::LoadCommittedDetails& details,
|
| const ViewHostMsg_FrameNavigate_Params& params) {
|
| - if (opener_web_ui_type_ != WebUIFactory::kNoWebUI) {
|
| + if (opener_web_ui_type_ != WebUI::kNoWebUI) {
|
| // If this is a window.open navigation, use the same WebUI as the renderer
|
| // that opened the window, as long as both renderers have the same
|
| // privileges.
|
| - if (opener_web_ui_type_ ==
|
| - WebUIFactory::GetWebUIType(profile(), GetURL())) {
|
| - WebUI* web_ui = WebUIFactory::CreateWebUIForURL(this, GetURL());
|
| + if (delegate_ && opener_web_ui_type_ == GetWebUITypeForCurrentState()) {
|
| + WebUI* web_ui = content::GetContentClient()->web_ui()->
|
| + CreateWebUIForURL(this, GetURL());
|
| // web_ui might be NULL if the URL refers to a non-existent extension.
|
| if (web_ui) {
|
| render_manager_.SetWebUIPostCommit(web_ui);
|
| web_ui->RenderViewCreated(render_view_host());
|
| }
|
| }
|
| - opener_web_ui_type_ = WebUIFactory::kNoWebUI;
|
| + opener_web_ui_type_ = WebUI::kNoWebUI;
|
| }
|
|
|
| if (details.is_user_initiated_main_frame_load()) {
|
| @@ -2003,9 +2011,8 @@ void TabContents::RenderViewCreated(RenderViewHost* render_view_host) {
|
|
|
| // When we're creating views, we're still doing initial setup, so we always
|
| // use the pending Web UI rather than any possibly existing committed one.
|
| - if (render_manager_.pending_web_ui()) {
|
| + if (render_manager_.pending_web_ui())
|
| render_manager_.pending_web_ui()->RenderViewCreated(render_view_host);
|
| - }
|
|
|
| if (entry->IsViewSourceMode()) {
|
| // Put the renderer in view source mode.
|
| @@ -2597,7 +2604,7 @@ NavigationController& TabContents::GetControllerForRenderManager() {
|
| }
|
|
|
| WebUI* TabContents::CreateWebUIForRenderManager(const GURL& url) {
|
| - return WebUIFactory::CreateWebUIForURL(this, url);
|
| + return content::GetContentClient()->web_ui()->CreateWebUIForURL(this, url);
|
| }
|
|
|
| NavigationEntry*
|
|
|