Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_FACTORY_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_UI_FACTORY_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_FACTORY_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_UI_FACTORY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/browser/webui/web_ui.h" | 9 #include "content/browser/webui/web_ui.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 class BrowserContext; | 16 class BrowserContext; |
| 17 class WebContents; | 17 class WebContents; |
| 18 class WebUIController; | |
| 18 | 19 |
| 19 // Interface for an object which controls which URLs are considered WebUI URLs | 20 // Interface for an object which controls which URLs are considered WebUI URLs |
| 20 // and creates WebUI instances for given URLs. | 21 // and creates WebUI instances for given URLs. |
| 21 class CONTENT_EXPORT WebUIFactory { | 22 class CONTENT_EXPORT WebUIFactory { |
| 22 public: | 23 public: |
| 23 // Returns a WebUI instance for the given URL, or NULL if the URL doesn't | 24 // Returns a WebUI instance for the given URL, or NULL if the URL doesn't |
|
Evan Stade
2012/01/17 19:14:56
this comment is out of date (WebUIController inste
jam
2012/01/17 19:20:45
yep I'm planning on updating the interface and met
| |
| 24 // correspond to a WebUI. | 25 // correspond to a WebUI. |
| 25 virtual WebUI* CreateWebUIForURL(WebContents* source, | 26 virtual WebUIController* CreateWebUIForURL(WebUI* web_ui, |
| 26 const GURL& url) const = 0; | 27 const GURL& url) const = 0; |
| 27 | 28 |
| 28 // Gets the WebUI type for the given URL. This will return kNoWebUI if the | 29 // Gets the WebUI type for the given URL. This will return kNoWebUI if the |
| 29 // corresponding call to CreateWebUIForURL would fail, or something non-NULL | 30 // corresponding call to CreateWebUIForURL would fail, or something non-NULL |
| 30 // if CreateWebUIForURL would succeed. | 31 // if CreateWebUIForURL would succeed. |
| 31 virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, | 32 virtual WebUI::TypeID GetWebUIType(BrowserContext* browser_context, |
| 32 const GURL& url) const = 0; | 33 const GURL& url) const = 0; |
| 33 | 34 |
| 34 // Shorthand for the above, but returns a simple yes/no. | 35 // Shorthand for the above, but returns a simple yes/no. |
| 35 virtual bool UseWebUIForURL(BrowserContext* browser_context, | 36 virtual bool UseWebUIForURL(BrowserContext* browser_context, |
| 36 const GURL& url) const = 0; | 37 const GURL& url) const = 0; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 49 // normal tabs such as javascript: URLs or about:hang. | 50 // normal tabs such as javascript: URLs or about:hang. |
| 50 virtual bool IsURLAcceptableForWebUI(BrowserContext* browser_context, | 51 virtual bool IsURLAcceptableForWebUI(BrowserContext* browser_context, |
| 51 const GURL& url) const = 0; | 52 const GURL& url) const = 0; |
| 52 | 53 |
| 53 virtual ~WebUIFactory() {} | 54 virtual ~WebUIFactory() {} |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 } // namespace content | 57 } // namespace content |
| 57 | 58 |
| 58 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_FACTORY_H_ | 59 #endif // CONTENT_PUBLIC_BROWSER_WEB_UI_FACTORY_H_ |
| OLD | NEW |