diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 02:05:50 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-27 02:05:50 +0000 |
commit | 863f70aa8b46421f442a089b21e1bd97a446785c (patch) | |
tree | d3468b7ab02aaaf80c7602e7c671ea37dc7672f1 /content/browser/tab_contents/tab_contents_unittest.cc | |
parent | a3b85d85e73b838e5bc6599a779a6a725980ce6e (diff) | |
download | chromium_src-863f70aa8b46421f442a089b21e1bd97a446785c.zip chromium_src-863f70aa8b46421f442a089b21e1bd97a446785c.tar.gz chromium_src-863f70aa8b46421f442a089b21e1bd97a446785c.tar.bz2 |
Rename WebUIFactory to WebUIControllerFactory since that's what it creates now.
I've removed EmptyWebUIFactory, since that doesn't fit in well with Content API now. There were only a few places in the code that called it, and handling NULL wasn't much work.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9288074
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/tab_contents/tab_contents_unittest.cc')
-rw-r--r-- | content/browser/tab_contents/tab_contents_unittest.cc | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/content/browser/tab_contents/tab_contents_unittest.cc b/content/browser/tab_contents/tab_contents_unittest.cc index d943c1f..bb7c7d469 100644 --- a/content/browser/tab_contents/tab_contents_unittest.cc +++ b/content/browser/tab_contents/tab_contents_unittest.cc @@ -12,13 +12,13 @@ #include "content/browser/tab_contents/interstitial_page.h" #include "content/browser/tab_contents/navigation_entry_impl.h" #include "content/browser/tab_contents/test_tab_contents.h" -#include "content/browser/webui/empty_web_ui_factory.h" #include "content/common/view_messages.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/web_ui_controller.h" +#include "content/public/browser/web_ui_controller_factory.h" #include "content/public/common/bindings_policy.h" #include "content/public/common/content_constants.h" #include "content/public/common/url_constants.h" @@ -26,37 +26,50 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/webkit_glue.h" +using content::BrowserContext; using content::BrowserThread; using content::NavigationEntry; using content::NavigationEntryImpl; using content::SiteInstance; using content::WebContents; +using content::WebUI; using content::WebUIController; using webkit::forms::PasswordForm; namespace { -class TabContentsTestWebUIFactory : public content::EmptyWebUIFactory { +class TabContentsTestWebUIControllerFactory + : public content::WebUIControllerFactory { public: - virtual WebUIController* CreateWebUIForURL(content::WebUI* web_ui, - const GURL& url) const OVERRIDE { + virtual WebUIController* CreateWebUIControllerForURL( + content::WebUI* web_ui, const GURL& url) const OVERRIDE { if (!HasWebUIScheme(url)) return NULL; return new WebUIController(web_ui); } - virtual bool UseWebUIForURL(content::BrowserContext* browser_context, + virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, + const GURL& url) const OVERRIDE { + return WebUI::kNoWebUI; + } + + virtual bool UseWebUIForURL(BrowserContext* browser_context, const GURL& url) const OVERRIDE { return HasWebUIScheme(url); } + virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, + const GURL& url) const OVERRIDE { + return HasWebUIScheme(url); + } + virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE { return url.SchemeIs("tabcontentstest"); } - virtual bool IsURLAcceptableForWebUI(content::BrowserContext* browser_context, - const GURL& url) const { + virtual bool IsURLAcceptableForWebUI( + BrowserContext* browser_context, const GURL& url) const { return HasWebUIScheme(url); } }; @@ -66,12 +79,13 @@ class TabContentsTestBrowserClient : public content::MockContentBrowserClient { TabContentsTestBrowserClient() { } - virtual content::WebUIFactory* GetWebUIFactory() OVERRIDE { + virtual content::WebUIControllerFactory* + GetWebUIControllerFactory() OVERRIDE { return &factory_; } private: - TabContentsTestWebUIFactory factory_; + TabContentsTestWebUIControllerFactory factory_; }; class TestInterstitialPage : public InterstitialPage { |