Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4476)

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc

Issue 12084029: Simplify how TestChromeWebUIControllerFactory is registered now that multiple WebUIControllerFactor… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync to head Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
===================================================================
--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (revision 179251)
+++ chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc (working copy)
@@ -48,7 +48,6 @@
#include "chrome/browser/ui/webui/quota_internals_ui.h"
#include "chrome/browser/ui/webui/signin_internals_ui.h"
#include "chrome/browser/ui/webui/sync_internals_ui.h"
-#include "chrome/browser/ui/webui/test_chrome_web_ui_controller_factory.h"
#include "chrome/browser/ui/webui/tracing_ui.h"
#include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
#include "chrome/browser/ui/webui/version_ui.h"
@@ -408,20 +407,6 @@
return NULL;
}
-// When the test-type switch is set, return a TestType object, which should be a
-// subclass of Type. The logic is provided here in the traits class, rather than
-// in GetInstance() so that the choice is made only once, when the Singleton is
-// first instantiated, rather than every time GetInstance() is called.
-template<typename Type, typename TestType>
-struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> {
- static Type* New() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType))
- return DefaultSingletonTraits<TestType>::New();
- else
- return DefaultSingletonTraits<Type>::New();
- }
-};
-
void RunFaviconCallbackAsync(
const FaviconService::FaviconResultsCallback& callback,
const std::vector<history::FaviconBitmapResult>* results) {
@@ -519,8 +504,7 @@
// static
ChromeWebUIControllerFactory* ChromeWebUIControllerFactory::GetInstance() {
- return Singleton< ChromeWebUIControllerFactory, PossibleTestSingletonTraits<
- ChromeWebUIControllerFactory, TestChromeWebUIControllerFactory> >::get();
+ return Singleton<ChromeWebUIControllerFactory>::get();
}
ChromeWebUIControllerFactory::ChromeWebUIControllerFactory() {

Powered by Google App Engine
This is Rietveld 408576698