summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/chrome_web_ui_factory.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 16:18:33 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 16:18:33 +0000
commite12b30268ea0dffc301a9bb06f25db6a924d6e00 (patch)
tree9892358261c8cb350d94727ad3a764c7cbb3f5f0 /chrome/browser/ui/webui/chrome_web_ui_factory.h
parent8f34c55ab33c9ae2232c61913882be7e320f5542 (diff)
downloadchromium_src-e12b30268ea0dffc301a9bb06f25db6a924d6e00.zip
chromium_src-e12b30268ea0dffc301a9bb06f25db6a924d6e00.tar.gz
chromium_src-e12b30268ea0dffc301a9bb06f25db6a924d6e00.tar.bz2
Move WebUIFactory to chrome/browser.
This reduces dependencies from content/ to chrome/. WebUIFactory is the interface in content/ to ChromeWebUIFactory in chrome/ BUG=77092 TEST=none Review URL: http://codereview.chromium.org/6713082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/chrome_web_ui_factory.h')
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_factory.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/chrome/browser/ui/webui/chrome_web_ui_factory.h b/chrome/browser/ui/webui/chrome_web_ui_factory.h
new file mode 100644
index 0000000..b2328f9
--- /dev/null
+++ b/chrome/browser/ui/webui/chrome_web_ui_factory.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_FACTORY_H_
+#define CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_FACTORY_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/memory/singleton.h"
+#include "content/browser/webui/web_ui.h"
+#include "content/browser/webui/web_ui_factory.h"
+#include "chrome/browser/favicon_service.h"
+
+class WebUI;
+class GURL;
+class Profile;
+class RefCountedMemory;
+class TabContents;
+
+class ChromeWebUIFactory : public content::WebUIFactory {
+ public:
+ virtual WebUI::TypeID GetWebUIType(Profile* profile, const GURL& url) const;
+ virtual bool UseWebUIForURL(Profile* profile, const GURL& url) const;
+ virtual bool HasWebUIScheme(const GURL& url) const;
+ virtual bool IsURLAcceptableForWebUI(Profile* profile, const GURL& url) const;
+ virtual WebUI* CreateWebUIForURL(TabContents* tab_contents,
+ const GURL& url) const;
+
+ // Get the favicon for |page_url| and forward the result to the |request|
+ // when loaded.
+ void GetFaviconForURL(Profile* profile,
+ FaviconService::GetFaviconRequest* request,
+ const GURL& page_url) const;
+
+ static ChromeWebUIFactory* GetInstance();
+
+ private:
+ virtual ~ChromeWebUIFactory();
+
+ friend struct DefaultSingletonTraits<ChromeWebUIFactory>;
+
+ // Gets the data for the favicon for a WebUI page. Returns NULL if the WebUI
+ // does not have a favicon.
+ RefCountedMemory* GetFaviconResourceBytes(Profile* profile,
+ const GURL& page_url) const;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeWebUIFactory);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_CHROME_WEB_UI_FACTORY_H_