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 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/about_flags.h" | 8 #include "chrome/browser/about_flags.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" |
11 #include "chrome/browser/extensions/extensions_ui.h" | 11 #include "chrome/browser/extensions/extensions_ui.h" |
| 12 #include "chrome/browser/history/history_types.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/webui/bookmarks_ui.h" | 14 #include "chrome/browser/ui/webui/bookmarks_ui.h" |
14 #include "chrome/browser/ui/webui/bug_report_ui.h" | 15 #include "chrome/browser/ui/webui/bug_report_ui.h" |
15 #include "chrome/browser/ui/webui/constrained_html_ui.h" | 16 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
16 #include "chrome/browser/ui/webui/crashes_ui.h" | 17 #include "chrome/browser/ui/webui/crashes_ui.h" |
17 #include "chrome/browser/ui/webui/devtools_ui.h" | 18 #include "chrome/browser/ui/webui/devtools_ui.h" |
18 #include "chrome/browser/ui/webui/downloads_ui.h" | 19 #include "chrome/browser/ui/webui/downloads_ui.h" |
19 #include "chrome/browser/ui/webui/flags_ui.h" | 20 #include "chrome/browser/ui/webui/flags_ui.h" |
20 #include "chrome/browser/ui/webui/flash_ui.h" | 21 #include "chrome/browser/ui/webui/flash_ui.h" |
21 #include "chrome/browser/ui/webui/gpu_internals_ui.h" | 22 #include "chrome/browser/ui/webui/gpu_internals_ui.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 // part of the manifest. | 284 // part of the manifest. |
284 if (page_url.SchemeIs(chrome::kExtensionScheme) && | 285 if (page_url.SchemeIs(chrome::kExtensionScheme) && |
285 page_url.host() != extension_misc::kBookmarkManagerId) { | 286 page_url.host() != extension_misc::kBookmarkManagerId) { |
286 ExtensionWebUI::GetFaviconForURL(profile, request, page_url); | 287 ExtensionWebUI::GetFaviconForURL(profile, request, page_url); |
287 } else { | 288 } else { |
288 history::FaviconData favicon; | 289 history::FaviconData favicon; |
289 favicon.image_data = scoped_refptr<RefCountedMemory>( | 290 favicon.image_data = scoped_refptr<RefCountedMemory>( |
290 GetFaviconResourceBytes(page_url)); | 291 GetFaviconResourceBytes(page_url)); |
291 favicon.known_icon = favicon.image_data.get() != NULL && | 292 favicon.known_icon = favicon.image_data.get() != NULL && |
292 favicon.image_data->size() > 0; | 293 favicon.image_data->size() > 0; |
| 294 favicon.icon_type = history::FAVICON; |
293 request->ForwardResultAsync( | 295 request->ForwardResultAsync( |
294 FaviconService::FaviconDataCallback::TupleType(request->handle(), | 296 FaviconService::FaviconDataCallback::TupleType(request->handle(), |
295 favicon)); | 297 favicon)); |
296 } | 298 } |
297 } | 299 } |
298 | 300 |
299 // static | 301 // static |
300 ChromeWebUIFactory* ChromeWebUIFactory::GetInstance() { | 302 ChromeWebUIFactory* ChromeWebUIFactory::GetInstance() { |
301 return Singleton< ChromeWebUIFactory, PossibleTestSingletonTraits< | 303 return Singleton< ChromeWebUIFactory, PossibleTestSingletonTraits< |
302 ChromeWebUIFactory, TestChromeWebUIFactory> >::get(); | 304 ChromeWebUIFactory, TestChromeWebUIFactory> >::get(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 return FlashUI::GetFaviconResourceBytes(); | 356 return FlashUI::GetFaviconResourceBytes(); |
355 | 357 |
356 if (page_url.host() == chrome::kChromeUISettingsHost) | 358 if (page_url.host() == chrome::kChromeUISettingsHost) |
357 return OptionsUI::GetFaviconResourceBytes(); | 359 return OptionsUI::GetFaviconResourceBytes(); |
358 | 360 |
359 if (page_url.host() == chrome::kChromeUIPluginsHost) | 361 if (page_url.host() == chrome::kChromeUIPluginsHost) |
360 return PluginsUI::GetFaviconResourceBytes(); | 362 return PluginsUI::GetFaviconResourceBytes(); |
361 | 363 |
362 return NULL; | 364 return NULL; |
363 } | 365 } |
OLD | NEW |