OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_controller_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_controller_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" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 GURL url(page_url); | 453 GURL url(page_url); |
454 ExtensionWebUI::HandleChromeURLOverride(&url, profile); | 454 ExtensionWebUI::HandleChromeURLOverride(&url, profile); |
455 | 455 |
456 // All extensions but the bookmark manager get their favicon from the icons | 456 // All extensions but the bookmark manager get their favicon from the icons |
457 // part of the manifest. | 457 // part of the manifest. |
458 if (url.SchemeIs(chrome::kExtensionScheme) && | 458 if (url.SchemeIs(chrome::kExtensionScheme) && |
459 url.host() != extension_misc::kBookmarkManagerId) { | 459 url.host() != extension_misc::kBookmarkManagerId) { |
460 ExtensionWebUI::GetFaviconForURL(profile, request, url); | 460 ExtensionWebUI::GetFaviconForURL(profile, request, url); |
461 } else { | 461 } else { |
462 history::FaviconData favicon; | 462 history::FaviconData favicon; |
463 favicon.bitmap_data = scoped_refptr<base::RefCountedMemory>( | 463 favicon.variants.resize(1); // XXX |
| 464 favicon.variants[0].bitmap_data = scoped_refptr<base::RefCountedMemory>( |
464 GetFaviconResourceBytes(url)); | 465 GetFaviconResourceBytes(url)); |
465 favicon.known_icon = favicon.bitmap_data.get() != NULL && | 466 favicon.known_icon = favicon.variants[0].bitmap_data.get() != NULL && |
466 favicon.bitmap_data->size() > 0; | 467 favicon.variants[0].bitmap_data->size() > 0; |
467 favicon.icon_type = history::FAVICON; | 468 favicon.icon_type = history::FAVICON; |
468 request->ForwardResultAsync(request->handle(), favicon); | 469 request->ForwardResultAsync(request->handle(), favicon); |
469 } | 470 } |
470 } | 471 } |
471 | 472 |
472 // static | 473 // static |
473 ChromeWebUIControllerFactory* ChromeWebUIControllerFactory::GetInstance() { | 474 ChromeWebUIControllerFactory* ChromeWebUIControllerFactory::GetInstance() { |
474 return Singleton< ChromeWebUIControllerFactory, PossibleTestSingletonTraits< | 475 return Singleton< ChromeWebUIControllerFactory, PossibleTestSingletonTraits< |
475 ChromeWebUIControllerFactory, TestChromeWebUIControllerFactory> >::get(); | 476 ChromeWebUIControllerFactory, TestChromeWebUIControllerFactory> >::get(); |
476 } | 477 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 525 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
525 return options2::OptionsUI::GetFaviconResourceBytes(); | 526 return options2::OptionsUI::GetFaviconResourceBytes(); |
526 | 527 |
527 // Android doesn't use the plugins pages. | 528 // Android doesn't use the plugins pages. |
528 if (page_url.host() == chrome::kChromeUIPluginsHost) | 529 if (page_url.host() == chrome::kChromeUIPluginsHost) |
529 return PluginsUI::GetFaviconResourceBytes(); | 530 return PluginsUI::GetFaviconResourceBytes(); |
530 #endif | 531 #endif |
531 | 532 |
532 return NULL; | 533 return NULL; |
533 } | 534 } |
OLD | NEW |