diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-17 18:42:22 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-17 18:42:22 +0000 |
commit | c63cedf228f9390647cafed05b64d0fc1fdf3e54 (patch) | |
tree | e9c179d0030a2360c877e18d326c6a99ec45ce9e /content/browser/tab_contents/tab_contents_unittest.cc | |
parent | a12ce8b2f53218843671aefec951e7bcc935d0fc (diff) | |
download | chromium_src-c63cedf228f9390647cafed05b64d0fc1fdf3e54.zip chromium_src-c63cedf228f9390647cafed05b64d0fc1fdf3e54.tar.gz chromium_src-c63cedf228f9390647cafed05b64d0fc1fdf3e54.tar.bz2 |
Make WebUI objects not derive from WebUI. WebUI objects own the controller. This is the ownership model since otherwise we'd have to make the interface class delete it, which is better avoided since it's supposed to be an interface. The controller has a pointer to the WebUI object.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9224002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117925 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 | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/content/browser/tab_contents/tab_contents_unittest.cc b/content/browser/tab_contents/tab_contents_unittest.cc index b37912d..4a591e2 100644 --- a/content/browser/tab_contents/tab_contents_unittest.cc +++ b/content/browser/tab_contents/tab_contents_unittest.cc @@ -30,19 +30,19 @@ using content::BrowserThread; using content::NavigationEntry; using content::NavigationEntryImpl; using content::WebContents; +using content::WebUIController; using webkit::forms::PasswordForm; namespace { class TabContentsTestWebUIFactory : public content::EmptyWebUIFactory { public: - virtual WebUI* CreateWebUIForURL(WebContents* source, - const GURL& url) const OVERRIDE { + virtual WebUIController* CreateWebUIForURL(WebUI* web_ui, + const GURL& url) const OVERRIDE { if (!HasWebUIScheme(url)) return NULL; - static content::WebUIController temp_controller; - return new WebUI(source, &temp_controller); + return new WebUIController(web_ui); } virtual bool UseWebUIForURL(content::BrowserContext* browser_context, @@ -58,7 +58,6 @@ class TabContentsTestWebUIFactory : public content::EmptyWebUIFactory { const GURL& url) const { return HasWebUIScheme(url); } - }; class TabContentsTestBrowserClient : public content::MockContentBrowserClient { |