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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 if (url.host() == chrome::kChromeUIExtensionActivityHost && | 362 if (url.host() == chrome::kChromeUIExtensionActivityHost && |
363 CommandLine::ForCurrentProcess()->HasSwitch( | 363 CommandLine::ForCurrentProcess()->HasSwitch( |
364 switches::kEnableExtensionActivityUI)) { | 364 switches::kEnableExtensionActivityUI)) { |
365 return &NewWebUI<ExtensionActivityUI>; | 365 return &NewWebUI<ExtensionActivityUI>; |
366 } | 366 } |
367 if (url.host() == chrome::kChromeUIExtensionInfoHost && | 367 if (url.host() == chrome::kChromeUIExtensionInfoHost && |
368 extensions::switch_utils::AreScriptBadgesEnabled()) { | 368 extensions::switch_utils::AreScriptBadgesEnabled()) { |
369 return &NewWebUI<ExtensionInfoUI>; | 369 return &NewWebUI<ExtensionInfoUI>; |
370 } | 370 } |
371 | 371 |
372 DLOG(WARNING) << "Unknown WebUI:" << url; | |
373 return NULL; | 372 return NULL; |
374 } | 373 } |
375 | 374 |
376 // When the test-type switch is set, return a TestType object, which should be a | 375 // When the test-type switch is set, return a TestType object, which should be a |
377 // subclass of Type. The logic is provided here in the traits class, rather than | 376 // subclass of Type. The logic is provided here in the traits class, rather than |
378 // in GetInstance() so that the choice is made only once, when the Singleton is | 377 // in GetInstance() so that the choice is made only once, when the Singleton is |
379 // first instantiated, rather than every time GetInstance() is called. | 378 // first instantiated, rather than every time GetInstance() is called. |
380 template<typename Type, typename TestType> | 379 template<typename Type, typename TestType> |
381 struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { | 380 struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { |
382 static Type* New() { | 381 static Type* New() { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 526 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
528 return options2::OptionsUI::GetFaviconResourceBytes(); | 527 return options2::OptionsUI::GetFaviconResourceBytes(); |
529 | 528 |
530 // Android doesn't use the plugins pages. | 529 // Android doesn't use the plugins pages. |
531 if (page_url.host() == chrome::kChromeUIPluginsHost) | 530 if (page_url.host() == chrome::kChromeUIPluginsHost) |
532 return PluginsUI::GetFaviconResourceBytes(); | 531 return PluginsUI::GetFaviconResourceBytes(); |
533 #endif | 532 #endif |
534 | 533 |
535 return NULL; | 534 return NULL; |
536 } | 535 } |
OLD | NEW |