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

Unified Diff: chrome/browser/ui/webui/web_ui_factory.h

Issue 6713082: Move WebUIFactory to chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ContentWebUIClient Created 9 years, 9 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
Index: chrome/browser/ui/webui/web_ui_factory.h
diff --git a/chrome/browser/ui/webui/web_ui_factory.h b/chrome/browser/ui/webui/web_ui_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..55d70d10759d7f99e4733f2a662db7cb2ea0713f
--- /dev/null
+++ b/chrome/browser/ui/webui/web_ui_factory.h
@@ -0,0 +1,52 @@
+// 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_WEB_UI_FACTORY_H_
+#define CHROME_BROWSER_UI_WEBUI_WEB_UI_FACTORY_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/singleton.h"
+#include "content/browser/webui/content_web_ui_client.h"
+#include "content/browser/webui/web_ui.h"
+#include "chrome/browser/favicon_service.h"
+
+class WebUI;
+class GURL;
+class Profile;
+class RefCountedMemory;
+class TabContents;
+
+class WebUIFactory : public content::ContentWebUIClient {
+ public:
+ virtual WebUI::WebUITypeID 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 WebUIFactory* GetInstance();
+
+ private:
+ virtual ~WebUIFactory();
+
+ friend struct DefaultSingletonTraits<WebUIFactory>;
+
+ // 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(WebUIFactory);
+};
+
+#endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698