| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_DOM_UI_DOM_UI_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_DOM_UI_FACTORY_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_DOM_UI_FACTORY_H_ | 6 #define CHROME_BROWSER_DOM_UI_DOM_UI_FACTORY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 class DOMUI; | 10 class DOMUI; |
| 11 class GURL; | 11 class GURL; |
| 12 class RefCountedMemory; |
| 12 class TabContents; | 13 class TabContents; |
| 13 | 14 |
| 14 // An opaque identifier used to identify a DOMUI. This can only be compared to | 15 // An opaque identifier used to identify a DOMUI. This can only be compared to |
| 15 // kNoDOMUI or other DOMUI types. See GetDOMUIType. | 16 // kNoDOMUI or other DOMUI types. See GetDOMUIType. |
| 16 typedef void* DOMUITypeID; | 17 typedef void* DOMUITypeID; |
| 17 | 18 |
| 18 class DOMUIFactory { | 19 class DOMUIFactory { |
| 19 public: | 20 public: |
| 20 // A special DOMUI type that signifies that a given page would not use the | 21 // A special DOMUI type that signifies that a given page would not use the |
| 21 // DOM UI system. | 22 // DOM UI system. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 35 // Returns true if the given URL will use the DOM UI system. | 36 // Returns true if the given URL will use the DOM UI system. |
| 36 static bool UseDOMUIForURL(const GURL& url); | 37 static bool UseDOMUIForURL(const GURL& url); |
| 37 | 38 |
| 38 // Allocates a new DOMUI object for the given URL, and returns it. If the URL | 39 // Allocates a new DOMUI object for the given URL, and returns it. If the URL |
| 39 // is not a DOM UI URL, then it will return NULL. When non-NULL, ownership of | 40 // is not a DOM UI URL, then it will return NULL. When non-NULL, ownership of |
| 40 // the returned pointer is passed to the caller. | 41 // the returned pointer is passed to the caller. |
| 41 static DOMUI* CreateDOMUIForURL(TabContents* tab_contents, const GURL& url); | 42 static DOMUI* CreateDOMUIForURL(TabContents* tab_contents, const GURL& url); |
| 42 | 43 |
| 43 // Gets the data for the favicon for a DOMUI page. Returns false if the DOMUI | 44 // Gets the data for the favicon for a DOMUI page. Returns false if the DOMUI |
| 44 // does not have a favicon. | 45 // does not have a favicon. |
| 45 static bool GetFaviconResourceBytes(const GURL& page_url, | 46 static RefCountedMemory* GetFaviconResourceBytes(const GURL& page_url); |
| 46 std::vector<unsigned char>* bytes); | |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 // Class is for scoping only. | 49 // Class is for scoping only. |
| 50 DOMUIFactory() {} | 50 DOMUIFactory() {} |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 #endif // CHROME_BROWSER_DOM_UI_DOM_UI_FACTORY_H_ | 53 #endif // CHROME_BROWSER_DOM_UI_DOM_UI_FACTORY_H_ |
| OLD | NEW |