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/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.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.image_data = scoped_refptr<base::RefCountedMemory>( | 463 favicon.bitmap_data = scoped_refptr<base::RefCountedMemory>( |
464 GetFaviconResourceBytes(url)); | 464 GetFaviconResourceBytes(url)); |
465 favicon.known_icon = favicon.image_data.get() != NULL && | 465 favicon.known_icon = favicon.bitmap_data.get() != NULL && |
466 favicon.image_data->size() > 0; | 466 favicon.bitmap_data->size() > 0; |
467 favicon.icon_type = history::FAVICON; | 467 favicon.icon_type = history::FAVICON; |
468 request->ForwardResultAsync(request->handle(), favicon); | 468 request->ForwardResultAsync(request->handle(), favicon); |
469 } | 469 } |
470 } | 470 } |
471 | 471 |
472 // static | 472 // static |
473 ChromeWebUIControllerFactory* ChromeWebUIControllerFactory::GetInstance() { | 473 ChromeWebUIControllerFactory* ChromeWebUIControllerFactory::GetInstance() { |
474 return Singleton< ChromeWebUIControllerFactory, PossibleTestSingletonTraits< | 474 return Singleton< ChromeWebUIControllerFactory, PossibleTestSingletonTraits< |
475 ChromeWebUIControllerFactory, TestChromeWebUIControllerFactory> >::get(); | 475 ChromeWebUIControllerFactory, TestChromeWebUIControllerFactory> >::get(); |
476 } | 476 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 524 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
525 return options2::OptionsUI::GetFaviconResourceBytes(); | 525 return options2::OptionsUI::GetFaviconResourceBytes(); |
526 | 526 |
527 // Android doesn't use the plugins pages. | 527 // Android doesn't use the plugins pages. |
528 if (page_url.host() == chrome::kChromeUIPluginsHost) | 528 if (page_url.host() == chrome::kChromeUIPluginsHost) |
529 return PluginsUI::GetFaviconResourceBytes(); | 529 return PluginsUI::GetFaviconResourceBytes(); |
530 #endif | 530 #endif |
531 | 531 |
532 return NULL; | 532 return NULL; |
533 } | 533 } |
OLD | NEW |