| 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 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 5 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/dom_ui/downloads_ui.h" | 7 #include "chrome/browser/dom_ui/downloads_ui.h" |
| 8 #include "chrome/browser/dom_ui/devtools_ui.h" | 8 #include "chrome/browser/dom_ui/devtools_ui.h" |
| 9 #include "chrome/browser/dom_ui/history_ui.h" | 9 #include "chrome/browser/dom_ui/history_ui.h" |
| 10 #include "chrome/browser/dom_ui/html_dialog_ui.h" | 10 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // static | 113 // static |
| 114 DOMUI* DOMUIFactory::CreateDOMUIForURL(TabContents* tab_contents, | 114 DOMUI* DOMUIFactory::CreateDOMUIForURL(TabContents* tab_contents, |
| 115 const GURL& url) { | 115 const GURL& url) { |
| 116 DOMUIFactoryFunction function = GetDOMUIFactoryFunction(url); | 116 DOMUIFactoryFunction function = GetDOMUIFactoryFunction(url); |
| 117 if (!function) | 117 if (!function) |
| 118 return NULL; | 118 return NULL; |
| 119 return (*function)(tab_contents, url); | 119 return (*function)(tab_contents, url); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // static | 122 // static |
| 123 bool DOMUIFactory::GetFaviconResourceBytes(const GURL& page_url, | 123 RefCountedMemory* DOMUIFactory::GetFaviconResourceBytes( |
| 124 std::vector<unsigned char>* bytes) { | 124 const GURL& page_url) { |
| 125 if (!HasDOMUIScheme(page_url)) | 125 if (!HasDOMUIScheme(page_url)) |
| 126 return false; | 126 return NULL; |
| 127 | 127 |
| 128 if (page_url.host() == chrome::kChromeUIHistoryHost) | 128 if (page_url.host() == chrome::kChromeUIHistoryHost) |
| 129 return HistoryUI::GetFaviconResourceBytes(bytes); | 129 return HistoryUI::GetFaviconResourceBytes(); |
| 130 | 130 |
| 131 if (page_url.host() == chrome::kChromeUIDownloadsHost) | 131 if (page_url.host() == chrome::kChromeUIDownloadsHost) |
| 132 return DownloadsUI::GetFaviconResourceBytes(bytes); | 132 return DownloadsUI::GetFaviconResourceBytes(); |
| 133 | 133 |
| 134 return false; | 134 return NULL; |
| 135 } | 135 } |
| OLD | NEW |